max_stars_repo_path
stringlengths
4
237
max_stars_repo_name
stringlengths
6
117
max_stars_count
int64
0
95.2k
id
stringlengths
1
7
content
stringlengths
12
593k
input_ids
sequencelengths
7
549k
google-datacatalog-apache-atlas-connector/tests/google/datacatalog_connectors/apache_atlas/scrape/apache_atlas_facade_test.py
skadinyo/datacatalog-connectors-hive
19
179106
#!/usr/bin/python # # Copyright 2020 Google LLC # # 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 unittest from unittest.mock import patch from google.datacatalog_connectors.commons_test import utils from google.datacatalog_connectors.apache_atlas import scrape class ApacheAtlasFacadeTestCase(unittest.TestCase): @patch('atlasclient.client.Atlas') def setUp(self, atlas_client): self.__atlas_facade = scrape.ApacheAtlasFacade({ 'host': 'my_host', 'port': 'my_port', 'user': 'my_user', 'pass': '<PASSWORD>', }) # Shortcut for the object assigned # to self.__atlas_facade.__apache_atlas self.__atlas_client = atlas_client.return_value def test_constructor_should_set_instance_attributes(self): attrs = self.__atlas_facade.__dict__ self.assertIsNotNone(attrs['_ApacheAtlasFacade__apache_atlas']) def test_get_admin_metrics_should_succeed(self): metric = utils.MockedObject() metric.entity = { 'entityActive': { 'AtlasGlossary': 2, 'StorageDesc': 1, 'Table': 8, 'Column': 17, 'AtlasGlossaryTerm': 44, 'AtlasGlossaryCategory': 23, 'View': 2, 'DB': 3, 'LoadProcess': 3 }, 'entityDeleted': { 'hbase_table': 2 } } metric.general = { 'collectionTime': 1590773837477, 'entityCount': 105, 'tagCount': 13, 'typeUnusedCount': 47, 'typeCount': 138 } self.__atlas_client.admin_metrics = [metric] response = self.__atlas_facade.get_admin_metrics()[0] self.assertDictEqual(metric.entity['entityActive'], response['entityActive']) self.assertDictEqual(metric.entity['entityDeleted'], response['entityDeleted']) self.assertDictEqual(metric.general, response['generalMetrics']) def test_get_typedefs(self): self.__atlas_client.typedefs = True # Just assert it was called, since typedefs is a lazy return. self.assertEqual(True, self.__atlas_facade.get_typedefs()) def test_search_entities_from_entity_type_should_return(self): search_result = utils.MockedObject() search_results = [search_result] table_1 = utils.MockedObject() table_1._data = { 'typeName': 'Table', 'attributes': { 'owner': 'Joe', 'createTime': 1589983835754, 'qualifiedName': 'sales_fact', 'name': 'sales_fact', 'description': 'sales fact table' }, 'guid': '2286a6bd-4b06-4f7c-a666-920d774b040e', 'status': 'ACTIVE', 'displayText': 'sales_fact', 'classificationNames': ['Fact'] } table_2 = utils.MockedObject() table_2._data = { 'typeName': 'Table', 'attributes': { 'owner': 'Tim ETL', 'createTime': 1589983847754, 'qualifiedName': 'log_fact_daily_mv', 'name': 'log_fact_daily_mv', 'description': 'log fact daily materialized ' 'view' }, 'guid': '30cfc9fc-aec4-4017-b649-f1f92351a727', 'status': 'ACTIVE', 'displayText': 'log_fact_daily_mv', 'classificationNames': ['Log Data'] } search_result.entities = [table_1, table_2] self.__atlas_client.search_dsl.side_effect = [search_results, []] response = self.__atlas_facade.search_entities_from_entity_type( 'Table') self.assertDictEqual(table_1._data, response[0]._data) self.assertDictEqual(table_2._data, response[1]._data) self.assertEqual(2, len(response)) def test_search_entities_from_entity_type_paged_should_return(self): search_result = utils.MockedObject() table_1 = utils.MockedObject() table_1._data = { 'typeName': 'Table', 'attributes': { 'owner': 'Joe', 'createTime': 1589983835754, 'qualifiedName': 'sales_fact', 'name': 'sales_fact', 'description': 'sales fact table' }, 'guid': '2286a6bd-4b06-4f7c-a666-920d774b040e', 'status': 'ACTIVE', 'displayText': 'sales_fact', 'classificationNames': ['Fact'] } search_result.entities = [table_1] search_results = [search_result] search_result_2 = utils.MockedObject() table_2 = utils.MockedObject() table_2._data = { 'typeName': 'Table', 'attributes': { 'owner': 'Tim ETL', 'createTime': 1589983847754, 'qualifiedName': 'log_fact_daily_mv', 'name': 'log_fact_daily_mv', 'description': 'log fact daily materialized ' 'view' }, 'guid': '30cfc9fc-aec4-4017-b649-f1f92351a727', 'status': 'ACTIVE', 'displayText': 'log_fact_daily_mv', 'classificationNames': ['Log Data'] } search_result_2.entities = [table_2] search_results_2 = [search_result_2] self.__atlas_client.search_dsl.side_effect = [ search_results, search_results_2, [] ] response = self.__atlas_facade.search_entities_from_entity_type( 'Table') self.assertDictEqual(table_1._data, response[0]._data) self.assertDictEqual(table_2._data, response[1]._data) self.assertEqual(2, len(response)) def test_search_entities_from_non_existent_entity_type_should_return_empty( self): search_result = utils.MockedObject() table_1 = utils.MockedObject() table_1._data = { 'typeName': 'Table', 'attributes': { 'owner': 'Joe', 'createTime': 1589983835754, 'qualifiedName': 'sales_fact', 'name': 'sales_fact', 'description': 'sales fact table' }, 'guid': '2286a6bd-4b06-4f7c-a666-920d774b040e', 'status': 'ACTIVE', 'displayText': 'sales_fact', 'classificationNames': ['Fact'] } search_result.entities = [table_1] search_results = [search_result] search_result_2 = utils.MockedObject() table_2 = utils.MockedObject() table_2._data = { 'typeName': 'Table', 'attributes': { 'owner': '<NAME>', 'createTime': 1589983847754, 'qualifiedName': 'log_fact_daily_mv', 'name': 'log_fact_daily_mv', 'description': 'log fact daily materialized ' 'view' }, 'guid': '30cfc9fc-aec4-4017-b649-f1f92351a727', 'status': 'ACTIVE', 'displayText': 'log_fact_daily_mv', 'classificationNames': ['Log Data'] } search_result_2.entities = [table_2] search_results_2 = [search_result_2] self.__atlas_client.search_dsl.side_effect = [ search_results, search_results_2, [] ] response = self.__atlas_facade.search_entities_from_entity_type( 'WrongType') self.assertEqual(0, len(response)) def test_search_entities_no_return_should_return_empty(self): self.__atlas_client.search_dsl.return_value = [] response = self.__atlas_facade.search_entities_from_entity_type( 'Table') self.assertEqual(0, len(response)) def test_fetch_entities_should_return(self): table_1 = utils.MockedObject() guid = '2286a6bd-4b06-4f7c-a666-920d774b040e' table_1.guid = guid table_1._data = { 'typeName': 'Table', 'attributes': { 'owner': 'Joe', 'temporary': False, 'lastAccessTime': 1589983835754, 'replicatedTo': None, 'replicatedFrom': None, 'qualifiedName': 'sales_fact', 'columns': [{ 'guid': 'c53f1ab7-970f-4199-bc9a-899291c93622', 'typeName': 'Column' }, { 'guid': 'e5188d7b-916e-4420-b02e-8eac75b17a68', 'typeName': 'Column' }, { 'guid': '84d83e16-e767-46f9-8165-db7e3a7a3762', 'typeName': 'Column' }, { 'guid': '909805b1-59f0-44db-b0c8-b6b0c384d2c5', 'typeName': 'Column' }], 'description': 'sales fact table', 'viewExpandedText': None, 'sd': { 'guid': 'a0989a5b-19aa-4ac4-92db-e2449554c799', 'typeName': 'StorageDesc' }, 'tableType': 'Managed', 'createTime': 1589983835754, 'name': 'sales_fact', 'additionalProperties': None, 'db': { 'guid': 'c0ebcb5e-21f8-424d-bf11-f39bb943ae2c', 'typeName': 'DB' }, 'retention': 1589983835754, 'viewOriginalText': None }, 'guid': guid, 'status': 'ACTIVE', 'createdBy': 'admin', 'updatedBy': 'admin', 'createTime': 1589983835765, 'updateTime': 1589983850688, 'version': 0, 'relationshipAttributes': { 'schema': [], 'inputToProcesses': [{ 'guid': '2aa15a65-ae8e-4e48-9b77-2ecb049f82b4', 'typeName': 'LoadProcess', 'displayText': 'loadSalesDaily', 'relationshipGuid': '95d240a4-009b-48c8-b1d3-66703720f60a', 'relationshipStatus': 'ACTIVE', 'relationshipAttributes': { 'typeName': 'dataset_process_inputs' } }], 'relatedFromObjectAnnotations': [], 'resourceListAnchors': [], 'relatedToObjectAnnotations': None, 'supportingResources': [], 'meanings': [], 'outputFromProcesses': [] } } collection_item = utils.MockedObject() entities = [table_1] collection_item.entities = lambda: entities bulk_collection = [collection_item] self.__atlas_client.entity_bulk.return_value = bulk_collection response = self.__atlas_facade.fetch_entities([guid]) self.assertEqual(1, len(response)) self.assertEqual(table_1.guid, response[guid]['guid']) self.assertDictEqual(table_1._data, response[guid]['data']) def test_fetch_entity_classifications_should_return(self): returned_entity = utils.MockedObject() cursor = utils.MockedObject() cursor._data = { 'list': [{ 'typeName': 'Log Data', 'entityGuid': '30cfc9fc-aec4-4017-b649-f1f92351a727', 'propagate': True }, { 'typeName': 'ETL', 'entityGuid': 'e73656c9-da05-4db7-9b88-e3669c1a98eb', 'propagate': True }] } returned_entity.classifications = iter([cursor]) self.__atlas_client.entity_guid.return_value = returned_entity response = self.__atlas_facade.fetch_entity_classifications( ['30cfc9fc-aec4-4017-b649-f1f92351a727']) self.assertEqual(2, len(response)) def test_fetch_entity_classifications_error_should_not_raise_it(self): returned_entity = utils.MockedObject() cursor = utils.MockedObject() cursor._data = { 'list': [{ 'typeName': 'Log Data', 'entityGuid': '30cfc9fc-aec4-4017-b649-f1f92351a727', 'propagate': True }, { 'typeName': 'ETL', 'entityGuid': 'e73656c9-da05-4db7-9b88-e3669c1a98eb', 'propagate': True }] } returned_entity.classifications = iter([]) self.__atlas_client.entity_guid.return_value = returned_entity response = self.__atlas_facade.fetch_entity_classifications( ['30cfc9fc-aec4-4017-b649-f1f92351a727']) self.assertIsNone(response) def test_fetch_entity_classifications_with_duplicates_should_return(self): returned_entity = utils.MockedObject() cursor = utils.MockedObject() cursor._data = { 'list': [{ 'typeName': 'Log Data', 'entityGuid': '30cfc9fc-aec4-4017-b649-f1f92351a727', 'propagate': True }, { 'typeName': 'ETL', 'entityGuid': 'e73656c9-da05-4db7-9b88-e3669c1a98eb', 'propagate': True }, { 'typeName': 'ETL', 'entityGuid': '30cfc9fc-aec4-4017-b649-f1f92351a727', 'propagate': True }] } returned_entity.classifications = iter([cursor]) self.__atlas_client.entity_guid.return_value = returned_entity response = self.__atlas_facade.fetch_entity_classifications( '30cfc9fc-aec4-4017-b649-f1f92351a727') self.assertEqual(2, len(response)) self.assertEqual('30cfc9fc-aec4-4017-b649-f1f92351a727', response[1]['entityGuid'])
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 13, 29937, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29900, 5087, 365, 12182, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 29937, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 29937, 887, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 418, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 13, 5215, 443, 27958, 13, 3166, 443, 27958, 29889, 17640, 1053, 13261, 13, 13, 3166, 5386, 29889, 1272, 28045, 29918, 6915, 943, 29889, 22382, 29918, 1688, 1053, 3667, 29879, 13, 13, 3166, 5386, 29889, 1272, 28045, 29918, 6915, 943, 29889, 4288, 29918, 271, 3333, 1053, 24559, 412, 13, 13, 13, 1990, 13380, 27753, 29943, 562, 1943, 3057, 8259, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 13, 1678, 732, 5041, 877, 271, 3333, 4645, 29889, 4645, 29889, 27753, 1495, 13, 1678, 822, 731, 3373, 29898, 1311, 29892, 472, 3333, 29918, 4645, 1125, 13, 4706, 1583, 17255, 271, 3333, 29918, 17470, 1943, 353, 24559, 412, 29889, 17396, 1829, 27753, 29943, 562, 1943, 3319, 13, 9651, 525, 3069, 2396, 525, 1357, 29918, 3069, 742, 13, 9651, 525, 637, 2396, 525, 1357, 29918, 637, 742, 13, 9651, 525, 1792, 2396, 525, 1357, 29918, 1792, 742, 13, 9651, 525, 3364, 2396, 12801, 25711, 17013, 29958, 742, 13, 4706, 5615, 13, 4706, 396, 13899, 7582, 363, 278, 1203, 9859, 13, 4706, 396, 304, 1583, 17255, 271, 3333, 29918, 17470, 1943, 17255, 4288, 29918, 271, 3333, 13, 4706, 1583, 17255, 271, 3333, 29918, 4645, 353, 472, 3333, 29918, 4645, 29889, 2457, 29918, 1767, 13, 13, 1678, 822, 1243, 29918, 27821, 29918, 9344, 29918, 842, 29918, 8758, 29918, 15697, 29898, 1311, 1125, 13, 4706, 12421, 29879, 353, 1583, 17255, 271, 3333, 29918, 17470, 1943, 17255, 8977, 1649, 13, 4706, 1583, 29889, 9294, 3624, 3664, 8516, 29898, 5552, 29879, 1839, 29918, 17396, 1829, 27753, 29943, 562, 1943, 1649, 4288, 29918, 271, 3333, 11287, 13, 13, 1678, 822, 1243, 29918, 657, 29918, 6406, 29918, 2527, 10817, 29918, 9344, 29918, 29879, 1682, 3947, 29898, 1311, 1125, 13, 4706, 12714, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 12714, 29889, 10041, 353, 426, 13, 9651, 525, 10041, 9966, 2396, 426, 13, 18884, 525, 27753, 29954, 6758, 653, 2396, 29871, 29906, 29892, 13, 18884, 525, 10486, 19617, 2396, 29871, 29896, 29892, 13, 18884, 525, 3562, 2396, 29871, 29947, 29892, 13, 18884, 525, 4409, 2396, 29871, 29896, 29955, 29892, 13, 18884, 525, 27753, 29954, 6758, 653, 14343, 2396, 29871, 29946, 29946, 29892, 13, 18884, 525, 27753, 29954, 6758, 653, 10900, 2396, 29871, 29906, 29941, 29892, 13, 18884, 525, 1043, 2396, 29871, 29906, 29892, 13, 18884, 525, 4051, 2396, 29871, 29941, 29892, 13, 18884, 525, 5896, 7032, 2396, 29871, 29941, 13, 9651, 2981, 13, 9651, 525, 10041, 2772, 22742, 2396, 426, 13, 18884, 525, 29882, 3188, 29918, 2371, 2396, 29871, 29906, 13, 9651, 500, 13, 4706, 500, 13, 13, 4706, 12714, 29889, 17492, 353, 426, 13, 9651, 525, 10855, 2481, 2396, 29871, 29896, 29945, 29929, 29900, 29955, 29955, 29941, 29947, 29941, 29955, 29946, 29955, 29955, 29892, 13, 9651, 525, 10041, 3981, 2396, 29871, 29896, 29900, 29945, 29892, 13, 9651, 525, 4039, 3981, 2396, 29871, 29896, 29941, 29892, 13, 9651, 525, 1853, 2525, 3880, 3981, 2396, 29871, 29946, 29955, 29892, 13, 9651, 525, 1853, 3981, 2396, 29871, 29896, 29941, 29947, 13, 4706, 500, 13, 13, 4706, 1583, 17255, 271, 3333, 29918, 4645, 29889, 6406, 29918, 2527, 10817, 353, 518, 16414, 29962, 13, 13, 4706, 2933, 353, 1583, 17255, 271, 3333, 29918, 17470, 1943, 29889, 657, 29918, 6406, 29918, 2527, 10817, 580, 29961, 29900, 29962, 13, 13, 4706, 1583, 29889, 9294, 21533, 9843, 29898, 16414, 29889, 10041, 1839, 10041, 9966, 7464, 13, 462, 632, 2933, 1839, 10041, 9966, 11287, 13, 4706, 1583, 29889, 9294, 21533, 9843, 29898, 16414, 29889, 10041, 1839, 10041, 2772, 22742, 7464, 13, 462, 632, 2933, 1839, 10041, 2772, 22742, 11287, 13, 4706, 1583, 29889, 9294, 21533, 9843, 29898, 16414, 29889, 17492, 29892, 2933, 1839, 17492, 10095, 10817, 11287, 13, 13, 1678, 822, 1243, 29918, 657, 29918, 1017, 9795, 1389, 29879, 29898, 1311, 1125, 13, 4706, 1583, 17255, 271, 3333, 29918, 4645, 29889, 1017, 9795, 1389, 29879, 353, 5852, 13, 13, 4706, 396, 3387, 4974, 372, 471, 2000, 29892, 1951, 21787, 29879, 338, 263, 17366, 736, 29889, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5574, 29892, 1583, 17255, 271, 3333, 29918, 17470, 1943, 29889, 657, 29918, 1017, 9795, 1389, 29879, 3101, 13, 13, 1678, 822, 1243, 29918, 4478, 29918, 296, 1907, 29918, 3166, 29918, 10041, 29918, 1853, 29918, 9344, 29918, 2457, 29898, 1311, 1125, 13, 4706, 2740, 29918, 2914, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 2740, 29918, 9902, 353, 518, 4478, 29918, 2914, 29962, 13, 13, 4706, 1591, 29918, 29896, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 1591, 29918, 29896, 3032, 1272, 353, 426, 13, 9651, 525, 1853, 1170, 2396, 525, 3562, 742, 13, 9651, 525, 15697, 2396, 426, 13, 18884, 525, 20348, 2396, 525, 29967, 7297, 742, 13, 18884, 525, 3258, 2481, 2396, 29871, 29896, 29945, 29947, 29929, 29929, 29947, 29941, 29947, 29941, 29945, 29955, 29945, 29946, 29892, 13, 18884, 525, 15380, 2164, 1170, 2396, 525, 29879, 2122, 29918, 17028, 742, 13, 18884, 525, 978, 2396, 525, 29879, 2122, 29918, 17028, 742, 13, 18884, 525, 8216, 2396, 525, 29879, 2122, 2114, 1591, 29915, 13, 9651, 2981, 13, 9651, 525, 2543, 333, 2396, 525, 29906, 29906, 29947, 29953, 29874, 29953, 6448, 29899, 29946, 29890, 29900, 29953, 29899, 29946, 29888, 29955, 29883, 29899, 29874, 29953, 29953, 29953, 29899, 29929, 29906, 29900, 29881, 29955, 29955, 29946, 29890, 29900, 29946, 29900, 29872, 742, 13, 9651, 525, 4882, 2396, 525, 17923, 18474, 742, 13, 9651, 525, 4990, 1626, 2396, 525, 29879, 2122, 29918, 17028, 742, 13, 9651, 525, 1990, 2450, 8659, 2396, 6024, 20738, 2033, 13, 4706, 500, 13, 13, 4706, 1591, 29918, 29906, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 1591, 29918, 29906, 3032, 1272, 353, 426, 13, 9651, 525, 1853, 1170, 2396, 525, 3562, 742, 13, 9651, 525, 15697, 2396, 426, 13, 18884, 525, 20348, 2396, 525, 13711, 382, 14632, 742, 13, 18884, 525, 3258, 2481, 2396, 29871, 29896, 29945, 29947, 29929, 29929, 29947, 29941, 29947, 29946, 29955, 29955, 29945, 29946, 29892, 13, 18884, 525, 15380, 2164, 1170, 2396, 525, 1188, 29918, 17028, 29918, 29881, 8683, 29918, 29324, 742, 13, 18884, 525, 978, 2396, 525, 1188, 29918, 17028, 29918, 29881, 8683, 29918, 29324, 742, 13, 18884, 525, 8216, 2396, 525, 1188, 2114, 14218, 5518, 1891, 525, 13, 462, 1669, 525, 1493, 29915, 13, 9651, 2981, 13, 9651, 525, 2543, 333, 2396, 525, 29941, 29900, 6854, 29883, 29929, 13801, 29899, 29874, 687, 29946, 29899, 29946, 29900, 29896, 29955, 29899, 29890, 29953, 29946, 29929, 29899, 29888, 29896, 29888, 29929, 29906, 29941, 29945, 29896, 29874, 29955, 29906, 29955, 742, 13, 9651, 525, 4882, 2396, 525, 17923, 18474, 742, 13, 9651, 525, 4990, 1626, 2396, 525, 1188, 29918, 17028, 29918, 29881, 8683, 29918, 29324, 742, 13, 9651, 525, 1990, 2450, 8659, 2396, 6024, 3403, 3630, 2033, 13, 4706, 500, 13, 13, 4706, 2740, 29918, 2914, 29889, 296, 1907, 353, 518, 2371, 29918, 29896, 29892, 1591, 29918, 29906, 29962, 13, 13, 4706, 1583, 17255, 271, 3333, 29918, 4645, 29889, 4478, 29918, 29881, 2536, 29889, 2975, 29918, 15987, 353, 518, 4478, 29918, 9902, 29892, 5159, 29962, 13, 13, 4706, 2933, 353, 1583, 17255, 271, 3333, 29918, 17470, 1943, 29889, 4478, 29918, 296, 1907, 29918, 3166, 29918, 10041, 29918, 1853, 29898, 13, 9651, 525, 3562, 1495, 13, 13, 4706, 1583, 29889, 9294, 21533, 9843, 29898, 2371, 29918, 29896, 3032, 1272, 29892, 2933, 29961, 29900, 1822, 29918, 1272, 29897, 13, 4706, 1583, 29889, 9294, 21533, 9843, 29898, 2371, 29918, 29906, 3032, 1272, 29892, 2933, 29961, 29896, 1822, 29918, 1272, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29906, 29892, 7431, 29898, 5327, 876, 13, 13, 1678, 822, 1243, 29918, 4478, 29918, 296, 1907, 29918, 3166, 29918, 10041, 29918, 1853, 29918, 29886, 4063, 29918, 9344, 29918, 2457, 29898, 1311, 1125, 13, 4706, 2740, 29918, 2914, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 13, 4706, 1591, 29918, 29896, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 1591, 29918, 29896, 3032, 1272, 353, 426, 13, 9651, 525, 1853, 1170, 2396, 525, 3562, 742, 13, 9651, 525, 15697, 2396, 426, 13, 18884, 525, 20348, 2396, 525, 29967, 7297, 742, 13, 18884, 525, 3258, 2481, 2396, 29871, 29896, 29945, 29947, 29929, 29929, 29947, 29941, 29947, 29941, 29945, 29955, 29945, 29946, 29892, 13, 18884, 525, 15380, 2164, 1170, 2396, 525, 29879, 2122, 29918, 17028, 742, 13, 18884, 525, 978, 2396, 525, 29879, 2122, 29918, 17028, 742, 13, 18884, 525, 8216, 2396, 525, 29879, 2122, 2114, 1591, 29915, 13, 9651, 2981, 13, 9651, 525, 2543, 333, 2396, 525, 29906, 29906, 29947, 29953, 29874, 29953, 6448, 29899, 29946, 29890, 29900, 29953, 29899, 29946, 29888, 29955, 29883, 29899, 29874, 29953, 29953, 29953, 29899, 29929, 29906, 29900, 29881, 29955, 29955, 29946, 29890, 29900, 29946, 29900, 29872, 742, 13, 9651, 525, 4882, 2396, 525, 17923, 18474, 742, 13, 9651, 525, 4990, 1626, 2396, 525, 29879, 2122, 29918, 17028, 742, 13, 9651, 525, 1990, 2450, 8659, 2396, 6024, 20738, 2033, 13, 4706, 500, 13, 13, 4706, 2740, 29918, 2914, 29889, 296, 1907, 353, 518, 2371, 29918, 29896, 29962, 13, 4706, 2740, 29918, 9902, 353, 518, 4478, 29918, 2914, 29962, 13, 13, 4706, 2740, 29918, 2914, 29918, 29906, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 13, 4706, 1591, 29918, 29906, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 1591, 29918, 29906, 3032, 1272, 353, 426, 13, 9651, 525, 1853, 1170, 2396, 525, 3562, 742, 13, 9651, 525, 15697, 2396, 426, 13, 18884, 525, 20348, 2396, 525, 13711, 382, 14632, 742, 13, 18884, 525, 3258, 2481, 2396, 29871, 29896, 29945, 29947, 29929, 29929, 29947, 29941, 29947, 29946, 29955, 29955, 29945, 29946, 29892, 13, 18884, 525, 15380, 2164, 1170, 2396, 525, 1188, 29918, 17028, 29918, 29881, 8683, 29918, 29324, 742, 13, 18884, 525, 978, 2396, 525, 1188, 29918, 17028, 29918, 29881, 8683, 29918, 29324, 742, 13, 18884, 525, 8216, 2396, 525, 1188, 2114, 14218, 5518, 1891, 525, 13, 462, 1669, 525, 1493, 29915, 13, 9651, 2981, 13, 9651, 525, 2543, 333, 2396, 525, 29941, 29900, 6854, 29883, 29929, 13801, 29899, 29874, 687, 29946, 29899, 29946, 29900, 29896, 29955, 29899, 29890, 29953, 29946, 29929, 29899, 29888, 29896, 29888, 29929, 29906, 29941, 29945, 29896, 29874, 29955, 29906, 29955, 742, 13, 9651, 525, 4882, 2396, 525, 17923, 18474, 742, 13, 9651, 525, 4990, 1626, 2396, 525, 1188, 29918, 17028, 29918, 29881, 8683, 29918, 29324, 742, 13, 9651, 525, 1990, 2450, 8659, 2396, 6024, 3403, 3630, 2033, 13, 4706, 500, 13, 13, 4706, 2740, 29918, 2914, 29918, 29906, 29889, 296, 1907, 353, 518, 2371, 29918, 29906, 29962, 13, 4706, 2740, 29918, 9902, 29918, 29906, 353, 518, 4478, 29918, 2914, 29918, 29906, 29962, 13, 13, 4706, 1583, 17255, 271, 3333, 29918, 4645, 29889, 4478, 29918, 29881, 2536, 29889, 2975, 29918, 15987, 353, 518, 13, 9651, 2740, 29918, 9902, 29892, 2740, 29918, 9902, 29918, 29906, 29892, 5159, 13, 4706, 4514, 13, 13, 4706, 2933, 353, 1583, 17255, 271, 3333, 29918, 17470, 1943, 29889, 4478, 29918, 296, 1907, 29918, 3166, 29918, 10041, 29918, 1853, 29898, 13, 9651, 525, 3562, 1495, 13, 13, 4706, 1583, 29889, 9294, 21533, 9843, 29898, 2371, 29918, 29896, 3032, 1272, 29892, 2933, 29961, 29900, 1822, 29918, 1272, 29897, 13, 4706, 1583, 29889, 9294, 21533, 9843, 29898, 2371, 29918, 29906, 3032, 1272, 29892, 2933, 29961, 29896, 1822, 29918, 1272, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29906, 29892, 7431, 29898, 5327, 876, 13, 13, 1678, 822, 1243, 29918, 4478, 29918, 296, 1907, 29918, 3166, 29918, 5464, 29918, 735, 9696, 29918, 10041, 29918, 1853, 29918, 9344, 29918, 2457, 29918, 6310, 29898, 13, 9651, 1583, 1125, 13, 4706, 2740, 29918, 2914, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 13, 4706, 1591, 29918, 29896, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 1591, 29918, 29896, 3032, 1272, 353, 426, 13, 9651, 525, 1853, 1170, 2396, 525, 3562, 742, 13, 9651, 525, 15697, 2396, 426, 13, 18884, 525, 20348, 2396, 525, 29967, 7297, 742, 13, 18884, 525, 3258, 2481, 2396, 29871, 29896, 29945, 29947, 29929, 29929, 29947, 29941, 29947, 29941, 29945, 29955, 29945, 29946, 29892, 13, 18884, 525, 15380, 2164, 1170, 2396, 525, 29879, 2122, 29918, 17028, 742, 13, 18884, 525, 978, 2396, 525, 29879, 2122, 29918, 17028, 742, 13, 18884, 525, 8216, 2396, 525, 29879, 2122, 2114, 1591, 29915, 13, 9651, 2981, 13, 9651, 525, 2543, 333, 2396, 525, 29906, 29906, 29947, 29953, 29874, 29953, 6448, 29899, 29946, 29890, 29900, 29953, 29899, 29946, 29888, 29955, 29883, 29899, 29874, 29953, 29953, 29953, 29899, 29929, 29906, 29900, 29881, 29955, 29955, 29946, 29890, 29900, 29946, 29900, 29872, 742, 13, 9651, 525, 4882, 2396, 525, 17923, 18474, 742, 13, 9651, 525, 4990, 1626, 2396, 525, 29879, 2122, 29918, 17028, 742, 13, 9651, 525, 1990, 2450, 8659, 2396, 6024, 20738, 2033, 13, 4706, 500, 13, 13, 4706, 2740, 29918, 2914, 29889, 296, 1907, 353, 518, 2371, 29918, 29896, 29962, 13, 4706, 2740, 29918, 9902, 353, 518, 4478, 29918, 2914, 29962, 13, 13, 4706, 2740, 29918, 2914, 29918, 29906, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 13, 4706, 1591, 29918, 29906, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 1591, 29918, 29906, 3032, 1272, 353, 426, 13, 9651, 525, 1853, 1170, 2396, 525, 3562, 742, 13, 9651, 525, 15697, 2396, 426, 13, 18884, 525, 20348, 2396, 12801, 5813, 29958, 742, 13, 18884, 525, 3258, 2481, 2396, 29871, 29896, 29945, 29947, 29929, 29929, 29947, 29941, 29947, 29946, 29955, 29955, 29945, 29946, 29892, 13, 18884, 525, 15380, 2164, 1170, 2396, 525, 1188, 29918, 17028, 29918, 29881, 8683, 29918, 29324, 742, 13, 18884, 525, 978, 2396, 525, 1188, 29918, 17028, 29918, 29881, 8683, 29918, 29324, 742, 13, 18884, 525, 8216, 2396, 525, 1188, 2114, 14218, 5518, 1891, 525, 13, 462, 1669, 525, 1493, 29915, 13, 9651, 2981, 13, 9651, 525, 2543, 333, 2396, 525, 29941, 29900, 6854, 29883, 29929, 13801, 29899, 29874, 687, 29946, 29899, 29946, 29900, 29896, 29955, 29899, 29890, 29953, 29946, 29929, 29899, 29888, 29896, 29888, 29929, 29906, 29941, 29945, 29896, 29874, 29955, 29906, 29955, 742, 13, 9651, 525, 4882, 2396, 525, 17923, 18474, 742, 13, 9651, 525, 4990, 1626, 2396, 525, 1188, 29918, 17028, 29918, 29881, 8683, 29918, 29324, 742, 13, 9651, 525, 1990, 2450, 8659, 2396, 6024, 3403, 3630, 2033, 13, 4706, 500, 13, 13, 4706, 2740, 29918, 2914, 29918, 29906, 29889, 296, 1907, 353, 518, 2371, 29918, 29906, 29962, 13, 4706, 2740, 29918, 9902, 29918, 29906, 353, 518, 4478, 29918, 2914, 29918, 29906, 29962, 13, 13, 4706, 1583, 17255, 271, 3333, 29918, 4645, 29889, 4478, 29918, 29881, 2536, 29889, 2975, 29918, 15987, 353, 518, 13, 9651, 2740, 29918, 9902, 29892, 2740, 29918, 9902, 29918, 29906, 29892, 5159, 13, 4706, 4514, 13, 13, 4706, 2933, 353, 1583, 17255, 271, 3333, 29918, 17470, 1943, 29889, 4478, 29918, 296, 1907, 29918, 3166, 29918, 10041, 29918, 1853, 29898, 13, 9651, 525, 29956, 29373, 1542, 1495, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29900, 29892, 7431, 29898, 5327, 876, 13, 13, 1678, 822, 1243, 29918, 4478, 29918, 296, 1907, 29918, 1217, 29918, 2457, 29918, 9344, 29918, 2457, 29918, 6310, 29898, 1311, 1125, 13, 4706, 1583, 17255, 271, 3333, 29918, 4645, 29889, 4478, 29918, 29881, 2536, 29889, 2457, 29918, 1767, 353, 5159, 13, 13, 4706, 2933, 353, 1583, 17255, 271, 3333, 29918, 17470, 1943, 29889, 4478, 29918, 296, 1907, 29918, 3166, 29918, 10041, 29918, 1853, 29898, 13, 9651, 525, 3562, 1495, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29900, 29892, 7431, 29898, 5327, 876, 13, 13, 1678, 822, 1243, 29918, 9155, 29918, 296, 1907, 29918, 9344, 29918, 2457, 29898, 1311, 1125, 13, 4706, 1591, 29918, 29896, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 16605, 353, 525, 29906, 29906, 29947, 29953, 29874, 29953, 6448, 29899, 29946, 29890, 29900, 29953, 29899, 29946, 29888, 29955, 29883, 29899, 29874, 29953, 29953, 29953, 29899, 29929, 29906, 29900, 29881, 29955, 29955, 29946, 29890, 29900, 29946, 29900, 29872, 29915, 13, 4706, 1591, 29918, 29896, 29889, 2543, 333, 353, 16605, 13, 4706, 1591, 29918, 29896, 3032, 1272, 353, 426, 13, 9651, 525, 1853, 1170, 2396, 525, 3562, 742, 13, 9651, 525, 15697, 2396, 426, 13, 18884, 525, 20348, 2396, 525, 29967, 7297, 742, 13, 18884, 525, 1356, 1971, 653, 2396, 7700, 29892, 13, 18884, 525, 4230, 6638, 2481, 2396, 29871, 29896, 29945, 29947, 29929, 29929, 29947, 29941, 29947, 29941, 29945, 29955, 29945, 29946, 29892, 13, 18884, 525, 3445, 9169, 1762, 2396, 6213, 29892, 13, 18884, 525, 3445, 9169, 4591, 2396, 6213, 29892, 13, 18884, 525, 15380, 2164, 1170, 2396, 525, 29879, 2122, 29918, 17028, 742, 13, 18884, 525, 13099, 2396, 15974, 13, 462, 1678, 525, 2543, 333, 2396, 525, 29883, 29945, 29941, 29888, 29896, 370, 29955, 29899, 29929, 29955, 29900, 29888, 29899, 29946, 29896, 29929, 29929, 29899, 12328, 29929, 29874, 29899, 29947, 29929, 29929, 29906, 29929, 29896, 29883, 29929, 29941, 29953, 29906, 29906, 742, 13, 462, 1678, 525, 1853, 1170, 2396, 525, 4409, 29915, 13, 18884, 2981, 426, 13, 462, 1678, 525, 2543, 333, 2396, 525, 29872, 29945, 29896, 29947, 29947, 29881, 29955, 29890, 29899, 29929, 29896, 29953, 29872, 29899, 29946, 29946, 29906, 29900, 29899, 29890, 29900, 29906, 29872, 29899, 29947, 29872, 562, 29955, 29945, 29890, 29896, 29955, 29874, 29953, 29947, 742, 13, 462, 1678, 525, 1853, 1170, 2396, 525, 4409, 29915, 13, 18884, 2981, 426, 13, 462, 1678, 525, 2543, 333, 2396, 525, 29947, 29946, 29881, 29947, 29941, 29872, 29896, 29953, 29899, 29872, 29955, 29953, 29955, 29899, 29946, 29953, 29888, 29929, 29899, 29947, 29896, 29953, 29945, 29899, 2585, 29955, 29872, 29941, 29874, 29955, 29874, 29941, 29955, 29953, 29906, 742, 13, 462, 1678, 525, 1853, 1170, 2396, 525, 4409, 29915, 13, 18884, 2981, 426, 13, 462, 1678, 525, 2543, 333, 2396, 525, 29929, 29900, 29929, 29947, 29900, 29945, 29890, 29896, 29899, 29945, 29929, 29888, 29900, 29899, 29946, 29946, 2585, 29899, 29890, 29900, 29883, 29947, 29899, 29890, 29953, 29890, 29900, 29883, 29941, 29947, 29946, 29881, 29906, 29883, 29945, 742, 13, 462, 1678, 525, 1853, 1170, 2396, 525, 4409, 29915, 13, 18884, 500, 1402, 13, 18884, 525, 8216, 2396, 525, 29879, 2122, 2114, 1591, 742, 13, 18884, 525, 1493, 29777, 287, 1626, 2396, 6213, 29892, 13, 18884, 525, 4928, 2396, 426, 13, 462, 1678, 525, 2543, 333, 2396, 525, 29874, 29900, 29929, 29947, 29929, 29874, 29945, 29890, 29899, 29896, 29929, 7340, 29899, 29946, 562, 29946, 29899, 29929, 29906, 2585, 29899, 29872, 29906, 29946, 29946, 29929, 29945, 29945, 29946, 29883, 29955, 29929, 29929, 742, 13, 462, 1678, 525, 1853, 1170, 2396, 525, 10486, 19617, 29915, 13, 18884, 2981, 13, 18884, 525, 2371, 1542, 2396, 525, 26542, 742, 13, 18884, 525, 3258, 2481, 2396, 29871, 29896, 29945, 29947, 29929, 29929, 29947, 29941, 29947, 29941, 29945, 29955, 29945, 29946, 29892, 13, 18884, 525, 978, 2396, 525, 29879, 2122, 29918, 17028, 742, 13, 18884, 525, 1202, 3245, 11857, 2396, 6213, 29892, 13, 18884, 525, 2585, 2396, 426, 13, 462, 1678, 525, 2543, 333, 2396, 525, 29883, 29900, 774, 10702, 29945, 29872, 29899, 29906, 29896, 29888, 29947, 29899, 29946, 29906, 29946, 29881, 29899, 1635, 29896, 29896, 29899, 29888, 29941, 29929, 1327, 29929, 29946, 29941, 3660, 29906, 29883, 742, 13, 462, 1678, 525, 1853, 1170, 2396, 525, 4051, 29915, 13, 18884, 2981, 13, 18884, 525, 2267, 2509, 2396, 29871, 29896, 29945, 29947, 29929, 29929, 29947, 29941, 29947, 29941, 29945, 29955, 29945, 29946, 29892, 13, 18884, 525, 1493, 26036, 1626, 2396, 6213, 13, 9651, 2981, 13, 9651, 525, 2543, 333, 2396, 16605, 29892, 13, 9651, 525, 4882, 2396, 525, 17923, 18474, 742, 13, 9651, 525, 11600, 2059, 2396, 525, 6406, 742, 13, 9651, 525, 21402, 2059, 2396, 525, 6406, 742, 13, 9651, 525, 3258, 2481, 2396, 29871, 29896, 29945, 29947, 29929, 29929, 29947, 29941, 29947, 29941, 29945, 29955, 29953, 29945, 29892, 13, 9651, 525, 5504, 2481, 2396, 29871, 29896, 29945, 29947, 29929, 29929, 29947, 29941, 29947, 29945, 29900, 29953, 29947, 29947, 29892, 13, 9651, 525, 3259, 2396, 29871, 29900, 29892, 13, 9651, 525, 2674, 800, 4034, 15801, 2396, 426, 13, 18884, 525, 11010, 2396, 19997, 13, 18884, 525, 2080, 1762, 7032, 267, 2396, 15974, 13, 462, 1678, 525, 2543, 333, 2396, 525, 29906, 7340, 29896, 29945, 29874, 29953, 29945, 29899, 3660, 29947, 29872, 29899, 29946, 29872, 29946, 29947, 29899, 29929, 29890, 29955, 29955, 29899, 29906, 687, 29890, 29900, 29946, 29929, 29888, 29947, 29906, 29890, 29946, 742, 13, 462, 1678, 525, 1853, 1170, 2396, 525, 5896, 7032, 742, 13, 462, 1678, 525, 4990, 1626, 2396, 525, 1359, 29903, 2122, 29928, 8683, 742, 13, 462, 1678, 525, 2674, 800, 4034, 29954, 5416, 2396, 525, 29929, 29945, 29881, 29906, 29946, 29900, 29874, 29946, 29899, 29900, 29900, 29929, 29890, 29899, 29946, 29947, 29883, 29947, 29899, 29890, 29896, 29881, 29941, 29899, 29953, 29953, 29955, 29900, 29941, 29955, 29906, 29900, 29888, 29953, 29900, 29874, 742, 13, 462, 1678, 525, 2674, 800, 4034, 5709, 2396, 525, 17923, 18474, 742, 13, 462, 1678, 525, 2674, 800, 4034, 15801, 2396, 426, 13, 462, 4706, 525, 1853, 1170, 2396, 525, 24713, 29918, 5014, 29918, 2080, 29879, 29915, 13, 462, 1678, 500, 13, 18884, 500, 1402, 13, 18884, 525, 12817, 4591, 2061, 2744, 1333, 800, 2396, 19997, 13, 18884, 525, 10314, 1293, 2744, 305, 943, 2396, 19997, 13, 18884, 525, 12817, 1762, 2061, 2744, 1333, 800, 2396, 6213, 29892, 13, 18884, 525, 5924, 292, 13770, 2396, 19997, 13, 18884, 525, 12676, 886, 2396, 19997, 13, 18884, 525, 4905, 4591, 7032, 267, 2396, 5159, 13, 9651, 500, 13, 4706, 500, 13, 13, 4706, 4333, 29918, 667, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 16212, 353, 518, 2371, 29918, 29896, 29962, 13, 4706, 4333, 29918, 667, 29889, 296, 1907, 353, 14013, 29901, 16212, 13, 13, 4706, 21610, 29918, 10855, 353, 518, 10855, 29918, 667, 29962, 13, 13, 4706, 1583, 17255, 271, 3333, 29918, 4645, 29889, 10041, 29918, 8645, 29895, 29889, 2457, 29918, 1767, 353, 21610, 29918, 10855, 13, 13, 4706, 2933, 353, 1583, 17255, 271, 3333, 29918, 17470, 1943, 29889, 9155, 29918, 296, 1907, 4197, 2543, 333, 2314, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29896, 29892, 7431, 29898, 5327, 876, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2371, 29918, 29896, 29889, 2543, 333, 29892, 2933, 29961, 2543, 333, 22322, 2543, 333, 11287, 13, 4706, 1583, 29889, 9294, 21533, 9843, 29898, 2371, 29918, 29896, 3032, 1272, 29892, 2933, 29961, 2543, 333, 22322, 1272, 11287, 13, 13, 1678, 822, 1243, 29918, 9155, 29918, 10041, 29918, 1990, 8232, 29918, 9344, 29918, 2457, 29898, 1311, 1125, 13, 4706, 4133, 29918, 10041, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 10677, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 10677, 3032, 1272, 353, 426, 13, 9651, 525, 1761, 2396, 15974, 13, 18884, 525, 1853, 1170, 2396, 525, 3403, 3630, 742, 13, 18884, 525, 10041, 29954, 5416, 2396, 525, 29941, 29900, 6854, 29883, 29929, 13801, 29899, 29874, 687, 29946, 29899, 29946, 29900, 29896, 29955, 29899, 29890, 29953, 29946, 29929, 29899, 29888, 29896, 29888, 29929, 29906, 29941, 29945, 29896, 29874, 29955, 29906, 29955, 742, 13, 18884, 525, 7728, 351, 403, 2396, 5852, 13, 9651, 2981, 426, 13, 18884, 525, 1853, 1170, 2396, 525, 2544, 29931, 742, 13, 18884, 525, 10041, 29954, 5416, 2396, 525, 29872, 29955, 29941, 29953, 29945, 29953, 29883, 29929, 29899, 1388, 29900, 29945, 29899, 29946, 2585, 29955, 29899, 29929, 29890, 29947, 29947, 29899, 29872, 29941, 29953, 29953, 29929, 29883, 29896, 29874, 29929, 29947, 774, 742, 13, 18884, 525, 7728, 351, 403, 2396, 5852, 13, 9651, 500, 29962, 13, 4706, 500, 13, 4706, 4133, 29918, 10041, 29889, 1990, 8232, 353, 4256, 4197, 18127, 2314, 13, 13, 4706, 1583, 17255, 271, 3333, 29918, 4645, 29889, 10041, 29918, 2543, 333, 29889, 2457, 29918, 1767, 353, 4133, 29918, 10041, 13, 13, 4706, 2933, 353, 1583, 17255, 271, 3333, 29918, 17470, 1943, 29889, 9155, 29918, 10041, 29918, 1990, 8232, 29898, 13, 9651, 6024, 29941, 29900, 6854, 29883, 29929, 13801, 29899, 29874, 687, 29946, 29899, 29946, 29900, 29896, 29955, 29899, 29890, 29953, 29946, 29929, 29899, 29888, 29896, 29888, 29929, 29906, 29941, 29945, 29896, 29874, 29955, 29906, 29955, 11287, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29906, 29892, 7431, 29898, 5327, 876, 13, 13, 1678, 822, 1243, 29918, 9155, 29918, 10041, 29918, 1990, 8232, 29918, 2704, 29918, 9344, 29918, 1333, 29918, 22692, 29918, 277, 29898, 1311, 1125, 13, 4706, 4133, 29918, 10041, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 10677, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 10677, 3032, 1272, 353, 426, 13, 9651, 525, 1761, 2396, 15974, 13, 18884, 525, 1853, 1170, 2396, 525, 3403, 3630, 742, 13, 18884, 525, 10041, 29954, 5416, 2396, 525, 29941, 29900, 6854, 29883, 29929, 13801, 29899, 29874, 687, 29946, 29899, 29946, 29900, 29896, 29955, 29899, 29890, 29953, 29946, 29929, 29899, 29888, 29896, 29888, 29929, 29906, 29941, 29945, 29896, 29874, 29955, 29906, 29955, 742, 13, 18884, 525, 7728, 351, 403, 2396, 5852, 13, 9651, 2981, 426, 13, 18884, 525, 1853, 1170, 2396, 525, 2544, 29931, 742, 13, 18884, 525, 10041, 29954, 5416, 2396, 525, 29872, 29955, 29941, 29953, 29945, 29953, 29883, 29929, 29899, 1388, 29900, 29945, 29899, 29946, 2585, 29955, 29899, 29929, 29890, 29947, 29947, 29899, 29872, 29941, 29953, 29953, 29929, 29883, 29896, 29874, 29929, 29947, 774, 742, 13, 18884, 525, 7728, 351, 403, 2396, 5852, 13, 9651, 500, 29962, 13, 4706, 500, 13, 4706, 4133, 29918, 10041, 29889, 1990, 8232, 353, 4256, 4197, 2314, 13, 13, 4706, 1583, 17255, 271, 3333, 29918, 4645, 29889, 10041, 29918, 2543, 333, 29889, 2457, 29918, 1767, 353, 4133, 29918, 10041, 13, 13, 4706, 2933, 353, 1583, 17255, 271, 3333, 29918, 17470, 1943, 29889, 9155, 29918, 10041, 29918, 1990, 8232, 29898, 13, 9651, 6024, 29941, 29900, 6854, 29883, 29929, 13801, 29899, 29874, 687, 29946, 29899, 29946, 29900, 29896, 29955, 29899, 29890, 29953, 29946, 29929, 29899, 29888, 29896, 29888, 29929, 29906, 29941, 29945, 29896, 29874, 29955, 29906, 29955, 11287, 13, 13, 4706, 1583, 29889, 9294, 3624, 8516, 29898, 5327, 29897, 13, 13, 1678, 822, 1243, 29918, 9155, 29918, 10041, 29918, 1990, 8232, 29918, 2541, 29918, 20908, 15815, 29918, 9344, 29918, 2457, 29898, 1311, 1125, 13, 4706, 4133, 29918, 10041, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 10677, 353, 3667, 29879, 29889, 18680, 287, 2061, 580, 13, 4706, 10677, 3032, 1272, 353, 426, 13, 9651, 525, 1761, 2396, 15974, 13, 18884, 525, 1853, 1170, 2396, 525, 3403, 3630, 742, 13, 18884, 525, 10041, 29954, 5416, 2396, 525, 29941, 29900, 6854, 29883, 29929, 13801, 29899, 29874, 687, 29946, 29899, 29946, 29900, 29896, 29955, 29899, 29890, 29953, 29946, 29929, 29899, 29888, 29896, 29888, 29929, 29906, 29941, 29945, 29896, 29874, 29955, 29906, 29955, 742, 13, 18884, 525, 7728, 351, 403, 2396, 5852, 13, 9651, 2981, 426, 13, 18884, 525, 1853, 1170, 2396, 525, 2544, 29931, 742, 13, 18884, 525, 10041, 29954, 5416, 2396, 525, 29872, 29955, 29941, 29953, 29945, 29953, 29883, 29929, 29899, 1388, 29900, 29945, 29899, 29946, 2585, 29955, 29899, 29929, 29890, 29947, 29947, 29899, 29872, 29941, 29953, 29953, 29929, 29883, 29896, 29874, 29929, 29947, 774, 742, 13, 18884, 525, 7728, 351, 403, 2396, 5852, 13, 9651, 2981, 426, 13, 18884, 525, 1853, 1170, 2396, 525, 2544, 29931, 742, 13, 18884, 525, 10041, 29954, 5416, 2396, 525, 29941, 29900, 6854, 29883, 29929, 13801, 29899, 29874, 687, 29946, 29899, 29946, 29900, 29896, 29955, 29899, 29890, 29953, 29946, 29929, 29899, 29888, 29896, 29888, 29929, 29906, 29941, 29945, 29896, 29874, 29955, 29906, 29955, 742, 13, 18884, 525, 7728, 351, 403, 2396, 5852, 13, 9651, 500, 29962, 13, 4706, 500, 13, 4706, 4133, 29918, 10041, 29889, 1990, 8232, 353, 4256, 4197, 18127, 2314, 13, 13, 4706, 1583, 17255, 271, 3333, 29918, 4645, 29889, 10041, 29918, 2543, 333, 29889, 2457, 29918, 1767, 353, 4133, 29918, 10041, 13, 13, 4706, 2933, 353, 1583, 17255, 271, 3333, 29918, 17470, 1943, 29889, 9155, 29918, 10041, 29918, 1990, 8232, 29898, 13, 9651, 525, 29941, 29900, 6854, 29883, 29929, 13801, 29899, 29874, 687, 29946, 29899, 29946, 29900, 29896, 29955, 29899, 29890, 29953, 29946, 29929, 29899, 29888, 29896, 29888, 29929, 29906, 29941, 29945, 29896, 29874, 29955, 29906, 29955, 1495, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29906, 29892, 7431, 29898, 5327, 876, 13, 4706, 1583, 29889, 9294, 9843, 877, 29941, 29900, 6854, 29883, 29929, 13801, 29899, 29874, 687, 29946, 29899, 29946, 29900, 29896, 29955, 29899, 29890, 29953, 29946, 29929, 29899, 29888, 29896, 29888, 29929, 29906, 29941, 29945, 29896, 29874, 29955, 29906, 29955, 742, 13, 462, 308, 2933, 29961, 29896, 22322, 10041, 29954, 5416, 11287, 13, 2 ]
skewt/__init__.py
aktaylor08/SkewT
1
191801
__version__="0.1.3r1"
[ 1, 4770, 3259, 1649, 543, 29900, 29889, 29896, 29889, 29941, 29878, 29896, 29908, 13, 2 ]
src/test/TestAffichage.py
Franckyi/Simulation-Telecom
0
95652
#!/usr/bin/env python # coding: utf-8 import affichage import sequence seq = sequence.sequence_aleatoire(32) affichage.figure_sequence(seq, 0, 3) affichage.afficher()
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 5215, 2756, 436, 482, 13, 5215, 5665, 13, 13, 11762, 353, 5665, 29889, 16506, 29918, 744, 20141, 29898, 29941, 29906, 29897, 13, 3470, 436, 482, 29889, 4532, 29918, 16506, 29898, 11762, 29892, 29871, 29900, 29892, 29871, 29941, 29897, 13, 3470, 436, 482, 29889, 3470, 12805, 580, 13, 2 ]
ahmed-package/__init__.py
gokcelahmed/ahmed-package
0
28977
<filename>ahmed-package/__init__.py from ahmed-package.functions import printName
[ 1, 529, 9507, 29958, 801, 2168, 29899, 5113, 29914, 1649, 2344, 26914, 2272, 13, 3166, 21023, 2168, 29899, 5113, 29889, 12171, 1053, 1596, 1170, 2 ]
src/com/model/view.py
amzpiper/synchronize_data
0
114871
#!/usr/bin/env/python # -*- coding:utf-8 -*- # Author:guoyuhang from com.config.config import Config import uuid class ViewModel(object): def __init__(self,name,priority,acls,href,owners,dns64s,fail_forwarder,zones,comment,aclList): self.config = Config.get_instance() self.name= name self.priority = priority self.acls = acls self.href = href self.owners = owners self.dns64s = dns64s self.fail_forwarder = fail_forwarder self.zones = zones self.zones = "" self.comment = comment self.view_id = ''.join(str(uuid.uuid1()).split('-')) self.zdns_view_id = ''.join(str(uuid.uuid1()).split('-')) self.view_zdns_view_id = ''.join(str(uuid.uuid1()).split('-')) self.view_acl_id = ''.join(str(uuid.uuid1()).split('-')) self.toJsonString() self.toSqlString(aclList) """ 组合后输出为json对象,方便请求dns创建服务 """ def toJsonString(self): pass """ 组合sql模板输出SQL语句 """ def toSqlString(self,aclList): # 查询acls中的acl_id acl_id={} acl_id[0]="" acl_index=0 for aclName in self.acls: for acl in aclList: if acl.name == aclName: print(acl.acl_id,':',acl.name) acl_id[acl_index]=acl.acl_id acl_index +=1 self.sql = self.config.view_table_insert % ( self.view_id, self.config.pool_id, self.config.tenant_id, self.name ) + "\n" + self.config.zdns_view_info_t_table_insert % ( self.zdns_view_id, self.name, self.dns64s, self.owners, self.fail_forwarder, self.config.current_users, self.priority, self.href, self.zones, self.comment ) + "\n" + self.config.view_zdns_view_associations_table_insert %( self.view_zdns_view_id, self.view_id, self.zdns_view_id ) + "\n" + self.config.view_acl_associations_table_insert %( self.view_acl_id, acl_id[0], self.view_id ) return self.sql
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 29914, 4691, 13, 29937, 448, 29930, 29899, 14137, 29901, 9420, 29899, 29947, 448, 29930, 29899, 13, 29937, 13361, 29901, 2543, 12602, 29884, 11895, 13, 13, 3166, 419, 29889, 2917, 29889, 2917, 1053, 12782, 13, 5215, 318, 5416, 13, 13, 13, 1990, 4533, 3195, 29898, 3318, 1125, 13, 268, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 978, 29892, 29886, 21766, 29892, 562, 3137, 29892, 12653, 29892, 776, 414, 29892, 29881, 1983, 29953, 29946, 29879, 29892, 14057, 29918, 11333, 261, 29892, 29920, 2873, 29892, 9342, 29892, 562, 29880, 1293, 1125, 13, 4706, 1583, 29889, 2917, 353, 12782, 29889, 657, 29918, 8758, 580, 13, 4706, 1583, 29889, 978, 29922, 1024, 13, 4706, 1583, 29889, 29886, 21766, 353, 20136, 13, 4706, 1583, 29889, 562, 3137, 353, 263, 25932, 13, 4706, 1583, 29889, 12653, 353, 2822, 13, 4706, 1583, 29889, 776, 414, 353, 1914, 414, 13, 4706, 1583, 29889, 29881, 1983, 29953, 29946, 29879, 353, 270, 1983, 29953, 29946, 29879, 13, 4706, 1583, 29889, 14057, 29918, 11333, 261, 353, 4418, 29918, 11333, 261, 13, 4706, 1583, 29889, 29920, 2873, 353, 20542, 13, 4706, 1583, 29889, 29920, 2873, 353, 5124, 13, 4706, 1583, 29889, 9342, 353, 3440, 13, 4706, 1583, 29889, 1493, 29918, 333, 353, 525, 4286, 7122, 29898, 710, 29898, 25118, 29889, 25118, 29896, 16655, 5451, 877, 29899, 8785, 13, 4706, 1583, 29889, 8849, 1983, 29918, 1493, 29918, 333, 353, 525, 4286, 7122, 29898, 710, 29898, 25118, 29889, 25118, 29896, 16655, 5451, 877, 29899, 8785, 13, 4706, 1583, 29889, 1493, 29918, 8849, 1983, 29918, 1493, 29918, 333, 353, 525, 4286, 7122, 29898, 710, 29898, 25118, 29889, 25118, 29896, 16655, 5451, 877, 29899, 8785, 13, 4706, 1583, 29889, 1493, 29918, 562, 29880, 29918, 333, 353, 525, 4286, 7122, 29898, 710, 29898, 25118, 29889, 25118, 29896, 16655, 5451, 877, 29899, 8785, 13, 308, 13, 4706, 1583, 29889, 517, 8148, 1231, 580, 13, 4706, 1583, 29889, 517, 10520, 1231, 29898, 562, 29880, 1293, 29897, 13, 268, 13, 1678, 9995, 29871, 31263, 30733, 30822, 31573, 30544, 30573, 3126, 30783, 31133, 30214, 30525, 231, 193, 194, 31088, 31376, 29881, 1983, 31441, 30886, 31520, 31358, 9995, 13, 1678, 822, 304, 8148, 1231, 29898, 1311, 1125, 13, 4706, 1209, 13, 268, 13, 1678, 9995, 29871, 31263, 30733, 2850, 31382, 233, 160, 194, 31573, 30544, 4176, 31505, 232, 146, 168, 9995, 13, 1678, 822, 304, 10520, 1231, 29898, 1311, 29892, 562, 29880, 1293, 1125, 13, 4706, 396, 29871, 31213, 235, 178, 165, 562, 3137, 30275, 30210, 562, 29880, 29918, 333, 13, 4706, 263, 695, 29918, 333, 3790, 29913, 13, 4706, 263, 695, 29918, 333, 29961, 29900, 29962, 13776, 13, 4706, 263, 695, 29918, 2248, 29922, 29900, 13, 4706, 363, 263, 695, 1170, 297, 1583, 29889, 562, 3137, 29901, 13, 9651, 363, 263, 695, 297, 263, 695, 1293, 29901, 13, 18884, 565, 263, 695, 29889, 978, 1275, 263, 695, 1170, 29901, 13, 462, 1678, 1596, 29898, 562, 29880, 29889, 562, 29880, 29918, 333, 29892, 2396, 742, 562, 29880, 29889, 978, 29897, 13, 462, 1678, 263, 695, 29918, 333, 29961, 562, 29880, 29918, 2248, 13192, 562, 29880, 29889, 562, 29880, 29918, 333, 13, 462, 1678, 263, 695, 29918, 2248, 4619, 29896, 13, 13, 4706, 1583, 29889, 2850, 353, 1583, 29889, 2917, 29889, 1493, 29918, 2371, 29918, 7851, 1273, 313, 13, 462, 4706, 1583, 29889, 1493, 29918, 333, 29892, 13, 462, 4706, 1583, 29889, 2917, 29889, 10109, 29918, 333, 29892, 13, 462, 4706, 1583, 29889, 2917, 29889, 841, 424, 29918, 333, 29892, 13, 462, 4706, 1583, 29889, 978, 13, 462, 1678, 1723, 718, 6634, 29876, 29908, 718, 1583, 29889, 2917, 29889, 8849, 1983, 29918, 1493, 29918, 3888, 29918, 29873, 29918, 2371, 29918, 7851, 1273, 313, 13, 462, 4706, 1583, 29889, 8849, 1983, 29918, 1493, 29918, 333, 29892, 13, 462, 4706, 1583, 29889, 978, 29892, 13, 462, 4706, 1583, 29889, 29881, 1983, 29953, 29946, 29879, 29892, 13, 462, 4706, 1583, 29889, 776, 414, 29892, 13, 462, 4706, 1583, 29889, 14057, 29918, 11333, 261, 29892, 13, 462, 4706, 1583, 29889, 2917, 29889, 3784, 29918, 7193, 29892, 13, 462, 4706, 1583, 29889, 29886, 21766, 29892, 13, 462, 4706, 1583, 29889, 12653, 29892, 13, 462, 4706, 1583, 29889, 29920, 2873, 29892, 13, 462, 4706, 1583, 29889, 9342, 13, 462, 1678, 1723, 718, 6634, 29876, 29908, 718, 1583, 29889, 2917, 29889, 1493, 29918, 8849, 1983, 29918, 1493, 29918, 21264, 800, 29918, 2371, 29918, 7851, 1273, 29898, 13, 462, 4706, 1583, 29889, 1493, 29918, 8849, 1983, 29918, 1493, 29918, 333, 29892, 13, 462, 4706, 1583, 29889, 1493, 29918, 333, 29892, 13, 462, 4706, 1583, 29889, 8849, 1983, 29918, 1493, 29918, 333, 13, 462, 1678, 1723, 718, 6634, 29876, 29908, 718, 1583, 29889, 2917, 29889, 1493, 29918, 562, 29880, 29918, 21264, 800, 29918, 2371, 29918, 7851, 1273, 29898, 13, 462, 4706, 1583, 29889, 1493, 29918, 562, 29880, 29918, 333, 29892, 13, 462, 4706, 263, 695, 29918, 333, 29961, 29900, 1402, 13, 462, 4706, 1583, 29889, 1493, 29918, 333, 13, 462, 1678, 1723, 13, 13, 4706, 736, 1583, 29889, 2850, 13, 13, 2 ]
app/__init__.py
Keqing84/unzip-bot
0
78526
from os import environ as env from Config import Config AUTH_USERS = [] if " " in Config.AUTH_USER: achat = Config.AUTH_USER achat.split(" ") else: achat = Config.AUTH_USER for ID in achat: AUTH_USERS.append(int(ID))
[ 1, 515, 2897, 1053, 12471, 408, 8829, 13, 3166, 12782, 1053, 12782, 13, 13, 13, 20656, 29950, 29918, 11889, 29903, 353, 5159, 13, 361, 376, 376, 297, 12782, 29889, 20656, 29950, 29918, 11889, 29901, 13, 418, 3657, 271, 353, 12782, 29889, 20656, 29950, 29918, 11889, 13, 418, 3657, 271, 29889, 5451, 703, 16521, 13, 2870, 29901, 13, 418, 3657, 271, 353, 12782, 29889, 20656, 29950, 29918, 11889, 13, 1454, 3553, 297, 3657, 271, 29901, 13, 268, 26524, 29950, 29918, 11889, 29903, 29889, 4397, 29898, 524, 29898, 1367, 876, 13, 2 ]
lab07/filterWord.py
NickStucchi/CSC221
0
49458
#!/usr/bin/env python3 # <NAME> # 03/23/2017 # Filter out words and replace with dashes def replaceWord(sentence, word): wordList = sentence.split() newSentence = [] for w in wordList: if w == word: newSentence.append("-" * len(word)) else: newSentence.append(w) return " ".join(newSentence) def main(): sentence = input("Enter a sentence: ") word = input("Enter a word to replace: ") result = input("The resulting string is: " + "\n" + replaceWord(sentence, word)) print(result) if __name__ == "__main__": main()
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 29937, 529, 5813, 29958, 13, 29937, 29871, 29900, 29941, 29914, 29906, 29941, 29914, 29906, 29900, 29896, 29955, 13, 29937, 19916, 714, 3838, 322, 5191, 411, 12569, 267, 13, 13, 1753, 5191, 14463, 29898, 18616, 663, 29892, 1734, 1125, 13, 1678, 1734, 1293, 353, 10541, 29889, 5451, 580, 13, 1678, 716, 29903, 296, 663, 353, 5159, 13, 1678, 363, 281, 297, 1734, 1293, 29901, 13, 4706, 565, 281, 1275, 1734, 29901, 13, 9651, 716, 29903, 296, 663, 29889, 4397, 703, 29899, 29908, 334, 7431, 29898, 1742, 876, 13, 4706, 1683, 29901, 13, 9651, 716, 29903, 296, 663, 29889, 4397, 29898, 29893, 29897, 13, 1678, 736, 376, 11393, 7122, 29898, 1482, 29903, 296, 663, 29897, 13, 268, 13, 13, 13, 13, 13, 1753, 1667, 7295, 13, 1678, 10541, 353, 1881, 703, 10399, 263, 10541, 29901, 16521, 13, 1678, 1734, 353, 1881, 703, 10399, 263, 1734, 304, 5191, 29901, 16521, 13, 1678, 1121, 353, 1881, 703, 1576, 9819, 1347, 338, 29901, 376, 718, 6634, 29876, 29908, 718, 5191, 14463, 29898, 18616, 663, 29892, 1734, 876, 13, 1678, 1596, 29898, 2914, 29897, 13, 268, 13, 268, 13, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1667, 580, 13, 2 ]
scripts/P24qp.py
bopopescu/Bus-Pirate-1
0
175300
#!/usr/bin/python ### Bus Pirate Programmer (should work for other PIC24F devices as well) ### (C) 2009 <NAME> <<EMAIL>> # # 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., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import serial import sys import os import getopt import math import ConfigParser ### Prints the usage screen def Usage(): print "Bus Pirate Programmer v1.0" print "\nP24qp <command>" print "\t-a --auto=FILE\t\t- Erase, Program and Quit the Bootloader" print "\t-c --config=FILE\t- P24qp compatible configuration file" print "\t\t\t\t (Default: P24qp.ini)" print "\t-e --erase\t\t- Erase the flash programming" print "\t-f --finalize\t- Finalize the programming and go to user mode" print "\t-i --info\t\t- Information about the bootloader" print "\t-q --quiet\t\t- Quiet messages about writing progress" print "\t-r --read=FILE\t\t- Read programming from flash" print "\t-s --serial=DEVICE\t- Override serial device path" print "\t-t --reset\t\t- Reset the bootloader" print "\t-v \t\t\t- Enable verification of write commands" print "\t-w --write=FILE\t- Write programming file to flash" ### Get the other command line options try: optlist, args = getopt.getopt(sys.argv[1:], "fhveitqs:w:r:a:", ["auto=", "config=", "help","write=","read=", "serial=", "erase", "info", "quiet", "reset", "finalize"]) except getopt.GetoptError, err: print str(err) Usage() sys.exit(2) ### Figure out what the user wants to do Command = None File = None Verify = False SerialPort = None Quiet = False ### Default config file Config = "P24qp.ini" for op, val in optlist: if op in ("-h", "--help"): Usage() sys.exit() elif op in ("-w", "--write"): Command = "WT_FLASH" File = val elif op in ("-r", "--read"): Command = "RD_FLASH" File = val elif op in ("-e", "--erase"): Command = "ER_FLASH" elif op in ("-f", "--finalize"): Command = "VERIFY_OK" elif op in ("-i", "--info"): Command = "RD_VER" elif op in ("-a", "--auto"): Command = "Auto" File = val elif op in ("-t", "--reset"): Command = "Reset" elif op in ("-v"): Verify = True elif op in ("-c", "--config"): Config = val elif op in ("-s", "--serial"): SerialPort = val elif op in ("-q", "--quiet"): Quiet = True ### If there's no command, just print the options if Command == None: Usage() sys.exit(-1) ### Note: Only supports Intel 32 Hex format class HEX_File: def __init__(self): self.data = {} self.encoded = None ### Clear the stored data in the file def clear(self): self.data = {} ### Read the encoded file def read(self, filename): FILE = open(filename, 'r') self.encoded = FILE.readlines() FILE.close() self.decode() ### Write the encoded file def write(self, filename): self.encode() FILE = open(filename, 'w') for line in self.encoded: FILE.write(line) FILE.close() ### Decode the encoded file into data def decode(self): ### Bail out if there isn't an encoded file if self.encoded == None: print "No encoded file yet" return line = 0 ### Current high address addrh = 0 ### Current low address (for concatenation) addrl = -1 ### Decode each line for r in self.encoded: r = r.rstrip('\x0D\x0A') ### Every line starts with ":" if r[0] != ":": continue ### Get the byte count, address and record type bc = int(r[1:3], 16) ### Get the address addr = int(r[3:7], 16) ### Get the record type rt = int(r[7:9], 16) ### Decide if it's time to move to the next key if rt == 0: if addrl == -1 or addr != addrl + len(self.data[(addrh << 16) | addrl]): addrl = addr self.data[(addrh << 16) | addrl] = [] ### Get the checksum ck = int(r[-2:], 16) ### Compute the checksum, make sure it matches chksum = 0 for c in range(0, len(r[1:-2])/2): chksum += int(r[c * 2 + 1: c * 2 + 3], 16) chksum = (~(chksum & 0xFF) + 1) & 0xFF if ck != chksum: print "Checksum doesn't match on line " + str(line) + "!" break ### Figure out the record type ### Data Record if rt == 0: for d in range(0, bc): t = int(r[d * 2 + 9: d * 2 + 11], 16) self.data[(addrh<< 16) | addrl].append(t) ### EOF Record elif rt == 1: break ### Extended Segment Address Record elif rt == 2: print "Record type 2 Not supported!" break ### Start Segment Address Record elif rt == 3: print "Record type 3 Not supported!" break ### Extended Linear Address Record elif rt == 4: addrh = int(r[9:13], 16) addrl = -1 ### Start Linear Address Record elif rt == 5: print "Record type 5 Not supported!" break line += 1 ### Encode the data def encode(self): if len(self.data.keys()) == 0: print "No data to encode yet" return self.encoded = [] line = 0 ### Encode each line data_k = self.data.keys() data_k.sort() last_addru = -1 ### Loop over the address segments for base_addr in data_k: ### Add the data lines (16 per line) for line in range(0, len(self.data[base_addr]) / 16): ### Find the upper address addru = (((base_addr + (line * 16)) >> 16) & 0xFF) ### Print the address record if needed if addru != last_addru: enc = ":02000004%04X" % addru ### Make the checksum chksum = 0 for c in range(0, len(enc[1:])/2): chksum += int(enc[c * 2 + 1: c * 2 + 3], 16) chksum = (~(chksum & 0xFF) + 1) & 0xFF enc += "%02X" % chksum self.encoded.append(enc+"\x0D\x0A") last_addru = addru ### Every line starts with ":", followed by record size (always 16(?)), address, then record type enc = ":%02X%04X%02X" % (16, (base_addr + (line * 16)) & 0xFFFF, 0) ### Add the data for d in self.data[base_addr][line * 16:(line+1) * 16]: enc += "%02X" % ord(d) ### Compute the checksum chksum = 0 for c in range(0, len(enc[1:])/2): chksum += int(enc[c * 2 + 1: c * 2 + 3], 16) chksum = (~(chksum & 0xFF) + 1) & 0xFF enc = enc + "%02X" % chksum self.encoded.append(enc+"\x0D\x0A") ### Add the end record enc = ":00000001FF\x0D\x0A" self.encoded.append(enc) class PIC24F_Prog: def __init__(self, Config, SerialPort): self.device = {} self.serial = {} ### Assume that the size of the read block is 4 until we know better self.device['readblock'] = 4 ### Assume that there are 2 bytes per address until we know better self.device['bytesperaddr'] = 2 ### Load the configuration if os.path.isfile(Config): cfg = ConfigParser.SafeConfigParser() cfg.read(Config) if not cfg.has_section("PIC24FBOOT"): print "Invalid configuration, no PIC24FBOOT section!" sys.exit(-1) ### Get the serial settings rates = [ 0, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 ] rate_index = cfg.getint('PIC24FBOOT', 'bitrateindex') self.serial['rate'] = rates[rate_index] self.serial['timeout'] = cfg.getint('PIC24FBOOT', 'commtimeout') self.serial['retries'] = cfg.getint('PIC24FBOOT', 'maxretry') self.serial['maxpacket'] = cfg.getint('PIC24FBOOT', 'maxpacketsize') ### If the serial port isn't forced, use the config if SerialPort == None: self.serial['port'] = cfg.getint('PIC24FBOOT', 'portindex') else: self.serial['port'] = SerialPort ### Get the location of the bootloader self.device['bootaddrlo'] = int(cfg.get('PIC24FBOOT', 'bootaddrlo')[1:-1], 16) self.device['bootaddrhi'] = int(cfg.get('PIC24FBOOT', 'bootaddrhi')[1:-1], 16) ### Otherwise, error out else: print "Please provide a configuration file!" Usage() sys.exit(-1) ### State variables self.last_cmd = None self.verify = False self.hexfile = HEX_File() self.quiet = False ### Configuration words self.config_words = None ### Set up the serial connection print "Using Serial Port", self.serial['port'], "@", self.serial['rate'] try: self.ser = serial.Serial(self.serial['port'], self.serial['rate'], xonxoff=0, rtscts=0, timeout=(self.serial['timeout']/1000)) except: print "Can't open serial port", self.serial['port'], "!" sys.exit(-1) ### Get the device type to set the device settings from the config device = self.GetDevice() if not cfg.has_section('DEVICELIST'): print "Invalid configuration, no DEVICELIST section!" sys.exit(-1) if not cfg.has_option('DEVICELIST', str(device)): print "Device with ID:", device, "not listed in the config file!" sys.exit(-1) device_name = cfg.get('DEVICELIST', str(device))[1:-1] if not cfg.has_section(device_name): print device_name, "not specified in the config file!" sys.exit(-1) print "Found", device_name ### Get the locations of the boot vectors self.device['userresetvector'] = int(cfg.get(device_name, 'userresetvector')[1:-1], 16) self.device['bootdelay'] = int(cfg.get(device_name, 'bootdelay')[1:-1], 16) ### Fill in the device specific settings self.device['writeblock'] = cfg.getint(device_name, 'writeblock') self.device['readblock'] = cfg.getint(device_name, 'readblock') self.device['eraseblock'] = cfg.getint(device_name, 'eraseblock') ### Some devices specify larger packet sizes self.device['maxpacket'] = cfg.getint(device_name, 'maxpacketsize') self.device['bytesperaddr'] = cfg.getint(device_name, 'bytesperaddr') ### Program memory area addresses self.device['pmrangelow'] = int(cfg.get(device_name, 'pmrangelow')[1:-1], 16) self.device['pmrangehigh'] = int(cfg.get(device_name, 'pmrangehigh')[1:-1], 16) ### Vector addresses self.device['userresetvector'] = int(cfg.get(device_name, 'userresetvector')[1:-1], 16) self.device['bootdelay'] = int(cfg.get(device_name, 'bootdelay')[1:-1], 16) ### Get the device type def GetDevice(self): device_data = self.ReadFlash(0xFF0000, 4) if len(device_data) < 2: print "Can't connect to device, sorry!" sys.exit(-1) device = ord(device_data[0]) | ord(device_data[1]) << 8 return device def TX_PKT(self, data): ### PKT Wire format STX = "\x55" ETX = "\x04" DLE = "\x05" ### Sanity check the data if len(data) > self.serial['maxpacket']: print "Warning: truncated packet" data = data[0:self.serial['maxpacket']] ### Generate the checksum chksum = 0 for d in data: chksum += ord(d) chksum = chr((~(chksum) + 1) & 0xFF) ### Preamble self.ser.write(STX) self.ser.write(STX) for d in data: ### Add escape character for special characters if d == STX or d == ETX or d == DLE: self.ser.write(DLE) self.ser.write(d) if chksum == STX or chksum == ETX or chksum == DLE: self.ser.write(DLE) self.ser.write(chksum) ### Postfix self.ser.write(ETX) ### Read a byte (with retries) from the serial device def ReadSer(self): db = "" for i in range(0, self.serial['retries']): db = self.ser.read() if len(db) != 0: break return db def RX_PKT(self): ### PKT Wire format ETX = "\x04" DLE = "\x05" data = "" data_len = 0 ### Get the data packet while True: db = self.ReadSer() ### Throw an error if we didn't get data if len(db) == 0: print "RX Error: ", len(data), " bytes received" if len(data) > 0: for d in data: print ord(d), print "\n" return data ### Always add the escaped character if db == DLE: db = self.ReadSer() ### End condition elif db == ETX: break ### Normal data data += db data_len += 1 ### Get the checksum byte ck = ord(data[-1]) ### Remove the framing characters data = data[2:-1] ### Check the checksum of the data segment chksum = 0 for d in data: chksum += ord(d) chksum = (~(chksum & 0xFF) + 1) & 0xFF ### Print a warning if the checksum fails if chksum != ck: print "\nWARNING: Checksum mismatch: %02X / %02X!" % (chksum, ck) for d in data: print ord(d), print "\n" return data ### Generate the packet to send over the wire and send it def BootloaderCMD(self, cmd, args = {}): repeat = False replicate = False data = [] ### Repeat and replicate use the last command if cmd == "REPEAT": if self.last_cmd != None: cmd = self.last_cmd repeat = True else: print "Can't repeat, no command in buffer" if cmd == "REPLICATE": if self.last_cmd != None and self.last_cmd[0:2] == "WT": cmd = self.last_cmd replicate = True else: print "Can't replicate, no compatible command in buffer" ### Process the rest of the commands if cmd == "RESET": data = ["\x00", "\x00"] self.TX_PKT(data) ### No response... ### Read Version Information elif cmd == "RD_VER": print "Reading Bootloader Version Information: " ### Send the data packet data = ["\x00", "\x02"] self.TX_PKT(data) ### Get the result data = self.RX_PKT() if len(data) == 0: print "\tUnable to determine version!" return print "\tBootloader Version: " + str(ord(data[3])) + "." + str(ord(data[2])) ### Read the programming out of the flash elif cmd == "RD_FLASH": #print "Reading Program Memory:" ### Send the data packet if repeat: #print "\tReading from last location" data = ["\x01"] else: #print "\tReading 0x%02X words from 0x%08X" % (args['LEN'], (args['ADDRU'] << 16 | args['ADDRH'] << 8 | args['ADDRL'])) data = ["\x01", chr(args['LEN']), chr(args['ADDRL']), chr(args['ADDRH']), chr(args['ADDRU'])] self.TX_PKT(data) ### Get the result data = self.RX_PKT() ### If there was an error, just store junk if len(data) == 0: print "\tError reading from device!" data = "" for i in range(0, args['LEN']): data += "\xFF\xFF\xFF\x00" return data ### Return only the data read from flash, not the address preamble return data[5:] ### Write a new program into the flash elif cmd == "WT_FLASH": #print "Write Program Memory:" ### Generate the data packet if repeat: #print "\tWriting to last location" data = ["\x02"] else: #print "\tWriting row to 0x%08X" % ((args['ADDRU'] << 16 | args['ADDRH'] << 8 | args['ADDRL'])) data = ["\x02", chr(args['LEN']), chr(args['ADDRL']), chr(args['ADDRH']), chr(args['ADDRU'])] ### On a replication, we don't provide the data if not replicate: ### Generate the data string for d in args['DATA']: data.append(chr(d)) ### Send the data packet self.TX_PKT(data) ### Get the response data = self.RX_PKT() if len(data) == 0 or data[0] != "\x02": print "\tError writing to device!" ### Erase Flash elif cmd == "ER_FLASH": print "Erase Flash:" ### Send the data packet if repeat: print "\tErasing previous location" data = ["\x03"] else: print "\tErasing %i pages, starting at 0x%08X" % (args['LEN'], (args['ADDRU'] << 16 | args['ADDRH'] << 8 | args['ADDRL'])) data = ["\x03", chr(args['LEN']), chr(args['ADDRL']), chr(args['ADDRH']), chr(args['ADDRU'])] self.TX_PKT(data) ### Get the response data = self.RX_PKT() if len(data) == 0 or data[0] != "\x03": print "\tError erasing device!" else: print "\tErase complete" ### These commands are unimplemented at this time since we don't ### use them with the BP. If needed, implement the same as the ### flash read/write with the correct addressing and instructions elif cmd == "RD_EEDATA": print "Unsupported at this time!" pass elif cmd == "WT_EEDATA": print "Unsupported at this time!" pass elif cmd == "RD_CONFIG": print "Unsupported at this time!" pass elif cmd == "WT_CONFIG": print "Unsupported at this time!" pass ### Send the packet that tells the device to start the watchdog ### to restart into userspace mode elif cmd == "VERIFY_OK": print "Verified Okay." ### Send the data packet data = ["\x08", "\x01", "\x00", "\x00", "\x00"] self.TX_PKT(data) ### Get the response data = self.RX_PKT() if data[0] != "\x08": print "\tError verifying device!" else: print "\tVerification complete, switching to user mode" ### Send a reset packet data = ["\x00", "\x00"] self.TX_PKT(data) ### Back up the last command for repeating self.last_cmd = cmd return ### Convienence functions for saving and loading files def ReadFile(self, filename): self.hexfile.read(filename) def WriteFile(self, filename): self.hexfile.write(filename) def DataToFile(self, addr, data): self.hexfile.data[addr] = data ### Write to the flash def WriteFlash(self, start_address, data): ### Get the word count bc = len(data) dots = "" for p in range(0, int(bc / self.device['writeblock'])): ### Build the argument tree args = {} ### Length is always 1 since we can write only one block at a time args['LEN'] = 1 ### Now write in the data args['DATA'] = data[p * self.device['writeblock']:(p + 1) * self.device['writeblock']] ### Finally, generate the address addr_p = start_address + p * (self.device['writeblock'] / self.device['bytesperaddr']) if addr_p >= self.device['pmrangehigh']: return args['ADDRL'] = addr_p & 0xFF args['ADDRH'] = (addr_p >> 8) & 0xFF args['ADDRU'] = (addr_p >> 16) & 0xFF if not self.quiet: print "Writing %i bytes to address 0x%08X" % (self.device['writeblock'], addr_p) self.BootloaderCMD("WT_FLASH", args) ### If we're verifying as we write, read the row we just wrote and compare if self.verify: if addr_p in range(self.device['bootaddrlo'], self.device['bootaddrhi']): print "Skipping verification of bootloader area." else: ### Read the flash we just wrote verify_data = self.ReadFlash(addr_p, self.device['writeblock']) for i in range(0, len(verify_data)): if ord(verify_data[i]) != args['DATA'][i]: print "Verification failed at 0x%08X: %i != %i" % (int(addr_p + i), ord(verify_data[i]), args['DATA'][i]) ### Read from the flash def ReadFlash(self, addr, length): data = "" ### Count of reads to do max_read_len = (self.serial['maxpacket'] - 5) / self.device['readblock'] length /= self.device['readblock'] dots = "" ### Loop over each segment in a read block while length > 0: ### Build the argument tree args = {} if length > max_read_len: args['LEN'] = max_read_len else: args['LEN'] = length length -= args['LEN'] ### Generate the address args['ADDRL'] = addr & 0xFF args['ADDRH'] = (addr >> 8) & 0xFF args['ADDRU'] = (addr >> 16) & 0xFF if not self.quiet: print "Reading %i bytes from address 0x%08X" % (args['LEN'] * self.device['readblock'], addr) data += self.BootloaderCMD("RD_FLASH", args) addr += (args['LEN'] * self.device['readblock']) / self.device['bytesperaddr'] return data ### Erase the flash device ### Note: Not sure if the cfg word backup is really needed... def EraseFlash(self): ### Back up the configuration words cfg_words = self.ReadCFGWords() ### Loop to catch all address (if the # of blocks is greater than 255) nBlocks = (self.device['pmrangehigh'] - self.device['pmrangelow'] + 1) / (self.device['eraseblock'] / self.device['bytesperaddr']) start_addr = self.device['pmrangelow'] while nBlocks > 0: ### Build the argument tree args = {} if nBlocks > 255: args['LEN'] = 255 else: args['LEN'] = nBlocks nBlocks -= args['LEN'] ### Generate the address addr = start_addr args['ADDRL'] = addr & 0xFF args['ADDRH'] = (addr >> 8) & 0xFF args['ADDRU'] = (addr >> 16) & 0xFF self.BootloaderCMD("ER_FLASH", args) start_addr += (self.device['eraseblock'] / self.device['bytesperaddr']) * nBlocks ### Write the configuration words self.WriteCFGWords(cfg_words) ### Read the config words def ReadCFGWords(self): addr = (self.device['pmrangehigh'] + 1) - 8 return self.ReadFlash(addr, 2) ### Write the config words into memory (shouldn't mess up other data if present?) def WriteCFGWords(self, cfg_words): ### Write the config words args = {} args['LEN'] = 1 addr = (self.device['pmrangehigh'] + 1) - (self.device['eraseblock'] / self.device['bytesperaddr']) args['ADDRL'] = addr & 0xFF args['ADDRH'] = (addr >> 8) & 0xFF args['ADDRU'] = (addr >> 16) & 0xFF ### Build the data packet args['DATA'] = [0xFF, 0xFF, 0xFF, 0x00] * ((self.device['writeblock'] / 4) - 2) for i in cfg_words: args['DATA'].append(ord(i)) self.BootloaderCMD("WT_FLASH", args) ############################################################################### ### Run the commands the user requests ############################################################################### ### Initialize p = PIC24F_Prog(Config, SerialPort) p.verify = Verify p.quiet = Quiet ### Prepare the command and run if Command == "Auto": ### Erase the flash p.EraseFlash() ### Read in the flash file if File == None: Usage() sys.exit(2) p.ReadFile(File) ### Now write to the flash for k in p.hexfile.data.keys(): ### Addresses from the hexfile are in bytes ### convert to device's addressing scheme first p.WriteFlash(k / p.device['bytesperaddr'], p.hexfile.data[k]) print "Write operation complete." ### We're done, finish up p.BootloaderCMD("VERIFY_OK") ### These commands are just run with no other arguments elif Command in ("VERIFY_OK", "RD_VER"): p.BootloaderCMD(Command) ### Read the flash into a file elif Command == "RD_FLASH": print "Starting read operation..." ### Make sure the filename was given if File == None: Usage() sys.exit(2) ### Read the entire flash out data = p.ReadFlash(p.device['pmrangelow'], ((p.device['pmrangehigh'] + 1) - p.device['pmrangelow']) * p.device['bytesperaddr']) ### Add the data to the file p.DataToFile(p.device['pmrangelow'], data) ### Write out the file p.WriteFile(File) print "Read operation complete." ### Erase the flash elif Command == "ER_FLASH": p.EraseFlash() ### Write the flash from a file elif Command == "WT_FLASH": print "Starting write operation..." ### Open the file if File == None: Usage() sys.exit(2) p.ReadFile(File) ### Now write to the flash for k in p.hexfile.data.keys(): ### Addresses from the hexfile are in bytes ### convert to device's addressing scheme first p.WriteFlash(k / p.device['bytesperaddr'], p.hexfile.data[k]) print "Write operation complete."
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 13, 2277, 29937, 8406, 16937, 403, 7835, 1050, 313, 9344, 664, 363, 916, 349, 2965, 29906, 29946, 29943, 9224, 408, 1532, 29897, 13, 2277, 29937, 313, 29907, 29897, 29871, 29906, 29900, 29900, 29929, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 29937, 13, 29937, 910, 1824, 338, 3889, 7047, 29936, 366, 508, 2654, 391, 2666, 372, 322, 29914, 272, 6623, 13, 29937, 372, 1090, 278, 4958, 310, 278, 15143, 4593, 5236, 19245, 408, 6369, 491, 13, 29937, 278, 12362, 18540, 10606, 29936, 2845, 1873, 29871, 29906, 310, 278, 19245, 29892, 470, 13, 29937, 313, 271, 596, 2984, 29897, 738, 2678, 1873, 29889, 13, 29937, 13, 29937, 910, 1824, 338, 13235, 297, 278, 4966, 393, 372, 674, 367, 5407, 29892, 13, 29937, 541, 399, 1806, 8187, 2692, 13764, 29979, 399, 1718, 29934, 13566, 29979, 29936, 1728, 1584, 278, 2411, 2957, 1370, 21867, 29891, 310, 13, 29937, 341, 1001, 3210, 13566, 2882, 6227, 11937, 470, 383, 1806, 8186, 1799, 15842, 319, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 29889, 29871, 2823, 278, 13, 29937, 15143, 4593, 5236, 19245, 363, 901, 4902, 29889, 13, 29937, 13, 29937, 887, 881, 505, 4520, 263, 3509, 310, 278, 15143, 4593, 5236, 19245, 3412, 13, 29937, 411, 445, 1824, 29936, 565, 451, 29892, 2436, 304, 278, 12362, 18540, 10606, 29892, 9266, 1696, 13, 29937, 29871, 29945, 29896, 21504, 7103, 29892, 29008, 386, 383, 10102, 29892, 12115, 29892, 14861, 29871, 29900, 29906, 29896, 29896, 29900, 29899, 29896, 29941, 29900, 29896, 8278, 29889, 13, 13, 5215, 7797, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 679, 3670, 13, 5215, 5844, 13, 5215, 12782, 11726, 13, 13, 2277, 29937, 1588, 9466, 278, 8744, 4315, 13, 1753, 10783, 482, 7295, 13, 12, 2158, 376, 16890, 16937, 403, 7835, 1050, 325, 29896, 29889, 29900, 29908, 13, 12, 2158, 6634, 29876, 29925, 29906, 29946, 29939, 29886, 529, 6519, 11903, 13, 12, 2158, 6634, 29873, 29899, 29874, 1192, 6921, 29922, 7724, 29905, 29873, 29905, 29873, 29899, 1425, 559, 29892, 7835, 322, 751, 277, 278, 13760, 12657, 29908, 13, 12, 2158, 6634, 29873, 29899, 29883, 1192, 2917, 29922, 7724, 29905, 29873, 29899, 349, 29906, 29946, 29939, 29886, 15878, 5285, 934, 29908, 13, 12, 2158, 6634, 29873, 29905, 29873, 29905, 29873, 29905, 29873, 29871, 313, 4592, 29901, 349, 29906, 29946, 29939, 29886, 29889, 2172, 5513, 13, 12, 2158, 6634, 29873, 29899, 29872, 1192, 261, 559, 29905, 29873, 29905, 29873, 29899, 1425, 559, 278, 11013, 8720, 29908, 13, 12, 2158, 6634, 29873, 29899, 29888, 1192, 8394, 675, 29905, 29873, 29899, 9550, 675, 278, 8720, 322, 748, 304, 1404, 4464, 29908, 13, 12, 2158, 6634, 29873, 29899, 29875, 1192, 3888, 29905, 29873, 29905, 29873, 29899, 10343, 1048, 278, 6579, 12657, 29908, 13, 12, 2158, 6634, 29873, 29899, 29939, 1192, 339, 2035, 29905, 29873, 29905, 29873, 29899, 751, 2035, 7191, 1048, 5007, 6728, 29908, 13, 12, 2158, 6634, 29873, 29899, 29878, 1192, 949, 29922, 7724, 29905, 29873, 29905, 29873, 29899, 7523, 8720, 515, 11013, 29908, 13, 12, 2158, 6634, 29873, 29899, 29879, 1192, 15550, 29922, 2287, 19059, 29905, 29873, 29899, 6811, 2426, 7797, 4742, 2224, 29908, 13, 12, 2158, 6634, 29873, 29899, 29873, 1192, 12071, 29905, 29873, 29905, 29873, 29899, 2538, 300, 278, 6579, 12657, 29908, 13, 12, 2158, 6634, 29873, 29899, 29894, 320, 29873, 29905, 29873, 29905, 29873, 29899, 1174, 519, 1147, 2450, 310, 2436, 8260, 29908, 13, 12, 2158, 6634, 29873, 29899, 29893, 1192, 3539, 29922, 7724, 29905, 29873, 29899, 14350, 8720, 934, 304, 11013, 29908, 13, 13, 2277, 29937, 3617, 278, 916, 1899, 1196, 3987, 13, 2202, 29901, 13, 12, 3670, 1761, 29892, 6389, 353, 679, 3670, 29889, 657, 3670, 29898, 9675, 29889, 19218, 29961, 29896, 29901, 1402, 376, 29888, 29882, 345, 277, 29939, 29879, 29901, 29893, 29901, 29878, 29901, 29874, 29901, 613, 6796, 6921, 543, 29892, 376, 2917, 543, 29892, 376, 8477, 3284, 3539, 543, 1699, 949, 543, 29892, 376, 15550, 543, 29892, 376, 261, 559, 613, 376, 3888, 613, 376, 339, 2035, 613, 376, 12071, 613, 376, 8394, 675, 20068, 13, 19499, 679, 3670, 29889, 2577, 3670, 2392, 29892, 4589, 29901, 13, 12, 2158, 851, 29898, 3127, 29897, 13, 12, 27573, 580, 13, 12, 9675, 29889, 13322, 29898, 29906, 29897, 13, 13, 2277, 29937, 11479, 714, 825, 278, 1404, 10753, 304, 437, 13, 6255, 353, 6213, 13, 2283, 353, 6213, 13, 6565, 1598, 353, 7700, 13, 9125, 2290, 353, 6213, 13, 29984, 1481, 300, 353, 7700, 13, 2277, 29937, 13109, 2295, 934, 13, 3991, 353, 376, 29925, 29906, 29946, 29939, 29886, 29889, 2172, 29908, 13, 1454, 1015, 29892, 659, 297, 3523, 1761, 29901, 13, 12, 361, 1015, 297, 4852, 29899, 29882, 613, 376, 489, 8477, 29908, 1125, 13, 12, 12, 27573, 580, 13, 12, 12, 9675, 29889, 13322, 580, 13, 12, 23681, 1015, 297, 4852, 29899, 29893, 613, 376, 489, 3539, 29908, 1125, 13, 12, 12, 6255, 353, 376, 17755, 29918, 10536, 24943, 29908, 13, 12, 12, 2283, 353, 659, 13, 12, 23681, 1015, 297, 4852, 29899, 29878, 613, 376, 489, 949, 29908, 1125, 13, 12, 12, 6255, 353, 376, 29934, 29928, 29918, 10536, 24943, 29908, 13, 12, 12, 2283, 353, 659, 13, 12, 23681, 1015, 297, 4852, 29899, 29872, 613, 376, 489, 261, 559, 29908, 1125, 13, 12, 12, 6255, 353, 376, 1001, 29918, 10536, 24943, 29908, 13, 12, 23681, 1015, 297, 4852, 29899, 29888, 613, 376, 489, 8394, 675, 29908, 1125, 13, 12, 12, 6255, 353, 376, 5348, 6545, 29979, 29918, 8949, 29908, 13, 12, 23681, 1015, 297, 4852, 29899, 29875, 613, 376, 489, 3888, 29908, 1125, 13, 12, 12, 6255, 353, 376, 29934, 29928, 29918, 5348, 29908, 13, 12, 23681, 1015, 297, 4852, 29899, 29874, 613, 376, 489, 6921, 29908, 1125, 13, 12, 12, 6255, 353, 376, 12300, 29908, 12, 13, 12, 12, 2283, 353, 659, 13, 12, 23681, 1015, 297, 4852, 29899, 29873, 613, 376, 489, 12071, 29908, 1125, 13, 12, 12, 6255, 353, 376, 27175, 29908, 13, 12, 23681, 1015, 297, 4852, 29899, 29894, 29908, 1125, 13, 12, 12, 6565, 1598, 353, 5852, 13, 12, 23681, 1015, 297, 4852, 29899, 29883, 613, 376, 489, 2917, 29908, 1125, 13, 12, 12, 3991, 353, 659, 13, 12, 23681, 1015, 297, 4852, 29899, 29879, 613, 376, 489, 15550, 29908, 1125, 13, 12, 12, 9125, 2290, 353, 659, 13, 12, 23681, 1015, 297, 4852, 29899, 29939, 613, 376, 489, 339, 2035, 29908, 1125, 13, 12, 12, 29984, 1481, 300, 353, 5852, 13, 13, 2277, 29937, 960, 727, 29915, 29879, 694, 1899, 29892, 925, 1596, 278, 3987, 13, 361, 10516, 1275, 6213, 29901, 13, 12, 27573, 580, 13, 12, 9675, 29889, 13322, 6278, 29896, 29897, 13, 12, 13, 2277, 29937, 3940, 29901, 9333, 11286, 18555, 29871, 29941, 29906, 379, 735, 3402, 13, 1990, 379, 5746, 29918, 2283, 29901, 13, 12, 1753, 4770, 2344, 12035, 1311, 1125, 13, 12, 12, 1311, 29889, 1272, 353, 6571, 13, 12, 12, 1311, 29889, 26716, 353, 6213, 13, 12, 13, 12, 2277, 29937, 17732, 278, 6087, 848, 297, 278, 934, 13, 12, 1753, 2821, 29898, 1311, 1125, 13, 12, 12, 1311, 29889, 1272, 353, 6571, 13, 13, 12, 2277, 29937, 7523, 278, 18511, 934, 13, 12, 1753, 1303, 29898, 1311, 29892, 10422, 1125, 13, 12, 12, 7724, 353, 1722, 29898, 9507, 29892, 525, 29878, 1495, 13, 12, 12, 1311, 29889, 26716, 353, 24080, 29889, 949, 9012, 580, 13, 12, 12, 7724, 29889, 5358, 580, 13, 12, 12, 1311, 29889, 13808, 580, 13, 13, 12, 2277, 29937, 14350, 278, 18511, 934, 13, 12, 1753, 2436, 29898, 1311, 29892, 10422, 1125, 13, 12, 12, 1311, 29889, 12508, 580, 13, 12, 12, 7724, 353, 1722, 29898, 9507, 29892, 525, 29893, 1495, 13, 12, 12, 1454, 1196, 297, 1583, 29889, 26716, 29901, 13, 12, 12, 12, 7724, 29889, 3539, 29898, 1220, 29897, 13, 12, 12, 7724, 29889, 5358, 580, 13, 13, 12, 2277, 29937, 897, 401, 278, 18511, 934, 964, 848, 13, 12, 1753, 21822, 29898, 1311, 1125, 13, 12, 12, 2277, 29937, 350, 737, 714, 565, 727, 3508, 29915, 29873, 385, 18511, 934, 13, 12, 12, 361, 1583, 29889, 26716, 1275, 6213, 29901, 13, 12, 12, 12, 2158, 376, 3782, 18511, 934, 3447, 29908, 13, 12, 12, 12, 2457, 13, 12, 12, 1220, 353, 29871, 29900, 13, 12, 12, 2277, 29937, 9626, 1880, 3211, 13, 12, 12, 10030, 29882, 353, 29871, 29900, 13, 12, 12, 2277, 29937, 9626, 4482, 3211, 313, 1454, 16125, 362, 29897, 13, 12, 12, 1202, 2096, 353, 448, 29896, 13, 12, 12, 2277, 29937, 897, 401, 1269, 1196, 13, 12, 12, 1454, 364, 297, 1583, 29889, 26716, 29901, 13, 12, 12, 12, 29878, 353, 364, 29889, 29878, 17010, 28909, 29916, 29900, 29928, 29905, 29916, 29900, 29909, 1495, 13, 12, 12, 12, 2277, 29937, 7569, 1196, 8665, 411, 376, 6160, 13, 12, 12, 12, 361, 364, 29961, 29900, 29962, 2804, 29242, 1115, 13, 12, 12, 12, 12, 19878, 13, 12, 12, 12, 2277, 29937, 3617, 278, 7023, 2302, 29892, 3211, 322, 2407, 1134, 13, 12, 12, 12, 12328, 353, 938, 29898, 29878, 29961, 29896, 29901, 29941, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 12, 2277, 29937, 3617, 278, 3211, 13, 12, 12, 12, 10030, 353, 938, 29898, 29878, 29961, 29941, 29901, 29955, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 12, 2277, 29937, 3617, 278, 2407, 1134, 13, 12, 12, 12, 2273, 353, 938, 29898, 29878, 29961, 29955, 29901, 29929, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 12, 2277, 29937, 897, 8204, 565, 372, 29915, 29879, 931, 304, 4337, 304, 278, 2446, 1820, 13, 12, 12, 12, 361, 364, 29873, 1275, 29871, 29900, 29901, 13, 12, 12, 12, 12, 361, 788, 2096, 1275, 448, 29896, 470, 28915, 2804, 788, 2096, 718, 7431, 29898, 1311, 29889, 1272, 15625, 10030, 29882, 3532, 29871, 29896, 29953, 29897, 891, 788, 2096, 29962, 1125, 13, 12, 12, 12, 12, 12, 1202, 2096, 353, 28915, 13, 12, 12, 12, 12, 12, 1311, 29889, 1272, 15625, 10030, 29882, 3532, 29871, 29896, 29953, 29897, 891, 788, 2096, 29962, 353, 5159, 13, 12, 12, 12, 2277, 29937, 3617, 278, 1423, 2083, 13, 12, 12, 12, 384, 353, 938, 29898, 29878, 14352, 29906, 29901, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 12, 2277, 29937, 11796, 29872, 278, 1423, 2083, 29892, 1207, 1854, 372, 7087, 13, 12, 12, 12, 305, 2039, 398, 353, 29871, 29900, 13, 12, 12, 12, 1454, 274, 297, 3464, 29898, 29900, 29892, 7431, 29898, 29878, 29961, 29896, 13018, 29906, 2314, 29914, 29906, 1125, 13, 12, 12, 12, 12, 305, 2039, 398, 4619, 938, 29898, 29878, 29961, 29883, 334, 29871, 29906, 718, 29871, 29896, 29901, 274, 334, 29871, 29906, 718, 29871, 29941, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 12, 305, 2039, 398, 353, 313, 30022, 29898, 305, 2039, 398, 669, 29871, 29900, 29916, 4198, 29897, 718, 29871, 29896, 29897, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 12, 361, 274, 29895, 2804, 521, 2039, 398, 29901, 13, 12, 12, 12, 12, 2158, 376, 5596, 2083, 1838, 29915, 29873, 1993, 373, 1196, 376, 718, 851, 29898, 1220, 29897, 718, 29871, 376, 3850, 29871, 13, 12, 12, 12, 12, 8690, 13, 13, 12, 12, 12, 2277, 29937, 11479, 714, 278, 2407, 1134, 13, 12, 12, 12, 2277, 29937, 3630, 14164, 13, 12, 12, 12, 361, 364, 29873, 1275, 29871, 29900, 29901, 13, 12, 12, 12, 12, 1454, 270, 297, 3464, 29898, 29900, 29892, 289, 29883, 1125, 13, 12, 12, 12, 12, 12, 29873, 353, 938, 29898, 29878, 29961, 29881, 334, 29871, 29906, 718, 29871, 29929, 29901, 270, 334, 29871, 29906, 718, 29871, 29896, 29896, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 12, 12, 12, 1311, 29889, 1272, 15625, 10030, 29882, 9314, 29871, 29896, 29953, 29897, 891, 788, 2096, 1822, 4397, 29898, 29873, 29897, 13, 12, 12, 12, 2277, 29937, 382, 9800, 14164, 13, 12, 12, 12, 23681, 364, 29873, 1275, 29871, 29896, 29901, 13, 12, 12, 12, 12, 8690, 13, 13, 12, 12, 12, 2277, 29937, 7338, 2760, 6667, 358, 16428, 14164, 13, 12, 12, 12, 23681, 364, 29873, 1275, 29871, 29906, 29901, 13, 12, 12, 12, 12, 2158, 376, 9182, 1134, 29871, 29906, 2216, 6969, 3850, 13, 12, 12, 12, 12, 8690, 13, 12, 12, 12, 13, 12, 12, 12, 2277, 29937, 7370, 6667, 358, 16428, 14164, 13, 12, 12, 12, 23681, 364, 29873, 1275, 29871, 29941, 29901, 13, 12, 12, 12, 12, 2158, 376, 9182, 1134, 29871, 29941, 2216, 6969, 3850, 13, 12, 12, 12, 12, 8690, 13, 12, 12, 12, 29871, 13, 12, 12, 12, 2277, 29937, 7338, 2760, 22985, 16428, 14164, 13, 12, 12, 12, 23681, 364, 29873, 1275, 29871, 29946, 29901, 13, 12, 12, 12, 12, 10030, 29882, 353, 938, 29898, 29878, 29961, 29929, 29901, 29896, 29941, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 12, 12, 1202, 2096, 353, 448, 29896, 13, 12, 12, 12, 2277, 29937, 7370, 22985, 16428, 14164, 13, 12, 12, 12, 23681, 364, 29873, 1275, 29871, 29945, 29901, 13, 12, 12, 12, 12, 2158, 376, 9182, 1134, 29871, 29945, 2216, 6969, 3850, 13, 12, 12, 12, 12, 8690, 13, 13, 12, 12, 12, 1220, 4619, 29871, 29896, 13, 13, 12, 2277, 29937, 1174, 401, 278, 848, 13, 12, 1753, 19750, 29898, 1311, 1125, 13, 12, 12, 361, 7431, 29898, 1311, 29889, 1272, 29889, 8149, 3101, 1275, 29871, 29900, 29901, 13, 12, 12, 12, 2158, 376, 3782, 848, 304, 19750, 3447, 29908, 13, 12, 12, 12, 2457, 13, 12, 12, 12, 13, 12, 12, 1311, 29889, 26716, 353, 5159, 13, 12, 12, 1220, 353, 29871, 29900, 13, 12, 12, 2277, 29937, 1174, 401, 1269, 1196, 13, 12, 12, 1272, 29918, 29895, 353, 1583, 29889, 1272, 29889, 8149, 580, 13, 12, 12, 1272, 29918, 29895, 29889, 6605, 580, 13, 12, 12, 4230, 29918, 1202, 582, 353, 448, 29896, 13, 12, 12, 2277, 29937, 21493, 975, 278, 3211, 24611, 13, 12, 12, 1454, 2967, 29918, 10030, 297, 848, 29918, 29895, 29901, 13, 12, 12, 12, 2277, 29937, 3462, 278, 848, 3454, 313, 29896, 29953, 639, 1196, 29897, 13, 12, 12, 12, 1454, 1196, 297, 3464, 29898, 29900, 29892, 7431, 29898, 1311, 29889, 1272, 29961, 3188, 29918, 10030, 2314, 847, 29871, 29896, 29953, 1125, 13, 12, 12, 12, 12, 2277, 29937, 10987, 278, 7568, 3211, 13, 12, 12, 12, 12, 1202, 582, 353, 313, 3552, 3188, 29918, 10030, 718, 313, 1220, 334, 29871, 29896, 29953, 876, 5099, 29871, 29896, 29953, 29897, 669, 29871, 29900, 29916, 4198, 29897, 13, 12, 12, 12, 12, 2277, 29937, 13905, 278, 3211, 2407, 565, 4312, 13, 12, 12, 12, 12, 361, 788, 582, 2804, 1833, 29918, 1202, 582, 29901, 13, 12, 12, 12, 12, 12, 3977, 353, 29242, 29900, 29906, 29900, 29900, 29900, 29900, 29900, 29946, 29995, 29900, 29946, 29990, 29908, 1273, 788, 582, 13, 12, 12, 12, 12, 12, 2277, 29937, 8561, 278, 1423, 2083, 13, 12, 12, 12, 12, 12, 305, 2039, 398, 353, 29871, 29900, 13, 12, 12, 12, 12, 12, 1454, 274, 297, 3464, 29898, 29900, 29892, 7431, 29898, 3977, 29961, 29896, 29901, 2314, 29914, 29906, 1125, 13, 12, 12, 12, 12, 12, 12, 305, 2039, 398, 4619, 938, 29898, 3977, 29961, 29883, 334, 29871, 29906, 718, 29871, 29896, 29901, 274, 334, 29871, 29906, 718, 29871, 29941, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 12, 12, 12, 305, 2039, 398, 353, 313, 30022, 29898, 305, 2039, 398, 669, 29871, 29900, 29916, 4198, 29897, 718, 29871, 29896, 29897, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 12, 12, 12, 3977, 4619, 11860, 29900, 29906, 29990, 29908, 1273, 521, 2039, 398, 13, 12, 12, 12, 12, 12, 1311, 29889, 26716, 29889, 4397, 29898, 3977, 13578, 29905, 29916, 29900, 29928, 29905, 29916, 29900, 29909, 1159, 13, 12, 12, 12, 12, 12, 4230, 29918, 1202, 582, 353, 788, 582, 13, 12, 12, 12, 12, 2277, 29937, 7569, 1196, 8665, 411, 29242, 613, 5643, 491, 2407, 2159, 313, 21936, 29871, 29896, 29953, 29898, 7897, 511, 3211, 29892, 769, 2407, 1134, 13, 12, 12, 12, 12, 3977, 353, 376, 16664, 29900, 29906, 29990, 29995, 29900, 29946, 29990, 29995, 29900, 29906, 29990, 29908, 1273, 313, 29896, 29953, 29892, 313, 3188, 29918, 10030, 718, 313, 1220, 334, 29871, 29896, 29953, 876, 669, 29871, 29900, 29916, 22098, 29892, 29871, 29900, 29897, 13, 12, 12, 12, 12, 2277, 29937, 3462, 278, 848, 13, 12, 12, 12, 12, 1454, 270, 297, 1583, 29889, 1272, 29961, 3188, 29918, 10030, 3816, 1220, 334, 29871, 29896, 29953, 5919, 1220, 29974, 29896, 29897, 334, 29871, 29896, 29953, 5387, 13, 12, 12, 12, 12, 12, 3977, 4619, 11860, 29900, 29906, 29990, 29908, 1273, 4356, 29898, 29881, 29897, 13, 12, 12, 12, 12, 2277, 29937, 11796, 29872, 278, 1423, 2083, 13, 12, 12, 12, 12, 305, 2039, 398, 353, 29871, 29900, 13, 12, 12, 12, 12, 1454, 274, 297, 3464, 29898, 29900, 29892, 7431, 29898, 3977, 29961, 29896, 29901, 2314, 29914, 29906, 1125, 13, 12, 12, 12, 12, 12, 305, 2039, 398, 4619, 938, 29898, 3977, 29961, 29883, 334, 29871, 29906, 718, 29871, 29896, 29901, 274, 334, 29871, 29906, 718, 29871, 29941, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 12, 12, 305, 2039, 398, 353, 313, 30022, 29898, 305, 2039, 398, 669, 29871, 29900, 29916, 4198, 29897, 718, 29871, 29896, 29897, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 12, 12, 3977, 353, 2094, 718, 11860, 29900, 29906, 29990, 29908, 1273, 521, 2039, 398, 13, 12, 12, 12, 12, 1311, 29889, 26716, 29889, 4397, 29898, 3977, 13578, 29905, 29916, 29900, 29928, 29905, 29916, 29900, 29909, 1159, 13, 13, 12, 12, 2277, 29937, 3462, 278, 1095, 2407, 13, 12, 12, 3977, 353, 29242, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 4198, 29905, 29916, 29900, 29928, 29905, 29916, 29900, 29909, 29908, 13, 12, 12, 1311, 29889, 26716, 29889, 4397, 29898, 3977, 29897, 13, 12, 13, 12, 13, 1990, 349, 2965, 29906, 29946, 29943, 29918, 1184, 29887, 29901, 13, 12, 1753, 4770, 2344, 12035, 1311, 29892, 12782, 29892, 18896, 2290, 1125, 13, 12, 12, 1311, 29889, 10141, 353, 6571, 13, 12, 12, 1311, 29889, 15550, 353, 6571, 13, 12, 12, 13, 12, 12, 2277, 29937, 22680, 393, 278, 2159, 310, 278, 1303, 2908, 338, 29871, 29946, 2745, 591, 1073, 2253, 13, 12, 12, 1311, 29889, 10141, 1839, 949, 1271, 2033, 353, 29871, 29946, 13, 12, 12, 2277, 29937, 22680, 393, 727, 526, 29871, 29906, 6262, 639, 3211, 2745, 591, 1073, 2253, 13, 12, 12, 1311, 29889, 10141, 1839, 13193, 546, 10030, 2033, 353, 29871, 29906, 13, 13, 12, 12, 2277, 29937, 16012, 278, 5285, 13, 12, 12, 361, 2897, 29889, 2084, 29889, 275, 1445, 29898, 3991, 1125, 13, 12, 12, 12, 16859, 353, 12782, 11726, 29889, 17618, 1725, 3991, 11726, 580, 12, 12, 13, 12, 12, 12, 16859, 29889, 949, 29898, 3991, 29897, 13, 12, 12, 12, 361, 451, 274, 16434, 29889, 5349, 29918, 2042, 703, 2227, 29907, 29906, 29946, 29943, 8456, 2891, 29908, 1125, 13, 12, 12, 12, 12, 2158, 376, 13919, 5285, 29892, 694, 349, 2965, 29906, 29946, 29943, 8456, 2891, 4004, 3850, 13, 12, 12, 12, 12, 9675, 29889, 13322, 6278, 29896, 29897, 13, 13, 12, 12, 12, 2277, 29937, 3617, 278, 7797, 6055, 13, 12, 12, 12, 29878, 1078, 353, 518, 29871, 29900, 29892, 29871, 29896, 29906, 29900, 29900, 29892, 29871, 29906, 29946, 29900, 29900, 29892, 29871, 29946, 29947, 29900, 29900, 29892, 29871, 29929, 29953, 29900, 29900, 29892, 29871, 29896, 29929, 29906, 29900, 29900, 29892, 29871, 29941, 29947, 29946, 29900, 29900, 29892, 29871, 29945, 29955, 29953, 29900, 29900, 29892, 29871, 29896, 29896, 29945, 29906, 29900, 29900, 4514, 13, 12, 12, 12, 10492, 29918, 2248, 353, 274, 16434, 29889, 657, 524, 877, 2227, 29907, 29906, 29946, 29943, 8456, 2891, 742, 525, 8844, 403, 2248, 1495, 13, 12, 12, 12, 1311, 29889, 15550, 1839, 10492, 2033, 353, 19257, 29961, 10492, 29918, 2248, 29962, 13, 12, 12, 12, 1311, 29889, 15550, 1839, 15619, 2033, 353, 274, 16434, 29889, 657, 524, 877, 2227, 29907, 29906, 29946, 29943, 8456, 2891, 742, 525, 2055, 15619, 1495, 13, 12, 12, 12, 1311, 29889, 15550, 1839, 2267, 2722, 2033, 353, 274, 16434, 29889, 657, 524, 877, 2227, 29907, 29906, 29946, 29943, 8456, 2891, 742, 525, 3317, 276, 2202, 1495, 13, 12, 12, 12, 1311, 29889, 15550, 1839, 3317, 4058, 300, 2033, 353, 274, 16434, 29889, 657, 524, 877, 2227, 29907, 29906, 29946, 29943, 8456, 2891, 742, 525, 3317, 4058, 1691, 675, 1495, 29871, 13, 12, 12, 12, 2277, 29937, 960, 278, 7797, 2011, 3508, 29915, 29873, 11826, 29892, 671, 278, 2295, 13, 12, 12, 12, 361, 18896, 2290, 1275, 6213, 29901, 13, 12, 12, 12, 12, 1311, 29889, 15550, 1839, 637, 2033, 353, 274, 16434, 29889, 657, 524, 877, 2227, 29907, 29906, 29946, 29943, 8456, 2891, 742, 525, 637, 2248, 1495, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 1311, 29889, 15550, 1839, 637, 2033, 353, 18896, 2290, 13, 13, 12, 12, 12, 2277, 29937, 3617, 278, 4423, 310, 278, 6579, 12657, 13, 12, 12, 12, 1311, 29889, 10141, 1839, 4777, 10030, 417, 2033, 353, 938, 29898, 16859, 29889, 657, 877, 2227, 29907, 29906, 29946, 29943, 8456, 2891, 742, 525, 4777, 10030, 417, 29861, 29896, 13018, 29896, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 12, 1311, 29889, 10141, 1839, 4777, 10030, 2918, 2033, 353, 938, 29898, 16859, 29889, 657, 877, 2227, 29907, 29906, 29946, 29943, 8456, 2891, 742, 525, 4777, 10030, 2918, 29861, 29896, 13018, 29896, 1402, 29871, 29896, 29953, 29897, 13, 13, 12, 12, 2277, 29937, 13466, 29892, 1059, 714, 13, 12, 12, 2870, 29901, 13, 12, 12, 12, 2158, 376, 12148, 3867, 263, 5285, 934, 3850, 13, 12, 12, 12, 27573, 580, 13, 12, 12, 12, 9675, 29889, 13322, 6278, 29896, 29897, 13, 13, 12, 12, 2277, 29937, 4306, 3651, 13, 12, 12, 1311, 29889, 4230, 29918, 9006, 353, 6213, 13, 12, 12, 1311, 29889, 27902, 353, 7700, 13, 12, 12, 1311, 29889, 20970, 1445, 353, 379, 5746, 29918, 2283, 580, 13, 12, 12, 1311, 29889, 339, 2035, 353, 7700, 13, 12, 12, 2277, 29937, 20999, 3838, 13, 12, 12, 1311, 29889, 2917, 29918, 9303, 353, 6213, 13, 12, 12, 13, 12, 12, 2277, 29937, 3789, 701, 278, 7797, 3957, 13, 12, 12, 2158, 376, 15156, 18896, 3371, 613, 1583, 29889, 15550, 1839, 637, 7464, 17962, 613, 1583, 29889, 15550, 1839, 10492, 2033, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 1311, 29889, 643, 353, 7797, 29889, 9125, 29898, 1311, 29889, 15550, 1839, 637, 7464, 1583, 29889, 15550, 1839, 10492, 7464, 921, 265, 29916, 2696, 29922, 29900, 29892, 364, 1372, 312, 29879, 29922, 29900, 29892, 11815, 7607, 1311, 29889, 15550, 1839, 15619, 2033, 29914, 29896, 29900, 29900, 29900, 876, 13, 12, 12, 19499, 29901, 13, 12, 12, 12, 2158, 376, 6028, 29915, 29873, 1722, 7797, 2011, 613, 1583, 29889, 15550, 1839, 637, 7464, 376, 3850, 13, 12, 12, 12, 9675, 29889, 13322, 6278, 29896, 29897, 13, 13, 12, 12, 2277, 29937, 3617, 278, 4742, 1134, 304, 731, 278, 4742, 6055, 515, 278, 2295, 13, 12, 12, 10141, 353, 1583, 29889, 2577, 11501, 580, 12, 13, 13, 12, 12, 361, 451, 274, 16434, 29889, 5349, 29918, 2042, 877, 2287, 19059, 24360, 29374, 13, 12, 12, 12, 2158, 376, 13919, 5285, 29892, 694, 5012, 19059, 24360, 4004, 3850, 13, 12, 12, 12, 9675, 29889, 13322, 6278, 29896, 29897, 13, 13, 12, 12, 361, 451, 274, 16434, 29889, 5349, 29918, 3385, 877, 2287, 19059, 24360, 742, 851, 29898, 10141, 22164, 13, 12, 12, 12, 2158, 376, 11501, 411, 3553, 29901, 613, 4742, 29892, 376, 1333, 9904, 297, 278, 2295, 934, 3850, 13, 12, 12, 12, 9675, 29889, 13322, 6278, 29896, 29897, 13, 13, 12, 12, 10141, 29918, 978, 353, 274, 16434, 29889, 657, 877, 2287, 19059, 24360, 742, 851, 29898, 10141, 876, 29961, 29896, 13018, 29896, 29962, 13, 12, 12, 13, 12, 12, 361, 451, 274, 16434, 29889, 5349, 29918, 2042, 29898, 10141, 29918, 978, 1125, 13, 12, 12, 12, 2158, 4742, 29918, 978, 29892, 376, 1333, 6790, 297, 278, 2295, 934, 3850, 13, 12, 12, 12, 9675, 29889, 13322, 6278, 29896, 29897, 13, 13, 12, 12, 2158, 376, 9692, 613, 4742, 29918, 978, 13, 13, 12, 12, 2277, 29937, 3617, 278, 14354, 310, 278, 6579, 12047, 13, 12, 12, 1311, 29889, 10141, 1839, 1792, 12071, 8111, 2033, 353, 938, 29898, 16859, 29889, 657, 29898, 10141, 29918, 978, 29892, 525, 1792, 12071, 8111, 29861, 29896, 13018, 29896, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 1311, 29889, 10141, 1839, 4777, 18829, 2033, 353, 938, 29898, 16859, 29889, 657, 29898, 10141, 29918, 978, 29892, 525, 4777, 18829, 29861, 29896, 13018, 29896, 1402, 29871, 29896, 29953, 29897, 13, 13, 12, 12, 2277, 29937, 383, 453, 297, 278, 4742, 2702, 6055, 13, 12, 12, 1311, 29889, 10141, 1839, 3539, 1271, 2033, 353, 274, 16434, 29889, 657, 524, 29898, 10141, 29918, 978, 29892, 525, 3539, 1271, 1495, 13, 12, 12, 1311, 29889, 10141, 1839, 949, 1271, 2033, 353, 274, 16434, 29889, 657, 524, 29898, 10141, 29918, 978, 29892, 525, 949, 1271, 1495, 13, 12, 12, 1311, 29889, 10141, 1839, 261, 559, 1271, 2033, 353, 274, 16434, 29889, 657, 524, 29898, 10141, 29918, 978, 29892, 525, 261, 559, 1271, 1495, 13, 13, 12, 12, 2277, 29937, 3834, 9224, 6084, 7200, 18203, 15786, 13, 12, 12, 1311, 29889, 10141, 1839, 3317, 4058, 300, 2033, 353, 274, 16434, 29889, 657, 524, 29898, 10141, 29918, 978, 29892, 525, 3317, 4058, 1691, 675, 1495, 13, 12, 12, 1311, 29889, 10141, 1839, 13193, 546, 10030, 2033, 353, 274, 16434, 29889, 657, 524, 29898, 10141, 29918, 978, 29892, 525, 13193, 546, 10030, 1495, 13, 13, 12, 12, 2277, 29937, 7835, 3370, 4038, 14157, 13, 12, 12, 1311, 29889, 10141, 1839, 3358, 29878, 9477, 340, 2033, 353, 938, 29898, 16859, 29889, 657, 29898, 10141, 29918, 978, 29892, 525, 3358, 29878, 9477, 340, 29861, 29896, 13018, 29896, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 1311, 29889, 10141, 1839, 3358, 3881, 9812, 2033, 353, 938, 29898, 16859, 29889, 657, 29898, 10141, 29918, 978, 29892, 525, 3358, 3881, 9812, 29861, 29896, 13018, 29896, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 13, 12, 12, 2277, 29937, 16510, 14157, 13, 12, 12, 1311, 29889, 10141, 1839, 1792, 12071, 8111, 2033, 353, 938, 29898, 16859, 29889, 657, 29898, 10141, 29918, 978, 29892, 525, 1792, 12071, 8111, 29861, 29896, 13018, 29896, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 1311, 29889, 10141, 1839, 4777, 18829, 2033, 353, 938, 29898, 16859, 29889, 657, 29898, 10141, 29918, 978, 29892, 525, 4777, 18829, 29861, 29896, 13018, 29896, 1402, 29871, 29896, 29953, 29897, 13, 12, 12, 13, 12, 2277, 29937, 3617, 278, 4742, 1134, 13, 12, 1753, 3617, 11501, 29898, 1311, 1125, 13, 12, 12, 10141, 29918, 1272, 353, 1583, 29889, 6359, 8754, 1161, 29898, 29900, 29916, 4198, 29900, 29900, 29900, 29900, 29892, 29871, 29946, 29897, 13, 12, 12, 361, 7431, 29898, 10141, 29918, 1272, 29897, 529, 29871, 29906, 29901, 13, 12, 12, 12, 2158, 376, 6028, 29915, 29873, 4511, 304, 4742, 29892, 7423, 3850, 13, 12, 12, 12, 9675, 29889, 13322, 6278, 29896, 29897, 13, 12, 12, 10141, 353, 4356, 29898, 10141, 29918, 1272, 29961, 29900, 2314, 891, 4356, 29898, 10141, 29918, 1272, 29961, 29896, 2314, 3532, 29871, 29947, 13, 12, 12, 2457, 4742, 13, 13, 12, 1753, 323, 29990, 29918, 21738, 29911, 29898, 1311, 29892, 848, 1125, 29871, 13, 12, 12, 2277, 29937, 24457, 29911, 399, 533, 3402, 13, 12, 12, 1254, 29990, 353, 6634, 29916, 29945, 29945, 29908, 13, 12, 12, 2544, 29990, 353, 6634, 29916, 29900, 29946, 29908, 13, 12, 12, 29928, 1307, 353, 6634, 29916, 29900, 29945, 29908, 13, 13, 12, 12, 2277, 29937, 3087, 537, 1423, 278, 848, 13, 12, 12, 361, 7431, 29898, 1272, 29897, 1405, 1583, 29889, 15550, 1839, 3317, 4058, 300, 2033, 29901, 13, 12, 12, 12, 2158, 376, 22709, 29901, 21022, 630, 18203, 29908, 13, 12, 12, 12, 1272, 353, 848, 29961, 29900, 29901, 1311, 29889, 15550, 1839, 3317, 4058, 300, 2033, 29962, 13, 12, 13, 12, 12, 2277, 29937, 3251, 403, 278, 1423, 2083, 13, 12, 12, 305, 2039, 398, 353, 29871, 29900, 13, 12, 12, 1454, 270, 297, 848, 29901, 13, 12, 12, 12, 305, 2039, 398, 4619, 4356, 29898, 29881, 29897, 13, 12, 12, 305, 2039, 398, 353, 18460, 3552, 30022, 29898, 305, 2039, 398, 29897, 718, 29871, 29896, 29897, 669, 29871, 29900, 29916, 4198, 29897, 13, 13, 12, 12, 2277, 29937, 349, 1633, 569, 13, 12, 12, 1311, 29889, 643, 29889, 3539, 29898, 1254, 29990, 29897, 13, 12, 12, 1311, 29889, 643, 29889, 3539, 29898, 1254, 29990, 29897, 13, 12, 12, 1454, 270, 297, 848, 29901, 13, 12, 12, 12, 2277, 29937, 3462, 10169, 2931, 363, 4266, 4890, 13, 12, 12, 12, 361, 270, 1275, 6850, 29990, 470, 270, 1275, 382, 28627, 470, 270, 1275, 360, 1307, 29901, 13, 12, 12, 12, 12, 1311, 29889, 643, 29889, 3539, 29898, 29928, 1307, 29897, 13, 12, 12, 12, 1311, 29889, 643, 29889, 3539, 29898, 29881, 29897, 13, 12, 12, 361, 521, 2039, 398, 1275, 6850, 29990, 470, 521, 2039, 398, 1275, 382, 28627, 470, 521, 2039, 398, 1275, 360, 1307, 29901, 13, 12, 12, 12, 1311, 29889, 643, 29889, 3539, 29898, 29928, 1307, 29897, 13, 12, 12, 1311, 29889, 643, 29889, 3539, 29898, 305, 2039, 398, 29897, 13, 12, 12, 2277, 29937, 4918, 5878, 13, 12, 12, 1311, 29889, 643, 29889, 3539, 29898, 2544, 29990, 29897, 13, 13, 12, 2277, 29937, 7523, 263, 7023, 313, 2541, 3240, 2722, 29897, 515, 278, 7797, 4742, 13, 12, 1753, 7523, 1748, 29898, 1311, 1125, 13, 12, 12, 2585, 353, 5124, 13, 12, 12, 1454, 474, 297, 3464, 29898, 29900, 29892, 1583, 29889, 15550, 1839, 2267, 2722, 2033, 1125, 13, 12, 12, 12, 2585, 353, 1583, 29889, 643, 29889, 949, 580, 13, 12, 12, 12, 361, 7431, 29898, 2585, 29897, 2804, 29871, 29900, 29901, 13, 12, 12, 12, 12, 8690, 13, 12, 12, 2457, 4833, 13, 12, 13, 12, 1753, 390, 29990, 29918, 21738, 29911, 29898, 1311, 1125, 13, 12, 12, 2277, 29937, 24457, 29911, 399, 533, 3402, 13, 12, 12, 2544, 29990, 353, 6634, 29916, 29900, 29946, 29908, 13, 12, 12, 29928, 1307, 353, 6634, 29916, 29900, 29945, 29908, 13, 13, 12, 12, 1272, 353, 5124, 13, 12, 12, 1272, 29918, 2435, 353, 29871, 29900, 13, 12, 12, 2277, 29937, 3617, 278, 848, 18203, 13, 12, 12, 8000, 5852, 29901, 13, 12, 12, 12, 2585, 353, 1583, 29889, 6359, 1748, 580, 13, 13, 12, 12, 12, 2277, 29937, 498, 798, 385, 1059, 565, 591, 3282, 29915, 29873, 679, 848, 13, 12, 12, 12, 361, 7431, 29898, 2585, 29897, 1275, 29871, 29900, 29901, 13, 12, 12, 12, 12, 2158, 376, 29934, 29990, 4829, 29901, 9162, 7431, 29898, 1272, 511, 376, 6262, 4520, 29908, 13, 12, 12, 12, 12, 361, 7431, 29898, 1272, 29897, 1405, 29871, 29900, 29901, 13, 12, 12, 12, 12, 12, 1454, 270, 297, 848, 29901, 13, 12, 12, 12, 12, 12, 12, 2158, 4356, 29898, 29881, 511, 13, 12, 12, 12, 12, 12, 2158, 6634, 29876, 29908, 13, 12, 12, 12, 12, 2457, 848, 13, 13, 12, 12, 12, 2277, 29937, 29849, 788, 278, 19824, 2931, 13, 12, 12, 12, 361, 4833, 1275, 360, 1307, 29901, 13, 12, 12, 12, 12, 2585, 353, 1583, 29889, 6359, 1748, 580, 13, 12, 12, 12, 12, 13, 12, 12, 12, 2277, 29937, 2796, 4195, 13, 12, 12, 12, 23681, 4833, 1275, 382, 28627, 29901, 13, 12, 12, 12, 12, 8690, 13, 13, 12, 12, 12, 2277, 29937, 21981, 848, 13, 12, 12, 12, 1272, 4619, 4833, 13, 12, 12, 12, 1272, 29918, 2435, 4619, 29871, 29896, 13, 12, 12, 12, 13, 12, 12, 2277, 29937, 3617, 278, 1423, 2083, 7023, 13, 12, 12, 384, 353, 4356, 29898, 1272, 14352, 29896, 2314, 13, 12, 12, 2277, 29937, 15154, 278, 1424, 11500, 4890, 13, 12, 12, 1272, 353, 848, 29961, 29906, 13018, 29896, 29962, 13, 12, 12, 2277, 29937, 5399, 278, 1423, 2083, 310, 278, 848, 10768, 13, 12, 12, 305, 2039, 398, 353, 29871, 29900, 13, 12, 12, 1454, 270, 297, 848, 29901, 13, 12, 12, 12, 305, 2039, 398, 4619, 4356, 29898, 29881, 29897, 13, 12, 12, 305, 2039, 398, 353, 313, 30022, 29898, 305, 2039, 398, 669, 29871, 29900, 29916, 4198, 29897, 718, 29871, 29896, 29897, 669, 29871, 29900, 29916, 4198, 13, 13, 12, 12, 2277, 29937, 13905, 263, 9177, 565, 278, 1423, 2083, 8465, 13, 12, 12, 361, 521, 2039, 398, 2804, 274, 29895, 29901, 13, 12, 12, 12, 2158, 6634, 29876, 29956, 25614, 29901, 5399, 2083, 29635, 29901, 1273, 29900, 29906, 29990, 847, 1273, 29900, 29906, 29990, 3850, 1273, 313, 305, 2039, 398, 29892, 274, 29895, 29897, 13, 12, 12, 12, 1454, 270, 297, 848, 29901, 13, 12, 12, 12, 12, 2158, 4356, 29898, 29881, 511, 12, 13, 12, 12, 12, 2158, 6634, 29876, 29908, 13, 12, 12, 2457, 848, 13, 13, 12, 2277, 29937, 3251, 403, 278, 18203, 304, 3638, 975, 278, 8014, 322, 3638, 372, 13, 12, 1753, 13760, 12657, 29907, 5773, 29898, 1311, 29892, 9920, 29892, 6389, 353, 6571, 1125, 13, 12, 12, 14358, 353, 7700, 13, 12, 12, 3445, 5926, 353, 7700, 13, 12, 12, 1272, 353, 5159, 13, 13, 12, 12, 2277, 29937, 830, 11666, 322, 1634, 5926, 671, 278, 1833, 1899, 13, 12, 12, 361, 9920, 1275, 376, 1525, 4162, 1299, 1115, 13, 12, 12, 12, 361, 1583, 29889, 4230, 29918, 9006, 2804, 6213, 29901, 13, 12, 12, 12, 12, 9006, 353, 1583, 29889, 4230, 29918, 9006, 12, 12, 12, 12, 13, 12, 12, 12, 12, 14358, 353, 5852, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 2158, 376, 6028, 29915, 29873, 12312, 29892, 694, 1899, 297, 6835, 29908, 13, 12, 12, 361, 9920, 1275, 376, 1525, 7390, 2965, 3040, 1115, 13, 12, 12, 12, 361, 1583, 29889, 4230, 29918, 9006, 2804, 6213, 322, 1583, 29889, 4230, 29918, 9006, 29961, 29900, 29901, 29906, 29962, 1275, 376, 17755, 1115, 13, 12, 12, 12, 12, 9006, 353, 1583, 29889, 4230, 29918, 9006, 12, 12, 12, 12, 13, 12, 12, 12, 12, 3445, 5926, 353, 5852, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 2158, 376, 6028, 29915, 29873, 1634, 5926, 29892, 694, 15878, 1899, 297, 6835, 29908, 13, 12, 12, 13, 12, 12, 2277, 29937, 10554, 278, 1791, 310, 278, 8260, 13, 12, 12, 361, 9920, 1275, 376, 1525, 10490, 1115, 13, 12, 12, 12, 1272, 353, 6796, 29905, 29916, 29900, 29900, 613, 6634, 29916, 29900, 29900, 3108, 13, 12, 12, 12, 1311, 29889, 28627, 29918, 21738, 29911, 29898, 1272, 29897, 13, 12, 12, 12, 2277, 29937, 1939, 2933, 856, 13, 13, 12, 12, 2277, 29937, 7523, 10079, 10343, 13, 12, 12, 23681, 9920, 1275, 376, 29934, 29928, 29918, 5348, 1115, 13, 12, 12, 12, 2158, 376, 6359, 292, 13760, 12657, 10079, 10343, 29901, 376, 13, 12, 12, 12, 2277, 29937, 15076, 278, 848, 18203, 13, 12, 12, 12, 1272, 353, 6796, 29905, 29916, 29900, 29900, 613, 6634, 29916, 29900, 29906, 3108, 13, 12, 12, 12, 1311, 29889, 28627, 29918, 21738, 29911, 29898, 1272, 29897, 13, 12, 12, 12, 2277, 29937, 3617, 278, 1121, 13, 12, 12, 12, 1272, 353, 1583, 29889, 29934, 29990, 29918, 21738, 29911, 580, 13, 12, 12, 12, 361, 7431, 29898, 1272, 29897, 1275, 29871, 29900, 29901, 13, 12, 12, 12, 12, 2158, 6634, 29873, 2525, 519, 304, 8161, 1873, 3850, 13, 12, 12, 12, 12, 2457, 13, 12, 12, 12, 2158, 6634, 29873, 20967, 12657, 10079, 29901, 376, 718, 851, 29898, 536, 29898, 1272, 29961, 29941, 12622, 718, 376, 1213, 718, 851, 29898, 536, 29898, 1272, 29961, 29906, 12622, 13, 13, 12, 12, 2277, 29937, 7523, 278, 8720, 714, 310, 278, 11013, 13, 12, 12, 23681, 9920, 1275, 376, 29934, 29928, 29918, 10536, 24943, 1115, 13, 12, 12, 12, 29937, 2158, 376, 6359, 292, 7835, 18914, 6160, 13, 12, 12, 12, 2277, 29937, 15076, 278, 848, 18203, 13, 12, 12, 12, 361, 12312, 29901, 13, 12, 12, 12, 12, 29937, 2158, 6634, 29873, 6359, 292, 515, 1833, 4423, 29908, 13, 12, 12, 12, 12, 1272, 353, 6796, 29905, 29916, 29900, 29896, 3108, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 29937, 2158, 6634, 29873, 6359, 292, 29871, 29900, 29916, 29995, 29900, 29906, 29990, 3838, 515, 29871, 29900, 29916, 29995, 29900, 29947, 29990, 29908, 1273, 313, 5085, 1839, 1307, 29940, 7464, 313, 5085, 1839, 3035, 8353, 29965, 2033, 3532, 29871, 29896, 29953, 891, 6389, 1839, 3035, 8353, 29950, 2033, 3532, 29871, 29947, 891, 6389, 1839, 17744, 2241, 25901, 13, 12, 12, 12, 12, 1272, 353, 6796, 29905, 29916, 29900, 29896, 613, 18460, 29898, 5085, 1839, 1307, 29940, 2033, 511, 18460, 29898, 5085, 1839, 17744, 2241, 2033, 511, 18460, 29898, 5085, 1839, 3035, 8353, 29950, 2033, 511, 18460, 29898, 5085, 1839, 3035, 8353, 29965, 2033, 4638, 13, 12, 12, 12, 1311, 29889, 28627, 29918, 21738, 29911, 29898, 1272, 29897, 13, 12, 12, 12, 2277, 29937, 3617, 278, 1121, 13, 12, 12, 12, 1272, 353, 1583, 29889, 29934, 29990, 29918, 21738, 29911, 580, 13, 12, 12, 12, 2277, 29937, 960, 727, 471, 385, 1059, 29892, 925, 3787, 432, 2960, 13, 12, 12, 12, 361, 7431, 29898, 1272, 29897, 1275, 29871, 29900, 29901, 13, 12, 12, 12, 12, 2158, 6634, 29873, 2392, 5183, 515, 4742, 3850, 13, 12, 12, 12, 12, 1272, 353, 5124, 13, 12, 12, 12, 12, 1454, 474, 297, 3464, 29898, 29900, 29892, 6389, 1839, 1307, 29940, 2033, 1125, 13, 12, 12, 12, 12, 12, 1272, 4619, 6634, 29916, 4198, 29905, 29916, 4198, 29905, 29916, 4198, 29905, 29916, 29900, 29900, 29908, 13, 12, 12, 12, 12, 2457, 848, 12, 13, 12, 12, 12, 2277, 29937, 7106, 871, 278, 848, 1303, 515, 11013, 29892, 451, 278, 3211, 758, 314, 569, 13, 12, 12, 12, 2457, 848, 29961, 29945, 17531, 13, 13, 12, 12, 2277, 29937, 14350, 263, 716, 1824, 964, 278, 11013, 13, 12, 12, 23681, 9920, 1275, 376, 17755, 29918, 10536, 24943, 1115, 13, 12, 12, 12, 29937, 2158, 376, 6113, 7835, 18914, 6160, 13, 12, 12, 12, 2277, 29937, 3251, 403, 278, 848, 18203, 13, 12, 12, 12, 361, 12312, 29901, 13, 12, 12, 12, 12, 29937, 2158, 6634, 29873, 29956, 768, 292, 304, 1833, 4423, 29908, 13, 12, 12, 12, 12, 1272, 353, 6796, 29905, 29916, 29900, 29906, 3108, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 29937, 2158, 6634, 29873, 29956, 768, 292, 1948, 304, 29871, 29900, 29916, 29995, 29900, 29947, 29990, 29908, 1273, 5135, 5085, 1839, 3035, 8353, 29965, 2033, 3532, 29871, 29896, 29953, 891, 6389, 1839, 3035, 8353, 29950, 2033, 3532, 29871, 29947, 891, 6389, 1839, 17744, 2241, 25901, 13, 12, 12, 12, 12, 1272, 353, 6796, 29905, 29916, 29900, 29906, 613, 18460, 29898, 5085, 1839, 1307, 29940, 2033, 511, 18460, 29898, 5085, 1839, 17744, 2241, 2033, 511, 18460, 29898, 5085, 1839, 3035, 8353, 29950, 2033, 511, 18460, 29898, 5085, 1839, 3035, 8353, 29965, 2033, 4638, 13, 12, 12, 12, 12, 2277, 29937, 1551, 263, 1634, 1414, 29892, 591, 1016, 29915, 29873, 3867, 278, 848, 13, 12, 12, 12, 12, 361, 451, 1634, 5926, 29901, 13, 12, 12, 12, 12, 12, 2277, 29937, 3251, 403, 278, 848, 1347, 13, 12, 12, 12, 12, 12, 1454, 270, 297, 6389, 1839, 14573, 2033, 29901, 13, 12, 12, 12, 12, 12, 12, 1272, 29889, 4397, 29898, 22495, 29898, 29881, 876, 13, 12, 12, 12, 2277, 29937, 15076, 278, 848, 18203, 13, 12, 12, 12, 1311, 29889, 28627, 29918, 21738, 29911, 29898, 1272, 29897, 13, 12, 12, 12, 2277, 29937, 3617, 278, 2933, 13, 12, 12, 12, 1272, 353, 1583, 29889, 29934, 29990, 29918, 21738, 29911, 580, 13, 12, 12, 12, 361, 7431, 29898, 1272, 29897, 1275, 29871, 29900, 470, 848, 29961, 29900, 29962, 2804, 6634, 29916, 29900, 29906, 1115, 13, 12, 12, 12, 12, 2158, 6634, 29873, 2392, 5007, 304, 4742, 3850, 13, 13, 12, 12, 2277, 29937, 1425, 559, 21967, 13, 12, 12, 23681, 9920, 1275, 376, 1001, 29918, 10536, 24943, 1115, 13, 12, 12, 12, 2158, 376, 2110, 559, 21967, 6160, 13, 12, 12, 12, 2277, 29937, 15076, 278, 848, 18203, 13, 12, 12, 12, 361, 12312, 29901, 13, 12, 12, 12, 12, 2158, 6634, 29873, 2110, 5832, 3517, 4423, 29908, 13, 12, 12, 12, 12, 1272, 353, 6796, 29905, 29916, 29900, 29941, 3108, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 2158, 6634, 29873, 2110, 5832, 1273, 29875, 6515, 29892, 6257, 472, 29871, 29900, 29916, 29995, 29900, 29947, 29990, 29908, 1273, 313, 5085, 1839, 1307, 29940, 7464, 313, 5085, 1839, 3035, 8353, 29965, 2033, 3532, 29871, 29896, 29953, 891, 6389, 1839, 3035, 8353, 29950, 2033, 3532, 29871, 29947, 891, 6389, 1839, 17744, 2241, 25901, 13, 12, 12, 12, 12, 1272, 353, 6796, 29905, 29916, 29900, 29941, 613, 18460, 29898, 5085, 1839, 1307, 29940, 2033, 511, 18460, 29898, 5085, 1839, 17744, 2241, 2033, 511, 18460, 29898, 5085, 1839, 3035, 8353, 29950, 2033, 511, 18460, 29898, 5085, 1839, 3035, 8353, 29965, 2033, 4638, 13, 12, 12, 12, 1311, 29889, 28627, 29918, 21738, 29911, 29898, 1272, 29897, 13, 12, 12, 12, 2277, 29937, 3617, 278, 2933, 13, 12, 12, 12, 1272, 353, 1583, 29889, 29934, 29990, 29918, 21738, 29911, 580, 13, 12, 12, 12, 361, 7431, 29898, 1272, 29897, 1275, 29871, 29900, 470, 848, 29961, 29900, 29962, 2804, 6634, 29916, 29900, 29941, 1115, 13, 12, 12, 12, 12, 2158, 6634, 29873, 2392, 604, 5832, 4742, 3850, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 2158, 6634, 29873, 2110, 559, 4866, 29908, 13, 13, 12, 12, 2277, 29937, 4525, 8260, 526, 443, 326, 2037, 287, 472, 445, 931, 1951, 591, 1016, 29915, 29873, 13, 12, 12, 2277, 29937, 671, 963, 411, 278, 350, 29925, 29889, 960, 4312, 29892, 2334, 278, 1021, 408, 278, 13, 12, 12, 2277, 29937, 11013, 1303, 29914, 3539, 411, 278, 1959, 3211, 292, 322, 11994, 13, 12, 12, 23681, 9920, 1275, 376, 29934, 29928, 29918, 29923, 3352, 8254, 1115, 13, 12, 12, 12, 2158, 376, 25807, 29884, 3016, 287, 472, 445, 931, 3850, 13, 12, 12, 12, 3364, 13, 12, 12, 23681, 9920, 1275, 376, 17755, 29918, 29923, 3352, 8254, 1115, 13, 12, 12, 12, 2158, 376, 25807, 29884, 3016, 287, 472, 445, 931, 3850, 13, 12, 12, 12, 3364, 13, 12, 12, 23681, 9920, 1275, 376, 29934, 29928, 29918, 25903, 1115, 13, 12, 12, 12, 2158, 376, 25807, 29884, 3016, 287, 472, 445, 931, 3850, 13, 12, 12, 12, 3364, 13, 12, 12, 23681, 9920, 1275, 376, 17755, 29918, 25903, 1115, 13, 12, 12, 12, 2158, 376, 25807, 29884, 3016, 287, 472, 445, 931, 3850, 13, 12, 12, 12, 3364, 13, 13, 12, 12, 2277, 29937, 15076, 278, 18203, 393, 10603, 278, 4742, 304, 1369, 278, 6505, 26169, 13, 12, 12, 2277, 29937, 304, 10715, 964, 4160, 3535, 4464, 13, 12, 12, 23681, 9920, 1275, 376, 5348, 6545, 29979, 29918, 8949, 1115, 13, 12, 12, 12, 2158, 376, 6565, 2164, 20419, 1213, 13, 12, 12, 12, 2277, 29937, 15076, 278, 848, 18203, 13, 12, 12, 12, 1272, 353, 6796, 29905, 29916, 29900, 29947, 613, 6634, 29916, 29900, 29896, 613, 6634, 29916, 29900, 29900, 613, 6634, 29916, 29900, 29900, 613, 6634, 29916, 29900, 29900, 3108, 13, 12, 12, 12, 1311, 29889, 28627, 29918, 21738, 29911, 29898, 1272, 29897, 13, 12, 12, 12, 2277, 29937, 3617, 278, 2933, 13, 12, 12, 12, 1272, 353, 1583, 29889, 29934, 29990, 29918, 21738, 29911, 580, 13, 12, 12, 12, 361, 848, 29961, 29900, 29962, 2804, 6634, 29916, 29900, 29947, 1115, 13, 12, 12, 12, 12, 2158, 6634, 29873, 2392, 1147, 9215, 4742, 3850, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 2158, 6634, 29873, 6565, 2450, 4866, 29892, 21293, 304, 1404, 4464, 29908, 13, 12, 12, 12, 12, 2277, 29937, 15076, 263, 10092, 18203, 13, 12, 12, 12, 12, 1272, 353, 6796, 29905, 29916, 29900, 29900, 613, 6634, 29916, 29900, 29900, 3108, 13, 12, 12, 12, 12, 1311, 29889, 28627, 29918, 21738, 29911, 29898, 1272, 29897, 13, 13, 12, 12, 2277, 29937, 7437, 701, 278, 1833, 1899, 363, 28769, 13, 12, 12, 1311, 29889, 4230, 29918, 9006, 353, 9920, 13, 12, 12, 2457, 13, 13, 12, 2277, 29937, 1281, 29894, 819, 663, 3168, 363, 14238, 322, 8363, 2066, 13, 12, 1753, 7523, 2283, 29898, 1311, 29892, 10422, 1125, 13, 12, 12, 1311, 29889, 20970, 1445, 29889, 949, 29898, 9507, 29897, 12, 13, 12, 1753, 14350, 2283, 29898, 1311, 29892, 10422, 1125, 13, 12, 12, 1311, 29889, 20970, 1445, 29889, 3539, 29898, 9507, 29897, 12, 13, 12, 1753, 3630, 1762, 2283, 29898, 1311, 29892, 28915, 29892, 848, 1125, 13, 12, 12, 1311, 29889, 20970, 1445, 29889, 1272, 29961, 10030, 29962, 353, 848, 13, 13, 12, 2277, 29937, 14350, 304, 278, 11013, 13, 12, 1753, 14350, 8754, 1161, 29898, 1311, 29892, 1369, 29918, 7328, 29892, 848, 1125, 13, 12, 12, 2277, 29937, 3617, 278, 1734, 2302, 13, 12, 12, 12328, 353, 7431, 29898, 1272, 29897, 13, 12, 12, 7778, 353, 5124, 13, 13, 12, 12, 1454, 282, 297, 3464, 29898, 29900, 29892, 938, 29898, 12328, 847, 1583, 29889, 10141, 1839, 3539, 1271, 2033, 22164, 13, 12, 12, 12, 2277, 29937, 8878, 278, 2980, 5447, 13, 12, 12, 12, 5085, 353, 6571, 13, 12, 12, 12, 2277, 29937, 365, 1477, 338, 2337, 29871, 29896, 1951, 591, 508, 2436, 871, 697, 2908, 472, 263, 931, 13, 12, 12, 12, 5085, 1839, 1307, 29940, 2033, 353, 29871, 29896, 29871, 13, 12, 12, 12, 2277, 29937, 2567, 2436, 297, 278, 848, 13, 12, 12, 12, 5085, 1839, 14573, 2033, 353, 848, 29961, 29886, 334, 1583, 29889, 10141, 1839, 3539, 1271, 2033, 5919, 29886, 718, 29871, 29896, 29897, 334, 1583, 29889, 10141, 1839, 3539, 1271, 2033, 29962, 13, 12, 12, 12, 2277, 29937, 9788, 29892, 5706, 278, 3211, 13, 12, 12, 12, 10030, 29918, 29886, 353, 1369, 29918, 7328, 718, 282, 334, 313, 1311, 29889, 10141, 1839, 3539, 1271, 2033, 847, 1583, 29889, 10141, 1839, 13193, 546, 10030, 11287, 13, 12, 12, 12, 361, 28915, 29918, 29886, 6736, 1583, 29889, 10141, 1839, 3358, 3881, 9812, 2033, 29901, 13, 12, 12, 12, 12, 2457, 13, 12, 12, 12, 5085, 1839, 17744, 2241, 2033, 353, 28915, 29918, 29886, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 12, 5085, 1839, 3035, 8353, 29950, 2033, 353, 313, 10030, 29918, 29886, 5099, 29871, 29947, 29897, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 12, 5085, 1839, 3035, 8353, 29965, 2033, 353, 313, 10030, 29918, 29886, 5099, 29871, 29896, 29953, 29897, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 12, 361, 451, 1583, 29889, 339, 2035, 29901, 13, 12, 12, 12, 12, 2158, 376, 29956, 768, 292, 1273, 29875, 6262, 304, 3211, 29871, 29900, 29916, 29995, 29900, 29947, 29990, 29908, 1273, 313, 1311, 29889, 10141, 1839, 3539, 1271, 7464, 28915, 29918, 29886, 29897, 13, 13, 12, 12, 12, 1311, 29889, 20967, 12657, 29907, 5773, 703, 17755, 29918, 10536, 24943, 613, 6389, 29897, 13, 13, 12, 12, 12, 2277, 29937, 960, 591, 29915, 276, 1147, 9215, 408, 591, 2436, 29892, 1303, 278, 1948, 591, 925, 5456, 322, 7252, 13, 12, 12, 12, 361, 1583, 29889, 27902, 29901, 13, 12, 12, 12, 12, 361, 28915, 29918, 29886, 297, 3464, 29898, 1311, 29889, 10141, 1839, 4777, 10030, 417, 7464, 1583, 29889, 10141, 1839, 4777, 10030, 2918, 2033, 1125, 13, 12, 12, 12, 12, 12, 2158, 376, 29903, 1984, 3262, 1147, 2450, 310, 6579, 12657, 4038, 1213, 13, 12, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 12, 2277, 29937, 7523, 278, 11013, 591, 925, 5456, 13, 12, 12, 12, 12, 12, 27902, 29918, 1272, 353, 1583, 29889, 6359, 8754, 1161, 29898, 10030, 29918, 29886, 29892, 1583, 29889, 10141, 1839, 3539, 1271, 11287, 13, 12, 13, 12, 12, 12, 12, 12, 1454, 474, 297, 3464, 29898, 29900, 29892, 7431, 29898, 27902, 29918, 1272, 22164, 13, 12, 12, 12, 12, 12, 12, 361, 4356, 29898, 27902, 29918, 1272, 29961, 29875, 2314, 2804, 6389, 1839, 14573, 2033, 29961, 29875, 5387, 13, 12, 12, 12, 12, 12, 12, 12, 2158, 376, 6565, 2450, 5229, 472, 29871, 29900, 29916, 29995, 29900, 29947, 29990, 29901, 1273, 29875, 2804, 1273, 29875, 29908, 1273, 313, 524, 29898, 10030, 29918, 29886, 718, 474, 511, 4356, 29898, 27902, 29918, 1272, 29961, 29875, 11724, 6389, 1839, 14573, 2033, 29961, 29875, 2314, 13, 12, 2277, 29937, 7523, 515, 278, 11013, 13, 12, 1753, 7523, 8754, 1161, 29898, 1311, 29892, 28915, 29892, 3309, 1125, 13, 12, 12, 1272, 353, 5124, 13, 12, 12, 2277, 29937, 3917, 310, 13623, 304, 437, 13, 12, 12, 3317, 29918, 949, 29918, 2435, 353, 313, 1311, 29889, 15550, 1839, 3317, 4058, 300, 2033, 448, 29871, 29945, 29897, 847, 1583, 29889, 10141, 1839, 949, 1271, 2033, 13, 12, 12, 2848, 847, 29922, 1583, 29889, 10141, 1839, 949, 1271, 2033, 13, 12, 12, 7778, 353, 5124, 13, 12, 12, 2277, 29937, 21493, 975, 1269, 10768, 297, 263, 1303, 2908, 13, 12, 12, 8000, 3309, 1405, 29871, 29900, 29901, 13, 12, 12, 12, 2277, 29937, 8878, 278, 2980, 5447, 13, 12, 12, 12, 5085, 353, 6571, 13, 12, 12, 12, 361, 3309, 1405, 4236, 29918, 949, 29918, 2435, 29901, 13, 12, 12, 12, 12, 5085, 1839, 1307, 29940, 2033, 353, 4236, 29918, 949, 29918, 2435, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 5085, 1839, 1307, 29940, 2033, 353, 3309, 13, 12, 12, 12, 2848, 22361, 6389, 1839, 1307, 29940, 2033, 13, 12, 12, 12, 2277, 29937, 3251, 403, 278, 3211, 13, 12, 12, 12, 5085, 1839, 17744, 2241, 2033, 353, 28915, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 12, 5085, 1839, 3035, 8353, 29950, 2033, 353, 313, 10030, 5099, 29871, 29947, 29897, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 12, 5085, 1839, 3035, 8353, 29965, 2033, 353, 313, 10030, 5099, 29871, 29896, 29953, 29897, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 12, 361, 451, 1583, 29889, 339, 2035, 29901, 13, 12, 12, 12, 12, 2158, 376, 6359, 292, 1273, 29875, 6262, 515, 3211, 29871, 29900, 29916, 29995, 29900, 29947, 29990, 29908, 1273, 313, 5085, 1839, 1307, 29940, 2033, 334, 1583, 29889, 10141, 1839, 949, 1271, 7464, 28915, 29897, 13, 12, 12, 12, 1272, 4619, 1583, 29889, 20967, 12657, 29907, 5773, 703, 29934, 29928, 29918, 10536, 24943, 613, 6389, 29897, 13, 12, 12, 12, 10030, 4619, 313, 5085, 1839, 1307, 29940, 2033, 334, 1583, 29889, 10141, 1839, 949, 1271, 11287, 847, 1583, 29889, 10141, 1839, 13193, 546, 10030, 2033, 13, 12, 12, 2457, 848, 13, 12, 12, 12, 13, 12, 2277, 29937, 1425, 559, 278, 11013, 4742, 13, 12, 2277, 29937, 3940, 29901, 2216, 1854, 565, 278, 274, 16434, 1734, 16199, 338, 2289, 4312, 856, 13, 12, 1753, 1425, 559, 8754, 1161, 29898, 1311, 1125, 13, 12, 12, 2277, 29937, 7437, 701, 278, 5285, 3838, 13, 12, 12, 16859, 29918, 9303, 353, 1583, 29889, 6359, 9207, 29954, 29956, 4339, 580, 13, 13, 12, 12, 2277, 29937, 21493, 304, 4380, 599, 3211, 313, 361, 278, 396, 310, 10930, 338, 7621, 1135, 29871, 29906, 29945, 29945, 29897, 13, 12, 12, 29876, 7445, 29879, 353, 313, 1311, 29889, 10141, 1839, 3358, 3881, 9812, 2033, 448, 1583, 29889, 10141, 1839, 3358, 29878, 9477, 340, 2033, 718, 29871, 29896, 29897, 847, 313, 1311, 29889, 10141, 1839, 261, 559, 1271, 2033, 847, 1583, 29889, 10141, 1839, 13193, 546, 10030, 11287, 13, 12, 12, 2962, 29918, 10030, 353, 1583, 29889, 10141, 1839, 3358, 29878, 9477, 340, 2033, 13, 12, 12, 8000, 302, 7445, 29879, 1405, 29871, 29900, 29901, 13, 12, 12, 12, 2277, 29937, 8878, 278, 2980, 5447, 13, 12, 12, 12, 5085, 353, 6571, 13, 13, 12, 12, 12, 361, 302, 7445, 29879, 1405, 29871, 29906, 29945, 29945, 29901, 13, 12, 12, 12, 12, 5085, 1839, 1307, 29940, 2033, 353, 29871, 29906, 29945, 29945, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 5085, 1839, 1307, 29940, 2033, 353, 302, 7445, 29879, 13, 12, 12, 12, 29876, 7445, 29879, 22361, 6389, 1839, 1307, 29940, 2033, 13, 12, 12, 12, 2277, 29937, 3251, 403, 278, 3211, 13, 12, 12, 12, 10030, 353, 1369, 29918, 10030, 13, 12, 12, 12, 5085, 1839, 17744, 2241, 2033, 353, 28915, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 12, 5085, 1839, 3035, 8353, 29950, 2033, 353, 313, 10030, 5099, 29871, 29947, 29897, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 12, 5085, 1839, 3035, 8353, 29965, 2033, 353, 313, 10030, 5099, 29871, 29896, 29953, 29897, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 12, 13, 12, 12, 12, 1311, 29889, 20967, 12657, 29907, 5773, 703, 1001, 29918, 10536, 24943, 613, 6389, 29897, 13, 12, 12, 12, 2962, 29918, 10030, 4619, 313, 1311, 29889, 10141, 1839, 261, 559, 1271, 2033, 847, 1583, 29889, 10141, 1839, 13193, 546, 10030, 11287, 334, 302, 7445, 29879, 13, 13, 12, 12, 2277, 29937, 14350, 278, 5285, 3838, 13, 12, 12, 1311, 29889, 6113, 9207, 29954, 29956, 4339, 29898, 16859, 29918, 9303, 29897, 13, 13, 12, 2277, 29937, 7523, 278, 2295, 3838, 13, 12, 1753, 7523, 9207, 29954, 29956, 4339, 29898, 1311, 1125, 13, 12, 12, 10030, 353, 313, 1311, 29889, 10141, 1839, 3358, 3881, 9812, 2033, 718, 29871, 29896, 29897, 448, 29871, 29947, 13, 12, 12, 2457, 1583, 29889, 6359, 8754, 1161, 29898, 10030, 29892, 29871, 29906, 29897, 13, 13, 12, 2277, 29937, 14350, 278, 2295, 3838, 964, 3370, 313, 9344, 29876, 29915, 29873, 4473, 701, 916, 848, 565, 2198, 7897, 13, 12, 1753, 14350, 9207, 29954, 29956, 4339, 29898, 1311, 29892, 274, 16434, 29918, 9303, 1125, 13, 12, 12, 2277, 29937, 14350, 278, 2295, 3838, 13, 12, 12, 5085, 353, 6571, 13, 12, 12, 5085, 1839, 1307, 29940, 2033, 353, 29871, 29896, 13, 12, 12, 10030, 353, 313, 1311, 29889, 10141, 1839, 3358, 3881, 9812, 2033, 718, 29871, 29896, 29897, 448, 313, 1311, 29889, 10141, 1839, 261, 559, 1271, 2033, 847, 1583, 29889, 10141, 1839, 13193, 546, 10030, 11287, 13, 12, 12, 5085, 1839, 17744, 2241, 2033, 353, 28915, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 5085, 1839, 3035, 8353, 29950, 2033, 353, 313, 10030, 5099, 29871, 29947, 29897, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 5085, 1839, 3035, 8353, 29965, 2033, 353, 313, 10030, 5099, 29871, 29896, 29953, 29897, 669, 29871, 29900, 29916, 4198, 13, 12, 12, 2277, 29937, 8878, 278, 848, 18203, 13, 12, 12, 5085, 1839, 14573, 2033, 353, 518, 29900, 29916, 4198, 29892, 29871, 29900, 29916, 4198, 29892, 29871, 29900, 29916, 4198, 29892, 29871, 29900, 29916, 29900, 29900, 29962, 334, 5135, 1311, 29889, 10141, 1839, 3539, 1271, 2033, 847, 29871, 29946, 29897, 448, 29871, 29906, 29897, 13, 12, 12, 1454, 474, 297, 274, 16434, 29918, 9303, 29901, 13, 12, 12, 12, 5085, 1839, 14573, 13359, 4397, 29898, 536, 29898, 29875, 876, 13, 12, 12, 1311, 29889, 20967, 12657, 29907, 5773, 703, 17755, 29918, 10536, 24943, 613, 6389, 29897, 13, 13, 13383, 13383, 13383, 13383, 7346, 4136, 2277, 29937, 13, 2277, 29937, 7525, 278, 8260, 278, 1404, 7274, 13, 13383, 13383, 13383, 13383, 7346, 4136, 2277, 29937, 13, 13, 2277, 29937, 25455, 13, 29886, 353, 349, 2965, 29906, 29946, 29943, 29918, 1184, 29887, 29898, 3991, 29892, 18896, 2290, 29897, 13, 29886, 29889, 27902, 353, 1798, 1598, 13, 29886, 29889, 339, 2035, 353, 751, 2035, 13, 13, 2277, 29937, 349, 3445, 598, 278, 1899, 322, 1065, 13, 361, 10516, 1275, 376, 12300, 1115, 13, 12, 2277, 29937, 1425, 559, 278, 11013, 13, 12, 29886, 29889, 2110, 559, 8754, 1161, 580, 12, 13, 12, 2277, 29937, 7523, 297, 278, 11013, 934, 13, 12, 361, 3497, 1275, 6213, 29901, 13, 12, 12, 27573, 580, 13, 12, 12, 9675, 29889, 13322, 29898, 29906, 29897, 13, 12, 29886, 29889, 6359, 2283, 29898, 2283, 29897, 13, 12, 2277, 29937, 2567, 2436, 304, 278, 11013, 13, 12, 1454, 413, 297, 282, 29889, 20970, 1445, 29889, 1272, 29889, 8149, 7295, 13, 12, 12, 2277, 29937, 16428, 267, 515, 278, 15090, 1445, 526, 297, 6262, 13, 12, 12, 2277, 29937, 3588, 304, 4742, 29915, 29879, 3211, 292, 11380, 937, 13, 12, 12, 29886, 29889, 6113, 8754, 1161, 29898, 29895, 847, 282, 29889, 10141, 1839, 13193, 546, 10030, 7464, 282, 29889, 20970, 1445, 29889, 1272, 29961, 29895, 2314, 13, 12, 2158, 376, 6113, 5858, 4866, 1213, 13, 12, 2277, 29937, 1334, 29915, 276, 2309, 29892, 8341, 701, 13, 12, 29886, 29889, 20967, 12657, 29907, 5773, 703, 5348, 6545, 29979, 29918, 8949, 1159, 13, 13, 2277, 29937, 4525, 8260, 526, 925, 1065, 411, 694, 916, 6273, 13, 23681, 10516, 297, 4852, 5348, 6545, 29979, 29918, 8949, 613, 376, 29934, 29928, 29918, 5348, 29908, 1125, 13, 12, 29886, 29889, 20967, 12657, 29907, 5773, 29898, 6255, 29897, 13, 13, 2277, 29937, 7523, 278, 11013, 964, 263, 934, 13, 23681, 10516, 1275, 376, 29934, 29928, 29918, 10536, 24943, 1115, 13, 12, 2158, 376, 4763, 292, 1303, 5858, 17794, 13, 12, 2277, 29937, 8561, 1854, 278, 10422, 471, 2183, 13, 12, 361, 3497, 1275, 6213, 29901, 13, 12, 12, 27573, 580, 13, 12, 12, 9675, 29889, 13322, 29898, 29906, 29897, 13, 12, 2277, 29937, 7523, 278, 4152, 11013, 714, 13, 12, 1272, 353, 282, 29889, 6359, 8754, 1161, 29898, 29886, 29889, 10141, 1839, 3358, 29878, 9477, 340, 7464, 5135, 29886, 29889, 10141, 1839, 3358, 3881, 9812, 2033, 718, 29871, 29896, 29897, 448, 282, 29889, 10141, 1839, 3358, 29878, 9477, 340, 11287, 334, 282, 29889, 10141, 1839, 13193, 546, 10030, 11287, 13, 12, 2277, 29937, 3462, 278, 848, 304, 278, 934, 13, 12, 29886, 29889, 1469, 1762, 2283, 29898, 29886, 29889, 10141, 1839, 3358, 29878, 9477, 340, 7464, 848, 29897, 12, 13, 12, 2277, 29937, 14350, 714, 278, 934, 13, 12, 29886, 29889, 6113, 2283, 29898, 2283, 29897, 13, 12, 2158, 376, 6359, 5858, 4866, 1213, 13, 13, 2277, 29937, 1425, 559, 278, 11013, 13, 23681, 10516, 1275, 376, 1001, 29918, 10536, 24943, 1115, 13, 12, 29886, 29889, 2110, 559, 8754, 1161, 580, 13, 13, 2277, 29937, 14350, 278, 11013, 515, 263, 934, 13, 23681, 10516, 1275, 376, 17755, 29918, 10536, 24943, 1115, 13, 12, 2158, 376, 4763, 292, 2436, 5858, 17794, 13, 12, 2277, 29937, 4673, 278, 934, 13, 12, 361, 3497, 1275, 6213, 29901, 13, 12, 12, 27573, 580, 13, 12, 12, 9675, 29889, 13322, 29898, 29906, 29897, 13, 12, 29886, 29889, 6359, 2283, 29898, 2283, 29897, 13, 12, 2277, 29937, 2567, 2436, 304, 278, 11013, 13, 12, 1454, 413, 297, 282, 29889, 20970, 1445, 29889, 1272, 29889, 8149, 7295, 13, 12, 12, 2277, 29937, 16428, 267, 515, 278, 15090, 1445, 526, 297, 6262, 13, 12, 12, 2277, 29937, 3588, 304, 4742, 29915, 29879, 3211, 292, 11380, 937, 13, 12, 12, 29886, 29889, 6113, 8754, 1161, 29898, 29895, 847, 282, 29889, 10141, 1839, 13193, 546, 10030, 7464, 282, 29889, 20970, 1445, 29889, 1272, 29961, 29895, 2314, 13, 12, 2158, 376, 6113, 5858, 4866, 1213, 13, 2 ]
sklearn_export/__init__.py
zwelz3/sklearn-export
4
119059
# -*- coding: utf-8 -*- from sklearn_export.Export import Export
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 2071, 19668, 29918, 15843, 29889, 26382, 1053, 1222, 637, 13, 2 ]
solver/__init__.py
mshrAndo/PyMCR
1
86666
import nmfsvd as nmfsvd import als as als
[ 1, 1053, 302, 29885, 29888, 4501, 29881, 408, 302, 29885, 29888, 4501, 29881, 30004, 13, 5215, 1620, 408, 1620, 2 ]
hchztests/tests/test_container_rappture.py
codedsk/hubcheck-hubzero-tests
1
1600995
<reponame>codedsk/hubcheck-hubzero-tests<gh_stars>1-10 import unittest import sys import os import pytest import re from string import Template import hubcheck from hubcheck.testcase import TestCase2 from hubcheck.shell import ContainerManager pytestmark = [ pytest.mark.container, pytest.mark.rappture, pytest.mark.weekly, pytest.mark.reboot ] SUB_SPACING = 12 TOOL_XML = """ <?xml version="1.0"?> <run> <tool> <about>Press Simulate to view results.</about> <command>@tool/fermi @driver</command> </tool> <input> <number id="Ef"> <about> <label>Fermi Level</label> <description>Energy at center of distribution.</description> </about> <units>eV</units> <min>-10eV</min> <max>10eV</max> <default>0.2556eV</default> </number> </input> </run> """.strip() @pytest.mark.rappture_c @pytest.mark.registereduser @pytest.mark.usefixtures('rappture_version') class TestContainerRapptureCApi(TestCase2): def setup_method(self,method): self.remove_files = [] # get user account info self.username,self.userpass = self.testdata.find_account_for('registeredworkspace') hubname = self.testdata.find_url_for('https') # access a tool session container cm = ContainerManager() self.ws = cm.access(host=hubname, username=self.username, password=self.userpass) self.ws.execute('cd $SESSIONDIR') self.sessiondir,es = self.ws.execute('pwd') def teardown_method(self,method): # remove the executable and config files for fname in self.remove_files: self.ws.execute('rm -f %s' % (fname)) # exit the workspace self.ws.close() def write_xml_file(self): # write xml file xmlfn = os.path.join(self.sessiondir,"tool.xml") self.ws.importfile(TOOL_XML,xmlfn,mode=0600,is_data=True) self.remove_files.append(xmlfn) def run_code(self,program,xmlfn='tool.xml'): # write program programfn = os.path.join(self.sessiondir,"program.c") self.ws.importfile(program,programfn,mode=0600,is_data=True) self.remove_files.append(programfn) # generate path for compiled executable compiledfn = os.path.join(self.sessiondir,'program') self.remove_files.append(compiledfn) # setup rappture environment self.ws.execute('. /etc/environ.sh') self.ws.execute('use -e -r %s' % (self.rappture_version)) # setup RAPPTURE_INCLUDE and RAPPTURE_LIB rpflags = '-I$RAPPTURE_PATH/include' rpflags += ' -L$RAPPTURE_PATH/lib -lrappture -lexpat -lz -lm' # compile the code command = 'gcc -o %s %s %s' % (compiledfn,rpflags,programfn) self.ws.execute(command) self.ws.execute('chmod 700 %s' % (compiledfn)) # run the code command = '%s %s' % (compiledfn,xmlfn) output,es = self.ws.execute(command,fail_on_exit_code=False) return output,es @pytest.mark.dsktest def test_rpLibrary_valid_path(self): """ rpLibrary() test the function using an xml file that exists on disk """ program = """ #include <stdio.h> #include "rappture.h" int main(int argc, char* argv[]) { RpLibrary* lib = NULL; int err = 1; lib = rpLibrary(argv[1]); if (lib != NULL) { err = 0; } return err; } """ self.write_xml_file() output,es = self.run_code(program) # check for success assert es == 0, \ "rpLibrary failed to open xml file, es = %s" % (es) @pytest.mark.skipif(True,reason="the rappture c api currently does not error on invalid path") def test_rpLibrary_invalid_path(self): """ rpLibrary() test the function using an xml file that does not exist on disk """ program = """ #include <stdio.h> #include "rappture.h" int main(int argc, char* argv[]) { RpLibrary* lib = NULL; int err = 0; lib = rpLibrary(argv[1]); if (lib == NULL) { err = 1; } return err; } """ xmlfn = "tool_does_not_exist.xml" output,es = self.run_code(program,xmlfn) # check for success assert es == 1, \ "rpLibrary successfully opened a file that does not exist: %s" \ % (xmlfn) @pytest.mark.skipif(True,reason="the rappture c api currently does not error on blank path") def test_rpLibrary_no_path(self): """ rpLibrary() test the function without giving a filename """ program = """ #include <stdio.h> #include "rappture.h" int main(int argc, char* argv[]) { RpLibrary* lib = NULL; int err = 0; lib = rpLibrary(""); if (lib == NULL) { err = 1; } return err; } """ output,es = self.run_code(program) # check for success assert es == 1, \ "rpLibrary initialized an object with blank filename" def test_rpLibrary_null_path(self): """ rpLibrary() test the function giving a NULL pointer """ program = """ #include <stdio.h> #include "rappture.h" int main(int argc, char* argv[]) { RpLibrary* lib = NULL; int err = 0; lib = rpLibrary(NULL); if (lib == NULL) { err = 1; } return err; } """ xmlfn = "tool_does_not_exist.xml" output,es = self.run_code(program,xmlfn) # check for success assert es == 0, \ "rpLibrary failed to initialize an object with NULL filename" def test_rpGetString_valid_path(self): """ rpGetString() test the function with a valid xml path """ path = "input.number(Ef).about.label" program = Template(""" #include <stdio.h> #include "rappture.h" int main(int argc, char* argv[]) { RpLibrary* lib = NULL; int err = 0; const char* val = NULL; lib = rpLibrary(argv[1]); if (lib == NULL) { err = 1; return err; } err = rpGetString(lib,"$path",&val); printf("%s",val); return err; } """).substitute(path=path) self.write_xml_file() output,es = self.run_code(program) # check for success assert es == 0, \ 'program exited with status %s while trying to call' % (es) \ + ' rpGetString with xml path %s' % (path) expected = 'Fermi Level' assert output == expected, \ "rpGetString returned the wrong data, expected: %s, received: %s" \ % (expected,output) @pytest.mark.skipif(True,reason="the rappture c api currently only returns 0 as an error code") def test_rpGetString_invalid_path(self): """ rpGetString() test that calling the function with an invalid xml path returns a non zero error code. """ path = "input.number(Ef).bad.path" program = Template(""" #include <stdio.h> #include "rappture.h" int main(int argc, char* argv[]) { RpLibrary* lib = NULL; int err = 0; const char* val = NULL; lib = rpLibrary(argv[1]); if (lib == NULL) { err = 1; return err; } err = rpGetString(lib,"$path",&val); if (err == 0) { printf("%s",val); } return err; } """).substitute(path=path) self.write_xml_file() output,es = self.run_code(program) # check for success assert es == 1, \ 'program exited with status %s while trying to call' % (es) \ + ' rpGetString with bad xml path %s' % (path) expected = '' assert output == expected, \ "rpGetString returned the wrong data, expected: %s, received: %s" \ % (expected,output) def test_rpGetString_null_retcstr(self): """ rpGetString() test that calling the function with a NULL retCStr non zero error code. """ path = "input.number(Ef).about.label" program = Template(""" #include <stdio.h> #include "rappture.h" int main(int argc, char* argv[]) { RpLibrary* lib = NULL; int err = 0; lib = rpLibrary(argv[1]); if (lib == NULL) { err = 1; return err; } err = rpGetString(lib,"$path",NULL); return err; } """).substitute(path=path) self.write_xml_file() output,es = self.run_code(program) # check for segfault assert es == 139, \ 'program exited with status %s while trying to call' % (es) \ + ' rpGetString with retCStr == NULL' def test_rpGetDouble_valid_path(self): """ rpGetDouble() test the function with a valid xml path """ path = "input.number(Ef).default" program = Template(""" #include <stdio.h> #include "rappture.h" int main(int argc, char* argv[]) { RpLibrary* lib = NULL; int err = 0; double val = 0.0; lib = rpLibrary(argv[1]); if (lib == NULL) { err = 1; return err; } err = rpGetDouble(lib,"$path",&val); printf("%g",val); return err; } """).substitute(path=path) self.write_xml_file() output,es = self.run_code(program) # check for success assert es == 0, \ 'program exited with status %s while trying to call' % (es) \ + ' rpGetDouble with xml path %s' % (path) expected = '0.2556' assert output == expected, \ "rpGetDouble returned the wrong data, expected: %s, received: %s" \ % (expected,output) @pytest.mark.skipif(True,reason="the rappture c api currently only returns 0 as an error code") def test_rpGetDouble_invalid_path(self): """ rpGetDouble() test that calling the function with an invalid xml path returns a non zero error code. """ path = "input.number(Ef).bad.path" program = Template(""" #include <stdio.h> #include "rappture.h" int main(int argc, char* argv[]) { RpLibrary* lib = NULL; int err = 0; double val = 0.0; lib = rpLibrary(argv[1]); if (lib == NULL) { err = 1; return err; } err = rpGetDouble(lib,"$path",&val); if (err == 0) { printf("%g",val); } return err; } """).substitute(path=path) self.write_xml_file() output,es = self.run_code(program) # check for success assert es != 0, \ 'program exited with status %s while trying to call' % (es) \ + ' rpGetDouble with bad xml path %s' % (path) expected = '0.2556' assert output == '', \ "rpGetDouble returned the wrong data, expected: %s, received: %s" \ % (expected,output) def test_rpGetDouble_null_retdval(self): """ rpGetDouble() test that calling the function with a NULL retDVal returns a non zero error code. """ path = "input.number(Ef).default" program = Template(""" #include <stdio.h> #include "rappture.h" int main(int argc, char* argv[]) { RpLibrary* lib = NULL; int err = 0; lib = rpLibrary(argv[1]); if (lib == NULL) { err = 1; return err; } err = rpGetDouble(lib,"$path",NULL); return err; } """).substitute(path=path) self.write_xml_file() output,es = self.run_code(program) # check for segfault assert es == 139, \ 'program exited with status %s while trying to call' % (es) \ + ' rpGetDouble with retDVal == NULL' def test_rpPutString_valid_path_valid_value(self): """ rpPutString() test the function with a valid xml path and valid value """ path = "output.string.current" val = "my new data" program = Template(""" #include <stdio.h> #include "rappture.h" int main(int argc, char* argv[]) { RpLibrary* lib = NULL; int err = 0; int append = 0; const char *path = "$path"; const char *value = "$val"; const char *rvalue = NULL; lib = rpLibrary(argv[1]); if (lib == NULL) { err = 1; return err; } err = rpPutString(lib,path,value,append); rpGetString(lib,path,&rvalue); printf("%s",rvalue); return err; } """).substitute(path=path,val=val) self.write_xml_file() output,es = self.run_code(program) # check for success assert es == 0, \ 'program exited with status %s while trying to call' % (es) \ + ' rpPutString with xml path %s and string %s' % (path,val) expected = val assert output == expected, \ "rpPutString returned the wrong data, expected: %s, received: %s" \ % (expected,output) @pytest.mark.skipif(True,reason="the rappture c api currently only returns 0 as an error code") def test_rpPutString_invalid_path_valid_value(self): """ rpPutString() test the function with an invalid xml path and valid value """ path = "output..string.current" val = "my new data" program = Template(""" #include <stdio.h> #include "rappture.h" int main(int argc, char* argv[]) { RpLibrary* lib = NULL; int err = 0; int append = 0; const char *path = "$path"; const char *value = "$val"; const char *rvalue = NULL; lib = rpLibrary(argv[1]); if (lib == NULL) { err = 1; return err; } err = rpPutString(lib,path,value,append); rpGetString(lib,path,&rvalue); printf("%s",rvalue); return err; } """).substitute(path=path,val=val) self.write_xml_file() output,es = self.run_code(program) # check for success assert es != 0, \ 'program exited with status %s while trying to call' % (es) \ + ' rpPutString with xml path %s and string %s' % (path,val) def test_rpPutString_valid_path_invalid_value(self): """ rpPutString() test the function with a valid xml path and invalid value """ path = "output.string.current" program = Template(""" #include <stdio.h> #include "rappture.h" int main(int argc, char* argv[]) { RpLibrary* lib = NULL; int err = 0; int append = 0; const char *path = "$path"; const char *value = NULL; const char *rvalue = NULL; lib = rpLibrary(argv[1]); if (lib == NULL) { err = 1; return err; } err = rpPutString(lib,path,value,append); rpGetString(lib,path,&rvalue); printf("%s",rvalue); return err; } """).substitute(path=path) self.write_xml_file() output,es = self.run_code(program) # check for success assert es != 139, \ 'program exited with status %s while trying to call' % (es) \ + ' rpPutString with xml path %s and NULL string' % (path) @pytest.mark.rappture_python @pytest.mark.registereduser @pytest.mark.usefixtures('rappture_version') class TestContainerRappturePythonApi(TestCase2): def setup_method(self,method): self.remove_files = [] # get user account info self.username,self.userpass = self.testdata.find_account_for('registeredworkspace') hubname = self.testdata.find_url_for('https') # access a tool session container cm = ContainerManager() self.ws = cm.access(host=hubname, username=self.username, password=self.userpass) self.ws.execute('cd $SESSIONDIR') self.sessiondir,es = self.ws.execute('pwd') def teardown_method(self,method): # remove the executable and config files for fname in self.remove_files: self.ws.execute('rm -f %s' % (fname)) # exit the workspace self.ws.close() def write_xml_file(self): # write xml file xmlfn = os.path.join(self.sessiondir,"tool.xml") self.ws.importfile(TOOL_XML,xmlfn,mode=0600,is_data=True) self.remove_files.append(xmlfn) def run_code(self,program,xmlfn='tool.xml'): # write program programfn = os.path.join(self.sessiondir,"program.py") self.ws.importfile(program,programfn,mode=0600,is_data=True) self.remove_files.append(programfn) # setup rappture environment self.ws.execute('. /etc/environ.sh') self.ws.execute('use -e -r %s' % (self.rappture_version)) # run the code command = 'python %s %s' % (programfn,xmlfn) output,es = self.ws.execute(command,fail_on_exit_code=False) return output,es def test_library_valid_path(self): """ Rappture.library() test the function using an xml file that exists on disk """ program = """ import sys import Rappture lib = Rappture.library(sys.argv[1]) if lib is None: raise Exception("failed to open xml file: %s" % (sys.argv[1])) sys.exit() """ program = re.sub('\n {%d}' % (SUB_SPACING),'\n',program,flags=re.M) self.write_xml_file() output,es = self.run_code(program) # check for success assert es == 0, \ "Rappture.library failed to open xml file: %s" % (output) @pytest.mark.skipif(True,reason="the rappture python api currently does not error on invalid path") def test_library_invalid_path(self): """ Rappture.library() test the function using an xml file that does not exist on disk """ program = """ import sys import Rappture lib = Rappture.library(sys.argv[1]) sys.exit() """ program = re.sub('\n {%d}' % (SUB_SPACING),'\n',program,flags=re.M) xmlfn = "tool_does_not_exist.xml" output,es = self.run_code(program,xmlfn) # check for success assert es == 1, \ "Rappture.library successfully opened a file that does not exist: %s" \ % (xmlfn) @pytest.mark.skipif(True,reason="the rappture python api currently does not error on blank path") def test_library_no_path(self): """ Rappture.library() test the function without giving a filename """ program = """ import sys import Rappture lib = Rappture.library('') sys.exit() """ program = re.sub('\n {%d}' % (SUB_SPACING),'\n',program,flags=re.M) output,es = self.run_code(program) # check for success assert es == 1, \ "Rappture.library initialized an object with blank filename" def test_library_none_path(self): """ Rappture.library() test the function giving a None object """ program = """ import sys import Rappture lib = Rappture.library(None) sys.exit() """ program = re.sub('\n {%d}' % (SUB_SPACING),'\n',program,flags=re.M) output,es = self.run_code(program) # check for success assert es == 1, \ "Rappture.library initialized an object with 'None' filename" def test_get_valid_path(self): """ get() test the function with a valid xml path """ path = "input.number(Ef).about.label" program = Template(""" import sys import Rappture val = None lib = Rappture.library(sys.argv[1]) if lib is None: raise Exception("failed to open xml file: %s" % (sys.argv[1])) val = lib.get('$path') print "%s" % (val) sys.exit() """).substitute(path=path) program = re.sub('\n {%d}' % (SUB_SPACING),'\n',program,flags=re.M) self.write_xml_file() output,es = self.run_code(program) # check for success assert es == 0, \ 'program exited with status %s while trying to call' % (es) \ + ' get() with xml path %s' % (path) expected = 'Fermi Level' assert output == expected, \ "get() returned the wrong data, expected: %s, received: %s" \ % (expected,output) @pytest.mark.skipif(True,reason="the rappture python api currently does not error on bad path") def test_get_invalid_path(self): """ get() test that calling the function with an invalid xml path returns a non zero error code. """ path = "input.number(Ef).bad.path" program = Template(""" import sys import Rappture val = None lib = Rappture.library(sys.argv[1]) if lib is None: raise Exception("failed to open xml file: %s" % (sys.argv[1])) val = lib.get('$path') print "%s" % (val) sys.exit() """).substitute(path=path) program = re.sub('\n {%d})' % (SUB_SPACING),'\n',program,flags=re.M) self.write_xml_file() output,es = self.run_code(program) # check for success assert es == 1, \ 'program exited with status %s while trying to call' % (es) \ + ' get() with bad xml path %s' % (path) expected = '' assert output == expected, \ "get() returned the wrong data, expected: %s, received: %s" \ % (expected,output) def test_get_none_path(self): """ get() test that calling the function with a None path returns a TypeError """ program = """ import sys import Rappture val = None lib = Rappture.library(sys.argv[1]) if lib is None: raise Exception("failed to open xml file: %s" % (sys.argv[1])) val = lib.get(None) sys.exit() """ program = re.sub('\n {%d}' % (SUB_SPACING),'\n',program,flags=re.M) self.write_xml_file() output,es = self.run_code(program) # check for error code assert es == 1, \ 'program exited with status %s while trying to call' % (es) \ + ' get() with path == None' # check for TypeError in output assert re.search("TypeError",output) is not None, \ 'program did not exit with a TypeError: %s' % (output) def test_put_valid_path_valid_value(self): """ put() test the function with a valid xml path and valid value """ path = "output.string.current" value = "my new data" program = Template(""" import sys import Rappture path = '$path' value = '$value' lib = Rappture.library(sys.argv[1]) if lib is None: raise Exception("failed to open xml file: %s" % (sys.argv[1])) lib.put(path,value) rval = lib.get(path) if value != rval: raise Exception("value stored differs from value returned." + "\\nstored: %s" % (value) + "\\nreturned: %s" % (rval)) sys.exit() """).substitute(path=path,value=value) program = re.sub('\n {%d}' % (SUB_SPACING),'\n',program,flags=re.M) self.write_xml_file() output,es = self.run_code(program) # check for success assert es == 0, \ 'program exited with status %s while trying to call' % (es) \ + ' put() with xml path %s and string %s: %s' % (path,value,output)
[ 1, 529, 276, 1112, 420, 29958, 29659, 808, 29914, 29882, 431, 3198, 29899, 29882, 431, 9171, 29899, 21150, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 443, 27958, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 11451, 1688, 13, 5215, 337, 13, 3166, 1347, 1053, 25663, 13, 13, 5215, 19766, 3198, 13, 3166, 19766, 3198, 29889, 1688, 4878, 1053, 4321, 8259, 29906, 13, 3166, 19766, 3198, 29889, 15903, 1053, 21679, 3260, 13, 13, 13, 2272, 1688, 3502, 353, 518, 11451, 1688, 29889, 3502, 29889, 7611, 29892, 13, 1669, 11451, 1688, 29889, 3502, 29889, 336, 407, 29873, 545, 29892, 13, 1669, 11451, 1688, 29889, 3502, 29889, 18448, 368, 29892, 13, 1669, 11451, 1688, 29889, 3502, 29889, 276, 4777, 13, 632, 4514, 13, 13, 13, 20633, 29918, 5550, 2477, 4214, 353, 29871, 29896, 29906, 13, 13, 4986, 5607, 29918, 9165, 353, 9995, 13, 8169, 3134, 1873, 543, 29896, 29889, 29900, 18943, 13, 29966, 3389, 29958, 13, 1678, 529, 10154, 29958, 13, 4706, 529, 12717, 29958, 10923, 3439, 5987, 304, 1776, 2582, 21106, 12717, 29958, 13, 4706, 529, 6519, 29958, 29992, 10154, 29914, 571, 2460, 732, 9465, 829, 6519, 29958, 13, 1678, 1533, 10154, 29958, 13, 1678, 529, 2080, 29958, 13, 4706, 529, 4537, 1178, 543, 29923, 29888, 1013, 13, 9651, 529, 12717, 29958, 13, 18884, 529, 1643, 29958, 29943, 837, 29875, 21597, 829, 1643, 29958, 13, 18884, 529, 8216, 29958, 29923, 1089, 1927, 472, 4818, 310, 4978, 21106, 8216, 29958, 13, 9651, 1533, 12717, 29958, 13, 9651, 529, 348, 1169, 29958, 29872, 29963, 829, 348, 1169, 29958, 13, 9651, 529, 1195, 29958, 29899, 29896, 29900, 29872, 29963, 829, 1195, 29958, 13, 9651, 529, 3317, 29958, 29896, 29900, 29872, 29963, 829, 3317, 29958, 13, 9651, 529, 4381, 29958, 29900, 29889, 29906, 29945, 29945, 29953, 29872, 29963, 829, 4381, 29958, 13, 4706, 1533, 4537, 29958, 13, 1678, 1533, 2080, 29958, 13, 829, 3389, 29958, 13, 15945, 1642, 17010, 580, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 336, 407, 29873, 545, 29918, 29883, 13, 29992, 2272, 1688, 29889, 3502, 29889, 9573, 287, 1792, 13, 29992, 2272, 1688, 29889, 3502, 29889, 1509, 7241, 486, 1973, 877, 336, 407, 29873, 545, 29918, 3259, 1495, 13, 1990, 4321, 7895, 29934, 932, 29873, 545, 5454, 1631, 29898, 3057, 8259, 29906, 1125, 13, 13, 13, 1678, 822, 6230, 29918, 5696, 29898, 1311, 29892, 5696, 1125, 13, 13, 4706, 1583, 29889, 5992, 29918, 5325, 353, 5159, 13, 13, 4706, 396, 679, 1404, 3633, 5235, 13, 4706, 1583, 29889, 6786, 29892, 1311, 29889, 1792, 3364, 353, 1583, 29889, 1688, 1272, 29889, 2886, 29918, 10149, 29918, 1454, 877, 9573, 287, 1287, 3493, 1495, 13, 4706, 19766, 978, 353, 1583, 29889, 1688, 1272, 29889, 2886, 29918, 2271, 29918, 1454, 877, 991, 1495, 13, 13, 4706, 396, 2130, 263, 5780, 4867, 5639, 13, 4706, 7477, 353, 21679, 3260, 580, 13, 4706, 1583, 29889, 5652, 353, 7477, 29889, 5943, 29898, 3069, 29922, 29882, 431, 978, 29892, 13, 462, 9651, 8952, 29922, 1311, 29889, 6786, 29892, 13, 462, 9651, 4800, 29922, 1311, 29889, 1792, 3364, 29897, 13, 13, 4706, 1583, 29889, 5652, 29889, 7978, 877, 2252, 395, 17493, 9464, 1495, 13, 4706, 1583, 29889, 7924, 3972, 29892, 267, 353, 1583, 29889, 5652, 29889, 7978, 877, 29886, 9970, 1495, 13, 13, 13, 1678, 822, 734, 538, 776, 29918, 5696, 29898, 1311, 29892, 5696, 1125, 13, 13, 4706, 396, 3349, 278, 16813, 322, 2295, 2066, 13, 4706, 363, 285, 978, 297, 1583, 29889, 5992, 29918, 5325, 29901, 13, 9651, 1583, 29889, 5652, 29889, 7978, 877, 1758, 448, 29888, 1273, 29879, 29915, 1273, 313, 29888, 978, 876, 13, 13, 4706, 396, 6876, 278, 664, 3493, 13, 4706, 1583, 29889, 5652, 29889, 5358, 580, 13, 13, 13, 1678, 822, 2436, 29918, 3134, 29918, 1445, 29898, 1311, 1125, 13, 13, 4706, 396, 2436, 4903, 934, 13, 4706, 4903, 9144, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 7924, 3972, 1699, 10154, 29889, 3134, 1159, 13, 4706, 1583, 29889, 5652, 29889, 5215, 1445, 29898, 4986, 5607, 29918, 9165, 29892, 3134, 9144, 29892, 8513, 29922, 29900, 29953, 29900, 29900, 29892, 275, 29918, 1272, 29922, 5574, 29897, 13, 4706, 1583, 29889, 5992, 29918, 5325, 29889, 4397, 29898, 3134, 9144, 29897, 13, 13, 13, 1678, 822, 1065, 29918, 401, 29898, 1311, 29892, 8860, 29892, 3134, 9144, 2433, 10154, 29889, 3134, 29374, 13, 13, 4706, 396, 2436, 1824, 13, 4706, 1824, 9144, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 7924, 3972, 1699, 8860, 29889, 29883, 1159, 13, 4706, 1583, 29889, 5652, 29889, 5215, 1445, 29898, 8860, 29892, 8860, 9144, 29892, 8513, 29922, 29900, 29953, 29900, 29900, 29892, 275, 29918, 1272, 29922, 5574, 29897, 13, 4706, 1583, 29889, 5992, 29918, 5325, 29889, 4397, 29898, 8860, 9144, 29897, 13, 13, 4706, 396, 5706, 2224, 363, 13126, 16813, 13, 4706, 6633, 2176, 29876, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 7924, 3972, 5501, 8860, 1495, 13, 4706, 1583, 29889, 5992, 29918, 5325, 29889, 4397, 29898, 12198, 2176, 29876, 29897, 13, 13, 4706, 396, 6230, 12468, 29873, 545, 5177, 13, 4706, 1583, 29889, 5652, 29889, 7978, 12839, 847, 7070, 29914, 21813, 29889, 845, 1495, 13, 4706, 1583, 29889, 5652, 29889, 7978, 877, 1509, 448, 29872, 448, 29878, 1273, 29879, 29915, 1273, 313, 1311, 29889, 336, 407, 29873, 545, 29918, 3259, 876, 13, 13, 4706, 396, 6230, 390, 3301, 7982, 11499, 29918, 1177, 6154, 29965, 2287, 322, 390, 3301, 7982, 11499, 29918, 5265, 29933, 13, 4706, 364, 29886, 15764, 29871, 353, 17411, 29902, 29938, 29934, 3301, 7982, 11499, 29918, 10145, 29914, 2856, 29915, 13, 4706, 364, 29886, 15764, 4619, 525, 448, 29931, 29938, 29934, 3301, 7982, 11499, 29918, 10145, 29914, 1982, 448, 29880, 336, 407, 29873, 545, 448, 2506, 5031, 448, 29880, 29920, 448, 21457, 29915, 13, 13, 4706, 396, 6633, 278, 775, 13, 4706, 1899, 353, 525, 19644, 448, 29877, 1273, 29879, 1273, 29879, 1273, 29879, 29915, 1273, 313, 12198, 2176, 29876, 29892, 19080, 15764, 29892, 8860, 9144, 29897, 13, 4706, 1583, 29889, 5652, 29889, 7978, 29898, 6519, 29897, 13, 4706, 1583, 29889, 5652, 29889, 7978, 877, 305, 1545, 29871, 29955, 29900, 29900, 1273, 29879, 29915, 1273, 313, 12198, 2176, 29876, 876, 13, 13, 4706, 396, 1065, 278, 775, 13, 4706, 1899, 353, 14210, 29879, 1273, 29879, 29915, 1273, 313, 12198, 2176, 29876, 29892, 3134, 9144, 29897, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 5652, 29889, 7978, 29898, 6519, 29892, 14057, 29918, 265, 29918, 13322, 29918, 401, 29922, 8824, 29897, 13, 13, 4706, 736, 1962, 29892, 267, 13, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 29881, 808, 1688, 13, 1678, 822, 1243, 29918, 19080, 12284, 29918, 3084, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 364, 29886, 12284, 580, 13, 4706, 1243, 278, 740, 773, 385, 4903, 934, 393, 4864, 373, 8086, 13, 4706, 9995, 13, 13, 4706, 1824, 353, 9995, 13, 9651, 396, 2856, 529, 23656, 29889, 29882, 29958, 13, 9651, 396, 2856, 376, 336, 407, 29873, 545, 29889, 29882, 29908, 13, 13, 9651, 938, 1667, 29898, 524, 1852, 29883, 29892, 1373, 29930, 1852, 29894, 23076, 426, 13, 13, 18884, 390, 29886, 12284, 29930, 4303, 353, 4265, 29936, 13, 18884, 938, 4589, 353, 29871, 29896, 29936, 13, 13, 18884, 4303, 353, 364, 29886, 12284, 29898, 19218, 29961, 29896, 5691, 13, 13, 18884, 565, 313, 1982, 2804, 4265, 29897, 426, 13, 462, 1678, 4589, 353, 29871, 29900, 29936, 13, 18884, 500, 13, 13, 18884, 736, 4589, 29936, 13, 9651, 500, 13, 4706, 9995, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29900, 29892, 320, 13, 9651, 376, 19080, 12284, 5229, 304, 1722, 4903, 934, 29892, 831, 353, 1273, 29879, 29908, 1273, 313, 267, 29897, 13, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 11014, 361, 29898, 5574, 29892, 23147, 543, 1552, 12468, 29873, 545, 274, 7882, 5279, 947, 451, 1059, 373, 8340, 2224, 1159, 13, 1678, 822, 1243, 29918, 19080, 12284, 29918, 20965, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 364, 29886, 12284, 580, 13, 4706, 1243, 278, 740, 773, 385, 4903, 934, 393, 947, 451, 1863, 373, 8086, 13, 4706, 9995, 13, 13, 4706, 1824, 353, 9995, 13, 9651, 396, 2856, 529, 23656, 29889, 29882, 29958, 13, 9651, 396, 2856, 376, 336, 407, 29873, 545, 29889, 29882, 29908, 13, 13, 9651, 938, 1667, 29898, 524, 1852, 29883, 29892, 1373, 29930, 1852, 29894, 23076, 426, 13, 13, 18884, 390, 29886, 12284, 29930, 4303, 353, 4265, 29936, 13, 18884, 938, 4589, 353, 29871, 29900, 29936, 13, 13, 18884, 4303, 353, 364, 29886, 12284, 29898, 19218, 29961, 29896, 5691, 13, 13, 18884, 565, 313, 1982, 1275, 4265, 29897, 426, 13, 462, 1678, 4589, 353, 29871, 29896, 29936, 13, 18884, 500, 13, 13, 18884, 736, 4589, 29936, 13, 9651, 500, 13, 4706, 9995, 13, 13, 13, 4706, 4903, 9144, 353, 376, 10154, 29918, 13221, 29918, 1333, 29918, 28997, 29889, 3134, 29908, 13, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29892, 3134, 9144, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29896, 29892, 320, 13, 9651, 376, 19080, 12284, 8472, 6496, 263, 934, 393, 947, 451, 1863, 29901, 1273, 29879, 29908, 320, 13, 9651, 1273, 313, 3134, 9144, 29897, 13, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 11014, 361, 29898, 5574, 29892, 23147, 543, 1552, 12468, 29873, 545, 274, 7882, 5279, 947, 451, 1059, 373, 9654, 2224, 1159, 13, 1678, 822, 1243, 29918, 19080, 12284, 29918, 1217, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 364, 29886, 12284, 580, 13, 4706, 1243, 278, 740, 1728, 6820, 263, 10422, 13, 4706, 9995, 13, 13, 4706, 1824, 353, 9995, 13, 9651, 396, 2856, 529, 23656, 29889, 29882, 29958, 13, 9651, 396, 2856, 376, 336, 407, 29873, 545, 29889, 29882, 29908, 13, 13, 9651, 938, 1667, 29898, 524, 1852, 29883, 29892, 1373, 29930, 1852, 29894, 23076, 426, 13, 13, 18884, 390, 29886, 12284, 29930, 4303, 353, 4265, 29936, 13, 18884, 938, 4589, 353, 29871, 29900, 29936, 13, 13, 18884, 4303, 353, 364, 29886, 12284, 703, 1496, 13, 13, 18884, 565, 313, 1982, 1275, 4265, 29897, 426, 13, 462, 1678, 4589, 353, 29871, 29896, 29936, 13, 18884, 500, 13, 13, 18884, 736, 4589, 29936, 13, 9651, 500, 13, 4706, 9995, 13, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29896, 29892, 320, 13, 9651, 376, 19080, 12284, 16601, 385, 1203, 411, 9654, 10422, 29908, 13, 13, 13, 1678, 822, 1243, 29918, 19080, 12284, 29918, 4304, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 364, 29886, 12284, 580, 13, 4706, 1243, 278, 740, 6820, 263, 4265, 4879, 13, 4706, 9995, 13, 13, 4706, 1824, 353, 9995, 13, 9651, 396, 2856, 529, 23656, 29889, 29882, 29958, 13, 9651, 396, 2856, 376, 336, 407, 29873, 545, 29889, 29882, 29908, 13, 13, 9651, 938, 1667, 29898, 524, 1852, 29883, 29892, 1373, 29930, 1852, 29894, 23076, 426, 13, 13, 18884, 390, 29886, 12284, 29930, 4303, 353, 4265, 29936, 13, 18884, 938, 4589, 353, 29871, 29900, 29936, 13, 13, 18884, 4303, 353, 364, 29886, 12284, 29898, 10074, 416, 13, 13, 18884, 565, 313, 1982, 1275, 4265, 29897, 426, 13, 462, 1678, 4589, 353, 29871, 29896, 29936, 13, 18884, 500, 13, 13, 18884, 736, 4589, 29936, 13, 9651, 500, 13, 4706, 9995, 13, 13, 13, 4706, 4903, 9144, 353, 376, 10154, 29918, 13221, 29918, 1333, 29918, 28997, 29889, 3134, 29908, 13, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29892, 3134, 9144, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29900, 29892, 320, 13, 9651, 376, 19080, 12284, 5229, 304, 11905, 385, 1203, 411, 4265, 10422, 29908, 13, 13, 13, 1678, 822, 1243, 29918, 19080, 2577, 1231, 29918, 3084, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 364, 29886, 2577, 1231, 580, 13, 4706, 1243, 278, 740, 411, 263, 2854, 4903, 2224, 13, 4706, 9995, 13, 13, 4706, 2224, 353, 376, 2080, 29889, 4537, 29898, 29923, 29888, 467, 12717, 29889, 1643, 29908, 13, 13, 4706, 1824, 353, 25663, 703, 15945, 13, 9651, 396, 2856, 529, 23656, 29889, 29882, 29958, 13, 9651, 396, 2856, 376, 336, 407, 29873, 545, 29889, 29882, 29908, 13, 13, 9651, 938, 1667, 29898, 524, 1852, 29883, 29892, 1373, 29930, 1852, 29894, 23076, 426, 13, 13, 18884, 390, 29886, 12284, 29930, 4303, 353, 4265, 29936, 13, 18884, 938, 4589, 353, 29871, 29900, 29936, 13, 18884, 1040, 1373, 29930, 659, 353, 4265, 29936, 13, 13, 18884, 4303, 353, 364, 29886, 12284, 29898, 19218, 29961, 29896, 5691, 13, 13, 18884, 565, 313, 1982, 1275, 4265, 29897, 426, 13, 462, 1678, 4589, 353, 29871, 29896, 29936, 13, 462, 1678, 736, 4589, 29936, 13, 18884, 500, 13, 13, 18884, 4589, 353, 364, 29886, 2577, 1231, 29898, 1982, 1699, 29938, 2084, 613, 29987, 791, 416, 13, 13, 18884, 7571, 11702, 29879, 613, 791, 416, 13, 13, 18884, 736, 4589, 29936, 13, 9651, 500, 13, 4706, 5124, 2564, 22492, 12356, 29898, 2084, 29922, 2084, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29900, 29892, 320, 13, 9651, 525, 8860, 429, 1573, 411, 4660, 1273, 29879, 1550, 1811, 304, 1246, 29915, 1273, 313, 267, 29897, 320, 13, 9651, 718, 525, 364, 29886, 2577, 1231, 411, 4903, 2224, 1273, 29879, 29915, 1273, 313, 2084, 29897, 13, 13, 4706, 3806, 353, 525, 29943, 837, 29875, 21597, 29915, 13, 4706, 4974, 1962, 1275, 3806, 29892, 320, 13, 9651, 376, 19080, 2577, 1231, 4133, 278, 2743, 848, 29892, 3806, 29901, 1273, 29879, 29892, 4520, 29901, 1273, 29879, 29908, 320, 13, 9651, 1273, 313, 9684, 29892, 4905, 29897, 13, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 11014, 361, 29898, 5574, 29892, 23147, 543, 1552, 12468, 29873, 545, 274, 7882, 5279, 871, 3639, 29871, 29900, 408, 385, 1059, 775, 1159, 13, 1678, 822, 1243, 29918, 19080, 2577, 1231, 29918, 20965, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 364, 29886, 2577, 1231, 580, 13, 13, 4706, 1243, 393, 5432, 278, 740, 411, 385, 8340, 4903, 2224, 3639, 263, 13, 4706, 1661, 5225, 1059, 775, 29889, 13, 4706, 9995, 13, 13, 4706, 2224, 353, 376, 2080, 29889, 4537, 29898, 29923, 29888, 467, 12313, 29889, 2084, 29908, 13, 13, 4706, 1824, 353, 25663, 703, 15945, 13, 9651, 396, 2856, 529, 23656, 29889, 29882, 29958, 13, 9651, 396, 2856, 376, 336, 407, 29873, 545, 29889, 29882, 29908, 13, 13, 9651, 938, 1667, 29898, 524, 1852, 29883, 29892, 1373, 29930, 1852, 29894, 23076, 426, 13, 13, 18884, 390, 29886, 12284, 29930, 4303, 353, 4265, 29936, 13, 18884, 938, 4589, 353, 29871, 29900, 29936, 13, 18884, 1040, 1373, 29930, 659, 353, 4265, 29936, 13, 13, 18884, 4303, 353, 364, 29886, 12284, 29898, 19218, 29961, 29896, 5691, 13, 13, 18884, 565, 313, 1982, 1275, 4265, 29897, 426, 13, 462, 1678, 4589, 353, 29871, 29896, 29936, 13, 462, 1678, 736, 4589, 29936, 13, 18884, 500, 13, 13, 18884, 4589, 353, 364, 29886, 2577, 1231, 29898, 1982, 1699, 29938, 2084, 613, 29987, 791, 416, 13, 13, 18884, 565, 313, 3127, 1275, 29871, 29900, 29897, 426, 13, 462, 1678, 7571, 11702, 29879, 613, 791, 416, 13, 18884, 500, 13, 13, 18884, 736, 4589, 29936, 13, 9651, 500, 13, 4706, 5124, 2564, 22492, 12356, 29898, 2084, 29922, 2084, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29896, 29892, 320, 13, 9651, 525, 8860, 429, 1573, 411, 4660, 1273, 29879, 1550, 1811, 304, 1246, 29915, 1273, 313, 267, 29897, 320, 13, 9651, 718, 525, 364, 29886, 2577, 1231, 411, 4319, 4903, 2224, 1273, 29879, 29915, 1273, 313, 2084, 29897, 13, 13, 4706, 3806, 353, 6629, 13, 4706, 4974, 1962, 1275, 3806, 29892, 320, 13, 9651, 376, 19080, 2577, 1231, 4133, 278, 2743, 848, 29892, 3806, 29901, 1273, 29879, 29892, 4520, 29901, 1273, 29879, 29908, 320, 13, 9651, 1273, 313, 9684, 29892, 4905, 29897, 13, 13, 13, 1678, 822, 1243, 29918, 19080, 2577, 1231, 29918, 4304, 29918, 2267, 29883, 710, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 364, 29886, 2577, 1231, 580, 13, 13, 4706, 1243, 393, 5432, 278, 740, 411, 263, 4265, 3240, 29907, 5015, 13, 4706, 1661, 5225, 1059, 775, 29889, 13, 4706, 9995, 13, 13, 4706, 2224, 353, 376, 2080, 29889, 4537, 29898, 29923, 29888, 467, 12717, 29889, 1643, 29908, 13, 13, 4706, 1824, 353, 25663, 703, 15945, 13, 9651, 396, 2856, 529, 23656, 29889, 29882, 29958, 13, 9651, 396, 2856, 376, 336, 407, 29873, 545, 29889, 29882, 29908, 13, 13, 9651, 938, 1667, 29898, 524, 1852, 29883, 29892, 1373, 29930, 1852, 29894, 23076, 426, 13, 13, 18884, 390, 29886, 12284, 29930, 4303, 353, 4265, 29936, 13, 18884, 938, 4589, 353, 29871, 29900, 29936, 13, 13, 18884, 4303, 353, 364, 29886, 12284, 29898, 19218, 29961, 29896, 5691, 13, 13, 18884, 565, 313, 1982, 1275, 4265, 29897, 426, 13, 462, 1678, 4589, 353, 29871, 29896, 29936, 13, 462, 1678, 736, 4589, 29936, 13, 18884, 500, 13, 13, 18884, 4589, 353, 364, 29886, 2577, 1231, 29898, 1982, 1699, 29938, 2084, 613, 10074, 416, 13, 13, 18884, 736, 4589, 29936, 13, 9651, 500, 13, 4706, 5124, 2564, 22492, 12356, 29898, 2084, 29922, 2084, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2377, 27934, 13, 4706, 4974, 831, 1275, 29871, 29896, 29941, 29929, 29892, 320, 13, 9651, 525, 8860, 429, 1573, 411, 4660, 1273, 29879, 1550, 1811, 304, 1246, 29915, 1273, 313, 267, 29897, 320, 13, 9651, 718, 525, 364, 29886, 2577, 1231, 411, 3240, 29907, 5015, 1275, 4265, 29915, 13, 13, 13, 1678, 822, 1243, 29918, 19080, 2577, 11843, 29918, 3084, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 364, 29886, 2577, 11843, 580, 13, 4706, 1243, 278, 740, 411, 263, 2854, 4903, 2224, 13, 4706, 9995, 13, 13, 4706, 2224, 353, 376, 2080, 29889, 4537, 29898, 29923, 29888, 467, 4381, 29908, 13, 13, 4706, 1824, 353, 25663, 703, 15945, 13, 9651, 396, 2856, 529, 23656, 29889, 29882, 29958, 13, 9651, 396, 2856, 376, 336, 407, 29873, 545, 29889, 29882, 29908, 13, 13, 9651, 938, 1667, 29898, 524, 1852, 29883, 29892, 1373, 29930, 1852, 29894, 23076, 426, 13, 13, 18884, 390, 29886, 12284, 29930, 4303, 353, 4265, 29936, 13, 18884, 938, 4589, 353, 29871, 29900, 29936, 13, 18884, 3765, 659, 353, 29871, 29900, 29889, 29900, 29936, 13, 13, 18884, 4303, 353, 364, 29886, 12284, 29898, 19218, 29961, 29896, 5691, 13, 13, 18884, 565, 313, 1982, 1275, 4265, 29897, 426, 13, 462, 1678, 4589, 353, 29871, 29896, 29936, 13, 462, 1678, 736, 4589, 29936, 13, 18884, 500, 13, 13, 18884, 4589, 353, 364, 29886, 2577, 11843, 29898, 1982, 1699, 29938, 2084, 613, 29987, 791, 416, 13, 13, 18884, 7571, 11702, 29887, 613, 791, 416, 13, 13, 18884, 736, 4589, 29936, 13, 9651, 500, 13, 4706, 5124, 2564, 22492, 12356, 29898, 2084, 29922, 2084, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29900, 29892, 320, 13, 9651, 525, 8860, 429, 1573, 411, 4660, 1273, 29879, 1550, 1811, 304, 1246, 29915, 1273, 313, 267, 29897, 320, 13, 9651, 718, 525, 364, 29886, 2577, 11843, 411, 4903, 2224, 1273, 29879, 29915, 1273, 313, 2084, 29897, 13, 13, 4706, 3806, 353, 525, 29900, 29889, 29906, 29945, 29945, 29953, 29915, 13, 4706, 4974, 1962, 1275, 3806, 29892, 320, 13, 9651, 376, 19080, 2577, 11843, 4133, 278, 2743, 848, 29892, 3806, 29901, 1273, 29879, 29892, 4520, 29901, 1273, 29879, 29908, 320, 13, 9651, 1273, 313, 9684, 29892, 4905, 29897, 13, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 11014, 361, 29898, 5574, 29892, 23147, 543, 1552, 12468, 29873, 545, 274, 7882, 5279, 871, 3639, 29871, 29900, 408, 385, 1059, 775, 1159, 13, 1678, 822, 1243, 29918, 19080, 2577, 11843, 29918, 20965, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 364, 29886, 2577, 11843, 580, 13, 13, 4706, 1243, 393, 5432, 278, 740, 411, 385, 8340, 4903, 2224, 3639, 263, 13, 4706, 1661, 5225, 1059, 775, 29889, 13, 4706, 9995, 13, 13, 4706, 2224, 353, 376, 2080, 29889, 4537, 29898, 29923, 29888, 467, 12313, 29889, 2084, 29908, 13, 13, 4706, 1824, 353, 25663, 703, 15945, 13, 9651, 396, 2856, 529, 23656, 29889, 29882, 29958, 13, 9651, 396, 2856, 376, 336, 407, 29873, 545, 29889, 29882, 29908, 13, 13, 9651, 938, 1667, 29898, 524, 1852, 29883, 29892, 1373, 29930, 1852, 29894, 23076, 426, 13, 13, 18884, 390, 29886, 12284, 29930, 4303, 353, 4265, 29936, 13, 18884, 938, 4589, 353, 29871, 29900, 29936, 13, 18884, 3765, 659, 353, 29871, 29900, 29889, 29900, 29936, 13, 13, 18884, 4303, 353, 364, 29886, 12284, 29898, 19218, 29961, 29896, 5691, 13, 13, 18884, 565, 313, 1982, 1275, 4265, 29897, 426, 13, 462, 1678, 4589, 353, 29871, 29896, 29936, 13, 462, 1678, 736, 4589, 29936, 13, 18884, 500, 13, 13, 18884, 4589, 353, 364, 29886, 2577, 11843, 29898, 1982, 1699, 29938, 2084, 613, 29987, 791, 416, 13, 13, 18884, 565, 313, 3127, 1275, 29871, 29900, 29897, 426, 13, 462, 1678, 7571, 11702, 29887, 613, 791, 416, 13, 18884, 500, 13, 13, 18884, 736, 4589, 29936, 13, 9651, 500, 13, 4706, 5124, 2564, 22492, 12356, 29898, 2084, 29922, 2084, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 2804, 29871, 29900, 29892, 320, 13, 9651, 525, 8860, 429, 1573, 411, 4660, 1273, 29879, 1550, 1811, 304, 1246, 29915, 1273, 313, 267, 29897, 320, 13, 9651, 718, 525, 364, 29886, 2577, 11843, 411, 4319, 4903, 2224, 1273, 29879, 29915, 1273, 313, 2084, 29897, 13, 13, 4706, 3806, 353, 525, 29900, 29889, 29906, 29945, 29945, 29953, 29915, 13, 4706, 4974, 1962, 1275, 15516, 320, 13, 9651, 376, 19080, 2577, 11843, 4133, 278, 2743, 848, 29892, 3806, 29901, 1273, 29879, 29892, 4520, 29901, 1273, 29879, 29908, 320, 13, 9651, 1273, 313, 9684, 29892, 4905, 29897, 13, 13, 13, 1678, 822, 1243, 29918, 19080, 2577, 11843, 29918, 4304, 29918, 276, 1594, 791, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 364, 29886, 2577, 11843, 580, 13, 13, 4706, 1243, 393, 5432, 278, 740, 411, 263, 4265, 3240, 29928, 1440, 13, 4706, 3639, 263, 1661, 5225, 1059, 775, 29889, 13, 4706, 9995, 13, 13, 4706, 2224, 353, 376, 2080, 29889, 4537, 29898, 29923, 29888, 467, 4381, 29908, 13, 13, 4706, 1824, 353, 25663, 703, 15945, 13, 9651, 396, 2856, 529, 23656, 29889, 29882, 29958, 13, 9651, 396, 2856, 376, 336, 407, 29873, 545, 29889, 29882, 29908, 13, 13, 9651, 938, 1667, 29898, 524, 1852, 29883, 29892, 1373, 29930, 1852, 29894, 23076, 426, 13, 13, 18884, 390, 29886, 12284, 29930, 4303, 353, 4265, 29936, 13, 18884, 938, 4589, 353, 29871, 29900, 29936, 13, 13, 18884, 4303, 353, 364, 29886, 12284, 29898, 19218, 29961, 29896, 5691, 13, 13, 18884, 565, 313, 1982, 1275, 4265, 29897, 426, 13, 462, 1678, 4589, 353, 29871, 29896, 29936, 13, 462, 1678, 736, 4589, 29936, 13, 18884, 500, 13, 13, 18884, 4589, 353, 364, 29886, 2577, 11843, 29898, 1982, 1699, 29938, 2084, 613, 10074, 416, 13, 13, 18884, 736, 4589, 29936, 13, 9651, 500, 13, 4706, 5124, 2564, 22492, 12356, 29898, 2084, 29922, 2084, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2377, 27934, 13, 4706, 4974, 831, 1275, 29871, 29896, 29941, 29929, 29892, 320, 13, 9651, 525, 8860, 429, 1573, 411, 4660, 1273, 29879, 1550, 1811, 304, 1246, 29915, 1273, 313, 267, 29897, 320, 13, 9651, 718, 525, 364, 29886, 2577, 11843, 411, 3240, 29928, 1440, 1275, 4265, 29915, 13, 13, 13, 1678, 822, 1243, 29918, 19080, 22908, 1231, 29918, 3084, 29918, 2084, 29918, 3084, 29918, 1767, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 364, 29886, 22908, 1231, 580, 13, 4706, 1243, 278, 740, 411, 263, 2854, 4903, 2224, 322, 2854, 995, 13, 4706, 9995, 13, 13, 4706, 2224, 353, 376, 4905, 29889, 1807, 29889, 3784, 29908, 13, 4706, 659, 353, 376, 1357, 716, 848, 29908, 13, 13, 4706, 1824, 353, 25663, 703, 15945, 13, 9651, 396, 2856, 529, 23656, 29889, 29882, 29958, 13, 9651, 396, 2856, 376, 336, 407, 29873, 545, 29889, 29882, 29908, 13, 13, 9651, 938, 1667, 29898, 524, 1852, 29883, 29892, 1373, 29930, 1852, 29894, 23076, 426, 13, 13, 18884, 390, 29886, 12284, 29930, 4303, 353, 4265, 29936, 13, 18884, 938, 4589, 353, 29871, 29900, 29936, 13, 18884, 938, 9773, 353, 29871, 29900, 29936, 13, 18884, 1040, 1373, 334, 2084, 353, 3908, 2084, 1769, 13, 18884, 1040, 1373, 334, 1767, 353, 3908, 791, 1769, 13, 18884, 1040, 1373, 334, 29878, 1767, 353, 4265, 29936, 13, 13, 18884, 4303, 353, 364, 29886, 12284, 29898, 19218, 29961, 29896, 5691, 13, 13, 18884, 565, 313, 1982, 1275, 4265, 29897, 426, 13, 462, 1678, 4589, 353, 29871, 29896, 29936, 13, 462, 1678, 736, 4589, 29936, 13, 18884, 500, 13, 13, 18884, 4589, 353, 364, 29886, 22908, 1231, 29898, 1982, 29892, 2084, 29892, 1767, 29892, 4397, 416, 13, 13, 18884, 364, 29886, 2577, 1231, 29898, 1982, 29892, 2084, 29892, 29987, 29878, 1767, 416, 13, 18884, 7571, 11702, 29879, 613, 29878, 1767, 416, 13, 13, 18884, 736, 4589, 29936, 13, 9651, 500, 13, 4706, 5124, 2564, 22492, 12356, 29898, 2084, 29922, 2084, 29892, 791, 29922, 791, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29900, 29892, 320, 13, 9651, 525, 8860, 429, 1573, 411, 4660, 1273, 29879, 1550, 1811, 304, 1246, 29915, 1273, 313, 267, 29897, 320, 13, 9651, 718, 525, 364, 29886, 22908, 1231, 411, 4903, 2224, 1273, 29879, 322, 1347, 1273, 29879, 29915, 1273, 313, 2084, 29892, 791, 29897, 13, 13, 4706, 3806, 353, 659, 13, 4706, 4974, 1962, 1275, 3806, 29892, 320, 13, 9651, 376, 19080, 22908, 1231, 4133, 278, 2743, 848, 29892, 3806, 29901, 1273, 29879, 29892, 4520, 29901, 1273, 29879, 29908, 320, 13, 9651, 1273, 313, 9684, 29892, 4905, 29897, 13, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 11014, 361, 29898, 5574, 29892, 23147, 543, 1552, 12468, 29873, 545, 274, 7882, 5279, 871, 3639, 29871, 29900, 408, 385, 1059, 775, 1159, 13, 1678, 822, 1243, 29918, 19080, 22908, 1231, 29918, 20965, 29918, 2084, 29918, 3084, 29918, 1767, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 364, 29886, 22908, 1231, 580, 13, 4706, 1243, 278, 740, 411, 385, 8340, 4903, 2224, 322, 2854, 995, 13, 4706, 9995, 13, 13, 4706, 2224, 353, 376, 4905, 636, 1807, 29889, 3784, 29908, 13, 4706, 659, 353, 376, 1357, 716, 848, 29908, 13, 13, 4706, 1824, 353, 25663, 703, 15945, 13, 9651, 396, 2856, 529, 23656, 29889, 29882, 29958, 13, 9651, 396, 2856, 376, 336, 407, 29873, 545, 29889, 29882, 29908, 13, 13, 9651, 938, 1667, 29898, 524, 1852, 29883, 29892, 1373, 29930, 1852, 29894, 23076, 426, 13, 13, 18884, 390, 29886, 12284, 29930, 4303, 353, 4265, 29936, 13, 18884, 938, 4589, 353, 29871, 29900, 29936, 13, 18884, 938, 9773, 353, 29871, 29900, 29936, 13, 18884, 1040, 1373, 334, 2084, 353, 3908, 2084, 1769, 13, 18884, 1040, 1373, 334, 1767, 353, 3908, 791, 1769, 13, 18884, 1040, 1373, 334, 29878, 1767, 353, 4265, 29936, 13, 13, 18884, 4303, 353, 364, 29886, 12284, 29898, 19218, 29961, 29896, 5691, 13, 13, 18884, 565, 313, 1982, 1275, 4265, 29897, 426, 13, 462, 1678, 4589, 353, 29871, 29896, 29936, 13, 462, 1678, 736, 4589, 29936, 13, 18884, 500, 13, 13, 18884, 4589, 353, 364, 29886, 22908, 1231, 29898, 1982, 29892, 2084, 29892, 1767, 29892, 4397, 416, 13, 13, 18884, 364, 29886, 2577, 1231, 29898, 1982, 29892, 2084, 29892, 29987, 29878, 1767, 416, 13, 18884, 7571, 11702, 29879, 613, 29878, 1767, 416, 13, 13, 18884, 736, 4589, 29936, 13, 9651, 500, 13, 4706, 5124, 2564, 22492, 12356, 29898, 2084, 29922, 2084, 29892, 791, 29922, 791, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 2804, 29871, 29900, 29892, 320, 13, 9651, 525, 8860, 429, 1573, 411, 4660, 1273, 29879, 1550, 1811, 304, 1246, 29915, 1273, 313, 267, 29897, 320, 13, 9651, 718, 525, 364, 29886, 22908, 1231, 411, 4903, 2224, 1273, 29879, 322, 1347, 1273, 29879, 29915, 1273, 313, 2084, 29892, 791, 29897, 13, 13, 13, 1678, 822, 1243, 29918, 19080, 22908, 1231, 29918, 3084, 29918, 2084, 29918, 20965, 29918, 1767, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 364, 29886, 22908, 1231, 580, 13, 4706, 1243, 278, 740, 411, 263, 2854, 4903, 2224, 322, 8340, 995, 13, 4706, 9995, 13, 13, 4706, 2224, 353, 376, 4905, 29889, 1807, 29889, 3784, 29908, 13, 13, 4706, 1824, 353, 25663, 703, 15945, 13, 9651, 396, 2856, 529, 23656, 29889, 29882, 29958, 13, 9651, 396, 2856, 376, 336, 407, 29873, 545, 29889, 29882, 29908, 13, 13, 9651, 938, 1667, 29898, 524, 1852, 29883, 29892, 1373, 29930, 1852, 29894, 23076, 426, 13, 13, 18884, 390, 29886, 12284, 29930, 4303, 353, 4265, 29936, 13, 18884, 938, 4589, 353, 29871, 29900, 29936, 13, 18884, 938, 9773, 353, 29871, 29900, 29936, 13, 18884, 1040, 1373, 334, 2084, 353, 3908, 2084, 1769, 13, 18884, 1040, 1373, 334, 1767, 353, 4265, 29936, 13, 18884, 1040, 1373, 334, 29878, 1767, 353, 4265, 29936, 13, 13, 18884, 4303, 353, 364, 29886, 12284, 29898, 19218, 29961, 29896, 5691, 13, 13, 18884, 565, 313, 1982, 1275, 4265, 29897, 426, 13, 462, 1678, 4589, 353, 29871, 29896, 29936, 13, 462, 1678, 736, 4589, 29936, 13, 18884, 500, 13, 13, 18884, 4589, 353, 364, 29886, 22908, 1231, 29898, 1982, 29892, 2084, 29892, 1767, 29892, 4397, 416, 13, 13, 18884, 364, 29886, 2577, 1231, 29898, 1982, 29892, 2084, 29892, 29987, 29878, 1767, 416, 13, 18884, 7571, 11702, 29879, 613, 29878, 1767, 416, 13, 13, 18884, 736, 4589, 29936, 13, 9651, 500, 13, 4706, 5124, 2564, 22492, 12356, 29898, 2084, 29922, 2084, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 2804, 29871, 29896, 29941, 29929, 29892, 320, 13, 9651, 525, 8860, 429, 1573, 411, 4660, 1273, 29879, 1550, 1811, 304, 1246, 29915, 1273, 313, 267, 29897, 320, 13, 9651, 718, 525, 364, 29886, 22908, 1231, 411, 4903, 2224, 1273, 29879, 322, 4265, 1347, 29915, 1273, 313, 2084, 29897, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 336, 407, 29873, 545, 29918, 4691, 13, 29992, 2272, 1688, 29889, 3502, 29889, 9573, 287, 1792, 13, 29992, 2272, 1688, 29889, 3502, 29889, 1509, 7241, 486, 1973, 877, 336, 407, 29873, 545, 29918, 3259, 1495, 13, 1990, 4321, 7895, 29934, 932, 29873, 545, 11980, 11713, 29898, 3057, 8259, 29906, 1125, 13, 13, 13, 1678, 822, 6230, 29918, 5696, 29898, 1311, 29892, 5696, 1125, 13, 13, 4706, 1583, 29889, 5992, 29918, 5325, 353, 5159, 13, 13, 4706, 396, 679, 1404, 3633, 5235, 13, 4706, 1583, 29889, 6786, 29892, 1311, 29889, 1792, 3364, 353, 1583, 29889, 1688, 1272, 29889, 2886, 29918, 10149, 29918, 1454, 877, 9573, 287, 1287, 3493, 1495, 13, 4706, 19766, 978, 353, 1583, 29889, 1688, 1272, 29889, 2886, 29918, 2271, 29918, 1454, 877, 991, 1495, 13, 13, 4706, 396, 2130, 263, 5780, 4867, 5639, 13, 4706, 7477, 353, 21679, 3260, 580, 13, 4706, 1583, 29889, 5652, 353, 7477, 29889, 5943, 29898, 3069, 29922, 29882, 431, 978, 29892, 13, 462, 9651, 8952, 29922, 1311, 29889, 6786, 29892, 13, 462, 9651, 4800, 29922, 1311, 29889, 1792, 3364, 29897, 13, 13, 4706, 1583, 29889, 5652, 29889, 7978, 877, 2252, 395, 17493, 9464, 1495, 13, 4706, 1583, 29889, 7924, 3972, 29892, 267, 353, 1583, 29889, 5652, 29889, 7978, 877, 29886, 9970, 1495, 13, 13, 13, 1678, 822, 734, 538, 776, 29918, 5696, 29898, 1311, 29892, 5696, 1125, 13, 13, 4706, 396, 3349, 278, 16813, 322, 2295, 2066, 13, 4706, 363, 285, 978, 297, 1583, 29889, 5992, 29918, 5325, 29901, 13, 9651, 1583, 29889, 5652, 29889, 7978, 877, 1758, 448, 29888, 1273, 29879, 29915, 1273, 313, 29888, 978, 876, 13, 13, 4706, 396, 6876, 278, 664, 3493, 13, 4706, 1583, 29889, 5652, 29889, 5358, 580, 13, 13, 13, 1678, 822, 2436, 29918, 3134, 29918, 1445, 29898, 1311, 1125, 13, 13, 4706, 396, 2436, 4903, 934, 13, 4706, 4903, 9144, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 7924, 3972, 1699, 10154, 29889, 3134, 1159, 13, 4706, 1583, 29889, 5652, 29889, 5215, 1445, 29898, 4986, 5607, 29918, 9165, 29892, 3134, 9144, 29892, 8513, 29922, 29900, 29953, 29900, 29900, 29892, 275, 29918, 1272, 29922, 5574, 29897, 13, 4706, 1583, 29889, 5992, 29918, 5325, 29889, 4397, 29898, 3134, 9144, 29897, 13, 13, 13, 1678, 822, 1065, 29918, 401, 29898, 1311, 29892, 8860, 29892, 3134, 9144, 2433, 10154, 29889, 3134, 29374, 13, 13, 4706, 396, 2436, 1824, 13, 4706, 1824, 9144, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 7924, 3972, 1699, 8860, 29889, 2272, 1159, 13, 4706, 1583, 29889, 5652, 29889, 5215, 1445, 29898, 8860, 29892, 8860, 9144, 29892, 8513, 29922, 29900, 29953, 29900, 29900, 29892, 275, 29918, 1272, 29922, 5574, 29897, 13, 4706, 1583, 29889, 5992, 29918, 5325, 29889, 4397, 29898, 8860, 9144, 29897, 13, 13, 4706, 396, 6230, 12468, 29873, 545, 5177, 13, 4706, 1583, 29889, 5652, 29889, 7978, 12839, 847, 7070, 29914, 21813, 29889, 845, 1495, 13, 4706, 1583, 29889, 5652, 29889, 7978, 877, 1509, 448, 29872, 448, 29878, 1273, 29879, 29915, 1273, 313, 1311, 29889, 336, 407, 29873, 545, 29918, 3259, 876, 13, 13, 4706, 396, 1065, 278, 775, 13, 4706, 1899, 353, 525, 4691, 1273, 29879, 1273, 29879, 29915, 1273, 313, 8860, 9144, 29892, 3134, 9144, 29897, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 5652, 29889, 7978, 29898, 6519, 29892, 14057, 29918, 265, 29918, 13322, 29918, 401, 29922, 8824, 29897, 13, 13, 4706, 736, 1962, 29892, 267, 13, 13, 13, 1678, 822, 1243, 29918, 5258, 29918, 3084, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 390, 932, 29873, 545, 29889, 5258, 580, 13, 4706, 1243, 278, 740, 773, 385, 4903, 934, 393, 4864, 373, 8086, 13, 4706, 9995, 13, 13, 4706, 1824, 353, 9995, 13, 9651, 1053, 10876, 13, 9651, 1053, 390, 932, 29873, 545, 13, 13, 9651, 4303, 353, 390, 932, 29873, 545, 29889, 5258, 29898, 9675, 29889, 19218, 29961, 29896, 2314, 13, 13, 9651, 565, 4303, 338, 6213, 29901, 13, 18884, 12020, 8960, 703, 26061, 304, 1722, 4903, 934, 29901, 1273, 29879, 29908, 1273, 313, 9675, 29889, 19218, 29961, 29896, 12622, 13, 13, 9651, 10876, 29889, 13322, 580, 13, 4706, 9995, 13, 13, 4706, 1824, 353, 337, 29889, 1491, 28909, 29876, 18674, 29881, 10162, 1273, 313, 20633, 29918, 5550, 2477, 4214, 511, 12764, 29876, 742, 8860, 29892, 15764, 29922, 276, 29889, 29924, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29900, 29892, 320, 13, 9651, 376, 29934, 932, 29873, 545, 29889, 5258, 5229, 304, 1722, 4903, 934, 29901, 1273, 29879, 29908, 1273, 313, 4905, 29897, 13, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 11014, 361, 29898, 5574, 29892, 23147, 543, 1552, 12468, 29873, 545, 3017, 7882, 5279, 947, 451, 1059, 373, 8340, 2224, 1159, 13, 1678, 822, 1243, 29918, 5258, 29918, 20965, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 390, 932, 29873, 545, 29889, 5258, 580, 13, 4706, 1243, 278, 740, 773, 385, 4903, 934, 393, 947, 451, 1863, 373, 8086, 13, 4706, 9995, 13, 13, 4706, 1824, 353, 9995, 13, 9651, 1053, 10876, 13, 9651, 1053, 390, 932, 29873, 545, 13, 13, 9651, 4303, 353, 390, 932, 29873, 545, 29889, 5258, 29898, 9675, 29889, 19218, 29961, 29896, 2314, 13, 13, 9651, 10876, 29889, 13322, 580, 13, 4706, 9995, 13, 13, 4706, 1824, 353, 337, 29889, 1491, 28909, 29876, 18674, 29881, 10162, 1273, 313, 20633, 29918, 5550, 2477, 4214, 511, 12764, 29876, 742, 8860, 29892, 15764, 29922, 276, 29889, 29924, 29897, 13, 13, 4706, 4903, 9144, 353, 376, 10154, 29918, 13221, 29918, 1333, 29918, 28997, 29889, 3134, 29908, 13, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29892, 3134, 9144, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29896, 29892, 320, 13, 9651, 376, 29934, 932, 29873, 545, 29889, 5258, 8472, 6496, 263, 934, 393, 947, 451, 1863, 29901, 1273, 29879, 29908, 320, 13, 9651, 1273, 313, 3134, 9144, 29897, 13, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 11014, 361, 29898, 5574, 29892, 23147, 543, 1552, 12468, 29873, 545, 3017, 7882, 5279, 947, 451, 1059, 373, 9654, 2224, 1159, 13, 1678, 822, 1243, 29918, 5258, 29918, 1217, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 390, 932, 29873, 545, 29889, 5258, 580, 13, 4706, 1243, 278, 740, 1728, 6820, 263, 10422, 13, 4706, 9995, 13, 13, 4706, 1824, 353, 9995, 13, 9651, 1053, 10876, 13, 9651, 1053, 390, 932, 29873, 545, 13, 13, 9651, 4303, 353, 390, 932, 29873, 545, 29889, 5258, 877, 1495, 13, 13, 9651, 10876, 29889, 13322, 580, 13, 4706, 9995, 13, 13, 4706, 1824, 353, 337, 29889, 1491, 28909, 29876, 18674, 29881, 10162, 1273, 313, 20633, 29918, 5550, 2477, 4214, 511, 12764, 29876, 742, 8860, 29892, 15764, 29922, 276, 29889, 29924, 29897, 13, 13, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29896, 29892, 320, 13, 9651, 376, 29934, 932, 29873, 545, 29889, 5258, 16601, 385, 1203, 411, 9654, 10422, 29908, 13, 13, 13, 1678, 822, 1243, 29918, 5258, 29918, 9290, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 390, 932, 29873, 545, 29889, 5258, 580, 13, 4706, 1243, 278, 740, 6820, 263, 6213, 1203, 13, 4706, 9995, 13, 13, 4706, 1824, 353, 9995, 13, 9651, 1053, 10876, 13, 9651, 1053, 390, 932, 29873, 545, 13, 13, 9651, 4303, 353, 390, 932, 29873, 545, 29889, 5258, 29898, 8516, 29897, 13, 13, 9651, 10876, 29889, 13322, 580, 13, 4706, 9995, 13, 13, 4706, 1824, 353, 337, 29889, 1491, 28909, 29876, 18674, 29881, 10162, 1273, 313, 20633, 29918, 5550, 2477, 4214, 511, 12764, 29876, 742, 8860, 29892, 15764, 29922, 276, 29889, 29924, 29897, 13, 13, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29896, 29892, 320, 13, 9651, 376, 29934, 932, 29873, 545, 29889, 5258, 16601, 385, 1203, 411, 525, 8516, 29915, 10422, 29908, 13, 13, 13, 1678, 822, 1243, 29918, 657, 29918, 3084, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 679, 580, 13, 4706, 1243, 278, 740, 411, 263, 2854, 4903, 2224, 13, 4706, 9995, 13, 13, 4706, 2224, 353, 376, 2080, 29889, 4537, 29898, 29923, 29888, 467, 12717, 29889, 1643, 29908, 13, 13, 4706, 1824, 353, 25663, 703, 15945, 13, 9651, 1053, 10876, 13, 9651, 1053, 390, 932, 29873, 545, 13, 13, 9651, 659, 353, 6213, 13, 13, 9651, 4303, 353, 390, 932, 29873, 545, 29889, 5258, 29898, 9675, 29889, 19218, 29961, 29896, 2314, 13, 13, 9651, 565, 4303, 338, 6213, 29901, 13, 18884, 12020, 8960, 703, 26061, 304, 1722, 4903, 934, 29901, 1273, 29879, 29908, 1273, 313, 9675, 29889, 19218, 29961, 29896, 12622, 13, 13, 9651, 659, 353, 4303, 29889, 657, 877, 29938, 2084, 1495, 13, 13, 9651, 1596, 11860, 29879, 29908, 1273, 313, 791, 29897, 13, 13, 9651, 10876, 29889, 13322, 580, 13, 4706, 5124, 2564, 22492, 12356, 29898, 2084, 29922, 2084, 29897, 13, 13, 4706, 1824, 353, 337, 29889, 1491, 28909, 29876, 18674, 29881, 10162, 1273, 313, 20633, 29918, 5550, 2477, 4214, 511, 12764, 29876, 742, 8860, 29892, 15764, 29922, 276, 29889, 29924, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29900, 29892, 320, 13, 9651, 525, 8860, 429, 1573, 411, 4660, 1273, 29879, 1550, 1811, 304, 1246, 29915, 1273, 313, 267, 29897, 320, 13, 9651, 718, 525, 679, 580, 411, 4903, 2224, 1273, 29879, 29915, 1273, 313, 2084, 29897, 13, 13, 4706, 3806, 353, 525, 29943, 837, 29875, 21597, 29915, 13, 4706, 4974, 1962, 1275, 3806, 29892, 320, 13, 9651, 376, 657, 580, 4133, 278, 2743, 848, 29892, 3806, 29901, 1273, 29879, 29892, 4520, 29901, 1273, 29879, 29908, 320, 13, 9651, 1273, 313, 9684, 29892, 4905, 29897, 13, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 11014, 361, 29898, 5574, 29892, 23147, 543, 1552, 12468, 29873, 545, 3017, 7882, 5279, 947, 451, 1059, 373, 4319, 2224, 1159, 13, 1678, 822, 1243, 29918, 657, 29918, 20965, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 679, 580, 13, 13, 4706, 1243, 393, 5432, 278, 740, 411, 385, 8340, 4903, 2224, 3639, 263, 13, 4706, 1661, 5225, 1059, 775, 29889, 13, 4706, 9995, 13, 13, 4706, 2224, 353, 376, 2080, 29889, 4537, 29898, 29923, 29888, 467, 12313, 29889, 2084, 29908, 13, 13, 4706, 1824, 353, 25663, 703, 15945, 13, 9651, 1053, 10876, 13, 9651, 1053, 390, 932, 29873, 545, 13, 13, 9651, 659, 353, 6213, 13, 13, 9651, 4303, 353, 390, 932, 29873, 545, 29889, 5258, 29898, 9675, 29889, 19218, 29961, 29896, 2314, 13, 13, 9651, 565, 4303, 338, 6213, 29901, 13, 18884, 12020, 8960, 703, 26061, 304, 1722, 4903, 934, 29901, 1273, 29879, 29908, 1273, 313, 9675, 29889, 19218, 29961, 29896, 12622, 13, 13, 9651, 659, 353, 4303, 29889, 657, 877, 29938, 2084, 1495, 13, 13, 9651, 1596, 11860, 29879, 29908, 1273, 313, 791, 29897, 13, 13, 9651, 10876, 29889, 13322, 580, 13, 4706, 5124, 2564, 22492, 12356, 29898, 2084, 29922, 2084, 29897, 13, 13, 4706, 1824, 353, 337, 29889, 1491, 28909, 29876, 18674, 29881, 1800, 29915, 1273, 313, 20633, 29918, 5550, 2477, 4214, 511, 12764, 29876, 742, 8860, 29892, 15764, 29922, 276, 29889, 29924, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29896, 29892, 320, 13, 9651, 525, 8860, 429, 1573, 411, 4660, 1273, 29879, 1550, 1811, 304, 1246, 29915, 1273, 313, 267, 29897, 320, 13, 9651, 718, 525, 679, 580, 411, 4319, 4903, 2224, 1273, 29879, 29915, 1273, 313, 2084, 29897, 13, 13, 4706, 3806, 353, 6629, 13, 4706, 4974, 1962, 1275, 3806, 29892, 320, 13, 9651, 376, 657, 580, 4133, 278, 2743, 848, 29892, 3806, 29901, 1273, 29879, 29892, 4520, 29901, 1273, 29879, 29908, 320, 13, 9651, 1273, 313, 9684, 29892, 4905, 29897, 13, 13, 13, 1678, 822, 1243, 29918, 657, 29918, 9290, 29918, 2084, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 679, 580, 13, 13, 4706, 1243, 393, 5432, 278, 740, 411, 263, 6213, 2224, 3639, 263, 20948, 13, 4706, 9995, 13, 13, 13, 4706, 1824, 353, 9995, 13, 9651, 1053, 10876, 13, 9651, 1053, 390, 932, 29873, 545, 13, 13, 9651, 659, 353, 6213, 13, 13, 9651, 4303, 353, 390, 932, 29873, 545, 29889, 5258, 29898, 9675, 29889, 19218, 29961, 29896, 2314, 13, 13, 9651, 565, 4303, 338, 6213, 29901, 13, 18884, 12020, 8960, 703, 26061, 304, 1722, 4903, 934, 29901, 1273, 29879, 29908, 1273, 313, 9675, 29889, 19218, 29961, 29896, 12622, 13, 13, 9651, 659, 353, 4303, 29889, 657, 29898, 8516, 29897, 13, 13, 9651, 10876, 29889, 13322, 580, 13, 4706, 9995, 13, 13, 4706, 1824, 353, 337, 29889, 1491, 28909, 29876, 18674, 29881, 10162, 1273, 313, 20633, 29918, 5550, 2477, 4214, 511, 12764, 29876, 742, 8860, 29892, 15764, 29922, 276, 29889, 29924, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 1059, 775, 13, 4706, 4974, 831, 1275, 29871, 29896, 29892, 320, 13, 9651, 525, 8860, 429, 1573, 411, 4660, 1273, 29879, 1550, 1811, 304, 1246, 29915, 1273, 313, 267, 29897, 320, 13, 9651, 718, 525, 679, 580, 411, 2224, 1275, 6213, 29915, 13, 13, 4706, 396, 1423, 363, 20948, 297, 1962, 13, 4706, 4974, 337, 29889, 4478, 703, 1542, 2392, 613, 4905, 29897, 338, 451, 6213, 29892, 320, 13, 9651, 525, 8860, 1258, 451, 6876, 411, 263, 20948, 29901, 1273, 29879, 29915, 1273, 313, 4905, 29897, 13, 13, 13, 1678, 822, 1243, 29918, 649, 29918, 3084, 29918, 2084, 29918, 3084, 29918, 1767, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 1925, 580, 13, 13, 4706, 1243, 278, 740, 411, 263, 2854, 4903, 2224, 322, 2854, 995, 13, 4706, 9995, 13, 13, 4706, 2224, 353, 376, 4905, 29889, 1807, 29889, 3784, 29908, 13, 4706, 995, 353, 376, 1357, 716, 848, 29908, 13, 13, 4706, 1824, 353, 25663, 703, 15945, 13, 9651, 1053, 10876, 13, 9651, 1053, 390, 932, 29873, 545, 13, 13, 9651, 2224, 353, 14180, 2084, 29915, 13, 9651, 995, 353, 14180, 1767, 29915, 13, 13, 9651, 4303, 353, 390, 932, 29873, 545, 29889, 5258, 29898, 9675, 29889, 19218, 29961, 29896, 2314, 13, 13, 9651, 565, 4303, 338, 6213, 29901, 13, 18884, 12020, 8960, 703, 26061, 304, 1722, 4903, 934, 29901, 1273, 29879, 29908, 1273, 313, 9675, 29889, 19218, 29961, 29896, 12622, 13, 13, 9651, 4303, 29889, 649, 29898, 2084, 29892, 1767, 29897, 13, 13, 9651, 364, 791, 353, 4303, 29889, 657, 29898, 2084, 29897, 13, 13, 9651, 565, 995, 2804, 364, 791, 29901, 13, 18884, 12020, 8960, 703, 1767, 6087, 2923, 414, 515, 995, 4133, 1213, 13, 462, 18884, 718, 376, 1966, 29876, 303, 4395, 29901, 1273, 29879, 29908, 1273, 313, 1767, 29897, 13, 462, 18884, 718, 376, 1966, 29876, 2457, 287, 29901, 1273, 29879, 29908, 1273, 313, 29878, 791, 876, 13, 13, 9651, 10876, 29889, 13322, 580, 13, 4706, 5124, 2564, 22492, 12356, 29898, 2084, 29922, 2084, 29892, 1767, 29922, 1767, 29897, 13, 13, 4706, 1824, 353, 337, 29889, 1491, 28909, 29876, 18674, 29881, 10162, 1273, 313, 20633, 29918, 5550, 2477, 4214, 511, 12764, 29876, 742, 8860, 29892, 15764, 29922, 276, 29889, 29924, 29897, 13, 13, 13, 4706, 1583, 29889, 3539, 29918, 3134, 29918, 1445, 580, 13, 4706, 1962, 29892, 267, 353, 1583, 29889, 3389, 29918, 401, 29898, 8860, 29897, 13, 13, 4706, 396, 1423, 363, 2551, 13, 4706, 4974, 831, 1275, 29871, 29900, 29892, 320, 13, 9651, 525, 8860, 429, 1573, 411, 4660, 1273, 29879, 1550, 1811, 304, 1246, 29915, 1273, 313, 267, 29897, 320, 13, 9651, 718, 525, 1925, 580, 411, 4903, 2224, 1273, 29879, 322, 1347, 1273, 29879, 29901, 1273, 29879, 29915, 1273, 313, 2084, 29892, 1767, 29892, 4905, 29897, 13, 13, 13, 2 ]
second.py
cplanck/remote-playground
0
45404
<gh_stars>0 print('this is the first line of second.py') for x in range(20): print(x) print('this is the chunk of code added to the fourth branch') print('Im editing this file in GitHub to see if fetch finds it') print('adding this code to push to the main on the remote repository')
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 2158, 877, 1366, 338, 278, 937, 1196, 310, 1473, 29889, 2272, 1495, 13, 13, 1454, 921, 297, 3464, 29898, 29906, 29900, 1125, 13, 1678, 1596, 29898, 29916, 29897, 13, 13, 2158, 877, 1366, 338, 278, 19875, 310, 775, 2715, 304, 278, 11582, 5443, 1495, 13, 2158, 877, 1888, 16278, 445, 934, 297, 25492, 304, 1074, 565, 6699, 14061, 372, 1495, 13, 2158, 877, 4676, 445, 775, 304, 5503, 304, 278, 1667, 373, 278, 7592, 9810, 1495, 2 ]
src/unzip.py
pzzzl/kino_installer
0
1602100
import zipfile class Unzip: def __init__(self, path, destination): self.path = path self.destination = destination def start(self): with zipfile.ZipFile(self.path, 'r') as zip_ref: print("Extracting " + self.path.rsplit('/', 1)[1]) zip_ref.extractall(self.destination)
[ 1, 1053, 14319, 1445, 13, 13, 1990, 853, 7554, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2224, 29892, 12551, 1125, 13, 4706, 1583, 29889, 2084, 353, 2224, 13, 4706, 1583, 29889, 23848, 353, 12551, 13, 1678, 822, 1369, 29898, 1311, 1125, 13, 4706, 411, 14319, 1445, 29889, 26264, 2283, 29898, 1311, 29889, 2084, 29892, 525, 29878, 1495, 408, 14319, 29918, 999, 29901, 13, 9651, 1596, 703, 5647, 1461, 292, 376, 718, 1583, 29889, 2084, 29889, 2288, 2830, 11219, 742, 29871, 29896, 9601, 29896, 2314, 13, 9651, 14319, 29918, 999, 29889, 21111, 497, 29898, 1311, 29889, 23848, 29897, 2 ]
ddict/__init__.py
GroMaster1/gromaster1111-gmail.com
3
103673
from .ddict import DotAccessDict
[ 1, 515, 869, 1289, 919, 1053, 360, 327, 6638, 21533, 13, 13, 2 ]
hphp/hack/test/integration/test_save_mini.py
MaxSem/hhvm
0
164113
<filename>hphp/hack/test/integration/test_save_mini.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import json import os import shlex import shutil import stat import subprocess import tempfile import time import unittest import common_tests import hierarchy_tests from hh_paths import hh_server, hh_client def write_echo_json(f, obj): f.write("echo %s\n" % shlex.quote(json.dumps(obj))) class MiniStateTestDriver(common_tests.CommonTestDriver): @classmethod def setUpClass(cls): super().setUpClass() # we create the state in a different dir from the one we run our tests # on, to verify that the saved state does not depend on any absolute # paths init_dir = os.path.join(cls.base_tmp_dir, 'init') shutil.copytree(cls.template_repo, init_dir) cls.saved_state_dir = tempfile.mkdtemp() cls.save_command(init_dir) shutil.rmtree(init_dir) @classmethod def tearDownClass(cls): shutil.rmtree(cls.saved_state_dir) @classmethod def saved_state_path(cls): return os.path.join(cls.saved_state_dir, 'foo') @classmethod def save_command(cls, init_dir): stdout, stderr, retcode = cls.proc_call([ hh_server, '--check', init_dir, '--save-mini', cls.saved_state_path() ]) if retcode != 0: raise Exception('Failed to save! stdout: "%s" stderr: "%s"' % (stdout, stderr)) def write_local_conf(self): with open(os.path.join(self.repo_dir, 'hh.conf'), 'w') as f: f.write(r""" # some comment use_mini_state = true use_watchman = true """) def write_hhconfig(self, script_name): with open(os.path.join(self.repo_dir, '.hhconfig'), 'w') as f: f.write(r""" # some comment assume_php = false load_mini_script = %s """ % os.path.join(self.repo_dir, script_name)) def write_watchman_config(self): with open(os.path.join(self.repo_dir, '.watchmanconfig'), 'w') as f: f.write('{}') os.mkdir(os.path.join(self.repo_dir, '.hg')) def write_load_config(self, *changed_files): with open(os.path.join(self.repo_dir, 'server_options.sh'), 'w') as f: f.write("#! /bin/sh\n") os.fchmod(f.fileno(), 0o700) write_echo_json(f, { 'state': self.saved_state_path(), 'is_cached': True, 'deptable': self.saved_state_path() + '.deptable', }) write_echo_json(f, { 'changes': changed_files, }) os.fchmod(f.fileno(), 0o700) self.write_local_conf() self.write_hhconfig('server_options.sh') self.write_watchman_config() def run_check(self, stdin=None, options=None): options = [] if options is None else options root = self.repo_dir + os.path.sep return self.proc_call([ hh_client, 'check', '--retries', '20', self.repo_dir ] + list(map(lambda x: x.format(root=root), options)), stdin=stdin) def check_cmd(self, expected_output, stdin=None, options=None): (output, err, _) = self.run_check(stdin, options) logs = self.get_server_logs() self.assertIn('Using watchman', logs) self.assertIn('Successfully loaded mini-state', logs) root = self.repo_dir + os.path.sep self.assertCountEqual( map(lambda x: x.format(root=root), expected_output), output.splitlines()) return err class LazyDeclTestDriver(MiniStateTestDriver): def write_local_conf(self): with open(os.path.join(self.repo_dir, 'hh.conf'), 'w') as f: f.write(r""" # some comment use_mini_state = true use_watchman = true lazy_decl = true """) class MiniStateCommonTests(common_tests.CommonTests, MiniStateTestDriver, unittest.TestCase): pass class LazyDeclCommonTests(common_tests.CommonTests, LazyDeclTestDriver, unittest.TestCase): pass class MiniStateHierarchyTests(hierarchy_tests.HierarchyTests, MiniStateTestDriver, unittest.TestCase): pass class LazyDeclHierarchyTests(hierarchy_tests.HierarchyTests, LazyDeclTestDriver, unittest.TestCase): pass class MiniStateTests(MiniStateTestDriver, unittest.TestCase): """ Tests in this class are specific to saved state; would not make sense for them to run on a fresh init """ template_repo = 'hphp/hack/test/integration/data/simple_repo' def test_no_state_found(self): error_msg = 'No such rev' with open(os.path.join(self.repo_dir, 'server_options.sh'), 'w') as f: f.write("#! /bin/sh\n") write_echo_json(f, { 'error': error_msg, }) os.fchmod(f.fileno(), 0o700) self.write_local_conf() self.write_hhconfig('server_options.sh') self.write_watchman_config() (output, _, _) = self.run_check() self.assertEqual(output.strip(), 'No errors!') logs = self.get_server_logs() self.assertIn('Could not load mini state', logs) self.assertIn(error_msg, logs) def test_get_changes_failure(self): error_msg = 'hg is not playing nice today' with open(os.path.join(self.repo_dir, 'server_options.sh'), 'w') as f: f.write("#! /bin/sh\n") write_echo_json(f, { 'state': self.saved_state_path(), 'is_cached': True, 'deptable': self.saved_state_path() + '.deptable', }) write_echo_json(f, { 'error': error_msg, }) os.fchmod(f.fileno(), 0o700) self.write_local_conf() self.write_hhconfig('server_options.sh') self.write_watchman_config() (output, _, _) = self.run_check() self.assertEqual(output.strip(), 'No errors!') logs = self.get_server_logs() self.assertIn('Could not load mini state', logs) self.assertIn(error_msg, logs) def test_hhconfig_change(self): """ Start hh_server, then change .hhconfig and check that the server restarts itself """ self.write_load_config() self.check_cmd(['No errors!']) with open(os.path.join(self.repo_dir, '.hhconfig'), 'w') as f: f.write(r""" # some comment assume_php = true load_mini_script = %s """ % os.path.join(self.repo_dir, 'server_options.sh')) # Server may take some time to kill itself. time.sleep(2) # this should start a new server self.check_cmd(['No errors!']) # check how the old one exited log_file = self.proc_call([ hh_client, '--logname', self.repo_dir] )[0].strip() + '.old' with open(log_file) as f: logs = f.read() self.assertIn('.hhconfig changed in an incompatible way', logs) def test_watchman_timeout(self): self.write_load_config() with open(os.path.join(self.repo_dir, 'hh.conf'), 'a') as f: f.write(r""" watchman_init_timeout = 1 """) with open(os.path.join(self.bin_dir, 'watchman'), 'w') as f: f.write(r"""sleep 2""") os.fchmod(f.fileno(), stat.S_IRWXU) self.run_check() # Stop the server, ensuring that its logs get flushed self.proc_call([hh_client, 'stop', self.repo_dir]) self.assertIn('Watchman.Timeout', self.get_server_logs())
[ 1, 529, 9507, 29958, 29882, 1961, 29914, 29882, 547, 29914, 1688, 29914, 27925, 29914, 1688, 29918, 7620, 29918, 1195, 29875, 29889, 2272, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8542, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 13, 5215, 4390, 13, 5215, 2897, 13, 5215, 528, 2506, 13, 5215, 528, 4422, 13, 5215, 1002, 13, 5215, 1014, 5014, 13, 5215, 5694, 1445, 13, 5215, 931, 13, 5215, 443, 27958, 13, 13, 5215, 3619, 29918, 21150, 13, 5215, 21277, 29918, 21150, 13, 13, 3166, 298, 29882, 29918, 24772, 1053, 298, 29882, 29918, 2974, 29892, 298, 29882, 29918, 4645, 13, 13, 1753, 2436, 29918, 8057, 29918, 3126, 29898, 29888, 29892, 5446, 1125, 13, 1678, 285, 29889, 3539, 703, 8057, 1273, 29879, 29905, 29876, 29908, 1273, 528, 2506, 29889, 1396, 29898, 3126, 29889, 29881, 17204, 29898, 5415, 4961, 13, 13, 1990, 341, 2172, 2792, 3057, 12376, 29898, 9435, 29918, 21150, 29889, 18877, 3057, 12376, 1125, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 731, 3373, 2385, 29898, 25932, 1125, 13, 4706, 2428, 2141, 842, 3373, 2385, 580, 13, 4706, 396, 591, 1653, 278, 2106, 297, 263, 1422, 4516, 515, 278, 697, 591, 1065, 1749, 6987, 13, 4706, 396, 373, 29892, 304, 11539, 393, 278, 7160, 2106, 947, 451, 8839, 373, 738, 8380, 13, 4706, 396, 10898, 13, 4706, 2069, 29918, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898, 25932, 29889, 3188, 29918, 7050, 29918, 3972, 29892, 525, 2344, 1495, 13, 4706, 528, 4422, 29889, 8552, 8336, 29898, 25932, 29889, 6886, 29918, 20095, 29892, 2069, 29918, 3972, 29897, 13, 4706, 1067, 29879, 29889, 17314, 29918, 3859, 29918, 3972, 353, 5694, 1445, 29889, 11256, 29881, 7382, 580, 13, 4706, 1067, 29879, 29889, 7620, 29918, 6519, 29898, 2344, 29918, 3972, 29897, 13, 4706, 528, 4422, 29889, 1758, 8336, 29898, 2344, 29918, 3972, 29897, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 734, 279, 6767, 2385, 29898, 25932, 1125, 13, 4706, 528, 4422, 29889, 1758, 8336, 29898, 25932, 29889, 17314, 29918, 3859, 29918, 3972, 29897, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 7160, 29918, 3859, 29918, 2084, 29898, 25932, 1125, 13, 4706, 736, 2897, 29889, 2084, 29889, 7122, 29898, 25932, 29889, 17314, 29918, 3859, 29918, 3972, 29892, 525, 5431, 1495, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 4078, 29918, 6519, 29898, 25932, 29892, 2069, 29918, 3972, 1125, 13, 4706, 27591, 29892, 380, 20405, 29892, 3240, 401, 353, 1067, 29879, 29889, 15439, 29918, 4804, 4197, 13, 9651, 298, 29882, 29918, 2974, 29892, 13, 9651, 525, 489, 3198, 742, 2069, 29918, 3972, 29892, 13, 9651, 525, 489, 7620, 29899, 1195, 29875, 742, 1067, 29879, 29889, 17314, 29918, 3859, 29918, 2084, 580, 13, 308, 2314, 13, 4706, 565, 3240, 401, 2804, 29871, 29900, 29901, 13, 9651, 12020, 8960, 877, 17776, 304, 4078, 29991, 27591, 29901, 11860, 29879, 29908, 380, 20405, 29901, 11860, 29879, 29908, 29915, 1273, 13, 462, 1678, 313, 25393, 29892, 380, 20405, 876, 13, 13, 1678, 822, 2436, 29918, 2997, 29918, 5527, 29898, 1311, 1125, 13, 4706, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 20095, 29918, 3972, 29892, 525, 25446, 29889, 5527, 5477, 525, 29893, 1495, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 29898, 29878, 15945, 29908, 13, 29937, 777, 3440, 13, 1509, 29918, 1195, 29875, 29918, 3859, 353, 1565, 13, 1509, 29918, 12344, 1171, 353, 1565, 13, 15945, 1159, 13, 13, 1678, 822, 2436, 29918, 25446, 2917, 29898, 1311, 29892, 2471, 29918, 978, 1125, 13, 4706, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 20095, 29918, 3972, 29892, 15300, 25446, 2917, 5477, 525, 29893, 1495, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 29898, 29878, 15945, 29908, 13, 29937, 777, 3440, 13, 465, 2017, 29918, 1961, 353, 2089, 13, 1359, 29918, 1195, 29875, 29918, 2154, 353, 1273, 29879, 13, 15945, 29908, 1273, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 20095, 29918, 3972, 29892, 2471, 29918, 978, 876, 13, 13, 1678, 822, 2436, 29918, 12344, 1171, 29918, 2917, 29898, 1311, 1125, 13, 4706, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 20095, 29918, 3972, 29892, 15300, 12344, 1171, 2917, 5477, 525, 29893, 1495, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 877, 8875, 1495, 13, 13, 4706, 2897, 29889, 11256, 3972, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 20095, 29918, 3972, 29892, 15300, 29882, 29887, 8785, 13, 13, 1678, 822, 2436, 29918, 1359, 29918, 2917, 29898, 1311, 29892, 334, 15033, 29918, 5325, 1125, 13, 4706, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 20095, 29918, 3972, 29892, 525, 2974, 29918, 6768, 29889, 845, 5477, 525, 29893, 1495, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 14822, 29991, 847, 2109, 29914, 845, 29905, 29876, 1159, 13, 9651, 2897, 29889, 29888, 305, 1545, 29898, 29888, 29889, 1777, 8154, 3285, 29871, 29900, 29877, 29955, 29900, 29900, 29897, 13, 9651, 2436, 29918, 8057, 29918, 3126, 29898, 29888, 29892, 426, 13, 18884, 525, 3859, 2396, 1583, 29889, 17314, 29918, 3859, 29918, 2084, 3285, 13, 18884, 525, 275, 29918, 29883, 3791, 2396, 5852, 29892, 13, 18884, 525, 311, 415, 519, 2396, 1583, 29889, 17314, 29918, 3859, 29918, 2084, 580, 718, 15300, 311, 415, 519, 742, 13, 18884, 5615, 13, 9651, 2436, 29918, 8057, 29918, 3126, 29898, 29888, 29892, 426, 13, 18884, 525, 25990, 2396, 3939, 29918, 5325, 29892, 13, 18884, 5615, 13, 9651, 2897, 29889, 29888, 305, 1545, 29898, 29888, 29889, 1777, 8154, 3285, 29871, 29900, 29877, 29955, 29900, 29900, 29897, 13, 13, 4706, 1583, 29889, 3539, 29918, 2997, 29918, 5527, 580, 13, 4706, 1583, 29889, 3539, 29918, 25446, 2917, 877, 2974, 29918, 6768, 29889, 845, 1495, 13, 4706, 1583, 29889, 3539, 29918, 12344, 1171, 29918, 2917, 580, 13, 13, 1678, 822, 1065, 29918, 3198, 29898, 1311, 29892, 3659, 262, 29922, 8516, 29892, 3987, 29922, 8516, 1125, 13, 4706, 3987, 353, 5159, 565, 3987, 338, 6213, 1683, 3987, 13, 4706, 3876, 353, 1583, 29889, 20095, 29918, 3972, 718, 2897, 29889, 2084, 29889, 19570, 13, 4706, 736, 1583, 29889, 15439, 29918, 4804, 4197, 13, 9651, 298, 29882, 29918, 4645, 29892, 13, 9651, 525, 3198, 742, 13, 9651, 525, 489, 2267, 2722, 742, 13, 9651, 525, 29906, 29900, 742, 13, 9651, 1583, 29889, 20095, 29918, 3972, 13, 9651, 4514, 718, 1051, 29898, 1958, 29898, 2892, 921, 29901, 921, 29889, 4830, 29898, 4632, 29922, 4632, 511, 3987, 8243, 13, 9651, 3659, 262, 29922, 4172, 262, 29897, 13, 13, 1678, 822, 1423, 29918, 9006, 29898, 1311, 29892, 3806, 29918, 4905, 29892, 3659, 262, 29922, 8516, 29892, 3987, 29922, 8516, 1125, 13, 4706, 313, 4905, 29892, 4589, 29892, 24459, 353, 1583, 29889, 3389, 29918, 3198, 29898, 4172, 262, 29892, 3987, 29897, 13, 4706, 10748, 353, 1583, 29889, 657, 29918, 2974, 29918, 20756, 580, 13, 4706, 1583, 29889, 9294, 797, 877, 15156, 6505, 1171, 742, 10748, 29897, 13, 4706, 1583, 29889, 9294, 797, 877, 14191, 3730, 7500, 20629, 29899, 3859, 742, 10748, 29897, 13, 4706, 3876, 353, 1583, 29889, 20095, 29918, 3972, 718, 2897, 29889, 2084, 29889, 19570, 13, 4706, 1583, 29889, 9294, 3981, 9843, 29898, 13, 9651, 2910, 29898, 2892, 921, 29901, 921, 29889, 4830, 29898, 4632, 29922, 4632, 511, 3806, 29918, 4905, 511, 13, 9651, 1962, 29889, 5451, 9012, 3101, 13, 4706, 736, 4589, 13, 13, 1990, 19575, 29891, 6185, 29880, 3057, 12376, 29898, 29924, 2172, 2792, 3057, 12376, 1125, 13, 1678, 822, 2436, 29918, 2997, 29918, 5527, 29898, 1311, 1125, 13, 4706, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 20095, 29918, 3972, 29892, 525, 25446, 29889, 5527, 5477, 525, 29893, 1495, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 29898, 29878, 15945, 29908, 13, 29937, 777, 3440, 13, 1509, 29918, 1195, 29875, 29918, 3859, 353, 1565, 13, 1509, 29918, 12344, 1171, 353, 1565, 13, 433, 1537, 29918, 27787, 353, 1565, 13, 15945, 1159, 13, 13, 1990, 341, 2172, 2792, 18877, 24376, 29898, 9435, 29918, 21150, 29889, 18877, 24376, 29892, 341, 2172, 2792, 3057, 12376, 29892, 13, 4706, 443, 27958, 29889, 3057, 8259, 1125, 13, 1678, 1209, 13, 13, 1990, 19575, 29891, 6185, 29880, 18877, 24376, 29898, 9435, 29918, 21150, 29889, 18877, 24376, 29892, 19575, 29891, 6185, 29880, 3057, 12376, 29892, 13, 4706, 443, 27958, 29889, 3057, 8259, 1125, 13, 1678, 1209, 13, 13, 1990, 341, 2172, 2792, 29950, 631, 12040, 24376, 29898, 29882, 631, 12040, 29918, 21150, 29889, 29950, 631, 12040, 24376, 29892, 13, 4706, 341, 2172, 2792, 3057, 12376, 29892, 443, 27958, 29889, 3057, 8259, 1125, 13, 1678, 1209, 13, 13, 1990, 19575, 29891, 6185, 29880, 29950, 631, 12040, 24376, 29898, 29882, 631, 12040, 29918, 21150, 29889, 29950, 631, 12040, 24376, 29892, 13, 4706, 19575, 29891, 6185, 29880, 3057, 12376, 29892, 443, 27958, 29889, 3057, 8259, 1125, 13, 1678, 1209, 13, 13, 1990, 341, 2172, 2792, 24376, 29898, 29924, 2172, 2792, 3057, 12376, 29892, 443, 27958, 29889, 3057, 8259, 1125, 13, 1678, 9995, 13, 1678, 4321, 29879, 297, 445, 770, 526, 2702, 304, 7160, 2106, 29936, 723, 451, 1207, 4060, 13, 1678, 363, 963, 304, 1065, 373, 263, 10849, 2069, 13, 1678, 9995, 13, 1678, 4472, 29918, 20095, 353, 525, 29882, 1961, 29914, 29882, 547, 29914, 1688, 29914, 27925, 29914, 1272, 29914, 12857, 29918, 20095, 29915, 13, 13, 1678, 822, 1243, 29918, 1217, 29918, 3859, 29918, 11940, 29898, 1311, 1125, 13, 4706, 1059, 29918, 7645, 353, 525, 3782, 1316, 6664, 29915, 13, 4706, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 20095, 29918, 3972, 29892, 525, 2974, 29918, 6768, 29889, 845, 5477, 525, 29893, 1495, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 14822, 29991, 847, 2109, 29914, 845, 29905, 29876, 1159, 13, 9651, 2436, 29918, 8057, 29918, 3126, 29898, 29888, 29892, 426, 13, 18884, 525, 2704, 2396, 1059, 29918, 7645, 29892, 13, 18884, 5615, 13, 9651, 2897, 29889, 29888, 305, 1545, 29898, 29888, 29889, 1777, 8154, 3285, 29871, 29900, 29877, 29955, 29900, 29900, 29897, 13, 13, 4706, 1583, 29889, 3539, 29918, 2997, 29918, 5527, 580, 13, 4706, 1583, 29889, 3539, 29918, 25446, 2917, 877, 2974, 29918, 6768, 29889, 845, 1495, 13, 4706, 1583, 29889, 3539, 29918, 12344, 1171, 29918, 2917, 580, 13, 13, 4706, 313, 4905, 29892, 17117, 24459, 353, 1583, 29889, 3389, 29918, 3198, 580, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 4905, 29889, 17010, 3285, 525, 3782, 4436, 29991, 1495, 13, 13, 4706, 10748, 353, 1583, 29889, 657, 29918, 2974, 29918, 20756, 580, 13, 4706, 1583, 29889, 9294, 797, 877, 23323, 451, 2254, 20629, 2106, 742, 10748, 29897, 13, 4706, 1583, 29889, 9294, 797, 29898, 2704, 29918, 7645, 29892, 10748, 29897, 13, 13, 1678, 822, 1243, 29918, 657, 29918, 25990, 29918, 14057, 545, 29898, 1311, 1125, 13, 4706, 1059, 29918, 7645, 353, 525, 29882, 29887, 338, 451, 8743, 7575, 9826, 29915, 13, 4706, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 20095, 29918, 3972, 29892, 525, 2974, 29918, 6768, 29889, 845, 5477, 525, 29893, 1495, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 14822, 29991, 847, 2109, 29914, 845, 29905, 29876, 1159, 13, 9651, 2436, 29918, 8057, 29918, 3126, 29898, 29888, 29892, 426, 13, 18884, 525, 3859, 2396, 1583, 29889, 17314, 29918, 3859, 29918, 2084, 3285, 13, 18884, 525, 275, 29918, 29883, 3791, 2396, 5852, 29892, 13, 18884, 525, 311, 415, 519, 2396, 1583, 29889, 17314, 29918, 3859, 29918, 2084, 580, 718, 15300, 311, 415, 519, 742, 13, 18884, 5615, 13, 9651, 2436, 29918, 8057, 29918, 3126, 29898, 29888, 29892, 426, 13, 18884, 525, 2704, 2396, 1059, 29918, 7645, 29892, 13, 18884, 5615, 13, 9651, 2897, 29889, 29888, 305, 1545, 29898, 29888, 29889, 1777, 8154, 3285, 29871, 29900, 29877, 29955, 29900, 29900, 29897, 13, 13, 4706, 1583, 29889, 3539, 29918, 2997, 29918, 5527, 580, 13, 4706, 1583, 29889, 3539, 29918, 25446, 2917, 877, 2974, 29918, 6768, 29889, 845, 1495, 13, 4706, 1583, 29889, 3539, 29918, 12344, 1171, 29918, 2917, 580, 13, 13, 4706, 313, 4905, 29892, 17117, 24459, 353, 1583, 29889, 3389, 29918, 3198, 580, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 4905, 29889, 17010, 3285, 525, 3782, 4436, 29991, 1495, 13, 13, 4706, 10748, 353, 1583, 29889, 657, 29918, 2974, 29918, 20756, 580, 13, 4706, 1583, 29889, 9294, 797, 877, 23323, 451, 2254, 20629, 2106, 742, 10748, 29897, 13, 4706, 1583, 29889, 9294, 797, 29898, 2704, 29918, 7645, 29892, 10748, 29897, 13, 13, 1678, 822, 1243, 29918, 25446, 2917, 29918, 3167, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 7370, 298, 29882, 29918, 2974, 29892, 769, 1735, 869, 25446, 2917, 322, 1423, 393, 278, 1923, 13, 4706, 1791, 5708, 3528, 13, 4706, 9995, 13, 4706, 1583, 29889, 3539, 29918, 1359, 29918, 2917, 580, 13, 4706, 1583, 29889, 3198, 29918, 9006, 18959, 3782, 4436, 29991, 11287, 13, 4706, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 20095, 29918, 3972, 29892, 15300, 25446, 2917, 5477, 525, 29893, 1495, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 29898, 29878, 15945, 29908, 13, 29937, 777, 3440, 13, 465, 2017, 29918, 1961, 353, 1565, 13, 1359, 29918, 1195, 29875, 29918, 2154, 353, 1273, 29879, 13, 15945, 29908, 1273, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 20095, 29918, 3972, 29892, 525, 2974, 29918, 6768, 29889, 845, 8785, 13, 13, 4706, 396, 5656, 1122, 2125, 777, 931, 304, 12088, 3528, 29889, 13, 4706, 931, 29889, 17059, 29898, 29906, 29897, 13, 13, 4706, 396, 445, 881, 1369, 263, 716, 1923, 13, 4706, 1583, 29889, 3198, 29918, 9006, 18959, 3782, 4436, 29991, 11287, 13, 4706, 396, 1423, 920, 278, 2030, 697, 429, 1573, 13, 4706, 1480, 29918, 1445, 353, 1583, 29889, 15439, 29918, 4804, 4197, 13, 9651, 298, 29882, 29918, 4645, 29892, 525, 489, 1188, 978, 742, 1583, 29889, 20095, 29918, 3972, 29962, 13, 9651, 1723, 29961, 29900, 1822, 17010, 580, 718, 15300, 1025, 29915, 13, 4706, 411, 1722, 29898, 1188, 29918, 1445, 29897, 408, 285, 29901, 13, 9651, 10748, 353, 285, 29889, 949, 580, 13, 9651, 1583, 29889, 9294, 797, 12839, 25446, 2917, 3939, 297, 385, 297, 23712, 982, 742, 10748, 29897, 13, 13, 1678, 822, 1243, 29918, 12344, 1171, 29918, 15619, 29898, 1311, 1125, 13, 4706, 1583, 29889, 3539, 29918, 1359, 29918, 2917, 580, 13, 13, 4706, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 20095, 29918, 3972, 29892, 525, 25446, 29889, 5527, 5477, 525, 29874, 1495, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 29898, 29878, 15945, 29908, 13, 12344, 1171, 29918, 2344, 29918, 15619, 353, 29871, 29896, 13, 15945, 1159, 13, 13, 4706, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 2109, 29918, 3972, 29892, 525, 12344, 1171, 5477, 525, 29893, 1495, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 29898, 29878, 15945, 29908, 17059, 29871, 29906, 15945, 1159, 13, 9651, 2897, 29889, 29888, 305, 1545, 29898, 29888, 29889, 1777, 8154, 3285, 1002, 29889, 29903, 29918, 8193, 29956, 29990, 29965, 29897, 13, 13, 4706, 1583, 29889, 3389, 29918, 3198, 580, 13, 4706, 396, 22303, 278, 1923, 29892, 5662, 3864, 393, 967, 10748, 679, 1652, 15392, 13, 4706, 1583, 29889, 15439, 29918, 4804, 4197, 25446, 29918, 4645, 29892, 525, 9847, 742, 1583, 29889, 20095, 29918, 3972, 2314, 13, 4706, 1583, 29889, 9294, 797, 877, 24709, 1171, 29889, 10851, 742, 1583, 29889, 657, 29918, 2974, 29918, 20756, 3101, 13, 2 ]
mozdns/mozbind/models.py
jlin/inventory
22
88032
from django.db import models class DNSBuildRun(models.Model): """ Everytime the DNS build scripts are ran, one of these objects is created to track which zones we have built and which zones we haven't built (since nothing has changed in them). :class:`BuildManifest` objects relate back to a :class:`DNSBuildRun` instance and represent one zone's state. """ log = models.TextField() # stats_json = models.JSONField("stats", max_length=max_length) def record(self, root_domain, soa, zfiles, zhash): bm = BuildManifest(zname=root_domain.name, files=','.join(zfiles), zhash=zhash, build_run=self) bm.save() return bm def stash(self, k, v): self.stats_json[k] = v def get_manifests(self, **kwargs): return BuildManifest.objects.filter(build_run=self, **kwargs) class BuildManifest(models.Model): max_length = 256 zname = models.CharField(max_length=max_length) files = models.CharField(max_length=max_length) zhash = models.CharField(max_length=max_length) build_run = models.ForeignKey(DNSBuildRun) # stats_json = models.JSONField("stats", max_length=max_length) def stash(self, k, v): self.stats_json[k] = v
[ 1, 515, 9557, 29889, 2585, 1053, 4733, 13, 13, 13, 1990, 360, 29940, 1744, 29884, 789, 6558, 29898, 9794, 29889, 3195, 1125, 13, 1678, 9995, 13, 1678, 7569, 2230, 278, 16332, 2048, 12078, 526, 6350, 29892, 697, 310, 1438, 3618, 338, 13, 1678, 2825, 304, 5702, 607, 20542, 591, 505, 4240, 322, 607, 20542, 591, 7359, 29915, 29873, 4240, 13, 1678, 313, 16076, 3078, 756, 3939, 297, 963, 467, 584, 1990, 18078, 8893, 2517, 7004, 29952, 3618, 13, 1678, 29279, 1250, 304, 263, 584, 1990, 18078, 28307, 1744, 29884, 789, 6558, 29952, 2777, 322, 2755, 697, 10640, 29915, 29879, 13, 1678, 2106, 29889, 13, 1678, 9995, 13, 1678, 1480, 353, 4733, 29889, 15778, 580, 13, 1678, 396, 22663, 29918, 3126, 353, 4733, 29889, 7249, 3073, 703, 16202, 613, 4236, 29918, 2848, 29922, 3317, 29918, 2848, 29897, 13, 13, 1678, 822, 2407, 29898, 1311, 29892, 3876, 29918, 7247, 29892, 577, 29874, 29892, 503, 5325, 29892, 503, 8568, 1125, 13, 4706, 289, 29885, 353, 8878, 2517, 7004, 29898, 29920, 978, 29922, 4632, 29918, 7247, 29889, 978, 29892, 2066, 29922, 3788, 29889, 7122, 29898, 29920, 5325, 511, 13, 462, 965, 503, 8568, 29922, 29920, 8568, 29892, 2048, 29918, 3389, 29922, 1311, 29897, 13, 4706, 289, 29885, 29889, 7620, 580, 13, 4706, 736, 289, 29885, 13, 13, 1678, 822, 380, 1161, 29898, 1311, 29892, 413, 29892, 325, 1125, 13, 4706, 1583, 29889, 16202, 29918, 3126, 29961, 29895, 29962, 353, 325, 13, 13, 1678, 822, 679, 29918, 29135, 29879, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 8878, 2517, 7004, 29889, 12650, 29889, 4572, 29898, 4282, 29918, 3389, 29922, 1311, 29892, 3579, 19290, 29897, 13, 13, 13, 1990, 8878, 2517, 7004, 29898, 9794, 29889, 3195, 1125, 13, 1678, 4236, 29918, 2848, 353, 29871, 29906, 29945, 29953, 13, 1678, 503, 978, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 3317, 29918, 2848, 29897, 13, 1678, 2066, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 3317, 29918, 2848, 29897, 13, 1678, 503, 8568, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 3317, 29918, 2848, 29897, 13, 1678, 2048, 29918, 3389, 353, 4733, 29889, 27755, 2558, 29898, 28307, 1744, 29884, 789, 6558, 29897, 13, 1678, 396, 22663, 29918, 3126, 353, 4733, 29889, 7249, 3073, 703, 16202, 613, 4236, 29918, 2848, 29922, 3317, 29918, 2848, 29897, 13, 13, 1678, 822, 380, 1161, 29898, 1311, 29892, 413, 29892, 325, 1125, 13, 4706, 1583, 29889, 16202, 29918, 3126, 29961, 29895, 29962, 353, 325, 13, 2 ]
make_csv.py
mlissner/pacer-free-document-stats
0
172912
<reponame>mlissner/pacer-free-document-stats<gh_stars>0 """Code to be run on the server. Kept here for easy reference. Use the %ed command to get a vi interface into iPython, and paste this in. """ import csv from cl.scrapers.models import PACERFreeDocumentRow def make_csv(): with open('/tmp/out.csv', 'w') as f: w = csv.writer(f) items = PACERFreeDocumentRow.objects.values_list() for row in items: try: w.writerow(row) except UnicodeEncodeError: pass del items # reclaim memory
[ 1, 529, 276, 1112, 420, 29958, 828, 790, 1089, 29914, 29886, 562, 261, 29899, 9021, 29899, 3225, 29899, 16202, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 3399, 304, 367, 1065, 373, 278, 1923, 29889, 4813, 415, 1244, 363, 4780, 3407, 29889, 13, 13, 11403, 278, 1273, 287, 1899, 304, 679, 263, 3516, 5067, 964, 474, 11980, 29892, 322, 11417, 445, 297, 29889, 13, 15945, 29908, 13, 13, 5215, 11799, 13, 3166, 1067, 29889, 1557, 2390, 414, 29889, 9794, 1053, 349, 2477, 1001, 20475, 6268, 4301, 13, 13, 13, 1753, 1207, 29918, 7638, 7295, 13, 1678, 411, 1722, 11219, 7050, 29914, 449, 29889, 7638, 742, 525, 29893, 1495, 408, 285, 29901, 13, 4706, 281, 353, 11799, 29889, 13236, 29898, 29888, 29897, 13, 4706, 4452, 353, 349, 2477, 1001, 20475, 6268, 4301, 29889, 12650, 29889, 5975, 29918, 1761, 580, 13, 4706, 363, 1948, 297, 4452, 29901, 13, 9651, 1018, 29901, 13, 18884, 281, 29889, 13236, 340, 29898, 798, 29897, 13, 9651, 5174, 23862, 2369, 401, 2392, 29901, 13, 18884, 1209, 13, 1678, 628, 4452, 29871, 396, 1162, 8342, 3370, 13, 2 ]
sample/python/SR1Walk.py
geenux/choreonoid
0
84138
from cnoid.Util import * from cnoid.Base import * from cnoid.Body import * from cnoid.BodyPlugin import * from cnoid.SimpleControllerPlugin import * import math; worldItem = WorldItem() RootItem.instance().addChildItem(worldItem) timeBar = TimeBar.instance() timeBar.setFrameRate(500) timeBar.setTimeRange(0.0, 15.0) timeBar.setFillLevelSync(False) robotItem = loadBodyItem(shareDirectory() + "/model/SR1/SR1.yaml") robot = robotItem.body() robot.rootLink().setTranslation( [0.0, 0.0, 0.7135] ) q = [ 0.0, -2.1, 0.0, 4.5, -2.4, 0.0, 10.0, -0.2, 0.0, -90.0, 0.0, 0.0, 0.0, 0.0, -2.1, 0.0, 4.5, -2.4, 0.0, 10.0, -0.2, 0.0, -90.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] for i in range(robot.numJoints()): robot.joint(i).q = math.radians(q[i]) robot.calcForwardKinematics() robotItem.storeInitialState() controllerItem = SimpleControllerItem() controllerItem.setControllerDllName("SR1WalkPatternController") robotItem.addChildItem(controllerItem) worldItem.addChildItem(robotItem) ItemTreeView.instance().checkItem(robotItem) worldItem.addChildItem(loadBodyItem(shareDirectory() + "/model/misc/floor.wrl")) simulatorItem = AISTSimulatorItem() worldItem.addChildItem(simulatorItem) ItemTreeView.instance().selectItem(simulatorItem) simulatorItem.startSimulation()
[ 1, 29871, 13, 3166, 274, 1217, 333, 29889, 7270, 1053, 334, 13, 3166, 274, 1217, 333, 29889, 5160, 1053, 334, 13, 3166, 274, 1217, 333, 29889, 8434, 1053, 334, 13, 3166, 274, 1217, 333, 29889, 8434, 16288, 1053, 334, 13, 3166, 274, 1217, 333, 29889, 15427, 2956, 16288, 1053, 334, 13, 5215, 5844, 29936, 13, 13, 11526, 2001, 353, 2787, 2001, 580, 13, 10303, 2001, 29889, 8758, 2141, 1202, 5938, 2001, 29898, 11526, 2001, 29897, 13, 13, 2230, 4297, 353, 5974, 4297, 29889, 8758, 580, 13, 2230, 4297, 29889, 842, 4308, 19907, 29898, 29945, 29900, 29900, 29897, 13, 2230, 4297, 29889, 842, 2481, 6069, 29898, 29900, 29889, 29900, 29892, 29871, 29896, 29945, 29889, 29900, 29897, 13, 2230, 4297, 29889, 842, 20876, 10108, 21077, 29898, 8824, 29897, 13, 13, 307, 7451, 2001, 353, 2254, 8434, 2001, 29898, 13653, 9882, 580, 718, 5591, 4299, 29914, 14098, 29896, 29914, 14098, 29896, 29889, 25162, 1159, 13, 13, 307, 7451, 353, 19964, 2001, 29889, 2587, 580, 13, 307, 7451, 29889, 4632, 6595, 2141, 842, 4300, 18411, 29898, 518, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29955, 29896, 29941, 29945, 29962, 1723, 13, 13, 29939, 353, 518, 29871, 29900, 29889, 29900, 29892, 448, 29906, 29889, 29896, 29892, 29871, 29900, 29889, 29900, 29892, 1678, 29946, 29889, 29945, 29892, 448, 29906, 29889, 29946, 29892, 29871, 29900, 29889, 29900, 29892, 13, 418, 29896, 29900, 29889, 29900, 29892, 448, 29900, 29889, 29906, 29892, 29871, 29900, 29889, 29900, 29892, 448, 29929, 29900, 29889, 29900, 29892, 259, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 13, 539, 29900, 29889, 29900, 29892, 448, 29906, 29889, 29896, 29892, 29871, 29900, 29889, 29900, 29892, 1678, 29946, 29889, 29945, 29892, 448, 29906, 29889, 29946, 29892, 29871, 29900, 29889, 29900, 29892, 13, 418, 29896, 29900, 29889, 29900, 29892, 448, 29900, 29889, 29906, 29892, 29871, 29900, 29889, 29900, 29892, 448, 29929, 29900, 29889, 29900, 29892, 259, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 13, 539, 29900, 29889, 29900, 29892, 259, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 4514, 13, 13, 1454, 474, 297, 3464, 29898, 307, 7451, 29889, 1949, 29967, 2461, 29879, 580, 1125, 13, 12, 307, 7451, 29889, 12090, 29898, 29875, 467, 29939, 353, 5844, 29889, 3665, 5834, 29898, 29939, 29961, 29875, 2314, 13, 13, 307, 7451, 29889, 28667, 2831, 1328, 29968, 262, 4579, 1199, 580, 13, 307, 7451, 2001, 29889, 8899, 15514, 2792, 580, 13, 13, 8299, 2001, 353, 12545, 2956, 2001, 580, 13, 8299, 2001, 29889, 842, 2956, 29928, 645, 1170, 703, 14098, 29896, 29956, 2235, 17144, 2956, 1159, 13, 307, 7451, 2001, 29889, 1202, 5938, 2001, 29898, 8299, 2001, 29897, 13, 13, 11526, 2001, 29889, 1202, 5938, 2001, 29898, 307, 7451, 2001, 29897, 13, 2001, 9643, 1043, 29889, 8758, 2141, 3198, 2001, 29898, 307, 7451, 2001, 29897, 13, 13, 11526, 2001, 29889, 1202, 5938, 2001, 29898, 1359, 8434, 2001, 29898, 13653, 9882, 580, 718, 5591, 4299, 29914, 29885, 10669, 29914, 14939, 29889, 29893, 2096, 5783, 13, 13, 3601, 9183, 2001, 353, 319, 9047, 8942, 9183, 2001, 580, 13, 11526, 2001, 29889, 1202, 5938, 2001, 29898, 3601, 9183, 2001, 29897, 13, 2001, 9643, 1043, 29889, 8758, 2141, 2622, 2001, 29898, 3601, 9183, 2001, 29897, 13, 13, 3601, 9183, 2001, 29889, 2962, 8942, 2785, 580, 13, 2 ]
crawler/functions/clien.py
cmh1027/Community-Analyzer
0
89123
import requests from bs4 import BeautifulSoup import sys, os sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from functions.crawler_decorator import url_crawler, article_crawler import utility.constant as constant @url_crawler def getGalleryArticleURLs(gallery_url, page, headers): # article_max 개의 게시글을 긁어옴 response = requests.get(gallery_url+"?od=T31&category=0&po="+str(page), headers=headers) urls = [] if response.status_code == 200: html = response.text soup = BeautifulSoup(html, 'html.parser') articles = soup.findAll("a", "list_subject") if len(articles) >= 1: articles = articles[1:] for article in articles: urls.append("https://m.clien.net" + article["href"]) return (response.status_code, urls) @article_crawler def getArticleContent(soup): title = soup.find("div", "post_title") if title is None: # article has been removed return "", "" else: return title.getText(), soup.find("div", "post_article").getText() # title, content
[ 1, 1053, 7274, 13, 3166, 24512, 29946, 1053, 25685, 29903, 1132, 13, 5215, 10876, 29892, 2897, 13, 9675, 29889, 2084, 29889, 4397, 29898, 359, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 13697, 13, 3166, 3168, 29889, 29883, 1610, 1358, 29918, 19557, 1061, 1053, 3142, 29918, 29883, 1610, 1358, 29892, 4274, 29918, 29883, 1610, 1358, 13, 5215, 19725, 29889, 23362, 408, 4868, 13, 13, 29992, 2271, 29918, 29883, 1610, 1358, 13, 1753, 679, 29954, 23365, 9986, 2512, 4219, 29879, 29898, 29887, 23365, 29918, 2271, 29892, 1813, 29892, 9066, 1125, 396, 4274, 29918, 3317, 29871, 31789, 30708, 29871, 237, 181, 143, 30889, 237, 187, 131, 31286, 29871, 237, 187, 132, 31129, 239, 155, 183, 13, 1678, 2933, 353, 7274, 29889, 657, 29898, 29887, 23365, 29918, 2271, 29974, 8652, 397, 29922, 29911, 29941, 29896, 29987, 7320, 29922, 29900, 29987, 1129, 543, 29974, 710, 29898, 3488, 511, 9066, 29922, 13662, 29897, 13, 1678, 23942, 353, 5159, 13, 1678, 565, 2933, 29889, 4882, 29918, 401, 1275, 29871, 29906, 29900, 29900, 29901, 13, 4706, 3472, 353, 2933, 29889, 726, 13, 4706, 22300, 353, 25685, 29903, 1132, 29898, 1420, 29892, 525, 1420, 29889, 16680, 1495, 13, 4706, 7456, 353, 22300, 29889, 2886, 3596, 703, 29874, 613, 376, 1761, 29918, 16009, 1159, 13, 4706, 565, 7431, 29898, 18569, 29897, 6736, 29871, 29896, 29901, 13, 9651, 7456, 353, 7456, 29961, 29896, 17531, 13, 4706, 363, 4274, 297, 7456, 29901, 13, 9651, 23942, 29889, 4397, 703, 991, 597, 29885, 29889, 11303, 264, 29889, 1212, 29908, 718, 4274, 3366, 12653, 20068, 13, 4706, 736, 313, 5327, 29889, 4882, 29918, 401, 29892, 23942, 29897, 13, 13, 29992, 7914, 29918, 29883, 1610, 1358, 13, 1753, 679, 9986, 2512, 3916, 29898, 29879, 1132, 1125, 13, 1678, 3611, 353, 22300, 29889, 2886, 703, 4563, 613, 376, 2490, 29918, 3257, 1159, 13, 1678, 565, 3611, 338, 6213, 29901, 396, 4274, 756, 1063, 6206, 13, 4706, 736, 12633, 5124, 13, 1678, 1683, 29901, 13, 4706, 736, 3611, 29889, 18516, 3285, 22300, 29889, 2886, 703, 4563, 613, 376, 2490, 29918, 7914, 2564, 18516, 580, 396, 3611, 29892, 2793, 2 ]
Python3Lab/zarathustra/SungJukV2.py
Yurisegye/HelloPython3
0
167901
<filename>Python3Lab/zarathustra/SungJukV2.py<gh_stars>0 print('-- 성적 처리 프로그램 v1 --') name = input("이름을 입력하세요") kor = int(input("국어 점수를 입력하세요")) eng = int(input("영어 점수를 입력하세요")) mat = int(input("수학 점수를 입력하세요")) def getTotal(): tot = kor + mat + eng return tot def getAverage(): avg = getTotal() / 3 return avg def getGrade(): avg = getAverage() grd = '가' if avg >= 90: grd = '수' elif avg >= 80: grd = '우' elif avg >= 70: grd = '미' elif avg >= 60: grd = '양' return grd fmt = '이름: %s 국어: %d 수학: %d 영어: %d 총점: %d 평균: %.2f 학점: %s' print(fmt % (name, kor, eng, mat, getTotal(), getAverage(), getGrade()))
[ 1, 529, 9507, 29958, 11980, 29941, 28632, 29914, 26687, 493, 504, 336, 29914, 29903, 686, 29967, 2679, 29963, 29906, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 2158, 877, 489, 29871, 31126, 239, 163, 132, 29871, 239, 181, 155, 30826, 29871, 240, 151, 135, 30906, 31607, 238, 161, 171, 325, 29896, 1192, 1495, 13, 13, 978, 353, 1881, 703, 30393, 238, 169, 135, 31286, 29871, 239, 161, 136, 238, 163, 168, 30944, 31578, 31527, 1159, 13, 13123, 353, 938, 29898, 2080, 703, 31293, 31129, 29871, 239, 163, 147, 30970, 31517, 29871, 239, 161, 136, 238, 163, 168, 30944, 31578, 31527, 5783, 13, 996, 353, 938, 29898, 2080, 703, 31288, 31129, 29871, 239, 163, 147, 30970, 31517, 29871, 239, 161, 136, 238, 163, 168, 30944, 31578, 31527, 5783, 13, 2922, 353, 938, 29898, 2080, 703, 30970, 31822, 29871, 239, 163, 147, 30970, 31517, 29871, 239, 161, 136, 238, 163, 168, 30944, 31578, 31527, 5783, 13, 13, 1753, 679, 11536, 7295, 13, 1678, 2025, 353, 10871, 718, 1775, 718, 3033, 13, 1678, 736, 2025, 13, 13, 1753, 679, 29909, 19698, 7295, 13, 1678, 1029, 29887, 353, 679, 11536, 580, 847, 29871, 29941, 13, 1678, 736, 1029, 29887, 13, 13, 1753, 679, 29954, 15464, 7295, 13, 1678, 1029, 29887, 353, 679, 29909, 19698, 580, 13, 1678, 867, 29881, 353, 525, 30903, 29915, 13, 1678, 565, 1029, 29887, 6736, 29871, 29929, 29900, 29901, 13, 4706, 867, 29881, 353, 525, 30970, 29915, 13, 1678, 25342, 1029, 29887, 6736, 29871, 29947, 29900, 29901, 13, 4706, 867, 29881, 353, 525, 31327, 29915, 13, 1678, 25342, 1029, 29887, 6736, 29871, 29955, 29900, 29901, 13, 4706, 867, 29881, 353, 525, 31362, 29915, 13, 1678, 25342, 1029, 29887, 6736, 29871, 29953, 29900, 29901, 13, 4706, 867, 29881, 353, 525, 239, 153, 148, 29915, 13, 1678, 736, 867, 29881, 13, 13, 23479, 353, 525, 30393, 238, 169, 135, 29901, 1273, 29879, 29871, 31293, 31129, 29901, 1273, 29881, 29871, 30970, 31822, 29901, 1273, 29881, 29871, 31288, 31129, 29901, 1273, 29881, 29871, 239, 183, 160, 239, 163, 147, 29901, 1273, 29881, 29871, 240, 146, 140, 237, 186, 163, 29901, 18695, 29906, 29888, 29871, 31822, 239, 163, 147, 29901, 1273, 29879, 29915, 13, 2158, 29898, 23479, 1273, 313, 978, 29892, 10871, 29892, 3033, 29892, 1775, 29892, 679, 11536, 3285, 679, 29909, 19698, 3285, 679, 29954, 15464, 22130, 2 ]
questions/increasing-order-search-tree/Solution.py
marcus-aurelianus/leetcode-solutions
141
64797
<filename>questions/increasing-order-search-tree/Solution.py """ Given the root of a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only one right child.   Example 1: Input: root = [5,3,6,2,4,null,8,1,null,null,null,7,9] Output: [1,null,2,null,3,null,4,null,5,null,6,null,7,null,8,null,9] Example 2: Input: root = [5,1,7] Output: [1,null,5,null,7]   Constraints: The number of nodes in the given tree will be in the range [1, 100]. 0 <= Node.val <= 1000 """ # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def increasingBST(self, root: TreeNode) -> TreeNode: def inorder(root, arr): if root is None: return inorder(root.left, arr) arr.append(root.val) inorder(root.right, arr) arr = [] inorder(root, arr) ps = [] for i, val in enumerate(arr): c = TreeNode(val) if i > 0: ps[-1].right = c ps.append(c) return ps[0]
[ 1, 529, 9507, 29958, 2619, 29914, 262, 1037, 5832, 29899, 2098, 29899, 4478, 29899, 8336, 29914, 13296, 918, 29889, 2272, 13, 15945, 29908, 13, 13, 29954, 5428, 278, 3876, 310, 263, 7581, 2740, 5447, 29892, 18983, 3881, 278, 5447, 297, 297, 29899, 2098, 577, 393, 278, 2175, 3242, 2943, 297, 278, 5447, 338, 1286, 278, 3876, 310, 278, 5447, 29892, 322, 1432, 2943, 756, 694, 2175, 2278, 322, 871, 697, 1492, 2278, 29889, 13, 30081, 13, 14023, 29871, 29896, 29901, 13, 13, 30004, 13, 4290, 29901, 3876, 353, 518, 29945, 29892, 29941, 29892, 29953, 29892, 29906, 29892, 29946, 29892, 4304, 29892, 29947, 29892, 29896, 29892, 4304, 29892, 4304, 29892, 4304, 29892, 29955, 29892, 29929, 29962, 30004, 13, 6466, 29901, 518, 29896, 29892, 4304, 29892, 29906, 29892, 4304, 29892, 29941, 29892, 4304, 29892, 29946, 29892, 4304, 29892, 29945, 29892, 4304, 29892, 29953, 29892, 4304, 29892, 29955, 29892, 4304, 29892, 29947, 29892, 4304, 29892, 29929, 29962, 30004, 13, 13, 14023, 29871, 29906, 29901, 13, 13, 30004, 13, 4290, 29901, 3876, 353, 518, 29945, 29892, 29896, 29892, 29955, 29962, 30004, 13, 6466, 29901, 518, 29896, 29892, 4304, 29892, 29945, 29892, 4304, 29892, 29955, 29962, 30004, 13, 13, 30081, 13, 27427, 29901, 13, 13, 1576, 1353, 310, 7573, 297, 278, 2183, 5447, 674, 367, 297, 278, 3464, 518, 29896, 29892, 29871, 29896, 29900, 29900, 1822, 13, 29900, 5277, 9071, 29889, 791, 5277, 29871, 29896, 29900, 29900, 29900, 13, 13, 15945, 29908, 13, 13, 13, 29937, 21940, 363, 263, 7581, 5447, 2943, 29889, 13, 29937, 770, 15472, 4247, 29901, 13, 29937, 268, 822, 4770, 2344, 12035, 1311, 29892, 659, 29922, 29900, 29892, 2175, 29922, 8516, 29892, 1492, 29922, 8516, 1125, 13, 29937, 308, 1583, 29889, 791, 353, 659, 13, 29937, 308, 1583, 29889, 1563, 353, 2175, 13, 29937, 308, 1583, 29889, 1266, 353, 1492, 13, 1990, 24380, 29901, 13, 1678, 822, 10231, 29933, 1254, 29898, 1311, 29892, 3876, 29901, 15472, 4247, 29897, 1599, 15472, 4247, 29901, 13, 4706, 822, 297, 2098, 29898, 4632, 29892, 3948, 1125, 13, 9651, 565, 3876, 338, 6213, 29901, 13, 18884, 736, 13, 9651, 297, 2098, 29898, 4632, 29889, 1563, 29892, 3948, 29897, 13, 9651, 3948, 29889, 4397, 29898, 4632, 29889, 791, 29897, 13, 9651, 297, 2098, 29898, 4632, 29889, 1266, 29892, 3948, 29897, 13, 308, 13, 4706, 3948, 353, 5159, 13, 4706, 297, 2098, 29898, 4632, 29892, 3948, 29897, 13, 4706, 6529, 353, 5159, 13, 4706, 363, 474, 29892, 659, 297, 26985, 29898, 2749, 1125, 13, 9651, 274, 353, 15472, 4247, 29898, 791, 29897, 13, 9651, 565, 474, 1405, 29871, 29900, 29901, 13, 18884, 6529, 14352, 29896, 1822, 1266, 353, 274, 13, 9651, 6529, 29889, 4397, 29898, 29883, 29897, 13, 4706, 736, 6529, 29961, 29900, 29962, 2 ]
2019/03-volga/web-shop2/solve.py
wani-hackase/wani-writeup
25
83681
import requests login_url = "http://shop2.q.2019.volgactf.ru/loginProcess" target_url = "http://shop2.q.2019.volgactf.ru/profile" payload0 = {'name': 'wani', 'pass': '<PASSWORD>'} payload1 = {'name': 'wani', 'CartItems[0].id': 4} s = requests.Session() r = s.post(login_url, data=payload0) r = s.post(target_url, data=payload1) print(r.text)
[ 1, 1053, 7274, 13, 13, 7507, 29918, 2271, 353, 376, 1124, 597, 19032, 29906, 29889, 29939, 29889, 29906, 29900, 29896, 29929, 29889, 1555, 29887, 627, 29888, 29889, 582, 29914, 7507, 7032, 29908, 13, 5182, 29918, 2271, 353, 376, 1124, 597, 19032, 29906, 29889, 29939, 29889, 29906, 29900, 29896, 29929, 29889, 1555, 29887, 627, 29888, 29889, 582, 29914, 10185, 29908, 13, 13, 23813, 29900, 353, 11117, 978, 2396, 525, 29893, 3270, 742, 525, 3364, 2396, 12801, 25711, 17013, 29958, 10827, 13, 23813, 29896, 353, 11117, 978, 2396, 525, 29893, 3270, 742, 525, 25233, 6913, 29961, 29900, 1822, 333, 2396, 29871, 29946, 29913, 13, 13, 29879, 353, 7274, 29889, 7317, 580, 13, 29878, 353, 269, 29889, 2490, 29898, 7507, 29918, 2271, 29892, 848, 29922, 23813, 29900, 29897, 13, 29878, 353, 269, 29889, 2490, 29898, 5182, 29918, 2271, 29892, 848, 29922, 23813, 29896, 29897, 13, 2158, 29898, 29878, 29889, 726, 29897, 13, 2 ]
modules/attention.py
Mehrad0711/HUBERT
3
195122
import torch from torch.nn import Linear, Module from torch.nn.init import xavier_uniform_, constant_, xavier_normal_ from torch.nn.parameter import Parameter from torch.nn import functional as F class MultiheadAttention(Module): r"""Allows the model to jointly attend to information from different representation subspaces. See reference: Attention Is All You Need .. math:: \text{MultiHead}(Q, K, V) = \text{Concat}(head_1,\dots,head_h)W^O \text{where} head_i = \text{Attention}(QW_i^Q, KW_i^K, VW_i^V) Args: embed_dim: total dimension of the model num_heads: parallel attention layers, or heads Examples:: >>> multihead_attn = nn.MultiheadAttention(embed_dim, num_heads) >>> attn_output, attn_output_weights = multihead_attn(query, key, value) """ def __init__(self, embed_dim, num_heads, dropout=0., bias=True, add_bias_kv=False, add_zero_attn=False): super(MultiheadAttention, self).__init__() self.embed_dim = embed_dim self.num_heads = num_heads self.dropout = dropout self.head_dim = embed_dim // num_heads assert self.head_dim * num_heads == self.embed_dim, "embed_dim must be divisible by num_heads" self.scaling = self.head_dim ** -0.5 self.in_proj_weight = Parameter(torch.empty(3 * embed_dim, embed_dim)) if bias: self.in_proj_bias = Parameter(torch.empty(3 * embed_dim)) else: self.register_parameter('in_proj_bias', None) self.out_proj = Linear(embed_dim, embed_dim, bias=bias) if add_bias_kv: self.bias_k = Parameter(torch.empty(1, 1, embed_dim)) self.bias_v = Parameter(torch.empty(1, 1, embed_dim)) else: self.bias_k = self.bias_v = None self.add_zero_attn = add_zero_attn self._reset_parameters() def _reset_parameters(self): xavier_uniform_(self.in_proj_weight[:self.embed_dim, :]) xavier_uniform_(self.in_proj_weight[self.embed_dim:(self.embed_dim * 2), :]) xavier_uniform_(self.in_proj_weight[(self.embed_dim * 2):, :]) xavier_uniform_(self.out_proj.weight) if self.in_proj_bias is not None: constant_(self.in_proj_bias, 0.) constant_(self.out_proj.bias, 0.) if self.bias_k is not None: xavier_normal_(self.bias_k) if self.bias_v is not None: xavier_normal_(self.bias_v) def forward(self, query, key, value, key_padding_mask=None, incremental_state=None, need_weights=True, static_kv=False, attn_mask=None): """ Inputs of forward function query: [target length, batch size, embed dim] key: [sequence length, batch size, embed dim] value: [sequence length, batch size, embed dim] key_padding_mask: if True, mask padding based on batch size incremental_state: if provided, previous time steps are cashed need_weights: output attn_output_weights static_kv: key and value are static Outputs of forward function attn_output: [target length, batch size, embed dim] attn_output_weights: [batch size, target length, sequence length] """ qkv_same = query.data_ptr() == key.data_ptr() == value.data_ptr() kv_same = key.data_ptr() == value.data_ptr() tgt_len, bsz, embed_dim = query.size() assert embed_dim == self.embed_dim assert list(query.size()) == [tgt_len, bsz, embed_dim] assert key.size() == value.size() if incremental_state is not None: saved_state = self._get_input_buffer(incremental_state) if 'prev_key' in saved_state: # previous time steps are cached - no need to recompute # key and value if they are static if static_kv: assert kv_same and not qkv_same key = value = None else: saved_state = None if qkv_same: # self-attention q, k, v = self._in_proj_qkv(query) elif kv_same: # encoder-decoder attention q = self._in_proj_q(query) if key is None: assert value is None k = v = None else: k, v = self._in_proj_kv(key) else: q = self._in_proj_q(query) k = self._in_proj_k(key) v = self._in_proj_v(value) q *= self.scaling if self.bias_k is not None: assert self.bias_v is not None k = torch.cat([k, self.bias_k.repeat(1, bsz, 1)]) v = torch.cat([v, self.bias_v.repeat(1, bsz, 1)]) if attn_mask is not None: attn_mask = torch.cat([attn_mask, attn_mask.new_zeros(attn_mask.size(0), 1)], dim=1) if key_padding_mask is not None: key_padding_mask = torch.cat( [key_padding_mask, key_padding_mask.new_zeros(key_padding_mask.size(0), 1)], dim=1) q = q.contiguous().view(tgt_len, bsz * self.num_heads, self.head_dim).transpose(0, 1) if k is not None: k = k.contiguous().view(-1, bsz * self.num_heads, self.head_dim).transpose(0, 1) if v is not None: v = v.contiguous().view(-1, bsz * self.num_heads, self.head_dim).transpose(0, 1) if saved_state is not None: # saved states are stored with shape (bsz, num_heads, seq_len, head_dim) if 'prev_key' in saved_state: prev_key = saved_state['prev_key'].view(bsz * self.num_heads, -1, self.head_dim) if static_kv: k = prev_key else: k = torch.cat((prev_key, k), dim=1) if 'prev_value' in saved_state: prev_value = saved_state['prev_value'].view(bsz * self.num_heads, -1, self.head_dim) if static_kv: v = prev_value else: v = torch.cat((prev_value, v), dim=1) saved_state['prev_key'] = k.view(bsz, self.num_heads, -1, self.head_dim) saved_state['prev_value'] = v.view(bsz, self.num_heads, -1, self.head_dim) self._set_input_buffer(incremental_state, saved_state) src_len = k.size(1) if key_padding_mask is not None: assert key_padding_mask.size(0) == bsz assert key_padding_mask.size(1) == src_len if self.add_zero_attn: src_len += 1 k = torch.cat([k, k.new_zeros((k.size(0), 1) + k.size()[2:])], dim=1) v = torch.cat([v, v.new_zeros((v.size(0), 1) + v.size()[2:])], dim=1) if attn_mask is not None: attn_mask = torch.cat([attn_mask, attn_mask.new_zeros(attn_mask.size(0), 1)], dim=1) if key_padding_mask is not None: key_padding_mask = torch.cat( [key_padding_mask, torch.zeros(key_padding_mask.size(0), 1).type_as(key_padding_mask)], dim=1) attn_output_weights = torch.bmm(q, k.transpose(1, 2)) assert list(attn_output_weights.size()) == [bsz * self.num_heads, tgt_len, src_len] if attn_mask is not None: attn_mask = attn_mask.unsqueeze(0) attn_output_weights += attn_mask if key_padding_mask is not None: attn_output_weights = attn_output_weights.view(bsz, self.num_heads, tgt_len, src_len) key_padding_mask = key_padding_mask.type(torch.uint8).to(query.device) attn_output_weights = attn_output_weights.masked_fill( key_padding_mask.unsqueeze(1).unsqueeze(2), float('-inf'), ) attn_output_weights = attn_output_weights.view(bsz * self.num_heads, tgt_len, src_len) attn_output_weights = F.softmax( attn_output_weights.float(), dim=-1, dtype=torch.float32 if attn_output_weights.dtype == torch.float16 else attn_output_weights.dtype) attn_output_weights = F.dropout(attn_output_weights, p=self.dropout, training=self.training) attn_output = torch.bmm(attn_output_weights, v) assert list(attn_output.size()) == [bsz * self.num_heads, tgt_len, self.head_dim] attn_output = attn_output.transpose(0, 1).contiguous().view(tgt_len, bsz, embed_dim) attn_output = self.out_proj(attn_output) if need_weights: # average attention weights over heads attn_output_weights = attn_output_weights.view(bsz, self.num_heads, tgt_len, src_len) attn_output_weights = attn_output_weights.sum(dim=1) / self.num_heads else: attn_output_weights = None return attn_output, attn_output_weights def _in_proj_qkv(self, query): return self._in_proj(query).chunk(3, dim=-1) def _in_proj_kv(self, key): return self._in_proj(key, start=self.embed_dim).chunk(2, dim=-1) def _in_proj_q(self, query): return self._in_proj(query, end=self.embed_dim) def _in_proj_k(self, key): return self._in_proj(key, start=self.embed_dim, end=2 * self.embed_dim) def _in_proj_v(self, value): return self._in_proj(value, start=2 * self.embed_dim) def _in_proj(self, input, start=0, end=None): weight = self.in_proj_weight bias = self.in_proj_bias weight = weight[start:end, :] if bias is not None: bias = bias[start:end] return F.linear(input, weight, bias)
[ 1, 1053, 4842, 305, 30004, 13, 3166, 4842, 305, 29889, 15755, 1053, 22985, 29892, 15591, 30004, 13, 3166, 4842, 305, 29889, 15755, 29889, 2344, 1053, 921, 18852, 29918, 29590, 3383, 4868, 3383, 921, 18852, 29918, 8945, 29918, 30004, 13, 3166, 4842, 305, 29889, 15755, 29889, 15501, 1053, 24953, 30004, 13, 3166, 4842, 305, 29889, 15755, 1053, 13303, 408, 383, 30004, 13, 30004, 13, 1990, 14974, 2813, 4165, 2509, 29898, 7355, 1125, 30004, 13, 1678, 364, 15945, 29908, 3596, 1242, 278, 1904, 304, 14002, 368, 14333, 304, 2472, 30004, 13, 1678, 515, 1422, 8954, 1014, 22854, 22993, 13, 1678, 2823, 3407, 29901, 6212, 2509, 1317, 2178, 887, 20768, 30004, 13, 30004, 13, 1678, 6317, 5844, 1057, 30004, 13, 4706, 320, 726, 29912, 15329, 5494, 2119, 29984, 29892, 476, 29892, 478, 29897, 353, 320, 726, 29912, 1168, 4117, 2119, 2813, 29918, 29896, 2053, 7778, 29892, 2813, 29918, 29882, 29897, 29956, 29985, 29949, 30004, 13, 4706, 320, 726, 29912, 3062, 29913, 2343, 29918, 29875, 353, 320, 726, 29912, 4165, 2509, 2119, 29984, 29956, 29918, 29875, 29985, 29984, 29892, 476, 29956, 29918, 29875, 29985, 29968, 29892, 478, 29956, 29918, 29875, 29985, 29963, 8443, 13, 30004, 13, 1678, 826, 3174, 29901, 30004, 13, 4706, 8297, 29918, 6229, 29901, 3001, 9927, 310, 278, 1904, 30004, 13, 4706, 954, 29918, 2813, 29879, 29901, 8943, 8570, 15359, 29892, 470, 15883, 30004, 13, 30004, 13, 1678, 1222, 9422, 1057, 30004, 13, 30004, 13, 4706, 8653, 2473, 2813, 29918, 1131, 29876, 353, 302, 29876, 29889, 15329, 2813, 4165, 2509, 29898, 17987, 29918, 6229, 29892, 954, 29918, 2813, 29879, 8443, 13, 4706, 8653, 1098, 29876, 29918, 4905, 29892, 1098, 29876, 29918, 4905, 29918, 705, 5861, 353, 2473, 2813, 29918, 1131, 29876, 29898, 1972, 29892, 1820, 29892, 995, 8443, 13, 1678, 9995, 30004, 13, 30004, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 8297, 29918, 6229, 29892, 954, 29918, 2813, 29879, 29892, 5768, 449, 29922, 29900, 1696, 24003, 29922, 5574, 29892, 788, 29918, 29890, 3173, 29918, 27049, 29922, 8824, 29892, 788, 29918, 9171, 29918, 1131, 29876, 29922, 8824, 1125, 30004, 13, 4706, 2428, 29898, 15329, 2813, 4165, 2509, 29892, 1583, 467, 1649, 2344, 1649, 26471, 13, 4706, 1583, 29889, 17987, 29918, 6229, 353, 8297, 29918, 6229, 30004, 13, 4706, 1583, 29889, 1949, 29918, 2813, 29879, 353, 954, 29918, 2813, 29879, 30004, 13, 4706, 1583, 29889, 8865, 449, 353, 5768, 449, 30004, 13, 4706, 1583, 29889, 2813, 29918, 6229, 353, 8297, 29918, 6229, 849, 954, 29918, 2813, 29879, 30004, 13, 4706, 4974, 1583, 29889, 2813, 29918, 6229, 334, 954, 29918, 2813, 29879, 1275, 1583, 29889, 17987, 29918, 6229, 29892, 376, 17987, 29918, 6229, 1818, 367, 8572, 1821, 491, 954, 29918, 2813, 29879, 19451, 13, 4706, 1583, 29889, 19529, 292, 353, 1583, 29889, 2813, 29918, 6229, 3579, 448, 29900, 29889, 29945, 30004, 13, 30004, 13, 4706, 1583, 29889, 262, 29918, 20865, 29918, 7915, 353, 24953, 29898, 7345, 305, 29889, 6310, 29898, 29941, 334, 8297, 29918, 6229, 29892, 8297, 29918, 6229, 876, 30004, 13, 4706, 565, 24003, 29901, 30004, 13, 9651, 1583, 29889, 262, 29918, 20865, 29918, 29890, 3173, 353, 24953, 29898, 7345, 305, 29889, 6310, 29898, 29941, 334, 8297, 29918, 6229, 876, 30004, 13, 4706, 1683, 29901, 30004, 13, 9651, 1583, 29889, 9573, 29918, 15501, 877, 262, 29918, 20865, 29918, 29890, 3173, 742, 6213, 8443, 13, 4706, 1583, 29889, 449, 29918, 20865, 353, 22985, 29898, 17987, 29918, 6229, 29892, 8297, 29918, 6229, 29892, 24003, 29922, 29890, 3173, 8443, 13, 30004, 13, 4706, 565, 788, 29918, 29890, 3173, 29918, 27049, 29901, 30004, 13, 9651, 1583, 29889, 29890, 3173, 29918, 29895, 353, 24953, 29898, 7345, 305, 29889, 6310, 29898, 29896, 29892, 29871, 29896, 29892, 8297, 29918, 6229, 876, 30004, 13, 9651, 1583, 29889, 29890, 3173, 29918, 29894, 353, 24953, 29898, 7345, 305, 29889, 6310, 29898, 29896, 29892, 29871, 29896, 29892, 8297, 29918, 6229, 876, 30004, 13, 4706, 1683, 29901, 30004, 13, 9651, 1583, 29889, 29890, 3173, 29918, 29895, 353, 1583, 29889, 29890, 3173, 29918, 29894, 353, 6213, 30004, 13, 30004, 13, 4706, 1583, 29889, 1202, 29918, 9171, 29918, 1131, 29876, 353, 788, 29918, 9171, 29918, 1131, 29876, 30004, 13, 30004, 13, 4706, 1583, 3032, 12071, 29918, 16744, 26471, 13, 30004, 13, 1678, 822, 903, 12071, 29918, 16744, 29898, 1311, 1125, 30004, 13, 4706, 921, 18852, 29918, 29590, 23538, 1311, 29889, 262, 29918, 20865, 29918, 7915, 7503, 1311, 29889, 17987, 29918, 6229, 29892, 584, 2314, 30004, 13, 4706, 921, 18852, 29918, 29590, 23538, 1311, 29889, 262, 29918, 20865, 29918, 7915, 29961, 1311, 29889, 17987, 29918, 6229, 5919, 1311, 29889, 17987, 29918, 6229, 334, 29871, 29906, 511, 584, 2314, 30004, 13, 4706, 921, 18852, 29918, 29590, 23538, 1311, 29889, 262, 29918, 20865, 29918, 7915, 15625, 1311, 29889, 17987, 29918, 6229, 334, 29871, 29906, 1125, 29892, 584, 2314, 30004, 13, 30004, 13, 4706, 921, 18852, 29918, 29590, 23538, 1311, 29889, 449, 29918, 20865, 29889, 7915, 8443, 13, 4706, 565, 1583, 29889, 262, 29918, 20865, 29918, 29890, 3173, 338, 451, 6213, 29901, 30004, 13, 9651, 4868, 23538, 1311, 29889, 262, 29918, 20865, 29918, 29890, 3173, 29892, 29871, 29900, 1846, 30004, 13, 9651, 4868, 23538, 1311, 29889, 449, 29918, 20865, 29889, 29890, 3173, 29892, 29871, 29900, 1846, 30004, 13, 4706, 565, 1583, 29889, 29890, 3173, 29918, 29895, 338, 451, 6213, 29901, 30004, 13, 9651, 921, 18852, 29918, 8945, 23538, 1311, 29889, 29890, 3173, 29918, 29895, 8443, 13, 4706, 565, 1583, 29889, 29890, 3173, 29918, 29894, 338, 451, 6213, 29901, 30004, 13, 9651, 921, 18852, 29918, 8945, 23538, 1311, 29889, 29890, 3173, 29918, 29894, 8443, 13, 30004, 13, 1678, 822, 6375, 29898, 1311, 29892, 2346, 29892, 1820, 29892, 995, 29892, 1820, 29918, 12791, 29918, 13168, 29922, 8516, 29892, 11924, 284, 29918, 3859, 29922, 8516, 11167, 13, 18884, 817, 29918, 705, 5861, 29922, 5574, 29892, 2294, 29918, 27049, 29922, 8824, 29892, 1098, 29876, 29918, 13168, 29922, 8516, 1125, 30004, 13, 4706, 9995, 30004, 13, 4706, 10567, 29879, 310, 6375, 740, 30004, 13, 9651, 2346, 29901, 518, 5182, 3309, 29892, 9853, 2159, 29892, 8297, 3964, 29962, 30004, 13, 9651, 1820, 29901, 518, 16506, 3309, 29892, 9853, 2159, 29892, 8297, 3964, 29962, 30004, 13, 9651, 995, 29901, 518, 16506, 3309, 29892, 9853, 2159, 29892, 8297, 3964, 29962, 30004, 13, 9651, 1820, 29918, 12791, 29918, 13168, 29901, 565, 5852, 29892, 11105, 7164, 2729, 373, 9853, 2159, 30004, 13, 9651, 11924, 284, 29918, 3859, 29901, 565, 4944, 29892, 3517, 931, 6576, 526, 274, 25936, 30004, 13, 9651, 817, 29918, 705, 5861, 29901, 1962, 1098, 29876, 29918, 4905, 29918, 705, 5861, 30004, 13, 9651, 2294, 29918, 27049, 29901, 1820, 322, 995, 526, 2294, 30004, 13, 30004, 13, 4706, 10604, 29879, 310, 6375, 740, 30004, 13, 9651, 1098, 29876, 29918, 4905, 29901, 518, 5182, 3309, 29892, 9853, 2159, 29892, 8297, 3964, 29962, 30004, 13, 9651, 1098, 29876, 29918, 4905, 29918, 705, 5861, 29901, 518, 16175, 2159, 29892, 3646, 3309, 29892, 5665, 3309, 29962, 30004, 13, 4706, 9995, 30004, 13, 4706, 3855, 27049, 29918, 17642, 353, 2346, 29889, 1272, 29918, 7414, 580, 1275, 1820, 29889, 1272, 29918, 7414, 580, 1275, 995, 29889, 1272, 29918, 7414, 26471, 13, 4706, 10908, 29918, 17642, 353, 1820, 29889, 1272, 29918, 7414, 580, 1275, 995, 29889, 1272, 29918, 7414, 26471, 13, 30004, 13, 4706, 260, 4141, 29918, 2435, 29892, 289, 3616, 29892, 8297, 29918, 6229, 353, 2346, 29889, 2311, 26471, 13, 4706, 4974, 8297, 29918, 6229, 1275, 1583, 29889, 17987, 29918, 6229, 30004, 13, 4706, 4974, 1051, 29898, 1972, 29889, 2311, 3101, 1275, 518, 29873, 4141, 29918, 2435, 29892, 289, 3616, 29892, 8297, 29918, 6229, 29962, 30004, 13, 4706, 4974, 1820, 29889, 2311, 580, 1275, 995, 29889, 2311, 26471, 13, 30004, 13, 4706, 565, 11924, 284, 29918, 3859, 338, 451, 6213, 29901, 30004, 13, 9651, 7160, 29918, 3859, 353, 1583, 3032, 657, 29918, 2080, 29918, 9040, 29898, 25629, 284, 29918, 3859, 8443, 13, 9651, 565, 525, 16304, 29918, 1989, 29915, 297, 7160, 29918, 3859, 29901, 30004, 13, 18884, 396, 3517, 931, 6576, 526, 22152, 448, 694, 817, 304, 337, 26017, 30004, 13, 18884, 396, 1820, 322, 995, 565, 896, 526, 2294, 30004, 13, 18884, 565, 2294, 29918, 27049, 29901, 30004, 13, 462, 1678, 4974, 10908, 29918, 17642, 322, 451, 3855, 27049, 29918, 17642, 30004, 13, 462, 1678, 1820, 353, 995, 353, 6213, 30004, 13, 4706, 1683, 29901, 30004, 13, 9651, 7160, 29918, 3859, 353, 6213, 30004, 13, 30004, 13, 4706, 565, 3855, 27049, 29918, 17642, 29901, 30004, 13, 9651, 396, 1583, 29899, 1131, 2509, 30004, 13, 9651, 3855, 29892, 413, 29892, 325, 353, 1583, 3032, 262, 29918, 20865, 29918, 29939, 27049, 29898, 1972, 8443, 13, 4706, 25342, 10908, 29918, 17642, 29901, 30004, 13, 9651, 396, 2094, 6119, 29899, 7099, 6119, 8570, 30004, 13, 9651, 3855, 353, 1583, 3032, 262, 29918, 20865, 29918, 29939, 29898, 1972, 8443, 13, 9651, 565, 1820, 338, 6213, 29901, 30004, 13, 18884, 4974, 995, 338, 6213, 30004, 13, 18884, 413, 353, 325, 353, 6213, 30004, 13, 9651, 1683, 29901, 30004, 13, 18884, 413, 29892, 325, 353, 1583, 3032, 262, 29918, 20865, 29918, 27049, 29898, 1989, 8443, 13, 4706, 1683, 29901, 30004, 13, 9651, 3855, 353, 1583, 3032, 262, 29918, 20865, 29918, 29939, 29898, 1972, 8443, 13, 9651, 413, 353, 1583, 3032, 262, 29918, 20865, 29918, 29895, 29898, 1989, 8443, 13, 9651, 325, 353, 1583, 3032, 262, 29918, 20865, 29918, 29894, 29898, 1767, 8443, 13, 4706, 3855, 334, 29922, 1583, 29889, 19529, 292, 30004, 13, 30004, 13, 4706, 565, 1583, 29889, 29890, 3173, 29918, 29895, 338, 451, 6213, 29901, 30004, 13, 9651, 4974, 1583, 29889, 29890, 3173, 29918, 29894, 338, 451, 6213, 30004, 13, 9651, 413, 353, 4842, 305, 29889, 4117, 4197, 29895, 29892, 1583, 29889, 29890, 3173, 29918, 29895, 29889, 14358, 29898, 29896, 29892, 289, 3616, 29892, 29871, 29896, 29897, 2314, 30004, 13, 9651, 325, 353, 4842, 305, 29889, 4117, 4197, 29894, 29892, 1583, 29889, 29890, 3173, 29918, 29894, 29889, 14358, 29898, 29896, 29892, 289, 3616, 29892, 29871, 29896, 29897, 2314, 30004, 13, 9651, 565, 1098, 29876, 29918, 13168, 338, 451, 6213, 29901, 30004, 13, 18884, 1098, 29876, 29918, 13168, 353, 4842, 305, 29889, 4117, 4197, 1131, 29876, 29918, 13168, 29892, 1098, 29876, 29918, 13168, 29889, 1482, 29918, 3298, 359, 29898, 1131, 29876, 29918, 13168, 29889, 2311, 29898, 29900, 511, 29871, 29896, 29897, 1402, 3964, 29922, 29896, 8443, 13, 9651, 565, 1820, 29918, 12791, 29918, 13168, 338, 451, 6213, 29901, 30004, 13, 18884, 1820, 29918, 12791, 29918, 13168, 353, 4842, 305, 29889, 4117, 29898, 30004, 13, 462, 1678, 518, 1989, 29918, 12791, 29918, 13168, 29892, 1820, 29918, 12791, 29918, 13168, 29889, 1482, 29918, 3298, 359, 29898, 1989, 29918, 12791, 29918, 13168, 29889, 2311, 29898, 29900, 511, 29871, 29896, 29897, 1402, 3964, 29922, 29896, 8443, 13, 30004, 13, 4706, 3855, 353, 3855, 29889, 1285, 5526, 681, 2141, 1493, 29898, 29873, 4141, 29918, 2435, 29892, 289, 3616, 334, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 1583, 29889, 2813, 29918, 6229, 467, 3286, 4220, 29898, 29900, 29892, 29871, 29896, 8443, 13, 4706, 565, 413, 338, 451, 6213, 29901, 30004, 13, 9651, 413, 353, 413, 29889, 1285, 5526, 681, 2141, 1493, 6278, 29896, 29892, 289, 3616, 334, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 1583, 29889, 2813, 29918, 6229, 467, 3286, 4220, 29898, 29900, 29892, 29871, 29896, 8443, 13, 4706, 565, 325, 338, 451, 6213, 29901, 30004, 13, 9651, 325, 353, 325, 29889, 1285, 5526, 681, 2141, 1493, 6278, 29896, 29892, 289, 3616, 334, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 1583, 29889, 2813, 29918, 6229, 467, 3286, 4220, 29898, 29900, 29892, 29871, 29896, 8443, 13, 30004, 13, 4706, 565, 7160, 29918, 3859, 338, 451, 6213, 29901, 30004, 13, 9651, 396, 7160, 5922, 526, 6087, 411, 8267, 313, 29890, 3616, 29892, 954, 29918, 2813, 29879, 29892, 19359, 29918, 2435, 29892, 2343, 29918, 6229, 8443, 13, 9651, 565, 525, 16304, 29918, 1989, 29915, 297, 7160, 29918, 3859, 29901, 30004, 13, 18884, 12379, 29918, 1989, 353, 7160, 29918, 3859, 1839, 16304, 29918, 1989, 13359, 1493, 29898, 29890, 3616, 334, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 448, 29896, 29892, 1583, 29889, 2813, 29918, 6229, 8443, 13, 18884, 565, 2294, 29918, 27049, 29901, 30004, 13, 462, 1678, 413, 353, 12379, 29918, 1989, 30004, 13, 18884, 1683, 29901, 30004, 13, 462, 1678, 413, 353, 4842, 305, 29889, 4117, 3552, 16304, 29918, 1989, 29892, 413, 511, 3964, 29922, 29896, 8443, 13, 9651, 565, 525, 16304, 29918, 1767, 29915, 297, 7160, 29918, 3859, 29901, 30004, 13, 18884, 12379, 29918, 1767, 353, 7160, 29918, 3859, 1839, 16304, 29918, 1767, 13359, 1493, 29898, 29890, 3616, 334, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 448, 29896, 29892, 1583, 29889, 2813, 29918, 6229, 8443, 13, 18884, 565, 2294, 29918, 27049, 29901, 30004, 13, 462, 1678, 325, 353, 12379, 29918, 1767, 30004, 13, 18884, 1683, 29901, 30004, 13, 462, 1678, 325, 353, 4842, 305, 29889, 4117, 3552, 16304, 29918, 1767, 29892, 325, 511, 3964, 29922, 29896, 8443, 13, 9651, 7160, 29918, 3859, 1839, 16304, 29918, 1989, 2033, 353, 413, 29889, 1493, 29898, 29890, 3616, 29892, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 448, 29896, 29892, 1583, 29889, 2813, 29918, 6229, 8443, 13, 9651, 7160, 29918, 3859, 1839, 16304, 29918, 1767, 2033, 353, 325, 29889, 1493, 29898, 29890, 3616, 29892, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 448, 29896, 29892, 1583, 29889, 2813, 29918, 6229, 8443, 13, 30004, 13, 9651, 1583, 3032, 842, 29918, 2080, 29918, 9040, 29898, 25629, 284, 29918, 3859, 29892, 7160, 29918, 3859, 8443, 13, 30004, 13, 4706, 4765, 29918, 2435, 353, 413, 29889, 2311, 29898, 29896, 8443, 13, 30004, 13, 4706, 565, 1820, 29918, 12791, 29918, 13168, 338, 451, 6213, 29901, 30004, 13, 9651, 4974, 1820, 29918, 12791, 29918, 13168, 29889, 2311, 29898, 29900, 29897, 1275, 289, 3616, 30004, 13, 9651, 4974, 1820, 29918, 12791, 29918, 13168, 29889, 2311, 29898, 29896, 29897, 1275, 4765, 29918, 2435, 30004, 13, 30004, 13, 4706, 565, 1583, 29889, 1202, 29918, 9171, 29918, 1131, 29876, 29901, 30004, 13, 9651, 4765, 29918, 2435, 4619, 29871, 29896, 30004, 13, 9651, 413, 353, 4842, 305, 29889, 4117, 4197, 29895, 29892, 413, 29889, 1482, 29918, 3298, 359, 3552, 29895, 29889, 2311, 29898, 29900, 511, 29871, 29896, 29897, 718, 413, 29889, 2311, 580, 29961, 29906, 29901, 2314, 1402, 3964, 29922, 29896, 8443, 13, 9651, 325, 353, 4842, 305, 29889, 4117, 4197, 29894, 29892, 325, 29889, 1482, 29918, 3298, 359, 3552, 29894, 29889, 2311, 29898, 29900, 511, 29871, 29896, 29897, 718, 325, 29889, 2311, 580, 29961, 29906, 29901, 2314, 1402, 3964, 29922, 29896, 8443, 13, 9651, 565, 1098, 29876, 29918, 13168, 338, 451, 6213, 29901, 30004, 13, 18884, 1098, 29876, 29918, 13168, 353, 4842, 305, 29889, 4117, 4197, 1131, 29876, 29918, 13168, 29892, 1098, 29876, 29918, 13168, 29889, 1482, 29918, 3298, 359, 29898, 1131, 29876, 29918, 13168, 29889, 2311, 29898, 29900, 511, 29871, 29896, 29897, 1402, 3964, 29922, 29896, 8443, 13, 9651, 565, 1820, 29918, 12791, 29918, 13168, 338, 451, 6213, 29901, 30004, 13, 18884, 1820, 29918, 12791, 29918, 13168, 353, 4842, 305, 29889, 4117, 29898, 30004, 13, 462, 1678, 518, 1989, 29918, 12791, 29918, 13168, 29892, 4842, 305, 29889, 3298, 359, 29898, 1989, 29918, 12791, 29918, 13168, 29889, 2311, 29898, 29900, 511, 29871, 29896, 467, 1853, 29918, 294, 29898, 1989, 29918, 12791, 29918, 13168, 29897, 1402, 3964, 29922, 29896, 8443, 13, 30004, 13, 4706, 1098, 29876, 29918, 4905, 29918, 705, 5861, 353, 4842, 305, 29889, 29890, 4317, 29898, 29939, 29892, 413, 29889, 3286, 4220, 29898, 29896, 29892, 29871, 29906, 876, 30004, 13, 4706, 4974, 1051, 29898, 1131, 29876, 29918, 4905, 29918, 705, 5861, 29889, 2311, 3101, 1275, 518, 29890, 3616, 334, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 260, 4141, 29918, 2435, 29892, 4765, 29918, 2435, 29962, 30004, 13, 30004, 13, 4706, 565, 1098, 29876, 29918, 13168, 338, 451, 6213, 29901, 30004, 13, 9651, 1098, 29876, 29918, 13168, 353, 1098, 29876, 29918, 13168, 29889, 6948, 802, 29872, 911, 29898, 29900, 8443, 13, 9651, 1098, 29876, 29918, 4905, 29918, 705, 5861, 4619, 1098, 29876, 29918, 13168, 30004, 13, 30004, 13, 4706, 565, 1820, 29918, 12791, 29918, 13168, 338, 451, 6213, 29901, 30004, 13, 9651, 1098, 29876, 29918, 4905, 29918, 705, 5861, 353, 1098, 29876, 29918, 4905, 29918, 705, 5861, 29889, 1493, 29898, 29890, 3616, 29892, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 260, 4141, 29918, 2435, 29892, 4765, 29918, 2435, 8443, 13, 9651, 1820, 29918, 12791, 29918, 13168, 353, 1820, 29918, 12791, 29918, 13168, 29889, 1853, 29898, 7345, 305, 29889, 13470, 29947, 467, 517, 29898, 1972, 29889, 10141, 8443, 13, 9651, 1098, 29876, 29918, 4905, 29918, 705, 5861, 353, 1098, 29876, 29918, 4905, 29918, 705, 5861, 29889, 13168, 287, 29918, 5589, 29898, 30004, 13, 18884, 1820, 29918, 12791, 29918, 13168, 29889, 6948, 802, 29872, 911, 29898, 29896, 467, 6948, 802, 29872, 911, 29898, 29906, 511, 30004, 13, 18884, 5785, 877, 29899, 7192, 5477, 30004, 13, 9651, 1723, 30004, 13, 9651, 1098, 29876, 29918, 4905, 29918, 705, 5861, 353, 1098, 29876, 29918, 4905, 29918, 705, 5861, 29889, 1493, 29898, 29890, 3616, 334, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 260, 4141, 29918, 2435, 29892, 4765, 29918, 2435, 8443, 13, 30004, 13, 4706, 1098, 29876, 29918, 4905, 29918, 705, 5861, 353, 383, 29889, 2695, 3317, 29898, 30004, 13, 9651, 1098, 29876, 29918, 4905, 29918, 705, 5861, 29889, 7411, 3285, 3964, 10457, 29896, 11167, 13, 9651, 26688, 29922, 7345, 305, 29889, 7411, 29941, 29906, 565, 1098, 29876, 29918, 4905, 29918, 705, 5861, 29889, 29881, 1853, 1275, 4842, 305, 29889, 7411, 29896, 29953, 1683, 1098, 29876, 29918, 4905, 29918, 705, 5861, 29889, 29881, 1853, 8443, 13, 4706, 1098, 29876, 29918, 4905, 29918, 705, 5861, 353, 383, 29889, 8865, 449, 29898, 1131, 29876, 29918, 4905, 29918, 705, 5861, 29892, 282, 29922, 1311, 29889, 8865, 449, 29892, 6694, 29922, 1311, 29889, 26495, 8443, 13, 30004, 13, 4706, 1098, 29876, 29918, 4905, 353, 4842, 305, 29889, 29890, 4317, 29898, 1131, 29876, 29918, 4905, 29918, 705, 5861, 29892, 325, 8443, 13, 4706, 4974, 1051, 29898, 1131, 29876, 29918, 4905, 29889, 2311, 3101, 1275, 518, 29890, 3616, 334, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 260, 4141, 29918, 2435, 29892, 1583, 29889, 2813, 29918, 6229, 29962, 30004, 13, 4706, 1098, 29876, 29918, 4905, 353, 1098, 29876, 29918, 4905, 29889, 3286, 4220, 29898, 29900, 29892, 29871, 29896, 467, 1285, 5526, 681, 2141, 1493, 29898, 29873, 4141, 29918, 2435, 29892, 289, 3616, 29892, 8297, 29918, 6229, 8443, 13, 4706, 1098, 29876, 29918, 4905, 353, 1583, 29889, 449, 29918, 20865, 29898, 1131, 29876, 29918, 4905, 8443, 13, 30004, 13, 4706, 565, 817, 29918, 705, 5861, 29901, 30004, 13, 9651, 396, 6588, 8570, 18177, 975, 15883, 30004, 13, 9651, 1098, 29876, 29918, 4905, 29918, 705, 5861, 353, 1098, 29876, 29918, 4905, 29918, 705, 5861, 29889, 1493, 29898, 29890, 3616, 29892, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 260, 4141, 29918, 2435, 29892, 4765, 29918, 2435, 8443, 13, 9651, 1098, 29876, 29918, 4905, 29918, 705, 5861, 353, 1098, 29876, 29918, 4905, 29918, 705, 5861, 29889, 2083, 29898, 6229, 29922, 29896, 29897, 847, 1583, 29889, 1949, 29918, 2813, 29879, 30004, 13, 4706, 1683, 29901, 30004, 13, 9651, 1098, 29876, 29918, 4905, 29918, 705, 5861, 353, 6213, 30004, 13, 30004, 13, 4706, 736, 1098, 29876, 29918, 4905, 29892, 1098, 29876, 29918, 4905, 29918, 705, 5861, 30004, 13, 30004, 13, 1678, 822, 903, 262, 29918, 20865, 29918, 29939, 27049, 29898, 1311, 29892, 2346, 1125, 30004, 13, 4706, 736, 1583, 3032, 262, 29918, 20865, 29898, 1972, 467, 29812, 29898, 29941, 29892, 3964, 10457, 29896, 8443, 13, 30004, 13, 1678, 822, 903, 262, 29918, 20865, 29918, 27049, 29898, 1311, 29892, 1820, 1125, 30004, 13, 4706, 736, 1583, 3032, 262, 29918, 20865, 29898, 1989, 29892, 1369, 29922, 1311, 29889, 17987, 29918, 6229, 467, 29812, 29898, 29906, 29892, 3964, 10457, 29896, 8443, 13, 30004, 13, 1678, 822, 903, 262, 29918, 20865, 29918, 29939, 29898, 1311, 29892, 2346, 1125, 30004, 13, 4706, 736, 1583, 3032, 262, 29918, 20865, 29898, 1972, 29892, 1095, 29922, 1311, 29889, 17987, 29918, 6229, 8443, 13, 30004, 13, 1678, 822, 903, 262, 29918, 20865, 29918, 29895, 29898, 1311, 29892, 1820, 1125, 30004, 13, 4706, 736, 1583, 3032, 262, 29918, 20865, 29898, 1989, 29892, 1369, 29922, 1311, 29889, 17987, 29918, 6229, 29892, 1095, 29922, 29906, 334, 1583, 29889, 17987, 29918, 6229, 8443, 13, 30004, 13, 1678, 822, 903, 262, 29918, 20865, 29918, 29894, 29898, 1311, 29892, 995, 1125, 30004, 13, 4706, 736, 1583, 3032, 262, 29918, 20865, 29898, 1767, 29892, 1369, 29922, 29906, 334, 1583, 29889, 17987, 29918, 6229, 8443, 13, 30004, 13, 1678, 822, 903, 262, 29918, 20865, 29898, 1311, 29892, 1881, 29892, 1369, 29922, 29900, 29892, 1095, 29922, 8516, 1125, 30004, 13, 4706, 7688, 353, 1583, 29889, 262, 29918, 20865, 29918, 7915, 30004, 13, 4706, 24003, 353, 1583, 29889, 262, 29918, 20865, 29918, 29890, 3173, 30004, 13, 4706, 7688, 353, 7688, 29961, 2962, 29901, 355, 29892, 584, 29962, 30004, 13, 4706, 565, 24003, 338, 451, 6213, 29901, 30004, 13, 9651, 24003, 353, 24003, 29961, 2962, 29901, 355, 29962, 30004, 13, 4706, 736, 383, 29889, 10660, 29898, 2080, 29892, 7688, 29892, 24003, 29897, 2 ]
alembic/versions/22f80ee91db_cdeppk.py
wenbs/mptracker
4
192848
revision = '22f80ee91db' down_revision = '5994be361ba' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column('proposal', sa.Column('cdeppk_cdep', sa.Integer(), nullable=True)) op.add_column('proposal', sa.Column('cdeppk_senate', sa.Integer(), nullable=True)) def downgrade(): op.drop_column('proposal', 'cdeppk_senate') op.drop_column('proposal', 'cdeppk_cdep')
[ 1, 26554, 353, 525, 29906, 29906, 29888, 29947, 29900, 3905, 29929, 29896, 2585, 29915, 13, 3204, 29918, 276, 4924, 353, 525, 29945, 29929, 29929, 29946, 915, 29941, 29953, 29896, 2291, 29915, 13, 13, 3166, 20712, 29890, 293, 1053, 1015, 13, 5215, 4576, 284, 305, 6764, 408, 872, 13, 13, 13, 1753, 14955, 7295, 13, 1678, 1015, 29889, 1202, 29918, 4914, 877, 771, 1066, 284, 742, 13, 4706, 872, 29889, 4409, 877, 29883, 311, 407, 29895, 29918, 29883, 2716, 742, 872, 29889, 7798, 3285, 1870, 519, 29922, 5574, 876, 13, 1678, 1015, 29889, 1202, 29918, 4914, 877, 771, 1066, 284, 742, 13, 4706, 872, 29889, 4409, 877, 29883, 311, 407, 29895, 29918, 4881, 403, 742, 872, 29889, 7798, 3285, 1870, 519, 29922, 5574, 876, 13, 13, 13, 1753, 1623, 8228, 7295, 13, 1678, 1015, 29889, 8865, 29918, 4914, 877, 771, 1066, 284, 742, 525, 29883, 311, 407, 29895, 29918, 4881, 403, 1495, 13, 1678, 1015, 29889, 8865, 29918, 4914, 877, 771, 1066, 284, 742, 525, 29883, 311, 407, 29895, 29918, 29883, 2716, 1495, 13, 2 ]
cmd_thread.py
summunity/DjangoReact_CLI
0
149921
import threading import time import ctypes class CmdThread(threading.Thread): def __init__(self, app, commands): threading.Thread.__init__(self) self.app = app self.commands = commands def run(self): import subprocess import os os.chdir(self.app['path']) # target function of the thread class try: for cmd in self.commands: subprocess.call(cmd) finally: print('ended') return # def get_id(self): # if hasattr(self, '_thread_id'): # return self._thread_id # def get_id( self ): # returns id of the respective thread if hasattr(self, '_thread_id'): return self._thread_id for id, thread in threading._active.items(): if thread is self: return id def raise_exception(self): thread_id = self.get_id() res = ctypes.pythonapi.PyThreadState_SetAsyncExc(thread_id, ctypes.py_object(SystemExit)) print('what is this', res) if res >= 1: ctypes.pythonapi.PyThreadState_SetAsyncExc(thread_id, 0) print('Exception raise failure')
[ 1, 29871, 13, 5215, 3244, 292, 13, 5215, 931, 13, 5215, 274, 8768, 13, 13, 13, 1990, 315, 3487, 4899, 29898, 7097, 292, 29889, 4899, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 623, 29892, 8260, 1125, 13, 4706, 3244, 292, 29889, 4899, 17255, 2344, 12035, 1311, 29897, 13, 13, 4706, 1583, 29889, 932, 353, 623, 13, 4706, 1583, 29889, 26381, 353, 8260, 13, 13, 13, 1678, 822, 1065, 29898, 1311, 1125, 13, 13, 4706, 1053, 1014, 5014, 13, 4706, 1053, 2897, 13, 13, 4706, 2897, 29889, 305, 3972, 29898, 1311, 29889, 932, 1839, 2084, 11287, 13, 13, 4706, 396, 3646, 740, 310, 278, 3244, 770, 13, 4706, 1018, 29901, 13, 9651, 363, 9920, 297, 1583, 29889, 26381, 29901, 13, 18884, 1014, 5014, 29889, 4804, 29898, 9006, 29897, 13, 13, 4706, 7146, 29901, 13, 9651, 1596, 877, 2760, 1495, 13, 13, 4706, 736, 13, 13, 1678, 396, 822, 679, 29918, 333, 29898, 1311, 1125, 13, 1678, 396, 268, 565, 756, 5552, 29898, 1311, 29892, 22868, 7097, 29918, 333, 29374, 13, 1678, 396, 308, 736, 1583, 3032, 7097, 29918, 333, 13, 1678, 396, 13, 1678, 822, 679, 29918, 333, 29898, 1583, 29871, 1125, 13, 4706, 396, 3639, 1178, 310, 278, 18067, 3244, 13, 4706, 565, 756, 5552, 29898, 1311, 29892, 22868, 7097, 29918, 333, 29374, 13, 9651, 736, 1583, 3032, 7097, 29918, 333, 13, 4706, 363, 1178, 29892, 3244, 297, 3244, 292, 3032, 4925, 29889, 7076, 7295, 13, 9651, 565, 3244, 338, 1583, 29901, 13, 18884, 736, 1178, 13, 13, 13, 1678, 822, 12020, 29918, 11739, 29898, 1311, 1125, 13, 4706, 3244, 29918, 333, 353, 1583, 29889, 657, 29918, 333, 580, 13, 4706, 620, 353, 274, 8768, 29889, 4691, 2754, 29889, 19737, 4899, 2792, 29918, 2697, 8123, 1252, 29883, 29898, 7097, 29918, 333, 29892, 274, 8768, 29889, 2272, 29918, 3318, 29898, 3924, 24365, 876, 13, 4706, 1596, 877, 5816, 338, 445, 742, 620, 29897, 13, 4706, 565, 620, 6736, 29871, 29896, 29901, 13, 9651, 274, 8768, 29889, 4691, 2754, 29889, 19737, 4899, 2792, 29918, 2697, 8123, 1252, 29883, 29898, 7097, 29918, 333, 29892, 29871, 29900, 29897, 13, 9651, 1596, 877, 2451, 12020, 10672, 1495, 13, 2 ]
Module3/notes/imshow_example.py
FernanOrtega/DAT210x
0
34048
<reponame>FernanOrtega/DAT210x #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Jul 21 13:15:22 2017 @author: fernando """ import matplotlib import matplotlib.pyplot as plt import pandas as pd matplotlib.style.use('ggplot') # Look Pretty # If the above line throws an error, use plt.style.use('ggplot') instead df = pd.read_csv("concrete.csv") plt.imshow(df.corr(), cmap=plt.cm.Blues, interpolation='nearest') plt.colorbar() tick_marks = [i for i in range(len(df.columns))] plt.xticks(tick_marks, df.columns, rotation='vertical') plt.yticks(tick_marks, df.columns) plt.show()
[ 1, 529, 276, 1112, 420, 29958, 20899, 273, 2816, 371, 3249, 29914, 25832, 29906, 29896, 29900, 29916, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29906, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 20399, 373, 11169, 2739, 29871, 29906, 29896, 29871, 29896, 29941, 29901, 29896, 29945, 29901, 29906, 29906, 29871, 29906, 29900, 29896, 29955, 13, 13, 29992, 8921, 29901, 285, 824, 1743, 13, 15945, 29908, 13, 13, 5215, 22889, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 11701, 408, 10518, 13, 2922, 17357, 29889, 3293, 29889, 1509, 877, 1505, 5317, 1495, 396, 7419, 4721, 4349, 13, 29937, 960, 278, 2038, 1196, 8026, 385, 1059, 29892, 671, 14770, 29889, 3293, 29889, 1509, 877, 1505, 5317, 1495, 2012, 13, 13, 2176, 353, 10518, 29889, 949, 29918, 7638, 703, 535, 9084, 29889, 7638, 1159, 13, 13, 572, 29873, 29889, 326, 4294, 29898, 2176, 29889, 29725, 3285, 274, 1958, 29922, 572, 29873, 29889, 4912, 29889, 10358, 1041, 29892, 29694, 2433, 28502, 342, 1495, 13, 572, 29873, 29889, 2780, 1646, 580, 13, 24667, 29918, 22848, 353, 518, 29875, 363, 474, 297, 3464, 29898, 2435, 29898, 2176, 29889, 13099, 28166, 13, 572, 29873, 29889, 486, 7358, 29898, 24667, 29918, 22848, 29892, 4489, 29889, 13099, 29892, 13733, 2433, 18575, 1495, 13, 572, 29873, 29889, 3637, 7358, 29898, 24667, 29918, 22848, 29892, 4489, 29889, 13099, 29897, 13, 13, 572, 29873, 29889, 4294, 580, 2 ]
paddlespatial/networks/sagnn.py
PaddlePaddle/PaddleSpatial
38
84996
<filename>paddlespatial/networks/sagnn.py # -*-Encoding: utf-8 -*- ################################################################################ # # Copyright (c) 2021 Baidu.com, Inc. All Rights Reserved # ################################################################################ """ Description: Spatial Adaptive Graph Convolutional Layer in the paper "Competitive analysis for points of interest". Authors: lishuangli(<EMAIL>) Date: 2021/09/24 """ import numpy as np import paddle import paddle.nn as nn import paddle.nn.functional as F import pgl from pgl.nn import functional as GF from pgl.sampling.custom import subgraph class SpatialLocalAGG(nn.Layer): """ Desc: Local aggregation layer for SA-GNN. """ def __init__(self, input_dim, hidden_dim, transform=False, activation=None): """ Desc: __init__ Args: input_dim: The dimension size of the input tensor hidden_dim: The dimension size of the output tensor transform: If transform is True, then the linear transformation is employed activation: The activation for the output """ super(SpatialLocalAGG, self).__init__() self.transform = transform if self.transform: self.linear = nn.Linear(input_dim, hidden_dim, bias_attr=False) self.activation = activation def forward(self, graph, feature, norm=True): """ Desc: A step of forward the layer. Args: graph: pgl.Graph instance feature: The node feature matrix with shape (num_nodes, input_size) norm: If norm is not None, then the feature will be normalized by given norm. If norm is None and self.norm is true, then we use lapacian degree norm. Returns: outputs: A tensor with shape (num_nodes, output_size) """ norm = GF.degree_norm(graph) if self.transform: feature = self.linear(feature) feature = feature * norm output = graph.send_recv(feature, "sum") output = output * norm if self.activation is not None: output = self.activation(output) return output class SpatialOrientedAGG(nn.Layer): """ Desc: Global aggregation layer for SA-GNN. """ def __init__(self, input_dim, hidden_dim, num_sectors, transform=False, activation=None): """ Desc: __init__ Args: input_dim: The dimension size of the input tensor hidden_dim: The dimension size of the output tensor num_sectors: The number of spatial sector transform: If transform is True, then the linear transformation is employed activation: The activation for the output """ super(SpatialOrientedAGG, self).__init__() self.num_sectors = num_sectors linear_input_dim = hidden_dim * (num_sectors + 1) if transform else input_dim * (num_sectors + 1) self.linear = nn.Linear(linear_input_dim, hidden_dim, bias_attr=False) self.conv_layer = nn.LayerList() for _ in range(num_sectors + 1): conv = SpatialLocalAGG(input_dim, hidden_dim, transform, activation=lambda x: x) self.conv_layer.append(conv) def get_subgraphs(self, g): """ Desc: Extract the subgraphs according to the spatial loction. Args: g: pgl.Graph instance Returns: outputs: A list of subgraphs (pgl.Graph instance) """ g = g.numpy() subgraph_edge_list = [[] for _ in range(self.num_sectors + 1)] coords = g.node_feat['coord'] # size: [num_poi, 2] for src_node, dst_node in g.edges: src_coord, dst_coord = coords[src_node], coords[dst_node] rela_coord = dst_coord - src_coord if rela_coord[0] == 0 and rela_coord[1] == 0: sec_ind = 0 else: rela_coord[0] += 1e-9 angle = np.arctan(rela_coord[1]/rela_coord[0]) angle = angle + np.pi * int(angle < 0) angle = angle + np.pi * int(rela_coord[0] < 0) sec_ind = int(angle / (np.pi / self.num_sectors)) sec_ind = min(sec_ind, self.num_sectors) subgraph_edge_list[sec_ind] += [(src_node, dst_node)] subgraph_list = [] for i in range(self.num_sectors + 1): sub_g = subgraph(g, g.nodes, edges=subgraph_edge_list[i]) subgraph_list.append(sub_g.tensor()) return subgraph_list def forward(self, graph, feature, norm=None): """ Desc: A step of forward the layer. Args: graph: pgl.Graph instance feature: The node feature matrix with shape (num_nodes, input_size) norm: If norm is not None, then the feature will be normalized by given norm. If norm is None and self.norm is true, then we use lapacian degree norm. Returns: outputs: A tensor with shape (num_nodes, output_size) """ subgraphs = self.get_subgraphs(graph) h_list = [] for i in range(self.num_sectors + 1): h = self.conv_layer[i](subgraphs[i], feature, norm) h_list.append(h) feat_h = paddle.concat(h_list, axis=-1) feat_h = paddle.cast(feat_h, 'float32') output = self.linear(feat_h) return output class SpatialAttnProp(nn.Layer): """ Desc: Location-aware attentive propagation layer for SA-GNN. """ def __init__(self, input_dim, hidden_dim, num_heads, dropout, max_dist=10000, grid_len=100, activation=None): super(SpatialAttnProp, self).__init__() """ Desc: __init__ Args: input_dim: The dimension size of the input tensor hidden_dim: The dimension size of the output tensor num_heads: The number of attention head dropout: Dropout ratio max_dist: The maximum distance range around each POI grid_len: The length of segmented grid activation: The activation for the output """ self.num_heads = num_heads self.hidden_dim = hidden_dim self.grid_len = grid_len self.max_dist = max_dist self.grid_num = int(max_dist / grid_len) self.poi_fc = nn.Linear(input_dim, num_heads * hidden_dim) self.loc_fc = nn.Linear(2 * hidden_dim, num_heads * hidden_dim) self.x_embedding = nn.Embedding(2 * self.grid_num, hidden_dim, sparse=True) self.y_embedding = nn.Embedding(2 * self.grid_num, hidden_dim, sparse=True) self.weight_src = self.create_parameter(shape=[num_heads, hidden_dim]) self.weight_dst = self.create_parameter(shape=[num_heads, hidden_dim]) self.weight_loc = self.create_parameter(shape=[num_heads, hidden_dim]) self.feat_drop = nn.Dropout(p=dropout) self.attn_drop = nn.Dropout(p=dropout) self.leaky_relu = nn.LeakyReLU(negative_slope=0.2) self.activation = activation def attn_send_func(self, src_feat, dst_feat, edge_feat): """ Desc: Sending function for message passing Args: src_feat: The feature of source POI node dst_feat: The feature of destination POI node edge_feat: The feature of edge between two POIs Returns: outputs: A dict of tensor """ alpha = src_feat["attn"] + dst_feat["attn"] + edge_feat['attn'] alpha = self.leaky_relu(alpha) return {"alpha": alpha, "h": src_feat["h"]} def attn_recv_func(self, msg): """ Desc: Receiving function for message passing Args: msg: Message dict Returns: outputs: A tensor with shape (num_nodes, output_size) """ alpha = msg.reduce_softmax(msg["alpha"]) alpha = paddle.reshape(alpha, [-1, self.num_heads, 1]) alpha = self.attn_drop(alpha) feature = msg["h"] feature = paddle.reshape(feature, [-1, self.num_heads, self.hidden_dim]) feature = feature * alpha feature = paddle.reshape(feature, [-1, self.num_heads * self.hidden_dim]) feature = msg.reduce(feature, pool_type="sum") return feature def calculate_loc_index(self, src_coord, dst_coord): """ Desc: Calculte the grid index for loaction-aware attention Args: src_coord: Coordinate of source POI node dst_coord: Coordinate of target POI node Returns: outputs: Two tensors with shape (num_edges, 1) """ x, y = paddle.split(dst_coord - src_coord, num_or_sections=2, axis=1) x_inds = paddle.cast(paddle.abs(x)/self.grid_len, 'int64') y_inds = paddle.cast(paddle.abs(y)/self.grid_len, 'int64') x_inds = x_inds + self.grid_num * paddle.cast(x >= 0, 'int64') y_inds = y_inds + self.grid_num * paddle.cast(y >= 0, 'int64') x_inds = paddle.clip(x_inds, 0, 2 * self.grid_num - 1) y_inds = paddle.clip(y_inds, 0, 2 * self.grid_num - 1) return x_inds, y_inds def forward(self, graph, feature): """ Desc: A step of forward the layer. Args: graph: pgl.Graph instance feature: The node feature matrix with shape (num_nodes, input_size) Returns: outputs: A tensor with shape (num_nodes, output_size) """ feature = self.feat_drop(feature) poi_feat = self.poi_fc(feature) poi_feat = paddle.reshape(poi_feat, [-1, self.num_heads, self.hidden_dim]) # calculate location feature src_inds, dst_inds = paddle.split(graph.edges, num_or_sections=2, axis=1) src_coord = paddle.gather(graph.node_feat['coord'], paddle.squeeze(src_inds)) dst_coord = paddle.gather(graph.node_feat['coord'], paddle.squeeze(dst_inds)) x_inds, y_inds = self.calculate_loc_index(src_coord, dst_coord) x_emb = self.x_embedding(x_inds) y_emb = self.y_embedding(y_inds) loc_feat = self.loc_fc(paddle.concat([x_emb, y_emb], axis=-1)) loc_feat = paddle.reshape(loc_feat, [-1, self.num_heads, self.hidden_dim]) attn_src = paddle.sum(poi_feat * self.weight_src, axis=-1) attn_dst = paddle.sum(poi_feat * self.weight_dst, axis=-1) attn_loc = paddle.sum(loc_feat * self.weight_loc, axis=-1) msg = graph.send(self.attn_send_func, src_feat={"attn": attn_src, "h": poi_feat}, dst_feat={"attn": attn_dst}, edge_feat={'attn': attn_loc}) rst = graph.recv(reduce_func=self.attn_recv_func, msg=msg) if self.activation: rst = self.activation(rst) return rst
[ 1, 529, 9507, 29958, 29886, 1202, 793, 5031, 616, 29914, 11618, 29879, 29914, 29879, 4211, 29876, 29889, 2272, 13, 29937, 448, 29930, 29899, 14934, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13383, 13383, 13383, 13383, 13383, 13, 29937, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29896, 6000, 333, 29884, 29889, 510, 29892, 9266, 29889, 2178, 26863, 2538, 9841, 13, 29937, 13, 13383, 13383, 13383, 13383, 13383, 13, 15945, 29908, 13, 9868, 29901, 29871, 1706, 15238, 23255, 415, 573, 12367, 1281, 4068, 284, 365, 2747, 297, 278, 5650, 376, 6843, 300, 3321, 7418, 363, 3291, 310, 4066, 1642, 13, 6444, 943, 29901, 301, 728, 29884, 574, 492, 29898, 29966, 26862, 6227, 12948, 13, 2539, 29901, 268, 29906, 29900, 29906, 29896, 29914, 29900, 29929, 29914, 29906, 29946, 13, 15945, 29908, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 282, 22352, 13, 5215, 282, 22352, 29889, 15755, 408, 302, 29876, 13, 5215, 282, 22352, 29889, 15755, 29889, 2220, 284, 408, 383, 13, 5215, 282, 3820, 13, 3166, 282, 3820, 29889, 15755, 1053, 13303, 408, 402, 29943, 13, 3166, 282, 3820, 29889, 13445, 10335, 29889, 6341, 1053, 1014, 4262, 13, 13, 13, 1990, 1706, 15238, 7717, 10051, 29954, 29898, 15755, 29889, 14420, 1125, 13, 1678, 9995, 13, 1678, 2726, 29883, 29901, 13, 539, 9959, 11404, 362, 7546, 363, 16698, 29899, 29954, 10262, 29889, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1881, 29918, 6229, 29892, 7934, 29918, 6229, 29892, 4327, 29922, 8824, 29892, 26229, 29922, 8516, 1125, 13, 4706, 9995, 13, 4706, 2726, 29883, 29901, 13, 9651, 4770, 2344, 1649, 13, 4706, 826, 3174, 29901, 13, 9651, 1881, 29918, 6229, 29901, 450, 9927, 2159, 310, 278, 1881, 12489, 13, 9651, 7934, 29918, 6229, 29901, 450, 9927, 2159, 310, 278, 1962, 12489, 13, 9651, 4327, 29901, 960, 4327, 338, 5852, 29892, 769, 278, 5608, 13852, 338, 15723, 13, 9651, 26229, 29901, 450, 26229, 363, 278, 1962, 13, 4706, 9995, 13, 4706, 2428, 29898, 29903, 5031, 616, 7717, 10051, 29954, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 9067, 353, 4327, 13, 4706, 565, 1583, 29889, 9067, 29901, 13, 9651, 1583, 29889, 10660, 353, 302, 29876, 29889, 12697, 29898, 2080, 29918, 6229, 29892, 7934, 29918, 6229, 29892, 24003, 29918, 5552, 29922, 8824, 29897, 13, 4706, 1583, 29889, 11236, 362, 353, 26229, 13, 13, 1678, 822, 6375, 29898, 1311, 29892, 3983, 29892, 4682, 29892, 6056, 29922, 5574, 1125, 13, 4706, 9995, 13, 4706, 2726, 29883, 29901, 13, 9651, 319, 4331, 310, 6375, 278, 7546, 29889, 13, 4706, 826, 3174, 29901, 13, 9651, 3983, 29901, 282, 3820, 29889, 9527, 2777, 13, 9651, 4682, 29901, 450, 2943, 4682, 4636, 411, 8267, 313, 1949, 29918, 18010, 29892, 1881, 29918, 2311, 29897, 13, 9651, 6056, 29901, 960, 6056, 338, 451, 6213, 29892, 769, 278, 4682, 674, 367, 4226, 1891, 491, 2183, 6056, 29889, 13, 462, 29871, 960, 6056, 338, 6213, 322, 1583, 29889, 12324, 338, 1565, 29892, 769, 591, 671, 425, 3274, 28445, 7426, 6056, 29889, 13, 4706, 16969, 29901, 13, 9651, 14391, 29901, 319, 12489, 411, 8267, 313, 1949, 29918, 18010, 29892, 1962, 29918, 2311, 29897, 13, 4706, 9995, 13, 4706, 6056, 353, 402, 29943, 29889, 12163, 929, 29918, 12324, 29898, 4262, 29897, 13, 4706, 565, 1583, 29889, 9067, 29901, 13, 9651, 4682, 353, 1583, 29889, 10660, 29898, 14394, 29897, 13, 4706, 4682, 353, 4682, 334, 6056, 13, 13, 4706, 1962, 353, 3983, 29889, 6717, 29918, 3757, 29894, 29898, 14394, 29892, 376, 2083, 1159, 13, 4706, 1962, 353, 1962, 334, 6056, 13, 4706, 565, 1583, 29889, 11236, 362, 338, 451, 6213, 29901, 13, 9651, 1962, 353, 1583, 29889, 11236, 362, 29898, 4905, 29897, 13, 4706, 736, 1962, 13, 13, 13, 1990, 1706, 15238, 15988, 14927, 10051, 29954, 29898, 15755, 29889, 14420, 1125, 13, 1678, 9995, 13, 1678, 2726, 29883, 29901, 13, 539, 12002, 11404, 362, 7546, 363, 16698, 29899, 29954, 10262, 29889, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1881, 29918, 6229, 29892, 7934, 29918, 6229, 29892, 954, 29918, 8803, 943, 29892, 4327, 29922, 8824, 29892, 26229, 29922, 8516, 1125, 13, 4706, 9995, 13, 4706, 2726, 29883, 29901, 13, 9651, 4770, 2344, 1649, 13, 4706, 826, 3174, 29901, 13, 9651, 1881, 29918, 6229, 29901, 450, 9927, 2159, 310, 278, 1881, 12489, 13, 9651, 7934, 29918, 6229, 29901, 450, 9927, 2159, 310, 278, 1962, 12489, 13, 9651, 954, 29918, 8803, 943, 29901, 450, 1353, 310, 18652, 17535, 13, 9651, 4327, 29901, 960, 4327, 338, 5852, 29892, 769, 278, 5608, 13852, 338, 15723, 13, 9651, 26229, 29901, 450, 26229, 363, 278, 1962, 13, 4706, 9995, 13, 4706, 2428, 29898, 29903, 5031, 616, 15988, 14927, 10051, 29954, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 1949, 29918, 8803, 943, 353, 954, 29918, 8803, 943, 13, 4706, 5608, 29918, 2080, 29918, 6229, 353, 7934, 29918, 6229, 334, 313, 1949, 29918, 8803, 943, 718, 29871, 29896, 29897, 565, 4327, 1683, 1881, 29918, 6229, 334, 313, 1949, 29918, 8803, 943, 718, 29871, 29896, 29897, 13, 4706, 1583, 29889, 10660, 353, 302, 29876, 29889, 12697, 29898, 10660, 29918, 2080, 29918, 6229, 29892, 7934, 29918, 6229, 29892, 24003, 29918, 5552, 29922, 8824, 29897, 13, 308, 13, 4706, 1583, 29889, 20580, 29918, 13148, 353, 302, 29876, 29889, 14420, 1293, 580, 13, 4706, 363, 903, 297, 3464, 29898, 1949, 29918, 8803, 943, 718, 29871, 29896, 1125, 13, 9651, 7602, 353, 1706, 15238, 7717, 10051, 29954, 29898, 2080, 29918, 6229, 29892, 7934, 29918, 6229, 29892, 4327, 29892, 26229, 29922, 2892, 921, 29901, 921, 29897, 13, 9651, 1583, 29889, 20580, 29918, 13148, 29889, 4397, 29898, 20580, 29897, 13, 13, 1678, 822, 679, 29918, 1491, 4262, 29879, 29898, 1311, 29892, 330, 1125, 13, 4706, 9995, 13, 4706, 2726, 29883, 29901, 13, 9651, 7338, 1461, 278, 1014, 4262, 29879, 5034, 304, 278, 18652, 658, 428, 29889, 13, 4706, 826, 3174, 29901, 13, 9651, 330, 29901, 282, 3820, 29889, 9527, 2777, 13, 4706, 16969, 29901, 13, 9651, 14391, 29901, 319, 1051, 310, 1014, 4262, 29879, 313, 29886, 3820, 29889, 9527, 2777, 29897, 13, 4706, 9995, 13, 4706, 330, 353, 330, 29889, 23749, 580, 13, 4706, 1014, 4262, 29918, 12864, 29918, 1761, 353, 518, 2636, 363, 903, 297, 3464, 29898, 1311, 29889, 1949, 29918, 8803, 943, 718, 29871, 29896, 4638, 13, 4706, 1302, 4339, 353, 330, 29889, 3177, 29918, 1725, 271, 1839, 1111, 536, 2033, 396, 2159, 29901, 518, 1949, 29918, 1129, 29875, 29892, 29871, 29906, 29962, 13, 4706, 363, 4765, 29918, 3177, 29892, 29743, 29918, 3177, 297, 330, 29889, 287, 2710, 29901, 13, 9651, 4765, 29918, 1111, 536, 29892, 29743, 29918, 1111, 536, 353, 1302, 4339, 29961, 4351, 29918, 3177, 1402, 1302, 4339, 29961, 22992, 29918, 3177, 29962, 13, 9651, 10208, 29918, 1111, 536, 353, 29743, 29918, 1111, 536, 448, 4765, 29918, 1111, 536, 13, 9651, 565, 10208, 29918, 1111, 536, 29961, 29900, 29962, 1275, 29871, 29900, 322, 10208, 29918, 1111, 536, 29961, 29896, 29962, 1275, 29871, 29900, 29901, 13, 18884, 5226, 29918, 513, 353, 29871, 29900, 13, 9651, 1683, 29901, 13, 18884, 10208, 29918, 1111, 536, 29961, 29900, 29962, 4619, 29871, 29896, 29872, 29899, 29929, 13, 18884, 10696, 353, 7442, 29889, 27014, 273, 29898, 276, 433, 29918, 1111, 536, 29961, 29896, 16261, 276, 433, 29918, 1111, 536, 29961, 29900, 2314, 13, 18884, 10696, 353, 10696, 718, 7442, 29889, 1631, 334, 938, 29898, 2521, 529, 29871, 29900, 29897, 13, 18884, 10696, 353, 10696, 718, 7442, 29889, 1631, 334, 938, 29898, 276, 433, 29918, 1111, 536, 29961, 29900, 29962, 529, 29871, 29900, 29897, 13, 18884, 5226, 29918, 513, 353, 938, 29898, 2521, 847, 313, 9302, 29889, 1631, 847, 1583, 29889, 1949, 29918, 8803, 943, 876, 29871, 13, 18884, 5226, 29918, 513, 353, 1375, 29898, 3471, 29918, 513, 29892, 1583, 29889, 1949, 29918, 8803, 943, 29897, 13, 9651, 1014, 4262, 29918, 12864, 29918, 1761, 29961, 3471, 29918, 513, 29962, 4619, 17288, 4351, 29918, 3177, 29892, 29743, 29918, 3177, 4638, 13, 308, 13, 4706, 1014, 4262, 29918, 1761, 353, 5159, 13, 4706, 363, 474, 297, 29871, 3464, 29898, 1311, 29889, 1949, 29918, 8803, 943, 718, 29871, 29896, 1125, 13, 9651, 1014, 29918, 29887, 353, 1014, 4262, 29898, 29887, 29892, 330, 29889, 18010, 29892, 12770, 29922, 1491, 4262, 29918, 12864, 29918, 1761, 29961, 29875, 2314, 13, 9651, 1014, 4262, 29918, 1761, 29889, 4397, 29898, 1491, 29918, 29887, 29889, 20158, 3101, 13, 13, 4706, 736, 1014, 4262, 29918, 1761, 13, 13, 1678, 822, 6375, 29898, 1311, 29892, 3983, 29892, 4682, 29892, 6056, 29922, 8516, 1125, 13, 4706, 9995, 13, 4706, 2726, 29883, 29901, 13, 9651, 319, 4331, 310, 6375, 278, 7546, 29889, 13, 4706, 826, 3174, 29901, 13, 9651, 3983, 29901, 282, 3820, 29889, 9527, 2777, 13, 9651, 4682, 29901, 450, 2943, 4682, 4636, 411, 8267, 313, 1949, 29918, 18010, 29892, 1881, 29918, 2311, 29897, 13, 9651, 6056, 29901, 960, 6056, 338, 451, 6213, 29892, 769, 278, 4682, 674, 367, 4226, 1891, 491, 2183, 6056, 29889, 13, 462, 29871, 960, 6056, 338, 6213, 322, 1583, 29889, 12324, 338, 1565, 29892, 769, 591, 671, 425, 3274, 28445, 7426, 6056, 29889, 13, 4706, 16969, 29901, 13, 9651, 14391, 29901, 319, 12489, 411, 8267, 313, 1949, 29918, 18010, 29892, 1962, 29918, 2311, 29897, 13, 4706, 9995, 13, 4706, 1014, 4262, 29879, 353, 1583, 29889, 657, 29918, 1491, 4262, 29879, 29898, 4262, 29897, 13, 308, 13, 4706, 298, 29918, 1761, 353, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 1949, 29918, 8803, 943, 718, 29871, 29896, 1125, 13, 9651, 298, 353, 1583, 29889, 20580, 29918, 13148, 29961, 29875, 850, 1491, 4262, 29879, 29961, 29875, 1402, 4682, 29892, 6056, 29897, 13, 9651, 298, 29918, 1761, 29889, 4397, 29898, 29882, 29897, 13, 308, 13, 4706, 1238, 271, 29918, 29882, 353, 282, 22352, 29889, 17685, 29898, 29882, 29918, 1761, 29892, 9685, 10457, 29896, 29897, 13, 4706, 1238, 271, 29918, 29882, 353, 282, 22352, 29889, 4384, 29898, 1725, 271, 29918, 29882, 29892, 525, 7411, 29941, 29906, 1495, 13, 4706, 1962, 353, 1583, 29889, 10660, 29898, 1725, 271, 29918, 29882, 29897, 13, 4706, 736, 1962, 13, 13, 13, 1990, 1706, 15238, 4165, 29876, 20420, 29898, 15755, 29889, 14420, 1125, 13, 1678, 9995, 13, 1678, 2726, 29883, 29901, 13, 539, 17015, 29899, 28327, 1098, 296, 573, 13089, 362, 7546, 363, 16698, 29899, 29954, 10262, 29889, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1881, 29918, 6229, 29892, 7934, 29918, 6229, 29892, 954, 29918, 2813, 29879, 29892, 5768, 449, 29892, 4236, 29918, 5721, 29922, 29896, 29900, 29900, 29900, 29900, 29892, 6856, 29918, 2435, 29922, 29896, 29900, 29900, 29892, 26229, 29922, 8516, 1125, 13, 4706, 2428, 29898, 29903, 5031, 616, 4165, 29876, 20420, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 4706, 9995, 13, 4706, 2726, 29883, 29901, 13, 9651, 4770, 2344, 1649, 13, 4706, 826, 3174, 29901, 13, 9651, 1881, 29918, 6229, 29901, 450, 9927, 2159, 310, 278, 1881, 12489, 13, 9651, 7934, 29918, 6229, 29901, 450, 9927, 2159, 310, 278, 1962, 12489, 13, 9651, 954, 29918, 2813, 29879, 29901, 450, 1353, 310, 8570, 2343, 13, 9651, 5768, 449, 29901, 20724, 449, 11959, 13, 9651, 4236, 29918, 5721, 29901, 450, 7472, 5418, 3464, 2820, 1269, 21521, 29902, 13, 9651, 6856, 29918, 2435, 29901, 450, 3309, 310, 10768, 287, 6856, 13, 9651, 26229, 29901, 450, 26229, 363, 278, 1962, 13, 4706, 9995, 13, 4706, 1583, 29889, 1949, 29918, 2813, 29879, 353, 954, 29918, 2813, 29879, 13, 4706, 1583, 29889, 10892, 29918, 6229, 353, 7934, 29918, 6229, 13, 4706, 1583, 29889, 7720, 29918, 2435, 353, 6856, 29918, 2435, 13, 4706, 1583, 29889, 3317, 29918, 5721, 353, 4236, 29918, 5721, 13, 4706, 1583, 29889, 7720, 29918, 1949, 353, 938, 29898, 3317, 29918, 5721, 847, 6856, 29918, 2435, 29897, 13, 4706, 1583, 29889, 1129, 29875, 29918, 13801, 353, 302, 29876, 29889, 12697, 29898, 2080, 29918, 6229, 29892, 954, 29918, 2813, 29879, 334, 7934, 29918, 6229, 29897, 13, 4706, 1583, 29889, 2029, 29918, 13801, 353, 302, 29876, 29889, 12697, 29898, 29906, 334, 7934, 29918, 6229, 29892, 954, 29918, 2813, 29879, 334, 7934, 29918, 6229, 29897, 13, 13, 4706, 1583, 29889, 29916, 29918, 17987, 8497, 353, 302, 29876, 29889, 6026, 2580, 8497, 29898, 29906, 334, 1583, 29889, 7720, 29918, 1949, 29892, 7934, 29918, 6229, 29892, 29234, 29922, 5574, 29897, 13, 4706, 1583, 29889, 29891, 29918, 17987, 8497, 353, 302, 29876, 29889, 6026, 2580, 8497, 29898, 29906, 334, 1583, 29889, 7720, 29918, 1949, 29892, 7934, 29918, 6229, 29892, 29234, 29922, 5574, 29897, 13, 4706, 1583, 29889, 7915, 29918, 4351, 353, 1583, 29889, 3258, 29918, 15501, 29898, 12181, 11759, 1949, 29918, 2813, 29879, 29892, 7934, 29918, 6229, 2314, 13, 4706, 1583, 29889, 7915, 29918, 22992, 353, 1583, 29889, 3258, 29918, 15501, 29898, 12181, 11759, 1949, 29918, 2813, 29879, 29892, 7934, 29918, 6229, 2314, 13, 4706, 1583, 29889, 7915, 29918, 2029, 353, 1583, 29889, 3258, 29918, 15501, 29898, 12181, 11759, 1949, 29918, 2813, 29879, 29892, 7934, 29918, 6229, 2314, 13, 13, 4706, 1583, 29889, 1725, 271, 29918, 8865, 353, 302, 29876, 29889, 15063, 449, 29898, 29886, 29922, 8865, 449, 29897, 13, 4706, 1583, 29889, 1131, 29876, 29918, 8865, 353, 302, 29876, 29889, 15063, 449, 29898, 29886, 29922, 8865, 449, 29897, 13, 4706, 1583, 29889, 280, 557, 29891, 29918, 2674, 29884, 353, 302, 29876, 29889, 3226, 557, 29891, 1123, 29931, 29965, 29898, 22198, 29918, 29879, 417, 412, 29922, 29900, 29889, 29906, 29897, 13, 4706, 1583, 29889, 11236, 362, 353, 26229, 13, 13, 1678, 822, 1098, 29876, 29918, 6717, 29918, 9891, 29898, 1311, 29892, 4765, 29918, 1725, 271, 29892, 29743, 29918, 1725, 271, 29892, 7636, 29918, 1725, 271, 1125, 13, 4706, 9995, 13, 4706, 2726, 29883, 29901, 13, 9651, 317, 2548, 740, 363, 2643, 6819, 13, 4706, 826, 3174, 29901, 13, 9651, 4765, 29918, 1725, 271, 29901, 450, 4682, 310, 2752, 21521, 29902, 2943, 13, 9651, 29743, 29918, 1725, 271, 29901, 450, 4682, 310, 12551, 21521, 29902, 2943, 13, 9651, 7636, 29918, 1725, 271, 29901, 450, 4682, 310, 7636, 1546, 1023, 21521, 3624, 13, 4706, 16969, 29901, 13, 9651, 14391, 29901, 319, 9657, 310, 12489, 13, 4706, 9995, 13, 4706, 15595, 353, 4765, 29918, 1725, 271, 3366, 1131, 29876, 3108, 718, 29743, 29918, 1725, 271, 3366, 1131, 29876, 3108, 718, 7636, 29918, 1725, 271, 1839, 1131, 29876, 2033, 13, 4706, 15595, 353, 1583, 29889, 280, 557, 29891, 29918, 2674, 29884, 29898, 2312, 29897, 13, 4706, 736, 8853, 2312, 1115, 15595, 29892, 376, 29882, 1115, 4765, 29918, 1725, 271, 3366, 29882, 3108, 29913, 13, 268, 13, 1678, 822, 1098, 29876, 29918, 3757, 29894, 29918, 9891, 29898, 1311, 29892, 10191, 1125, 13, 4706, 9995, 13, 4706, 2726, 29883, 29901, 13, 9651, 24328, 4357, 740, 363, 2643, 6819, 13, 4706, 826, 3174, 29901, 13, 9651, 10191, 29901, 7777, 9657, 13, 4706, 16969, 29901, 13, 9651, 14391, 29901, 319, 12489, 411, 8267, 313, 1949, 29918, 18010, 29892, 1962, 29918, 2311, 29897, 13, 4706, 9995, 13, 4706, 15595, 353, 10191, 29889, 17469, 29918, 2695, 3317, 29898, 7645, 3366, 2312, 20068, 13, 4706, 15595, 353, 282, 22352, 29889, 690, 14443, 29898, 2312, 29892, 21069, 29896, 29892, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 29871, 29896, 2314, 13, 4706, 15595, 353, 1583, 29889, 1131, 29876, 29918, 8865, 29898, 2312, 29897, 13, 13, 4706, 4682, 353, 10191, 3366, 29882, 3108, 13, 4706, 4682, 353, 282, 22352, 29889, 690, 14443, 29898, 14394, 29892, 21069, 29896, 29892, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 1583, 29889, 10892, 29918, 6229, 2314, 13, 4706, 4682, 353, 4682, 334, 15595, 13, 4706, 4682, 353, 282, 22352, 29889, 690, 14443, 29898, 14394, 29892, 21069, 29896, 29892, 1583, 29889, 1949, 29918, 2813, 29879, 334, 1583, 29889, 10892, 29918, 6229, 2314, 13, 4706, 4682, 353, 10191, 29889, 17469, 29898, 14394, 29892, 11565, 29918, 1853, 543, 2083, 1159, 13, 4706, 736, 4682, 13, 13, 1678, 822, 8147, 29918, 2029, 29918, 2248, 29898, 1311, 29892, 4765, 29918, 1111, 536, 29892, 29743, 29918, 1111, 536, 1125, 13, 4706, 9995, 13, 4706, 2726, 29883, 29901, 13, 9651, 20535, 371, 278, 6856, 2380, 363, 658, 2467, 29899, 28327, 8570, 13, 4706, 826, 3174, 29901, 13, 9651, 4765, 29918, 1111, 536, 29901, 3189, 16065, 310, 2752, 21521, 29902, 2943, 13, 9651, 29743, 29918, 1111, 536, 29901, 3189, 16065, 310, 3646, 21521, 29902, 2943, 13, 4706, 16969, 29901, 13, 9651, 14391, 29901, 7803, 25187, 943, 411, 8267, 313, 1949, 29918, 287, 2710, 29892, 29871, 29896, 29897, 13, 4706, 9995, 13, 4706, 921, 29892, 343, 353, 282, 22352, 29889, 5451, 29898, 22992, 29918, 1111, 536, 448, 4765, 29918, 1111, 536, 29892, 954, 29918, 272, 29918, 27117, 29922, 29906, 29892, 9685, 29922, 29896, 29897, 13, 4706, 921, 29918, 12772, 353, 282, 22352, 29889, 4384, 29898, 29886, 22352, 29889, 6897, 29898, 29916, 6802, 1311, 29889, 7720, 29918, 2435, 29892, 525, 524, 29953, 29946, 1495, 13, 4706, 343, 29918, 12772, 353, 282, 22352, 29889, 4384, 29898, 29886, 22352, 29889, 6897, 29898, 29891, 6802, 1311, 29889, 7720, 29918, 2435, 29892, 525, 524, 29953, 29946, 1495, 13, 4706, 921, 29918, 12772, 353, 921, 29918, 12772, 718, 1583, 29889, 7720, 29918, 1949, 334, 282, 22352, 29889, 4384, 29898, 29916, 6736, 29871, 29900, 29892, 525, 524, 29953, 29946, 1495, 13, 4706, 343, 29918, 12772, 353, 343, 29918, 12772, 718, 1583, 29889, 7720, 29918, 1949, 334, 282, 22352, 29889, 4384, 29898, 29891, 6736, 29871, 29900, 29892, 525, 524, 29953, 29946, 1495, 13, 4706, 921, 29918, 12772, 353, 282, 22352, 29889, 24049, 29898, 29916, 29918, 12772, 29892, 29871, 29900, 29892, 29871, 29906, 334, 1583, 29889, 7720, 29918, 1949, 448, 29871, 29896, 29897, 13, 4706, 343, 29918, 12772, 353, 282, 22352, 29889, 24049, 29898, 29891, 29918, 12772, 29892, 29871, 29900, 29892, 29871, 29906, 334, 1583, 29889, 7720, 29918, 1949, 448, 29871, 29896, 29897, 13, 4706, 736, 921, 29918, 12772, 29892, 343, 29918, 12772, 13, 13, 1678, 822, 6375, 29898, 1311, 29892, 3983, 29892, 4682, 1125, 13, 4706, 9995, 13, 4706, 2726, 29883, 29901, 13, 9651, 319, 4331, 310, 6375, 278, 7546, 29889, 13, 4706, 826, 3174, 29901, 13, 9651, 3983, 29901, 282, 3820, 29889, 9527, 2777, 13, 9651, 4682, 29901, 450, 2943, 4682, 4636, 411, 8267, 313, 1949, 29918, 18010, 29892, 1881, 29918, 2311, 29897, 13, 4706, 16969, 29901, 13, 9651, 14391, 29901, 319, 12489, 411, 8267, 313, 1949, 29918, 18010, 29892, 1962, 29918, 2311, 29897, 13, 4706, 9995, 13, 4706, 4682, 353, 1583, 29889, 1725, 271, 29918, 8865, 29898, 14394, 29897, 13, 4706, 11899, 29918, 1725, 271, 353, 1583, 29889, 1129, 29875, 29918, 13801, 29898, 14394, 29897, 13, 4706, 11899, 29918, 1725, 271, 353, 282, 22352, 29889, 690, 14443, 29898, 1129, 29875, 29918, 1725, 271, 29892, 21069, 29896, 29892, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 1583, 29889, 10892, 29918, 6229, 2314, 13, 13, 4706, 396, 8147, 4423, 4682, 13, 4706, 4765, 29918, 12772, 29892, 29743, 29918, 12772, 353, 282, 22352, 29889, 5451, 29898, 4262, 29889, 287, 2710, 29892, 954, 29918, 272, 29918, 27117, 29922, 29906, 29892, 9685, 29922, 29896, 29897, 13, 4706, 4765, 29918, 1111, 536, 353, 282, 22352, 29889, 29887, 1624, 29898, 4262, 29889, 3177, 29918, 1725, 271, 1839, 1111, 536, 7464, 282, 22352, 29889, 29879, 802, 29872, 911, 29898, 4351, 29918, 12772, 876, 13, 4706, 29743, 29918, 1111, 536, 353, 282, 22352, 29889, 29887, 1624, 29898, 4262, 29889, 3177, 29918, 1725, 271, 1839, 1111, 536, 7464, 282, 22352, 29889, 29879, 802, 29872, 911, 29898, 22992, 29918, 12772, 876, 13, 4706, 921, 29918, 12772, 29892, 343, 29918, 12772, 353, 1583, 29889, 15807, 403, 29918, 2029, 29918, 2248, 29898, 4351, 29918, 1111, 536, 29892, 29743, 29918, 1111, 536, 29897, 13, 4706, 921, 29918, 1590, 353, 1583, 29889, 29916, 29918, 17987, 8497, 29898, 29916, 29918, 12772, 29897, 13, 4706, 343, 29918, 1590, 353, 1583, 29889, 29891, 29918, 17987, 8497, 29898, 29891, 29918, 12772, 29897, 13, 4706, 1180, 29918, 1725, 271, 353, 1583, 29889, 2029, 29918, 13801, 29898, 29886, 22352, 29889, 17685, 4197, 29916, 29918, 1590, 29892, 343, 29918, 1590, 1402, 9685, 10457, 29896, 876, 13, 4706, 1180, 29918, 1725, 271, 353, 282, 22352, 29889, 690, 14443, 29898, 2029, 29918, 1725, 271, 29892, 21069, 29896, 29892, 1583, 29889, 1949, 29918, 2813, 29879, 29892, 1583, 29889, 10892, 29918, 6229, 2314, 13, 13, 4706, 1098, 29876, 29918, 4351, 353, 282, 22352, 29889, 2083, 29898, 1129, 29875, 29918, 1725, 271, 334, 1583, 29889, 7915, 29918, 4351, 29892, 9685, 10457, 29896, 29897, 13, 4706, 1098, 29876, 29918, 22992, 353, 282, 22352, 29889, 2083, 29898, 1129, 29875, 29918, 1725, 271, 334, 1583, 29889, 7915, 29918, 22992, 29892, 9685, 10457, 29896, 29897, 13, 4706, 1098, 29876, 29918, 2029, 353, 282, 22352, 29889, 2083, 29898, 2029, 29918, 1725, 271, 334, 1583, 29889, 7915, 29918, 2029, 29892, 9685, 10457, 29896, 29897, 13, 13, 4706, 10191, 353, 3983, 29889, 6717, 29898, 1311, 29889, 1131, 29876, 29918, 6717, 29918, 9891, 29892, 13, 462, 268, 4765, 29918, 1725, 271, 3790, 29908, 1131, 29876, 1115, 1098, 29876, 29918, 4351, 29892, 376, 29882, 1115, 11899, 29918, 1725, 271, 1118, 13, 462, 268, 29743, 29918, 1725, 271, 3790, 29908, 1131, 29876, 1115, 1098, 29876, 29918, 22992, 1118, 13, 462, 268, 7636, 29918, 1725, 271, 3790, 29915, 1131, 29876, 2396, 1098, 29876, 29918, 2029, 1800, 13, 4706, 364, 303, 353, 3983, 29889, 3757, 29894, 29898, 17469, 29918, 9891, 29922, 1311, 29889, 1131, 29876, 29918, 3757, 29894, 29918, 9891, 29892, 10191, 29922, 7645, 29897, 13, 13, 4706, 565, 1583, 29889, 11236, 362, 29901, 13, 9651, 364, 303, 353, 1583, 29889, 11236, 362, 29898, 29878, 303, 29897, 13, 4706, 736, 364, 303, 13, 632, 2 ]
LinearRegression/tf_summary/th_hook.py
SMZCC/TF-deep-learn
0
103660
<gh_stars>0 # coding=utf-8 # date: 2018/12/20, 14:23 # name: smz import torch as th import numpy as np import torch.autograd.variable as Variable import torch.nn as nn def demo_one(): grads = [] def hook_grad(grad_in): grads.append(grad_in.data) # x = Variable(th.from_numpy(np.array([1, 2]).astype(np.float32)), requires_grad=True) x = th.tensor([1, 2], dtype=th.float32, requires_grad=True) y = x.pow(2) + 1 z = th.mean(y, dim=0) # z = 1/2 * y || z = 1/2 * (x1^2 + x2^2) || dz/dy1 = 0.5, dz/dy2=0.5, dz/dx1 = 1 * x1, dz/dx2 = 1 * x2 y.register_hook(hook_grad) z.backward() print("x:{}\n".format(x)) print("z:{}\n".format(z)) print("x.grad:{}\n".format(x.grad)) print("y.grad:{}".format(y.grad)) print("z.grad:{}\n".format(z.grad)) print("grads:{}\n".format(grads)) def demo_two(): x = th.tensor([-1, 0, 1, 2], dtype=th.float32, requires_grad=True) x = x.cuda() # 这里不能放到GPU上,否则算出来的梯度为None relu_layer = nn.ReLU() res = relu_layer(x) loss = th.sum(res, dim=0) loss.backward() print("x:{}\n".format(x)) print("x.grad:{}\n".format(x.grad)) if __name__ == "__main__": demo_two()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 29937, 2635, 29901, 29871, 29906, 29900, 29896, 29947, 29914, 29896, 29906, 29914, 29906, 29900, 29892, 29871, 29896, 29946, 29901, 29906, 29941, 13, 29937, 1024, 29901, 1560, 29920, 13, 13, 13, 5215, 4842, 305, 408, 266, 13, 5215, 12655, 408, 7442, 13, 5215, 4842, 305, 29889, 1300, 468, 3665, 29889, 11918, 408, 28736, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 13, 13, 13, 13, 13, 1753, 13455, 29918, 650, 7295, 13, 1678, 4656, 29879, 353, 5159, 13, 13, 1678, 822, 12422, 29918, 5105, 29898, 5105, 29918, 262, 1125, 13, 4706, 4656, 29879, 29889, 4397, 29898, 5105, 29918, 262, 29889, 1272, 29897, 13, 13, 1678, 396, 921, 353, 28736, 29898, 386, 29889, 3166, 29918, 23749, 29898, 9302, 29889, 2378, 4197, 29896, 29892, 29871, 29906, 14664, 579, 668, 29898, 9302, 29889, 7411, 29941, 29906, 8243, 6858, 29918, 5105, 29922, 5574, 29897, 13, 1678, 921, 353, 266, 29889, 20158, 4197, 29896, 29892, 29871, 29906, 1402, 26688, 29922, 386, 29889, 7411, 29941, 29906, 29892, 6858, 29918, 5105, 29922, 5574, 29897, 13, 1678, 343, 353, 921, 29889, 12248, 29898, 29906, 29897, 718, 29871, 29896, 13, 1678, 503, 353, 266, 29889, 12676, 29898, 29891, 29892, 3964, 29922, 29900, 29897, 29871, 396, 503, 353, 29871, 29896, 29914, 29906, 334, 343, 3830, 503, 353, 29871, 29896, 29914, 29906, 334, 313, 29916, 29896, 29985, 29906, 718, 921, 29906, 29985, 29906, 29897, 29871, 3830, 9275, 29914, 4518, 29896, 353, 29871, 29900, 29889, 29945, 29892, 9275, 29914, 4518, 29906, 29922, 29900, 29889, 29945, 29892, 9275, 29914, 8235, 29896, 353, 29871, 29896, 334, 921, 29896, 29892, 9275, 29914, 8235, 29906, 353, 29871, 29896, 334, 921, 29906, 13, 1678, 343, 29889, 9573, 29918, 20849, 29898, 20849, 29918, 5105, 29897, 13, 13, 1678, 503, 29889, 1627, 1328, 580, 13, 13, 1678, 1596, 703, 29916, 26254, 1012, 29876, 1642, 4830, 29898, 29916, 876, 13, 1678, 1596, 703, 29920, 26254, 1012, 29876, 1642, 4830, 29898, 29920, 876, 13, 1678, 1596, 703, 29916, 29889, 5105, 26254, 1012, 29876, 1642, 4830, 29898, 29916, 29889, 5105, 876, 13, 1678, 1596, 703, 29891, 29889, 5105, 29901, 8875, 1642, 4830, 29898, 29891, 29889, 5105, 876, 13, 1678, 1596, 703, 29920, 29889, 5105, 26254, 1012, 29876, 1642, 4830, 29898, 29920, 29889, 5105, 876, 13, 1678, 1596, 703, 5105, 29879, 26254, 1012, 29876, 1642, 4830, 29898, 5105, 29879, 876, 13, 13, 13, 1753, 13455, 29918, 10184, 7295, 13, 1678, 921, 353, 266, 29889, 20158, 4197, 29899, 29896, 29892, 29871, 29900, 29892, 29871, 29896, 29892, 29871, 29906, 1402, 26688, 29922, 386, 29889, 7411, 29941, 29906, 29892, 6858, 29918, 5105, 29922, 5574, 29897, 13, 1678, 921, 353, 921, 29889, 29883, 6191, 580, 1678, 396, 29871, 30810, 30755, 30413, 30815, 31182, 30780, 29954, 7056, 30429, 30214, 31191, 31403, 31565, 30544, 30805, 30210, 233, 165, 178, 30898, 30573, 8516, 13, 1678, 1104, 29884, 29918, 13148, 353, 302, 29876, 29889, 1123, 29931, 29965, 580, 13, 1678, 620, 353, 1104, 29884, 29918, 13148, 29898, 29916, 29897, 13, 1678, 6410, 353, 266, 29889, 2083, 29898, 690, 29892, 3964, 29922, 29900, 29897, 13, 1678, 6410, 29889, 1627, 1328, 580, 13, 1678, 1596, 703, 29916, 26254, 1012, 29876, 1642, 4830, 29898, 29916, 876, 13, 1678, 1596, 703, 29916, 29889, 5105, 26254, 1012, 29876, 1642, 4830, 29898, 29916, 29889, 5105, 876, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 13455, 29918, 10184, 580, 2 ]
apex/transformer/pipeline_parallel/schedules/__init__.py
anirudhprabhakaran3/apex
0
1603163
from apex.transformer import parallel_state from apex.transformer.pipeline_parallel.utils import get_num_microbatches from apex.transformer.pipeline_parallel.schedules.fwd_bwd_no_pipelining import ( forward_backward_no_pipelining, ) from apex.transformer.pipeline_parallel.schedules.fwd_bwd_pipelining_with_interleaving import ( _forward_backward_pipelining_with_interleaving, ) from apex.transformer.pipeline_parallel.schedules.fwd_bwd_pipelining_without_interleaving import ( forward_backward_pipelining_without_interleaving, ) __all__ = [ "get_forward_backward_func", ] class ExperimentalWarning(Warning): pass def get_forward_backward_func( virtual_pipeline_model_parallel_size, pipeline_model_parallel_size, ): if parallel_state.get_pipeline_model_parallel_world_size() > 1: if virtual_pipeline_model_parallel_size is not None: if get_num_microbatches() % pipeline_model_parallel_size != 0: msg = "number of microbatches is not divisible by pipeline-parallel size when using interleaved schedule" raise RuntimeError(msg) forward_backward_func = _forward_backward_pipelining_with_interleaving else: forward_backward_func = forward_backward_pipelining_without_interleaving else: forward_backward_func = forward_backward_no_pipelining return forward_backward_func
[ 1, 515, 263, 412, 29916, 29889, 9067, 261, 1053, 8943, 29918, 3859, 13, 3166, 263, 412, 29916, 29889, 9067, 261, 29889, 13096, 5570, 29918, 23482, 29889, 13239, 1053, 679, 29918, 1949, 29918, 29885, 2357, 16175, 267, 13, 3166, 263, 412, 29916, 29889, 9067, 261, 29889, 13096, 5570, 29918, 23482, 29889, 816, 287, 2540, 29889, 29888, 9970, 29918, 29890, 9970, 29918, 1217, 29918, 13096, 295, 2827, 1053, 313, 13, 1678, 6375, 29918, 1627, 1328, 29918, 1217, 29918, 13096, 295, 2827, 29892, 13, 29897, 13, 3166, 263, 412, 29916, 29889, 9067, 261, 29889, 13096, 5570, 29918, 23482, 29889, 816, 287, 2540, 29889, 29888, 9970, 29918, 29890, 9970, 29918, 13096, 295, 2827, 29918, 2541, 29918, 1639, 280, 5555, 1053, 313, 13, 1678, 903, 11333, 29918, 1627, 1328, 29918, 13096, 295, 2827, 29918, 2541, 29918, 1639, 280, 5555, 29892, 13, 29897, 13, 3166, 263, 412, 29916, 29889, 9067, 261, 29889, 13096, 5570, 29918, 23482, 29889, 816, 287, 2540, 29889, 29888, 9970, 29918, 29890, 9970, 29918, 13096, 295, 2827, 29918, 14037, 29918, 1639, 280, 5555, 1053, 313, 13, 1678, 6375, 29918, 1627, 1328, 29918, 13096, 295, 2827, 29918, 14037, 29918, 1639, 280, 5555, 29892, 13, 29897, 13, 13, 1649, 497, 1649, 353, 518, 13, 1678, 376, 657, 29918, 11333, 29918, 1627, 1328, 29918, 9891, 613, 13, 29962, 13, 13, 13, 1990, 1222, 27910, 22709, 29898, 22709, 1125, 13, 1678, 1209, 13, 13, 13, 1753, 679, 29918, 11333, 29918, 1627, 1328, 29918, 9891, 29898, 13, 1678, 6901, 29918, 13096, 5570, 29918, 4299, 29918, 23482, 29918, 2311, 29892, 16439, 29918, 4299, 29918, 23482, 29918, 2311, 29892, 13, 1125, 13, 1678, 565, 8943, 29918, 3859, 29889, 657, 29918, 13096, 5570, 29918, 4299, 29918, 23482, 29918, 11526, 29918, 2311, 580, 1405, 29871, 29896, 29901, 13, 4706, 565, 6901, 29918, 13096, 5570, 29918, 4299, 29918, 23482, 29918, 2311, 338, 451, 6213, 29901, 13, 9651, 565, 679, 29918, 1949, 29918, 29885, 2357, 16175, 267, 580, 1273, 16439, 29918, 4299, 29918, 23482, 29918, 2311, 2804, 29871, 29900, 29901, 13, 18884, 10191, 353, 376, 4537, 310, 9200, 16175, 267, 338, 451, 8572, 1821, 491, 16439, 29899, 23482, 2159, 746, 773, 1006, 280, 10511, 20410, 29908, 13, 18884, 12020, 24875, 2392, 29898, 7645, 29897, 13, 9651, 6375, 29918, 1627, 1328, 29918, 9891, 353, 903, 11333, 29918, 1627, 1328, 29918, 13096, 295, 2827, 29918, 2541, 29918, 1639, 280, 5555, 13, 4706, 1683, 29901, 13, 9651, 6375, 29918, 1627, 1328, 29918, 9891, 353, 6375, 29918, 1627, 1328, 29918, 13096, 295, 2827, 29918, 14037, 29918, 1639, 280, 5555, 13, 1678, 1683, 29901, 13, 4706, 6375, 29918, 1627, 1328, 29918, 9891, 353, 6375, 29918, 1627, 1328, 29918, 1217, 29918, 13096, 295, 2827, 13, 1678, 736, 6375, 29918, 1627, 1328, 29918, 9891, 13, 2 ]
scripts/scrape_sciencedirect_urls.py
UWPRG/BETO2020
4
1007
""" This code is used to scrape ScienceDirect of publication urls and write them to a text file in the current directory for later use. """ import selenium from selenium import webdriver import numpy as np import pandas as pd import bs4 from bs4 import BeautifulSoup import time from sklearn.utils import shuffle def scrape_page(driver): """ This method finds all the publication result web elements on the webpage. Parameters ---------- driver (Selenium webdriver object) : Instance of the webdriver class e.g. webdriver.Chrome() Returns ------- elems (list) : A list of all scraped hrefs from the page """ elems = driver.find_elements_by_class_name('ResultItem') return elems def clean(elems): """ This method takes a list of scraped selenium web elements and filters/ returns only the hrefs leading to publications. Filtering includes removing all urls with keywords that are indicative of non-html links. Parameters ---------- elems (list) : The list of hrefs to be filtered Returns ------- urls (list) : The new list of hrefs, which should be the same as the list displayed on gui ScienceDirect """ titles = [] urls = [] for elem in elems: href_child = elem.find_element_by_css_selector('a[href]') url = href_child.get_attribute('href') title = href_child.text titles.append(title) urls.append(url) return urls, titles def build_url_list(gui_prefix,search_terms,journal_list): """ This method takes the list of journals and creates a tiple nested dictionary containing all accessible urls to each page, in each year, for each journal, for a given search on sciencedirect. """ dict1 = {} years = np.arange(1995,2020) for journal in journal_list: dict2 = {} for year in years: dict3 = {} for i in range(60): url = gui_prefix + search_terms + '&show=100'+ '&articleTypes=FLA%2CREV' + '&years='+ str(year) if i != 0: url = url + '&offset=' + str(i) +'00' url = url + '&pub=' + journal dict3[i] = url dict2[year] = dict3 dict1[journal] = dict2 return dict1 def proxify(scraped_urls,uw_prefix): """ This method takes a list of scraped urls and turns them into urls that go through the UW Library proxy so that all of them are full access. Parameters ---------- scraped_urls (list) : The list of URLs to be converted uw_prefix (str) : The string that all URLs which go through the UW Library Proxy start with. Returns ------- proxy_urls (list) : The list of converted URLs which go through UW Library proxy """ proxy_urls = [] for url in scraped_urls: sd_id = url[-17:] newlink = uw_prefix + sd_id if sd_id.startswith('S'): proxy_urls.append(newlink) return proxy_urls def write_urls(urls,titles,file,journal,year): """ This method takes a list of urls and writes them to a desired text file. Parameters ---------- urls (list) : The list of URLs to be saved. file (file object) : The opened .txt file which will be written to. year (str or int) : The year associated with the publication date. Returns ------- Does not return anything """ for link,title in zip(urls,titles): line = link + ',' + title + ',' + journal + ',' + str(year) file.write(line) file.write('\n') def find_pubTitle(driver,journal): """ This method finds the identifying number for a specific journal. This identifying number is added to the gui query URL to ensure only publciations from the desired journal are being found. """ pub_elems = driver.find_elements_by_css_selector('input[id*=publicationTitles]') pub_names = [] for elem in pub_elems: pub_name = elem.get_attribute("name") if pub_name == journal: return elem.get_attribute('id')[-6:] #returns the identifying number #for that journal df = pd.read_excel('elsevier_journals.xls') df.Full_Category = df.Full_Category.str.lower() # lowercase topics for searching df = df.drop_duplicates(subset = 'Journal_Title') # drop any duplicate journals df = shuffle(df,random_state = 42) # The set of default strings that will be used to sort which journals we want journal_strings = ['chemistry','energy','molecular','atomic','chemical','biochem' ,'organic','polymer','chemical engineering','biotech','coloid'] name = df.Full_Category.str.contains # making this an easier command to type # new dataframe full of only journals who's topic description contained the # desired keywords df2 = df[name('polymer') | name('chemistry') | name('energy') | name('molecular') | name('colloid') | name('biochem') | name('organic') | name('biotech') | name('chemical')] journal_list = df2.Journal_Title # Series of only the journals to be searched gui_prefix = 'https://www.sciencedirect.com/search/advanced?qs=' search_terms = 'chemistry%20OR%20molecule%20OR%20polymer%20OR%20organic' url_dict = build_url_list(gui_prefix,search_terms,journal_list) driver = webdriver.Chrome() uw_prefix = 'https://www-sciencedirect-com.offcampus.lib.washington.edu/science/article/pii/' filename = input("Input filename with .txt extension for URL storage: ") url_counter = 0 master_list = [] file = open(filename,'a+') for journal in journal_list: for year in np.arange(1995,2020): for offset in np.arange(60): page = url_dict[journal][year][offset] print("journal, year, offset = ",journal,year,offset) driver.get(page) time.sleep(2) # need sleep to load the page properly if offset == 0: # if on page 1, we need to grab the publisher number try: # we may be at a page which won't have the item we are looking for pubTitles = find_pubTitle(driver,journal_list[journal_counter]) for url in url_dict[journal]: url = url + '&pubTitles=' + pubTitles # update every url in the list driver.get(url_dict[journal][year][0]) # reload the first page with the new url except: pass # if there is an exception, it means we are on the right page scraped_elems = scrape_page(driver) # scrape the page scraped_urls, titles = clean(scraped_elems) proxy_urls = proxify(scraped_urls,uw_prefix) # not even sure this is needed write_urls(proxy_urls,titles,file,journal,year) url_counter += len(proxy_urls) print('Total URLs saved is: ',url_counter) if len(scraped_elems) < 100: # after content is saved, go to the next year break # because we know this is the last page of urls for this year file.close() driver.quit()
[ 1, 9995, 13, 4013, 775, 338, 1304, 304, 24559, 412, 9327, 17392, 310, 17745, 23942, 322, 2436, 963, 304, 13, 29874, 1426, 934, 297, 278, 1857, 3884, 363, 2678, 671, 29889, 13, 15945, 29908, 13, 13, 5215, 18866, 13, 3166, 18866, 1053, 1856, 9465, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 5215, 24512, 29946, 13, 3166, 24512, 29946, 1053, 25685, 29903, 1132, 13, 5215, 931, 13, 3166, 2071, 19668, 29889, 13239, 1053, 528, 21897, 13, 13, 1753, 24559, 412, 29918, 3488, 29898, 9465, 1125, 13, 1678, 9995, 13, 1678, 910, 1158, 14061, 599, 278, 17745, 1121, 1856, 3161, 373, 278, 24499, 29889, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 7156, 313, 29903, 13462, 1856, 9465, 1203, 29897, 584, 2799, 749, 310, 278, 1856, 9465, 770, 321, 29889, 29887, 29889, 13, 4706, 1856, 9465, 29889, 1451, 4871, 580, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 4552, 1516, 313, 1761, 29897, 584, 319, 1051, 310, 599, 885, 2390, 287, 2822, 29879, 515, 278, 1813, 13, 1678, 9995, 13, 13, 1678, 4552, 1516, 353, 7156, 29889, 2886, 29918, 17664, 29918, 1609, 29918, 1990, 29918, 978, 877, 3591, 2001, 1495, 13, 1678, 736, 4552, 1516, 13, 13, 13, 1753, 5941, 29898, 6146, 1516, 1125, 13, 1678, 9995, 13, 1678, 910, 1158, 4893, 263, 1051, 310, 885, 2390, 287, 18866, 1856, 3161, 13, 1678, 322, 18094, 29914, 3639, 871, 278, 2822, 29879, 8236, 304, 25964, 29889, 13, 1678, 19916, 292, 7805, 11077, 599, 23942, 411, 29361, 393, 526, 4221, 1230, 310, 13, 1678, 1661, 29899, 1420, 2988, 29889, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 4552, 1516, 313, 1761, 29897, 584, 450, 1051, 310, 2822, 29879, 304, 367, 22289, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 23942, 313, 1761, 29897, 584, 450, 716, 1051, 310, 2822, 29879, 29892, 607, 881, 367, 278, 1021, 408, 278, 1051, 13, 4706, 8833, 373, 1410, 29875, 9327, 17392, 13, 1678, 9995, 13, 13, 1678, 17735, 353, 5159, 13, 1678, 23942, 353, 5159, 13, 1678, 363, 21268, 297, 4552, 1516, 29901, 13, 4706, 2822, 29918, 5145, 353, 21268, 29889, 2886, 29918, 5029, 29918, 1609, 29918, 4268, 29918, 14357, 877, 29874, 29961, 12653, 29962, 1495, 13, 4706, 3142, 353, 2822, 29918, 5145, 29889, 657, 29918, 12715, 877, 12653, 1495, 13, 13, 4706, 3611, 353, 2822, 29918, 5145, 29889, 726, 13, 13, 4706, 17735, 29889, 4397, 29898, 3257, 29897, 13, 4706, 23942, 29889, 4397, 29898, 2271, 29897, 13, 1678, 736, 23942, 29892, 17735, 13, 13, 1753, 2048, 29918, 2271, 29918, 1761, 29898, 23569, 29918, 13506, 29892, 4478, 29918, 357, 1516, 29892, 29926, 4659, 29918, 1761, 1125, 13, 1678, 9995, 13, 1678, 910, 1158, 4893, 278, 1051, 310, 21824, 1338, 322, 10017, 263, 19538, 552, 9322, 8600, 13, 1678, 6943, 599, 15579, 23942, 304, 1269, 1813, 29892, 297, 1269, 1629, 29892, 363, 1269, 8955, 29892, 13, 1678, 363, 263, 2183, 2740, 373, 4560, 9223, 1088, 29889, 13, 1678, 9995, 13, 13, 1678, 9657, 29896, 353, 6571, 13, 1678, 2440, 353, 7442, 29889, 279, 927, 29898, 29896, 29929, 29929, 29945, 29892, 29906, 29900, 29906, 29900, 29897, 13, 1678, 363, 8955, 297, 8955, 29918, 1761, 29901, 13, 13, 4706, 9657, 29906, 353, 6571, 13, 4706, 363, 1629, 297, 2440, 29901, 13, 13, 9651, 9657, 29941, 353, 6571, 13, 9651, 363, 474, 297, 3464, 29898, 29953, 29900, 1125, 13, 18884, 3142, 353, 1410, 29875, 29918, 13506, 718, 2740, 29918, 357, 1516, 718, 525, 29987, 4294, 29922, 29896, 29900, 29900, 18717, 525, 29987, 7914, 10562, 29922, 18823, 29995, 29906, 22245, 29963, 29915, 718, 525, 29987, 6360, 29879, 2433, 29974, 851, 29898, 6360, 29897, 13, 13, 18884, 565, 474, 2804, 29871, 29900, 29901, 13, 462, 1678, 3142, 353, 3142, 718, 525, 29987, 10289, 2433, 718, 851, 29898, 29875, 29897, 718, 29915, 29900, 29900, 29915, 13, 18884, 3142, 353, 3142, 718, 525, 29987, 5467, 2433, 718, 8955, 13, 13, 18884, 9657, 29941, 29961, 29875, 29962, 353, 3142, 13, 13, 9651, 9657, 29906, 29961, 6360, 29962, 353, 9657, 29941, 13, 13, 4706, 9657, 29896, 29961, 29926, 4659, 29962, 353, 9657, 29906, 13, 13, 1678, 736, 9657, 29896, 13, 13, 1753, 410, 29916, 1598, 29898, 1557, 2390, 287, 29918, 26045, 29892, 7262, 29918, 13506, 1125, 13, 1678, 9995, 13, 1678, 910, 1158, 4893, 263, 1051, 310, 885, 2390, 287, 23942, 322, 12169, 963, 964, 23942, 393, 13, 1678, 748, 1549, 278, 501, 29956, 9538, 10166, 577, 393, 599, 310, 963, 526, 2989, 2130, 29889, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 885, 2390, 287, 29918, 26045, 313, 1761, 29897, 584, 450, 1051, 310, 24295, 304, 367, 11543, 13, 1678, 318, 29893, 29918, 13506, 313, 710, 29897, 584, 450, 1347, 393, 599, 24295, 607, 748, 1549, 278, 501, 29956, 9538, 13, 4706, 1019, 3594, 1369, 411, 29889, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 10166, 29918, 26045, 313, 1761, 29897, 584, 450, 1051, 310, 11543, 24295, 607, 748, 1549, 501, 29956, 9538, 13, 4706, 10166, 13, 1678, 9995, 13, 13, 1678, 10166, 29918, 26045, 353, 5159, 13, 1678, 363, 3142, 297, 885, 2390, 287, 29918, 26045, 29901, 13, 4706, 28972, 29918, 333, 353, 3142, 14352, 29896, 29955, 17531, 13, 4706, 716, 2324, 353, 318, 29893, 29918, 13506, 718, 28972, 29918, 333, 13, 4706, 565, 28972, 29918, 333, 29889, 27382, 2541, 877, 29903, 29374, 13, 9651, 10166, 29918, 26045, 29889, 4397, 29898, 1482, 2324, 29897, 13, 13, 1678, 736, 10166, 29918, 26045, 13, 13, 1753, 2436, 29918, 26045, 29898, 26045, 29892, 23545, 793, 29892, 1445, 29892, 29926, 4659, 29892, 6360, 1125, 13, 1678, 9995, 13, 1678, 910, 1158, 4893, 263, 1051, 310, 23942, 322, 15873, 963, 304, 263, 7429, 1426, 934, 29889, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 23942, 313, 1761, 29897, 584, 450, 1051, 310, 24295, 304, 367, 7160, 29889, 13, 1678, 934, 313, 1445, 1203, 29897, 584, 450, 6496, 869, 3945, 934, 607, 674, 367, 3971, 304, 29889, 13, 1678, 1629, 313, 710, 470, 938, 29897, 584, 450, 1629, 6942, 411, 278, 17745, 2635, 29889, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 5538, 451, 736, 3099, 13, 1678, 9995, 13, 1678, 363, 1544, 29892, 3257, 297, 14319, 29898, 26045, 29892, 23545, 793, 1125, 13, 4706, 1196, 353, 1544, 718, 525, 5501, 718, 3611, 718, 525, 5501, 718, 8955, 718, 525, 5501, 718, 851, 29898, 6360, 29897, 13, 4706, 934, 29889, 3539, 29898, 1220, 29897, 13, 4706, 934, 29889, 3539, 28909, 29876, 1495, 13, 13, 1753, 1284, 29918, 5467, 7030, 29898, 9465, 29892, 29926, 4659, 1125, 13, 1678, 9995, 13, 1678, 910, 1158, 14061, 278, 2893, 9215, 1353, 363, 263, 2702, 8955, 29889, 910, 13, 1678, 2893, 9215, 1353, 338, 2715, 304, 278, 1410, 29875, 2346, 3988, 304, 9801, 871, 2529, 29880, 455, 800, 13, 1678, 515, 278, 7429, 8955, 526, 1641, 1476, 29889, 13, 1678, 9995, 13, 1678, 2529, 29918, 6146, 1516, 353, 7156, 29889, 2886, 29918, 17664, 29918, 1609, 29918, 4268, 29918, 14357, 877, 2080, 29961, 333, 29930, 29922, 3597, 362, 29911, 277, 793, 29962, 1495, 13, 1678, 2529, 29918, 7039, 353, 5159, 13, 13, 1678, 363, 21268, 297, 2529, 29918, 6146, 1516, 29901, 13, 4706, 2529, 29918, 978, 353, 21268, 29889, 657, 29918, 12715, 703, 978, 1159, 13, 4706, 565, 2529, 29918, 978, 1275, 8955, 29901, 13, 9651, 736, 21268, 29889, 657, 29918, 12715, 877, 333, 1495, 14352, 29953, 17531, 396, 18280, 278, 2893, 9215, 1353, 13, 462, 462, 462, 396, 1454, 393, 8955, 13, 13, 13, 13, 13, 2176, 353, 10518, 29889, 949, 29918, 24633, 877, 2870, 7214, 29918, 29926, 2905, 1338, 29889, 20267, 1495, 13, 2176, 29889, 13658, 29918, 10900, 353, 4489, 29889, 13658, 29918, 10900, 29889, 710, 29889, 13609, 580, 396, 5224, 4878, 23820, 363, 11975, 13, 2176, 353, 4489, 29889, 8865, 29918, 20908, 15815, 29898, 6484, 353, 525, 29967, 4659, 29918, 7030, 1495, 396, 5768, 738, 7929, 21824, 1338, 13, 2176, 353, 528, 21897, 29898, 2176, 29892, 8172, 29918, 3859, 353, 29871, 29946, 29906, 29897, 13, 13, 13, 13, 29937, 450, 731, 310, 2322, 6031, 393, 674, 367, 1304, 304, 2656, 607, 21824, 1338, 591, 864, 13, 29926, 4659, 29918, 19651, 353, 6024, 14969, 6020, 3788, 27548, 3788, 29885, 1772, 16637, 3788, 21641, 3788, 14969, 936, 3788, 24840, 14969, 29915, 13, 462, 29871, 1919, 29915, 6388, 293, 3788, 3733, 962, 261, 3788, 14969, 936, 21639, 3788, 5365, 866, 305, 3788, 1054, 3398, 2033, 13, 13, 978, 353, 4489, 29889, 13658, 29918, 10900, 29889, 710, 29889, 11516, 396, 3907, 445, 385, 6775, 1899, 304, 1134, 13, 29937, 716, 12205, 2989, 310, 871, 21824, 1338, 1058, 29915, 29879, 11261, 6139, 11122, 278, 13, 29937, 7429, 29361, 13, 2176, 29906, 353, 4489, 29961, 978, 877, 3733, 962, 261, 1495, 891, 1024, 877, 14969, 6020, 1495, 891, 1024, 877, 27548, 1495, 13, 4706, 891, 1024, 877, 29885, 1772, 16637, 1495, 891, 1024, 877, 1054, 417, 333, 1495, 891, 1024, 877, 24840, 14969, 1495, 13, 4706, 891, 1024, 877, 6388, 293, 1495, 891, 1024, 877, 5365, 866, 305, 1495, 891, 1024, 877, 14969, 936, 1495, 29962, 13, 13, 29926, 4659, 29918, 1761, 353, 4489, 29906, 29889, 29967, 4659, 29918, 7030, 396, 10488, 310, 871, 278, 21824, 1338, 304, 367, 17371, 13, 13, 13, 23569, 29918, 13506, 353, 525, 991, 597, 1636, 29889, 26167, 9223, 1088, 29889, 510, 29914, 4478, 29914, 328, 16858, 29973, 29939, 29879, 2433, 13, 4478, 29918, 357, 1516, 353, 525, 14969, 6020, 29995, 29906, 29900, 1955, 29995, 29906, 29900, 29885, 1772, 29883, 1297, 29995, 29906, 29900, 1955, 29995, 29906, 29900, 3733, 962, 261, 29995, 29906, 29900, 1955, 29995, 29906, 29900, 6388, 293, 29915, 13, 2271, 29918, 8977, 353, 2048, 29918, 2271, 29918, 1761, 29898, 23569, 29918, 13506, 29892, 4478, 29918, 357, 1516, 29892, 29926, 4659, 29918, 1761, 29897, 13, 13, 9465, 353, 1856, 9465, 29889, 1451, 4871, 580, 13, 7262, 29918, 13506, 353, 525, 991, 597, 1636, 29899, 26167, 9223, 1088, 29899, 510, 29889, 2696, 24821, 375, 29889, 1982, 29889, 29893, 7321, 29889, 6085, 29914, 29879, 15277, 29914, 7914, 29914, 1631, 29875, 22208, 13, 13, 9507, 353, 1881, 703, 4290, 10422, 411, 869, 3945, 6081, 363, 3988, 8635, 29901, 16521, 13, 13, 2271, 29918, 11808, 353, 29871, 29900, 13, 6207, 29918, 1761, 353, 5159, 13, 1445, 353, 1722, 29898, 9507, 5501, 29874, 29974, 1495, 13, 13, 13, 13, 1454, 8955, 297, 8955, 29918, 1761, 29901, 13, 1678, 363, 1629, 297, 7442, 29889, 279, 927, 29898, 29896, 29929, 29929, 29945, 29892, 29906, 29900, 29906, 29900, 1125, 13, 4706, 363, 9210, 297, 7442, 29889, 279, 927, 29898, 29953, 29900, 1125, 13, 13, 9651, 1813, 353, 3142, 29918, 8977, 29961, 29926, 4659, 3816, 6360, 3816, 10289, 29962, 13, 9651, 1596, 703, 29926, 4659, 29892, 1629, 29892, 9210, 353, 29871, 9162, 29926, 4659, 29892, 6360, 29892, 10289, 29897, 13, 9651, 7156, 29889, 657, 29898, 3488, 29897, 13, 13, 9651, 931, 29889, 17059, 29898, 29906, 29897, 965, 396, 817, 8709, 304, 2254, 278, 1813, 6284, 13, 9651, 565, 9210, 1275, 29871, 29900, 29901, 308, 396, 565, 373, 1813, 29871, 29896, 29892, 591, 817, 304, 17229, 278, 9805, 261, 1353, 13, 18884, 1018, 29901, 18884, 396, 591, 1122, 367, 472, 263, 1813, 607, 2113, 29915, 29873, 505, 278, 2944, 591, 526, 3063, 363, 13, 462, 1678, 2529, 29911, 277, 793, 353, 1284, 29918, 5467, 7030, 29898, 9465, 29892, 29926, 4659, 29918, 1761, 29961, 29926, 4659, 29918, 11808, 2314, 13, 462, 1678, 363, 3142, 297, 3142, 29918, 8977, 29961, 29926, 4659, 5387, 13, 462, 4706, 3142, 353, 3142, 718, 525, 29987, 5467, 29911, 277, 793, 2433, 718, 2529, 29911, 277, 793, 396, 2767, 1432, 3142, 297, 278, 1051, 13, 462, 1678, 7156, 29889, 657, 29898, 2271, 29918, 8977, 29961, 29926, 4659, 3816, 6360, 3816, 29900, 2314, 462, 308, 396, 19763, 278, 937, 1813, 411, 278, 716, 3142, 13, 18884, 5174, 29901, 13, 462, 1678, 1209, 462, 462, 4706, 396, 565, 727, 338, 385, 3682, 29892, 372, 2794, 591, 526, 373, 278, 1492, 1813, 13, 13, 9651, 885, 2390, 287, 29918, 6146, 1516, 353, 24559, 412, 29918, 3488, 29898, 9465, 29897, 462, 396, 24559, 412, 278, 1813, 13, 13, 9651, 885, 2390, 287, 29918, 26045, 29892, 17735, 353, 5941, 29898, 1557, 2390, 287, 29918, 6146, 1516, 29897, 13, 9651, 10166, 29918, 26045, 353, 410, 29916, 1598, 29898, 1557, 2390, 287, 29918, 26045, 29892, 7262, 29918, 13506, 29897, 396, 451, 1584, 1854, 445, 338, 4312, 13, 13, 9651, 2436, 29918, 26045, 29898, 14701, 29918, 26045, 29892, 23545, 793, 29892, 1445, 29892, 29926, 4659, 29892, 6360, 29897, 13, 9651, 3142, 29918, 11808, 4619, 7431, 29898, 14701, 29918, 26045, 29897, 13, 9651, 1596, 877, 11536, 24295, 7160, 338, 29901, 13420, 2271, 29918, 11808, 29897, 13, 13, 9651, 565, 7431, 29898, 1557, 2390, 287, 29918, 6146, 1516, 29897, 529, 29871, 29896, 29900, 29900, 29901, 1678, 396, 1156, 2793, 338, 7160, 29892, 748, 304, 278, 2446, 1629, 13, 18884, 2867, 462, 539, 396, 1363, 591, 1073, 445, 338, 278, 1833, 1813, 310, 23942, 363, 445, 1629, 13, 13, 1445, 29889, 5358, 580, 13, 9465, 29889, 28358, 580, 13, 2 ]
services/director-v2/tests/unit/test_utils_dags.py
colinRawlings/osparc-simcore
25
195250
# pylint:disable=unused-variable # pylint:disable=unused-argument # pylint:disable=redefined-outer-name # pylint:disable=protected-access # pylint:disable=no-value-for-parameter from typing import Any, Dict, List, Set import networkx as nx import pytest from models_library.projects import Workbench from simcore_service_director_v2.utils.dags import ( create_complete_dag, create_minimal_computational_graph_based_on_selection, find_computational_node_cycles, ) def test_create_complete_dag_graph( fake_workbench: Workbench, fake_workbench_complete_adjacency: Dict[str, List[str]], ): dag_graph = create_complete_dag(fake_workbench) assert nx.is_directed_acyclic_graph(dag_graph) assert nx.to_dict_of_lists(dag_graph) == fake_workbench_complete_adjacency @pytest.mark.parametrize( "subgraph, force_exp_dag, not_forced_exp_dag", [ pytest.param( [], { "3a710d8b-565c-5f46-870b-b45ebe195fc7": [ "415fefd1-d08b-53c1-adb0-16bed3a687ef" ], "e1e2ea96-ce8f-5abc-8712-b8ed312a782c": [ "6ede1209-b459-5735-91fc-761aa584808d" ], "415fefd1-d08b-53c1-adb0-16bed3a687ef": [ "6ede1209-b459-5735-91fc-761aa584808d" ], "6ede1209-b459-5735-91fc-761aa584808d": [], }, { "e1e2ea96-ce8f-5abc-8712-b8ed312a782c": [ "6ede1209-b459-5735-91fc-761aa584808d" ], "415fefd1-d08b-53c1-adb0-16bed3a687ef": [ "6ede1209-b459-5735-91fc-761aa584808d" ], "6ede1209-b459-5735-91fc-761aa584808d": [], }, id="no sub selection returns the full graph", ), pytest.param( [ "8902d36c-bc65-5b0d-848f-88aed72d7849", "3a710d8b-565c-5f46-870b-b45ebe195fc7", "415fefd1-d08b-53c1-adb0-16bed3a687ef", "e1e2ea96-ce8f-5abc-8712-b8ed312a782c", "6ede1209-b459-5735-91fc-761aa584808d", "82d7a25c-18d4-44dc-a997-e5c9a745e7fd", ], { "3a710d8b-565c-5f46-870b-b45ebe195fc7": [ "415fefd1-d08b-53c1-adb0-16bed3a687ef" ], "e1e2ea96-ce8f-5abc-8712-b8ed312a782c": [ "6ede1209-b459-5735-91fc-761aa584808d" ], "415fefd1-d08b-53c1-adb0-16bed3a687ef": [ "6ede1209-b459-5735-91fc-761aa584808d" ], "6ede1209-b459-5735-91fc-761aa584808d": [], }, { "e1e2ea96-ce8f-5abc-8712-b8ed312a782c": [ "6ede1209-b459-5735-91fc-761aa584808d" ], "415fefd1-d08b-53c1-adb0-16bed3a687ef": [ "6ede1209-b459-5735-91fc-761aa584808d" ], "6ede1209-b459-5735-91fc-761aa584808d": [], }, id="all nodes selected returns the full graph", ), pytest.param( [ "8902d36c-bc65-5b0d-848f-88aed72d7849", # file-picker "3a710d8b-565c-5f46-870b-b45ebe195fc7", # sleeper 1 ], { "3a710d8b-565c-5f46-870b-b45ebe195fc7": [], }, {}, id="nodes 0 and 1", ), pytest.param( [ "8902d36c-bc65-5b0d-848f-88aed72d7849", # file-picker "415fefd1-d08b-53c1-adb0-16bed3a687ef", # sleeper 2 ], { "3a710d8b-565c-5f46-870b-b45ebe195fc7": [ "415fefd1-d08b-53c1-adb0-16bed3a687ef" ], "415fefd1-d08b-53c1-adb0-16bed3a687ef": [], }, { "415fefd1-d08b-53c1-adb0-16bed3a687ef": [], }, id="node 0 and 2", ), pytest.param( [ "415fefd1-d08b-53c1-adb0-16bed3a687ef", # sleeper 2 "6ede1209-b459-5735-91fc-761aa584808d", # sleeper 4 ], { "3a710d8b-565c-5f46-870b-b45ebe195fc7": [ "415fefd1-d08b-53c1-adb0-16bed3a687ef" ], "415fefd1-d08b-53c1-adb0-16bed3a687ef": [ "6ede1209-b459-5735-91fc-761aa584808d" ], "e1e2ea96-ce8f-5abc-8712-b8ed312a782c": [ "6ede1209-b459-5735-91fc-761aa584808d" ], "6ede1209-b459-5735-91fc-761aa584808d": [], }, { "415fefd1-d08b-53c1-adb0-16bed3a687ef": [ "6ede1209-b459-5735-91fc-761aa584808d" ], "e1e2ea96-ce8f-5abc-8712-b8ed312a782c": [ "6ede1209-b459-5735-91fc-761aa584808d" ], "6ede1209-b459-5735-91fc-761aa584808d": [], }, id="node 2 and 4", ), ], ) async def test_create_minimal_graph( loop, fake_workbench: Workbench, subgraph: Set[str], force_exp_dag: Dict[str, List[str]], not_forced_exp_dag: Dict[str, List[str]], ): complete_dag: nx.DiGraph = create_complete_dag(fake_workbench) # everything is outdated in that case reduced_dag: nx.DiGraph = ( await create_minimal_computational_graph_based_on_selection( complete_dag, subgraph, force_restart=True ) ) assert nx.to_dict_of_lists(reduced_dag) == force_exp_dag # only the outdated stuff shall be found here reduced_dag_with_auto_detect: nx.DiGraph = ( await create_minimal_computational_graph_based_on_selection( complete_dag, subgraph, force_restart=False ) ) assert nx.to_dict_of_lists(reduced_dag_with_auto_detect) == not_forced_exp_dag @pytest.mark.parametrize( "dag_adjacency, node_keys, exp_cycles", [ pytest.param({}, {}, [], id="empty dag exp no cycles"), pytest.param( {"node_1": ["node_2", "node_3"], "node_2": ["node_3"], "node_3": []}, { "node_1": {"key": "simcore/services/comp/fake"}, "node_2": {"key": "simcore/services/comp/fake"}, "node_3": {"key": "simcore/services/comp/fake"}, }, [], id="cycle less dag expect no cycle", ), pytest.param( { "node_1": ["node_2"], "node_2": ["node_3"], "node_3": ["node_1"], }, { "node_1": {"key": "simcore/services/comp/fake"}, "node_2": {"key": "simcore/services/comp/fake"}, "node_3": {"key": "simcore/services/comp/fake"}, }, [["node_1", "node_2", "node_3"]], id="dag with 1 cycle", ), pytest.param( { "node_1": ["node_2"], "node_2": ["node_3", "node_1"], "node_3": ["node_1"], }, { "node_1": {"key": "simcore/services/comp/fake"}, "node_2": {"key": "simcore/services/comp/fake"}, "node_3": {"key": "simcore/services/comp/fake"}, }, [["node_1", "node_2", "node_3"], ["node_1", "node_2"]], id="dag with 2 cycles", ), pytest.param( { "node_1": ["node_2"], "node_2": ["node_3"], "node_3": ["node_1"], }, { "node_1": {"key": "simcore/services/comp/fake"}, "node_2": {"key": "simcore/services/comp/fake"}, "node_3": {"key": "simcore/services/dynamic/fake"}, }, [["node_1", "node_2", "node_3"]], id="dag with 1 cycle and 1 dynamic services should fail", ), pytest.param( { "node_1": ["node_2"], "node_2": ["node_3"], "node_3": ["node_1"], }, { "node_1": {"key": "simcore/services/dynamic/fake"}, "node_2": {"key": "simcore/services/comp/fake"}, "node_3": {"key": "simcore/services/dynamic/fake"}, }, [["node_1", "node_2", "node_3"]], id="dag with 1 cycle and 2 dynamic services should fail", ), pytest.param( { "node_1": ["node_2"], "node_2": ["node_3"], "node_3": ["node_1"], }, { "node_1": {"key": "simcore/services/dynamic/fake"}, "node_2": {"key": "simcore/services/dynamic/fake"}, "node_3": {"key": "simcore/services/dynamic/fake"}, }, [], id="dag with 1 cycle and 3 dynamic services should be ok", ), ], ) def test_find_computational_node_cycles( dag_adjacency: Dict[str, List[str]], node_keys: Dict[str, Dict[str, Any]], exp_cycles: List[List[str]], ): dag = nx.from_dict_of_lists(dag_adjacency, create_using=nx.DiGraph) # add node attributes for key, values in node_keys.items(): for attr, attr_value in values.items(): dag.nodes[key][attr] = attr_value list_of_cycles = find_computational_node_cycles(dag) assert len(list_of_cycles) == len(exp_cycles), "expected number of cycles not found" for cycle in list_of_cycles: assert sorted(cycle) in exp_cycles
[ 1, 396, 282, 2904, 524, 29901, 20472, 29922, 348, 3880, 29899, 11918, 13, 29937, 282, 2904, 524, 29901, 20472, 29922, 348, 3880, 29899, 23516, 13, 29937, 282, 2904, 524, 29901, 20472, 29922, 276, 12119, 29899, 5561, 29899, 978, 13, 29937, 282, 2904, 524, 29901, 20472, 29922, 24681, 29899, 5943, 13, 29937, 282, 2904, 524, 29901, 20472, 29922, 1217, 29899, 1767, 29899, 1454, 29899, 15501, 13, 13, 13, 3166, 19229, 1053, 3139, 29892, 360, 919, 29892, 2391, 29892, 3789, 13, 13, 5215, 3564, 29916, 408, 302, 29916, 13, 5215, 11451, 1688, 13, 3166, 4733, 29918, 5258, 29889, 16418, 1053, 5244, 1785, 305, 13, 3166, 1027, 3221, 29918, 5509, 29918, 11851, 272, 29918, 29894, 29906, 29889, 13239, 29889, 29881, 810, 1053, 313, 13, 1678, 1653, 29918, 8835, 29918, 24157, 29892, 13, 1678, 1653, 29918, 1195, 3039, 29918, 12097, 1288, 29918, 4262, 29918, 6707, 29918, 265, 29918, 21731, 29892, 13, 1678, 1284, 29918, 12097, 1288, 29918, 3177, 29918, 1270, 7799, 29892, 13, 29897, 13, 13, 13, 1753, 1243, 29918, 3258, 29918, 8835, 29918, 24157, 29918, 4262, 29898, 13, 1678, 25713, 29918, 1287, 1785, 305, 29901, 5244, 1785, 305, 29892, 13, 1678, 25713, 29918, 1287, 1785, 305, 29918, 8835, 29918, 26859, 562, 3819, 29901, 360, 919, 29961, 710, 29892, 2391, 29961, 710, 20526, 13, 1125, 13, 1678, 12136, 29918, 4262, 353, 1653, 29918, 8835, 29918, 24157, 29898, 29888, 1296, 29918, 1287, 1785, 305, 29897, 13, 1678, 4974, 302, 29916, 29889, 275, 29918, 11851, 287, 29918, 4135, 28746, 29918, 4262, 29898, 24157, 29918, 4262, 29897, 13, 1678, 4974, 302, 29916, 29889, 517, 29918, 8977, 29918, 974, 29918, 21513, 29898, 24157, 29918, 4262, 29897, 1275, 25713, 29918, 1287, 1785, 305, 29918, 8835, 29918, 26859, 562, 3819, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 3207, 300, 374, 911, 29898, 13, 1678, 376, 1491, 4262, 29892, 4889, 29918, 4548, 29918, 24157, 29892, 451, 29918, 1454, 1133, 29918, 4548, 29918, 24157, 613, 13, 1678, 518, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 19997, 13, 9651, 426, 13, 18884, 376, 29941, 29874, 29955, 29896, 29900, 29881, 29947, 29890, 29899, 29945, 29953, 29945, 29883, 29899, 29945, 29888, 29946, 29953, 29899, 29947, 29955, 29900, 29890, 29899, 29890, 29946, 29945, 774, 29872, 29896, 29929, 29945, 13801, 29955, 1115, 518, 13, 462, 1678, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 29908, 13, 18884, 21251, 13, 18884, 376, 29872, 29896, 29872, 29906, 11248, 29929, 29953, 29899, 346, 29947, 29888, 29899, 29945, 10736, 29899, 29947, 29955, 29896, 29906, 29899, 29890, 29947, 287, 29941, 29896, 29906, 29874, 29955, 29947, 29906, 29883, 1115, 518, 13, 462, 1678, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 29908, 13, 18884, 21251, 13, 18884, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 1115, 518, 13, 462, 1678, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 29908, 13, 18884, 21251, 13, 18884, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 1115, 19997, 13, 9651, 2981, 13, 9651, 426, 13, 18884, 376, 29872, 29896, 29872, 29906, 11248, 29929, 29953, 29899, 346, 29947, 29888, 29899, 29945, 10736, 29899, 29947, 29955, 29896, 29906, 29899, 29890, 29947, 287, 29941, 29896, 29906, 29874, 29955, 29947, 29906, 29883, 1115, 518, 13, 462, 1678, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 29908, 13, 18884, 21251, 13, 18884, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 1115, 518, 13, 462, 1678, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 29908, 13, 18884, 21251, 13, 18884, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 1115, 19997, 13, 9651, 2981, 13, 9651, 1178, 543, 1217, 1014, 9262, 3639, 278, 2989, 3983, 613, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 518, 13, 18884, 376, 29947, 29929, 29900, 29906, 29881, 29941, 29953, 29883, 29899, 12328, 29953, 29945, 29899, 29945, 29890, 29900, 29881, 29899, 29947, 29946, 29947, 29888, 29899, 29947, 29947, 29874, 287, 29955, 29906, 29881, 29955, 29947, 29946, 29929, 613, 13, 18884, 376, 29941, 29874, 29955, 29896, 29900, 29881, 29947, 29890, 29899, 29945, 29953, 29945, 29883, 29899, 29945, 29888, 29946, 29953, 29899, 29947, 29955, 29900, 29890, 29899, 29890, 29946, 29945, 774, 29872, 29896, 29929, 29945, 13801, 29955, 613, 13, 18884, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 613, 13, 18884, 376, 29872, 29896, 29872, 29906, 11248, 29929, 29953, 29899, 346, 29947, 29888, 29899, 29945, 10736, 29899, 29947, 29955, 29896, 29906, 29899, 29890, 29947, 287, 29941, 29896, 29906, 29874, 29955, 29947, 29906, 29883, 613, 13, 18884, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 613, 13, 18884, 376, 29947, 29906, 29881, 29955, 29874, 29906, 29945, 29883, 29899, 29896, 29947, 29881, 29946, 29899, 29946, 29946, 13891, 29899, 29874, 29929, 29929, 29955, 29899, 29872, 29945, 29883, 29929, 29874, 29955, 29946, 29945, 29872, 29955, 11512, 613, 13, 9651, 21251, 13, 9651, 426, 13, 18884, 376, 29941, 29874, 29955, 29896, 29900, 29881, 29947, 29890, 29899, 29945, 29953, 29945, 29883, 29899, 29945, 29888, 29946, 29953, 29899, 29947, 29955, 29900, 29890, 29899, 29890, 29946, 29945, 774, 29872, 29896, 29929, 29945, 13801, 29955, 1115, 518, 13, 462, 1678, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 29908, 13, 18884, 21251, 13, 18884, 376, 29872, 29896, 29872, 29906, 11248, 29929, 29953, 29899, 346, 29947, 29888, 29899, 29945, 10736, 29899, 29947, 29955, 29896, 29906, 29899, 29890, 29947, 287, 29941, 29896, 29906, 29874, 29955, 29947, 29906, 29883, 1115, 518, 13, 462, 1678, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 29908, 13, 18884, 21251, 13, 18884, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 1115, 518, 13, 462, 1678, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 29908, 13, 18884, 21251, 13, 18884, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 1115, 19997, 13, 9651, 2981, 13, 9651, 426, 13, 18884, 376, 29872, 29896, 29872, 29906, 11248, 29929, 29953, 29899, 346, 29947, 29888, 29899, 29945, 10736, 29899, 29947, 29955, 29896, 29906, 29899, 29890, 29947, 287, 29941, 29896, 29906, 29874, 29955, 29947, 29906, 29883, 1115, 518, 13, 462, 1678, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 29908, 13, 18884, 21251, 13, 18884, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 1115, 518, 13, 462, 1678, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 29908, 13, 18884, 21251, 13, 18884, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 1115, 19997, 13, 9651, 2981, 13, 9651, 1178, 543, 497, 7573, 4629, 3639, 278, 2989, 3983, 613, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 518, 13, 18884, 376, 29947, 29929, 29900, 29906, 29881, 29941, 29953, 29883, 29899, 12328, 29953, 29945, 29899, 29945, 29890, 29900, 29881, 29899, 29947, 29946, 29947, 29888, 29899, 29947, 29947, 29874, 287, 29955, 29906, 29881, 29955, 29947, 29946, 29929, 613, 29871, 396, 934, 29899, 13908, 13, 18884, 376, 29941, 29874, 29955, 29896, 29900, 29881, 29947, 29890, 29899, 29945, 29953, 29945, 29883, 29899, 29945, 29888, 29946, 29953, 29899, 29947, 29955, 29900, 29890, 29899, 29890, 29946, 29945, 774, 29872, 29896, 29929, 29945, 13801, 29955, 613, 29871, 396, 12844, 11356, 29871, 29896, 13, 9651, 21251, 13, 9651, 426, 13, 18884, 376, 29941, 29874, 29955, 29896, 29900, 29881, 29947, 29890, 29899, 29945, 29953, 29945, 29883, 29899, 29945, 29888, 29946, 29953, 29899, 29947, 29955, 29900, 29890, 29899, 29890, 29946, 29945, 774, 29872, 29896, 29929, 29945, 13801, 29955, 1115, 19997, 13, 9651, 2981, 13, 9651, 24335, 13, 9651, 1178, 543, 18010, 29871, 29900, 322, 29871, 29896, 613, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 518, 13, 18884, 376, 29947, 29929, 29900, 29906, 29881, 29941, 29953, 29883, 29899, 12328, 29953, 29945, 29899, 29945, 29890, 29900, 29881, 29899, 29947, 29946, 29947, 29888, 29899, 29947, 29947, 29874, 287, 29955, 29906, 29881, 29955, 29947, 29946, 29929, 613, 29871, 396, 934, 29899, 13908, 13, 18884, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 613, 29871, 396, 12844, 11356, 29871, 29906, 13, 9651, 21251, 13, 9651, 426, 13, 18884, 376, 29941, 29874, 29955, 29896, 29900, 29881, 29947, 29890, 29899, 29945, 29953, 29945, 29883, 29899, 29945, 29888, 29946, 29953, 29899, 29947, 29955, 29900, 29890, 29899, 29890, 29946, 29945, 774, 29872, 29896, 29929, 29945, 13801, 29955, 1115, 518, 13, 462, 1678, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 29908, 13, 18884, 21251, 13, 18884, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 1115, 19997, 13, 9651, 2981, 13, 9651, 426, 13, 18884, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 1115, 19997, 13, 9651, 2981, 13, 9651, 1178, 543, 3177, 29871, 29900, 322, 29871, 29906, 613, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 518, 13, 18884, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 613, 29871, 396, 12844, 11356, 29871, 29906, 13, 18884, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 613, 29871, 396, 12844, 11356, 29871, 29946, 13, 9651, 21251, 13, 9651, 426, 13, 18884, 376, 29941, 29874, 29955, 29896, 29900, 29881, 29947, 29890, 29899, 29945, 29953, 29945, 29883, 29899, 29945, 29888, 29946, 29953, 29899, 29947, 29955, 29900, 29890, 29899, 29890, 29946, 29945, 774, 29872, 29896, 29929, 29945, 13801, 29955, 1115, 518, 13, 462, 1678, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 29908, 13, 18884, 21251, 13, 18884, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 1115, 518, 13, 462, 1678, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 29908, 13, 18884, 21251, 13, 18884, 376, 29872, 29896, 29872, 29906, 11248, 29929, 29953, 29899, 346, 29947, 29888, 29899, 29945, 10736, 29899, 29947, 29955, 29896, 29906, 29899, 29890, 29947, 287, 29941, 29896, 29906, 29874, 29955, 29947, 29906, 29883, 1115, 518, 13, 462, 1678, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 29908, 13, 18884, 21251, 13, 18884, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 1115, 19997, 13, 9651, 2981, 13, 9651, 426, 13, 18884, 376, 29946, 29896, 29945, 29888, 1389, 29881, 29896, 29899, 29881, 29900, 29947, 29890, 29899, 29945, 29941, 29883, 29896, 29899, 328, 29890, 29900, 29899, 29896, 29953, 2580, 29941, 29874, 29953, 29947, 29955, 1389, 1115, 518, 13, 462, 1678, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 29908, 13, 18884, 21251, 13, 18884, 376, 29872, 29896, 29872, 29906, 11248, 29929, 29953, 29899, 346, 29947, 29888, 29899, 29945, 10736, 29899, 29947, 29955, 29896, 29906, 29899, 29890, 29947, 287, 29941, 29896, 29906, 29874, 29955, 29947, 29906, 29883, 1115, 518, 13, 462, 1678, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 29908, 13, 18884, 21251, 13, 18884, 376, 29953, 2742, 29896, 29906, 29900, 29929, 29899, 29890, 29946, 29945, 29929, 29899, 29945, 29955, 29941, 29945, 29899, 29929, 29896, 13801, 29899, 29955, 29953, 29896, 7340, 29945, 29947, 29946, 29947, 29900, 29947, 29881, 1115, 19997, 13, 9651, 2981, 13, 9651, 1178, 543, 3177, 29871, 29906, 322, 29871, 29946, 613, 13, 4706, 10353, 13, 1678, 21251, 13, 29897, 13, 12674, 822, 1243, 29918, 3258, 29918, 1195, 3039, 29918, 4262, 29898, 13, 1678, 2425, 29892, 13, 1678, 25713, 29918, 1287, 1785, 305, 29901, 5244, 1785, 305, 29892, 13, 1678, 1014, 4262, 29901, 3789, 29961, 710, 1402, 13, 1678, 4889, 29918, 4548, 29918, 24157, 29901, 360, 919, 29961, 710, 29892, 2391, 29961, 710, 20526, 13, 1678, 451, 29918, 1454, 1133, 29918, 4548, 29918, 24157, 29901, 360, 919, 29961, 710, 29892, 2391, 29961, 710, 20526, 13, 1125, 13, 1678, 4866, 29918, 24157, 29901, 302, 29916, 29889, 12130, 9527, 353, 1653, 29918, 8835, 29918, 24157, 29898, 29888, 1296, 29918, 1287, 1785, 305, 29897, 13, 13, 1678, 396, 4129, 338, 714, 9715, 297, 393, 1206, 13, 1678, 12212, 29918, 24157, 29901, 302, 29916, 29889, 12130, 9527, 353, 313, 13, 4706, 7272, 1653, 29918, 1195, 3039, 29918, 12097, 1288, 29918, 4262, 29918, 6707, 29918, 265, 29918, 21731, 29898, 13, 9651, 4866, 29918, 24157, 29892, 1014, 4262, 29892, 4889, 29918, 5060, 442, 29922, 5574, 13, 4706, 1723, 13, 1678, 1723, 13, 1678, 4974, 302, 29916, 29889, 517, 29918, 8977, 29918, 974, 29918, 21513, 29898, 9313, 1133, 29918, 24157, 29897, 1275, 4889, 29918, 4548, 29918, 24157, 13, 13, 1678, 396, 871, 278, 714, 9715, 6433, 4091, 367, 1476, 1244, 13, 1678, 12212, 29918, 24157, 29918, 2541, 29918, 6921, 29918, 4801, 522, 29901, 302, 29916, 29889, 12130, 9527, 353, 313, 13, 4706, 7272, 1653, 29918, 1195, 3039, 29918, 12097, 1288, 29918, 4262, 29918, 6707, 29918, 265, 29918, 21731, 29898, 13, 9651, 4866, 29918, 24157, 29892, 1014, 4262, 29892, 4889, 29918, 5060, 442, 29922, 8824, 13, 4706, 1723, 13, 1678, 1723, 13, 1678, 4974, 302, 29916, 29889, 517, 29918, 8977, 29918, 974, 29918, 21513, 29898, 9313, 1133, 29918, 24157, 29918, 2541, 29918, 6921, 29918, 4801, 522, 29897, 1275, 451, 29918, 1454, 1133, 29918, 4548, 29918, 24157, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 3207, 300, 374, 911, 29898, 13, 1678, 376, 24157, 29918, 26859, 562, 3819, 29892, 2943, 29918, 8149, 29892, 1518, 29918, 1270, 7799, 613, 13, 1678, 518, 13, 4706, 11451, 1688, 29889, 3207, 3319, 1118, 24335, 19997, 1178, 543, 6310, 12136, 1518, 694, 25785, 4968, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 8853, 3177, 29918, 29896, 1115, 6796, 3177, 29918, 29906, 613, 376, 3177, 29918, 29941, 12436, 376, 3177, 29918, 29906, 1115, 6796, 3177, 29918, 29941, 12436, 376, 3177, 29918, 29941, 1115, 5159, 1118, 13, 9651, 426, 13, 18884, 376, 3177, 29918, 29896, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 2388, 29914, 29888, 1296, 10758, 13, 18884, 376, 3177, 29918, 29906, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 2388, 29914, 29888, 1296, 10758, 13, 18884, 376, 3177, 29918, 29941, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 2388, 29914, 29888, 1296, 10758, 13, 9651, 2981, 13, 9651, 19997, 13, 9651, 1178, 543, 23090, 3109, 12136, 2149, 694, 11412, 613, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 426, 13, 18884, 376, 3177, 29918, 29896, 1115, 6796, 3177, 29918, 29906, 12436, 13, 18884, 376, 3177, 29918, 29906, 1115, 6796, 3177, 29918, 29941, 12436, 13, 18884, 376, 3177, 29918, 29941, 1115, 6796, 3177, 29918, 29896, 12436, 13, 9651, 2981, 13, 9651, 426, 13, 18884, 376, 3177, 29918, 29896, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 2388, 29914, 29888, 1296, 10758, 13, 18884, 376, 3177, 29918, 29906, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 2388, 29914, 29888, 1296, 10758, 13, 18884, 376, 3177, 29918, 29941, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 2388, 29914, 29888, 1296, 10758, 13, 9651, 2981, 13, 9651, 518, 3366, 3177, 29918, 29896, 613, 376, 3177, 29918, 29906, 613, 376, 3177, 29918, 29941, 3108, 1402, 13, 9651, 1178, 543, 24157, 411, 29871, 29896, 11412, 613, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 426, 13, 18884, 376, 3177, 29918, 29896, 1115, 6796, 3177, 29918, 29906, 12436, 13, 18884, 376, 3177, 29918, 29906, 1115, 6796, 3177, 29918, 29941, 613, 376, 3177, 29918, 29896, 12436, 13, 18884, 376, 3177, 29918, 29941, 1115, 6796, 3177, 29918, 29896, 12436, 13, 9651, 2981, 13, 9651, 426, 13, 18884, 376, 3177, 29918, 29896, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 2388, 29914, 29888, 1296, 10758, 13, 18884, 376, 3177, 29918, 29906, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 2388, 29914, 29888, 1296, 10758, 13, 18884, 376, 3177, 29918, 29941, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 2388, 29914, 29888, 1296, 10758, 13, 9651, 2981, 13, 9651, 518, 3366, 3177, 29918, 29896, 613, 376, 3177, 29918, 29906, 613, 376, 3177, 29918, 29941, 12436, 6796, 3177, 29918, 29896, 613, 376, 3177, 29918, 29906, 3108, 1402, 13, 9651, 1178, 543, 24157, 411, 29871, 29906, 25785, 613, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 426, 13, 18884, 376, 3177, 29918, 29896, 1115, 6796, 3177, 29918, 29906, 12436, 13, 18884, 376, 3177, 29918, 29906, 1115, 6796, 3177, 29918, 29941, 12436, 13, 18884, 376, 3177, 29918, 29941, 1115, 6796, 3177, 29918, 29896, 12436, 13, 9651, 2981, 13, 9651, 426, 13, 18884, 376, 3177, 29918, 29896, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 2388, 29914, 29888, 1296, 10758, 13, 18884, 376, 3177, 29918, 29906, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 2388, 29914, 29888, 1296, 10758, 13, 18884, 376, 3177, 29918, 29941, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 16626, 29914, 29888, 1296, 10758, 13, 9651, 2981, 13, 9651, 518, 3366, 3177, 29918, 29896, 613, 376, 3177, 29918, 29906, 613, 376, 3177, 29918, 29941, 3108, 1402, 13, 9651, 1178, 543, 24157, 411, 29871, 29896, 11412, 322, 29871, 29896, 7343, 5786, 881, 4418, 613, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 426, 13, 18884, 376, 3177, 29918, 29896, 1115, 6796, 3177, 29918, 29906, 12436, 13, 18884, 376, 3177, 29918, 29906, 1115, 6796, 3177, 29918, 29941, 12436, 13, 18884, 376, 3177, 29918, 29941, 1115, 6796, 3177, 29918, 29896, 12436, 13, 9651, 2981, 13, 9651, 426, 13, 18884, 376, 3177, 29918, 29896, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 16626, 29914, 29888, 1296, 10758, 13, 18884, 376, 3177, 29918, 29906, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 2388, 29914, 29888, 1296, 10758, 13, 18884, 376, 3177, 29918, 29941, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 16626, 29914, 29888, 1296, 10758, 13, 9651, 2981, 13, 9651, 518, 3366, 3177, 29918, 29896, 613, 376, 3177, 29918, 29906, 613, 376, 3177, 29918, 29941, 3108, 1402, 13, 9651, 1178, 543, 24157, 411, 29871, 29896, 11412, 322, 29871, 29906, 7343, 5786, 881, 4418, 613, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 426, 13, 18884, 376, 3177, 29918, 29896, 1115, 6796, 3177, 29918, 29906, 12436, 13, 18884, 376, 3177, 29918, 29906, 1115, 6796, 3177, 29918, 29941, 12436, 13, 18884, 376, 3177, 29918, 29941, 1115, 6796, 3177, 29918, 29896, 12436, 13, 9651, 2981, 13, 9651, 426, 13, 18884, 376, 3177, 29918, 29896, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 16626, 29914, 29888, 1296, 10758, 13, 18884, 376, 3177, 29918, 29906, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 16626, 29914, 29888, 1296, 10758, 13, 18884, 376, 3177, 29918, 29941, 1115, 8853, 1989, 1115, 376, 3601, 3221, 29914, 9916, 29914, 16626, 29914, 29888, 1296, 10758, 13, 9651, 2981, 13, 9651, 19997, 13, 9651, 1178, 543, 24157, 411, 29871, 29896, 11412, 322, 29871, 29941, 7343, 5786, 881, 367, 3431, 613, 13, 4706, 10353, 13, 1678, 21251, 13, 29897, 13, 1753, 1243, 29918, 2886, 29918, 12097, 1288, 29918, 3177, 29918, 1270, 7799, 29898, 13, 1678, 12136, 29918, 26859, 562, 3819, 29901, 360, 919, 29961, 710, 29892, 2391, 29961, 710, 20526, 13, 1678, 2943, 29918, 8149, 29901, 360, 919, 29961, 710, 29892, 360, 919, 29961, 710, 29892, 3139, 20526, 13, 1678, 1518, 29918, 1270, 7799, 29901, 2391, 29961, 1293, 29961, 710, 20526, 13, 1125, 13, 1678, 12136, 353, 302, 29916, 29889, 3166, 29918, 8977, 29918, 974, 29918, 21513, 29898, 24157, 29918, 26859, 562, 3819, 29892, 1653, 29918, 4746, 29922, 23818, 29889, 12130, 9527, 29897, 13, 1678, 396, 788, 2943, 8393, 13, 1678, 363, 1820, 29892, 1819, 297, 2943, 29918, 8149, 29889, 7076, 7295, 13, 4706, 363, 12421, 29892, 12421, 29918, 1767, 297, 1819, 29889, 7076, 7295, 13, 9651, 12136, 29889, 18010, 29961, 1989, 3816, 5552, 29962, 353, 12421, 29918, 1767, 13, 1678, 1051, 29918, 974, 29918, 1270, 7799, 353, 1284, 29918, 12097, 1288, 29918, 3177, 29918, 1270, 7799, 29898, 24157, 29897, 13, 1678, 4974, 7431, 29898, 1761, 29918, 974, 29918, 1270, 7799, 29897, 1275, 7431, 29898, 4548, 29918, 1270, 7799, 511, 376, 9684, 1353, 310, 25785, 451, 1476, 29908, 13, 1678, 363, 11412, 297, 1051, 29918, 974, 29918, 1270, 7799, 29901, 13, 4706, 4974, 12705, 29898, 23090, 29897, 297, 1518, 29918, 1270, 7799, 13, 2 ]
tests/e2e/process_chm15k/tests.py
actris-cloudnet/data-processing
0
15981
<reponame>actris-cloudnet/data-processing import netCDF4 from os import path from test_utils.utils import count_strings, read_log_file import pytest SCRIPT_PATH = path.dirname(path.realpath(__file__)) class TestChm15kProcessing: product = 'lidar' instrument = 'chm15k' @pytest.fixture(autouse=True) def _fetch_params(self, params): self.full_path = params['full_path'] @pytest.mark.first_run def test_that_refuses_to_process_without_reprocess_flag(self): with pytest.raises(OSError): netCDF4.Dataset(self.full_path) @pytest.mark.first_run def test_that_calls_metadata_api_only_once(self): data = read_log_file(SCRIPT_PATH) assert len(data) == 1 assert '"GET /api/files?dateFrom=2020-10-22&dateTo=2020-10-22&site=bucharest&developer=True' \ '&product=lidar&showLegacy=True HTTP/1.1" 200 -' in data[0] @pytest.mark.first_run def test_that_does_not_call_pid_api(self): f = open(f'{SCRIPT_PATH}/pid.log') data = f.readlines() assert len(data) == 0 @pytest.mark.reprocess def test_attributes(self): nc = netCDF4.Dataset(self.full_path) assert nc.year == "2020" assert nc.month == "10" assert nc.day == "22" assert nc.cloudnet_file_type == self.product assert hasattr(nc, 'pid') is True nc.close() @pytest.mark.reprocess def test_that_calls_pid_api(self): f = open(f'{SCRIPT_PATH}/pid.log') data = f.readlines() assert len(data) == 1 assert 'POST /pid/ HTTP/1.1" 200 -' in data[0] @pytest.mark.reprocess def test_that_calls_metadata_api(self): data = read_log_file(SCRIPT_PATH) n_raw_files = 3 n_img = 2 n_gets = 5 n_puts = n_img + 2 n_posts = n_raw_files assert len(data) == n_gets + n_puts + n_posts # Check product status assert '"GET /api/files?dateFrom=2020-10-22&dateTo=2020-10-22&site=bucharest&developer=True' \ '&product=lidar&showLegacy=True HTTP/1.1" 200 -' in data[0] # Two API calls the get instrument status... # GET raw data assert '"GET /upload-metadata?dateFrom=2020-10-22&dateTo=2020-10-22&site=bucharest' \ '&developer=True&instrument=chm15k&status%5B%5D=uploaded&status%5B%5D=processed HTTP/1.1" 200 -' in data[3] # GET calibration assert '"GET /api/calibration?site=bucharest&date=2020-10-22&instrument=chm15k HTTP/1.1" 200 -' in data[4] # PUT file assert '"PUT /files/20201022_bucharest_chm15k.nc HTTP/1.1"' in data[5] # PUT images img_put = '"PUT /visualizations/20201022_bucharest_chm15k-' assert count_strings(data, img_put) == n_img # POST metadata file_put = '"POST /upload-metadata HTTP/1.1" 200 -' assert count_strings(data, file_put) == n_raw_files
[ 1, 529, 276, 1112, 420, 29958, 627, 3780, 29899, 9274, 1212, 29914, 1272, 29899, 19170, 13, 5215, 7787, 29907, 4037, 29946, 13, 3166, 2897, 1053, 2224, 13, 3166, 1243, 29918, 13239, 29889, 13239, 1053, 2302, 29918, 19651, 29892, 1303, 29918, 1188, 29918, 1445, 13, 5215, 11451, 1688, 13, 13, 7187, 24290, 29918, 10145, 353, 2224, 29889, 25721, 29898, 2084, 29889, 6370, 2084, 22168, 1445, 1649, 876, 13, 13, 13, 1990, 4321, 1451, 29885, 29896, 29945, 29895, 7032, 292, 29901, 13, 13, 1678, 3234, 353, 525, 29880, 333, 279, 29915, 13, 1678, 11395, 353, 525, 305, 29885, 29896, 29945, 29895, 29915, 13, 13, 1678, 732, 2272, 1688, 29889, 7241, 15546, 29898, 1300, 1709, 29922, 5574, 29897, 13, 1678, 822, 903, 9155, 29918, 7529, 29898, 1311, 29892, 8636, 1125, 13, 4706, 1583, 29889, 8159, 29918, 2084, 353, 8636, 1839, 8159, 29918, 2084, 2033, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 4102, 29918, 3389, 13, 1678, 822, 1243, 29918, 5747, 29918, 999, 6394, 29918, 517, 29918, 5014, 29918, 14037, 29918, 276, 5014, 29918, 15581, 29898, 1311, 1125, 13, 4706, 411, 11451, 1688, 29889, 336, 4637, 29898, 29949, 29173, 1125, 13, 9651, 7787, 29907, 4037, 29946, 29889, 16390, 24541, 29898, 1311, 29889, 8159, 29918, 2084, 29897, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 4102, 29918, 3389, 13, 1678, 822, 1243, 29918, 5747, 29918, 29883, 4293, 29918, 19635, 29918, 2754, 29918, 6194, 29918, 10646, 29898, 1311, 1125, 13, 4706, 848, 353, 1303, 29918, 1188, 29918, 1445, 29898, 7187, 24290, 29918, 10145, 29897, 13, 4706, 4974, 7431, 29898, 1272, 29897, 1275, 29871, 29896, 13, 4706, 4974, 18793, 7194, 847, 2754, 29914, 5325, 29973, 1256, 4591, 29922, 29906, 29900, 29906, 29900, 29899, 29896, 29900, 29899, 29906, 29906, 29987, 1256, 1762, 29922, 29906, 29900, 29906, 29900, 29899, 29896, 29900, 29899, 29906, 29906, 29987, 2746, 29922, 8458, 279, 342, 29987, 6734, 29922, 5574, 29915, 320, 13, 1669, 525, 29987, 4704, 29922, 29880, 333, 279, 29987, 4294, 22988, 4135, 29922, 5574, 7331, 29914, 29896, 29889, 29896, 29908, 29871, 29906, 29900, 29900, 448, 29915, 297, 848, 29961, 29900, 29962, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 4102, 29918, 3389, 13, 1678, 822, 1243, 29918, 5747, 29918, 13221, 29918, 1333, 29918, 4804, 29918, 5935, 29918, 2754, 29898, 1311, 1125, 13, 4706, 285, 353, 1722, 29898, 29888, 29915, 29912, 7187, 24290, 29918, 10145, 6822, 5935, 29889, 1188, 1495, 13, 4706, 848, 353, 285, 29889, 949, 9012, 580, 13, 4706, 4974, 7431, 29898, 1272, 29897, 1275, 29871, 29900, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 276, 5014, 13, 1678, 822, 1243, 29918, 15697, 29898, 1311, 1125, 13, 4706, 302, 29883, 353, 7787, 29907, 4037, 29946, 29889, 16390, 24541, 29898, 1311, 29889, 8159, 29918, 2084, 29897, 13, 4706, 4974, 302, 29883, 29889, 6360, 1275, 376, 29906, 29900, 29906, 29900, 29908, 13, 4706, 4974, 302, 29883, 29889, 10874, 1275, 376, 29896, 29900, 29908, 13, 4706, 4974, 302, 29883, 29889, 3250, 1275, 376, 29906, 29906, 29908, 13, 4706, 4974, 302, 29883, 29889, 9274, 1212, 29918, 1445, 29918, 1853, 1275, 1583, 29889, 4704, 13, 4706, 4974, 756, 5552, 29898, 17608, 29892, 525, 5935, 1495, 338, 5852, 13, 4706, 302, 29883, 29889, 5358, 580, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 276, 5014, 13, 1678, 822, 1243, 29918, 5747, 29918, 29883, 4293, 29918, 5935, 29918, 2754, 29898, 1311, 1125, 13, 4706, 285, 353, 1722, 29898, 29888, 29915, 29912, 7187, 24290, 29918, 10145, 6822, 5935, 29889, 1188, 1495, 13, 4706, 848, 353, 285, 29889, 949, 9012, 580, 13, 4706, 4974, 7431, 29898, 1272, 29897, 1275, 29871, 29896, 13, 4706, 4974, 525, 5438, 847, 5935, 29914, 7331, 29914, 29896, 29889, 29896, 29908, 29871, 29906, 29900, 29900, 448, 29915, 297, 848, 29961, 29900, 29962, 13, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 276, 5014, 13, 1678, 822, 1243, 29918, 5747, 29918, 29883, 4293, 29918, 19635, 29918, 2754, 29898, 1311, 1125, 13, 4706, 848, 353, 1303, 29918, 1188, 29918, 1445, 29898, 7187, 24290, 29918, 10145, 29897, 13, 13, 4706, 302, 29918, 1610, 29918, 5325, 353, 29871, 29941, 13, 4706, 302, 29918, 2492, 353, 29871, 29906, 13, 13, 4706, 302, 29918, 20078, 353, 29871, 29945, 13, 4706, 302, 29918, 649, 29879, 353, 302, 29918, 2492, 718, 29871, 29906, 13, 4706, 302, 29918, 14080, 353, 302, 29918, 1610, 29918, 5325, 13, 13, 4706, 4974, 7431, 29898, 1272, 29897, 1275, 302, 29918, 20078, 718, 302, 29918, 649, 29879, 718, 302, 29918, 14080, 13, 13, 4706, 396, 5399, 3234, 4660, 13, 4706, 4974, 18793, 7194, 847, 2754, 29914, 5325, 29973, 1256, 4591, 29922, 29906, 29900, 29906, 29900, 29899, 29896, 29900, 29899, 29906, 29906, 29987, 1256, 1762, 29922, 29906, 29900, 29906, 29900, 29899, 29896, 29900, 29899, 29906, 29906, 29987, 2746, 29922, 8458, 279, 342, 29987, 6734, 29922, 5574, 29915, 320, 13, 1669, 525, 29987, 4704, 29922, 29880, 333, 279, 29987, 4294, 22988, 4135, 29922, 5574, 7331, 29914, 29896, 29889, 29896, 29908, 29871, 29906, 29900, 29900, 448, 29915, 297, 848, 29961, 29900, 29962, 13, 13, 4706, 396, 7803, 3450, 5717, 278, 679, 11395, 4660, 856, 13, 13, 4706, 396, 12354, 10650, 848, 13, 4706, 4974, 18793, 7194, 847, 9009, 29899, 19635, 29973, 1256, 4591, 29922, 29906, 29900, 29906, 29900, 29899, 29896, 29900, 29899, 29906, 29906, 29987, 1256, 1762, 29922, 29906, 29900, 29906, 29900, 29899, 29896, 29900, 29899, 29906, 29906, 29987, 2746, 29922, 8458, 279, 342, 29915, 320, 13, 1669, 525, 29987, 6734, 29922, 5574, 29987, 2611, 15461, 29922, 305, 29885, 29896, 29945, 29895, 29987, 4882, 29995, 29945, 29933, 29995, 29945, 29928, 29922, 9009, 287, 29987, 4882, 29995, 29945, 29933, 29995, 29945, 29928, 29922, 5014, 287, 7331, 29914, 29896, 29889, 29896, 29908, 29871, 29906, 29900, 29900, 448, 29915, 297, 848, 29961, 29941, 29962, 13, 13, 4706, 396, 12354, 1208, 26218, 13, 4706, 4974, 18793, 7194, 847, 2754, 29914, 1052, 26218, 29973, 2746, 29922, 8458, 279, 342, 29987, 1256, 29922, 29906, 29900, 29906, 29900, 29899, 29896, 29900, 29899, 29906, 29906, 29987, 2611, 15461, 29922, 305, 29885, 29896, 29945, 29895, 7331, 29914, 29896, 29889, 29896, 29908, 29871, 29906, 29900, 29900, 448, 29915, 297, 848, 29961, 29946, 29962, 13, 13, 4706, 396, 349, 2692, 934, 13, 4706, 4974, 18793, 12336, 847, 5325, 29914, 29906, 29900, 29906, 29900, 29896, 29900, 29906, 29906, 29918, 8458, 279, 342, 29918, 305, 29885, 29896, 29945, 29895, 29889, 17608, 7331, 29914, 29896, 29889, 29896, 29908, 29915, 297, 848, 29961, 29945, 29962, 13, 13, 4706, 396, 349, 2692, 4558, 13, 4706, 10153, 29918, 649, 353, 18793, 12336, 847, 20119, 17063, 29914, 29906, 29900, 29906, 29900, 29896, 29900, 29906, 29906, 29918, 8458, 279, 342, 29918, 305, 29885, 29896, 29945, 29895, 29899, 29915, 13, 4706, 4974, 2302, 29918, 19651, 29898, 1272, 29892, 10153, 29918, 649, 29897, 1275, 302, 29918, 2492, 13, 13, 4706, 396, 11971, 15562, 13, 4706, 934, 29918, 649, 353, 18793, 5438, 847, 9009, 29899, 19635, 7331, 29914, 29896, 29889, 29896, 29908, 29871, 29906, 29900, 29900, 448, 29915, 13, 4706, 4974, 2302, 29918, 19651, 29898, 1272, 29892, 934, 29918, 649, 29897, 1275, 302, 29918, 1610, 29918, 5325, 13, 2 ]
src/Server/backend/GnC/migrations/0010_goals_cascaded_goal.py
tejpratap545/denselight_system
0
178791
# Generated by Django 3.1.2 on 2021-04-08 17:47 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('GnC', '0009_auto_20210407_1742'), ] operations = [ migrations.AddField( model_name='goals', name='cascaded_goal', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='GnC.cascadedgoals'), ), ]
[ 1, 396, 3251, 630, 491, 15337, 29871, 29941, 29889, 29896, 29889, 29906, 373, 29871, 29906, 29900, 29906, 29896, 29899, 29900, 29946, 29899, 29900, 29947, 29871, 29896, 29955, 29901, 29946, 29955, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 29892, 4733, 13, 5215, 9557, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 9962, 353, 518, 13, 4706, 6702, 29954, 29876, 29907, 742, 525, 29900, 29900, 29900, 29929, 29918, 6921, 29918, 29906, 29900, 29906, 29896, 29900, 29946, 29900, 29955, 29918, 29896, 29955, 29946, 29906, 5477, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 2528, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 1484, 1338, 742, 13, 9651, 1024, 2433, 29883, 6151, 11932, 29918, 28111, 742, 13, 9651, 1746, 29922, 9794, 29889, 27755, 2558, 29898, 19465, 29922, 5574, 29892, 1870, 29922, 5574, 29892, 373, 29918, 8143, 29922, 14095, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 29889, 29907, 3289, 5454, 2287, 29892, 304, 2433, 29954, 29876, 29907, 29889, 29883, 6151, 11932, 1484, 1338, 5477, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
setup.py
psjay/PyLocache
4
112767
<reponame>psjay/PyLocache #!/usr/bin/python # -*- coding: utf-8 -*- import os from setuptools import setup, find_packages def read_file(*path): base_dir = os.path.dirname(__file__) file_path = (base_dir, ) + tuple(path) return open(os.path.join(*file_path)).read() setup( name="PyLocache", url="https://github.com/psjay/PyLocache", version="0.0.4", license='WTFPL', description="PyLocache is a Python implementation of LRU local cache.", long_description=( read_file("README.rst") + "\n\n" + "Change History\n" + "==============\n\n" + read_file("CHANGES.rst")), author='psjay', author_email="<EMAIL>", include_package_data=True, zip_safe=False, packages=find_packages(), install_requires=[], test_suite='nose.collector', setup_requires=['nose>=1.0'], classifiers=[ "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Operating System :: OS Independent", "Topic :: Software Development :: Libraries", "Topic :: Utilities", ], )
[ 1, 529, 276, 1112, 420, 29958, 567, 29926, 388, 29914, 19737, 3524, 1829, 13, 29937, 14708, 4855, 29914, 2109, 29914, 4691, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 2897, 13, 3166, 731, 21245, 8789, 1053, 6230, 29892, 1284, 29918, 8318, 13, 13, 13, 1753, 1303, 29918, 1445, 10456, 2084, 1125, 13, 1678, 2967, 29918, 3972, 353, 2897, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 29897, 13, 1678, 934, 29918, 2084, 353, 313, 3188, 29918, 3972, 29892, 1723, 718, 18761, 29898, 2084, 29897, 13, 1678, 736, 1722, 29898, 359, 29889, 2084, 29889, 7122, 10456, 1445, 29918, 2084, 8106, 949, 580, 13, 13, 13, 14669, 29898, 13, 1678, 1024, 543, 19737, 3524, 1829, 613, 13, 1678, 3142, 543, 991, 597, 3292, 29889, 510, 29914, 567, 29926, 388, 29914, 19737, 3524, 1829, 613, 13, 1678, 1873, 543, 29900, 29889, 29900, 29889, 29946, 613, 13, 1678, 19405, 2433, 29956, 8969, 7390, 742, 13, 1678, 6139, 543, 19737, 3524, 1829, 338, 263, 5132, 5314, 310, 365, 28283, 1887, 7090, 19602, 13, 1678, 1472, 29918, 8216, 7607, 13, 4706, 1303, 29918, 1445, 703, 16310, 2303, 29889, 29878, 303, 1159, 718, 6634, 29876, 29905, 29876, 29908, 718, 13, 4706, 376, 7277, 5298, 29905, 29876, 29908, 718, 13, 4706, 376, 4936, 2751, 1360, 29905, 29876, 29905, 29876, 29908, 718, 13, 4706, 1303, 29918, 1445, 703, 3210, 24336, 29903, 29889, 29878, 303, 1159, 511, 13, 1678, 4148, 2433, 567, 29926, 388, 742, 13, 1678, 4148, 29918, 5269, 543, 29966, 26862, 6227, 28341, 13, 1678, 3160, 29918, 5113, 29918, 1272, 29922, 5574, 29892, 13, 1678, 14319, 29918, 11177, 29922, 8824, 29892, 13, 1678, 9741, 29922, 2886, 29918, 8318, 3285, 13, 1678, 2601, 29918, 276, 339, 2658, 11759, 1402, 13, 1678, 1243, 29918, 13495, 2433, 29876, 852, 29889, 15914, 272, 742, 13, 1678, 6230, 29918, 276, 339, 2658, 29922, 1839, 29876, 852, 18572, 29896, 29889, 29900, 7464, 13, 1678, 770, 14903, 11759, 13, 4706, 376, 9283, 4056, 17088, 4761, 5132, 613, 13, 4706, 376, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29906, 613, 13, 4706, 376, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29906, 29889, 29955, 613, 13, 4706, 376, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 613, 13, 4706, 376, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29941, 613, 13, 4706, 376, 7094, 1218, 2184, 4761, 6570, 25266, 613, 13, 4706, 376, 7031, 293, 4761, 18540, 14650, 4761, 365, 4626, 4314, 613, 13, 4706, 376, 7031, 293, 4761, 22310, 1907, 613, 13, 1678, 21251, 13, 29897, 13, 2 ]
Singleton.py
cxwithyxy/PythonSingleton
0
35418
#coding:utf-8 import threading class Singleton(object): def __new__(cls, *args, **kwargs): lock = threading.Lock() lock.acquire() if not hasattr(cls, "_instance"): cls._instance = object.__new__(cls) cls._instance.__Singleton_Init__(*args, **kwargs) lock.release() return cls._instance def __Singleton_Init__(self): raise RuntimeError("__Singleton_Init__ must be overwritten")
[ 1, 396, 29883, 3689, 29901, 9420, 29899, 29947, 13, 5215, 3244, 292, 13, 1990, 6106, 11285, 29898, 3318, 1125, 13, 13, 1678, 822, 4770, 1482, 12035, 25932, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 7714, 353, 3244, 292, 29889, 16542, 580, 13, 4706, 7714, 29889, 562, 1548, 580, 13, 4706, 565, 451, 756, 5552, 29898, 25932, 29892, 11119, 8758, 29908, 1125, 13, 9651, 1067, 29879, 3032, 8758, 353, 1203, 17255, 1482, 12035, 25932, 29897, 13, 9651, 1067, 29879, 3032, 8758, 17255, 10873, 11285, 29918, 6644, 1649, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 7714, 29889, 14096, 580, 13, 4706, 736, 1067, 29879, 3032, 8758, 13, 13, 1678, 822, 4770, 10873, 11285, 29918, 6644, 12035, 1311, 1125, 13, 4706, 12020, 24875, 2392, 703, 1649, 10873, 11285, 29918, 6644, 1649, 1818, 367, 975, 17625, 1159, 2 ]
relevanceai/client/client.py
RelevanceAI/RelevanceAI
21
170143
<gh_stars>10-100 """Relevance AI's base Client class - primarily used to login and access the Dataset class or ClusterOps class. The recomended way to log in is using: .. code-block:: from relevanceai import Client client = Client() client.list_datasets() If the user already knows their project and API key, they can log in this way: .. code-block:: from relevanceai import Client project = "" api_key = "" client = Client(project=project, api_key=api_key, firebase_uid=firebase_uid) client.list_datasets() If you need to change your token, simply run: .. code-block:: from relevanceai import Client client = Client(token="...") """ import os import re from tkinter import Label import uuid import getpass import pandas as pd import analytics from base64 import b64decode as decode from typing import Dict, List, Optional, Union from relevanceai._api import APIClient from doc_utils.doc_utils import DocUtils from relevanceai.client.helpers import * from relevanceai.constants.errors import APIError from relevanceai.constants.messages import Messages from relevanceai.dataset import Dataset from relevanceai.utils.decorators.analytics import track, identify from relevanceai.utils.decorators.version import beta, added from relevanceai.utils.config_mixin import ConfigMixin from relevanceai.client.cache import CacheMixin from relevanceai.client.operators import Operators class Client(APIClient, ConfigMixin, CacheMixin, Operators): def __init__( self, token: Optional[str] = None, authenticate: bool = True, ): """ Initialize the client Parameters ------------- token: str You can paste the token here if things need to be refreshed enable_request_logging: bool, str Whether to print out the requests made, if "full" the body will be printed as well. """ if token is None: token = auth() print( "If you require non-interactive token authentication, you can set token=..." ) self.token = token self.credentials = process_token(token) super().__init__(self.credentials) if os.getenv("DEBUG_REQUESTS") == "TRUE": print(f"logging requests to: {self.request_logging_fpath}") # Eventually the following should be accessed directly from # self.credentials, but keep for now. ( self.project, self.api_key, self.region, self.firebase_uid, ) = self.credentials.split_token() self.base_url = region_to_url(self.region) self.base_ingest_url = region_to_url(self.region) try: self._set_mixpanel_write_key() except Exception as e: pass self._identify() # used to debug if authenticate: if self.check_auth(): print(Messages.WELCOME_MESSAGE.format(self.project)) else: raise APIError(Messages.FAIL_MESSAGE) # Add non breaking changes to support old ways of inserting documents and csv # self.insert_documents = Dataset( # credentials=self.credentials, # dataset_id="", # )._insert_documents # self.insert_csv = Dataset( # credentials=self.credentials, # dataset_id="", # )._insert_csv @identify def _identify(self): return def _set_mixpanel_write_key(self): analytics.write_key = decode(self.mixpanel_write_key).decode("utf-8") def _get_token(self): # TODO: either use cache or keyring package token = getpass.getpass(f"Activation token:") return token def check_auth(self): print(f"Connecting to {self.region}...") return self.list_datasets() @track def create_dataset(self, dataset_id: str, schema: Optional[Dict] = None): """ A dataset can store documents to be searched, retrieved, filtered and aggregated (similar to Collections in MongoDB, Tables in SQL, Indexes in ElasticSearch). A powerful and core feature of VecDB is that you can store both your metadata and vectors in the same document. When specifying the schema of a dataset and inserting your own vector use the suffix (ends with) "_vector_" for the field name, and specify the length of the vector in dataset_schema. \n For example: .. code-block:: { "product_image_vector_": 1024, "product_text_description_vector_" : 128 } These are the field types supported in our datasets: ["text", "numeric", "date", "dict", "chunks", "vector", "chunkvector"]. \n For example: .. code-block:: { "product_text_description" : "text", "price" : "numeric", "created_date" : "date", "product_texts_chunk_": "chunks", "product_text_chunkvector_" : 1024 } You don't have to specify the schema of every single field when creating a dataset, as VecDB will automatically detect the appropriate data type for each field (vectors will be automatically identified by its "_vector_" suffix). Infact you also don't always have to use this endpoint to create a dataset as /datasets/bulk_insert will infer and create the dataset and schema as you insert new documents. \n Note: - A dataset name/id can only contain undercase letters, dash, underscore and numbers. - "_id" is reserved as the key and id of a document. - Once a schema is set for a dataset it cannot be altered. If it has to be altered, utlise the copy dataset endpoint. For more information about vectors check out the 'Vectorizing' section, services.search.vector or out blog at https://relevance.ai/blog. For more information about chunks and chunk vectors check out datasets.search.chunk. Parameters ---------- dataset_id: str The unique name of your dataset schema : dict Schema for specifying the field that are vectors and its length Example ---------- .. code-block:: from relevanceai import Client client = Client() client.create_dataset("sample_dataset_id") """ schema = {} if schema is None else schema return self.datasets.create(dataset_id, schema=schema) @track def list_datasets(self, verbose=False): """List Datasets Example ---------- .. code-block:: from relevanceai import Client client = Client() client.list_datasets() """ if verbose: self.print_dashboard_message( "You can view all your datasets at https://cloud.relevance.ai/datasets/" ) datasets = self.datasets.list() datasets["datasets"] = sorted(datasets["datasets"]) return datasets @track def delete_dataset(self, dataset_id): """ Delete a dataset Parameters ------------ dataset_id: str The ID of a dataset Example --------- .. code-block:: from relevanceai import Client client = Client() client.delete_dataset("sample_dataset_id") """ return self.datasets.delete(dataset_id) @track def Dataset( self, dataset_id: str, fields: Optional[List[str]] = None, image_fields: Optional[List[str]] = None, audio_fields: Optional[List[str]] = None, highlight_fields: Optional[Dict[str, List]] = None, text_fields: Optional[List[str]] = None, ): fields = [] if fields is None else fields image_fields = [] if image_fields is None else image_fields audio_fields = [] if audio_fields is None else audio_fields highlight_fields = {} if highlight_fields is None else highlight_fields text_fields = [] if text_fields is None else text_fields regex_check = re.search("^[a-z\d._-]+$", dataset_id) if regex_check is not None: self.create_dataset(dataset_id) else: raise ValueError( "dataset_id must contain only a combination of lowercase and/or '_' and/or '-' and/or '.'" ) return Dataset( credentials=self.credentials, dataset_id=dataset_id, fields=fields, image_fields=image_fields, audio_fields=audio_fields, highlight_fields=highlight_fields, text_fields=text_fields, ) ### Clustering @track def ClusterOps( self, dataset_id: str, vector_fields: list, alias: str, model=None, **kwargs, ): from relevanceai.operations_new.cluster.ops import ClusterOps return ClusterOps( credentials=self.credentials, dataset_id=dataset_id, vector_fields=vector_fields, alias=alias, model=model, **kwargs, ) @track def SubClusterOps( self, credentials, alias, dataset, model, vector_fields: list, parent_field: str, ): """ Sub Cluster Ops. """ from relevanceai.operations.cluster.sub import SubClusterOps return SubClusterOps( credentials=self.credentials, alias=alias, dataset=dataset, model=model, vector_fields=vector_fields, parent_field=parent_field, ) def _set_logger_to_verbose(self): # Use this for debugging self.config["logging.logging_level"] = "INFO" @track def send_dataset( self, dataset_id: str, receiver_project: str, receiver_api_key: str, ): """ Send an individual a dataset. For this, you must know their API key. Parameters ----------- dataset_id: str The name of the dataset receiver_project: str The project name that will receive the dataset receiver_api_key: str The project API key that will receive the dataset Example -------- .. code-block:: client = Client() client.send_dataset( dataset_id="research", receiver_project="...", receiver_api_key="..." ) """ return self.admin.send_dataset( dataset_id=dataset_id, receiver_project=receiver_project, receiver_api_key=receiver_api_key, ) @track def receive_dataset( self, dataset_id: str, sender_project: str, sender_api_key: str, ): """ Recieve an individual a dataset. Example -------- >>> client = Client() >>> client.admin.receive_dataset( dataset_id="research", sender_project="...", sender_api_key="..." ) Parameters ----------- dataset_id: str The name of the dataset sender_project: str The project name that will send the dataset sender_api_key: str The project API key that will send the dataset """ return self.admin.receive_dataset( dataset_id=dataset_id, sender_project=sender_project, sender_api_key=sender_api_key, ) @track def clone_dataset( self, source_dataset_id: str, new_dataset_id: Optional[str] = None, source_project: Optional[str] = None, source_api_key: Optional[str] = None, project: Optional[str] = None, api_key: Optional[str] = None, ): # To do this should be cloning a dataset in a project """ Clone a dataset from another user's projects into your project. Parameters ---------- dataset_id: The dataset to copy source_dataset_id: The original dataset source_project: The original project to copy from source_api_key: The original API key of the project project: The original project api_key: The original API key Example ----------- .. code-block:: client = Client() client.clone_dataset( dataset_id="research", source_project="...", source_api_key="..." ) """ if source_api_key is None: source_api_key = self.api_key source_project = self.project if new_dataset_id is None: new_dataset_id = source_dataset_id return self.admin.copy_foreign_dataset( dataset_id=new_dataset_id, source_dataset_id=source_dataset_id, source_project=source_project, source_api_key=source_api_key, project=project, api_key=api_key, ) @property def references(self): from relevanceai.__init__ import __version__ REFERENCE_URL = f"https://relevanceai.readthedocs.io/en/{__version__}/" MESSAGE = f"You can find your references here {REFERENCE_URL}." print(MESSAGE) docs = references def search_app(self, dataset_id: Optional[str] = None): if dataset_id is not None: self.print_search_dashboard_url(dataset_id) elif hasattr(self, "_dataset_id"): self.print_search_dashboard_url(self._dataset_id) elif hasattr(self, "dataset_id"): self.print_search_dashboard_url(self.dataset_id) else: print("You can build your search app at https://cloud.relevance.ai") @added(version="1.1.3") @track def search_datasets(self, query: str): """ Search through your datasets. """ return [x for x in self.list_datasets()["datasets"] if query in x] @added(version="2.1.3") @beta def list_cluster_reports(self): """ List all cluster reports. .. code-block:: from relevanceai import Client client = Client() client.list_cluster_reports() """ return pd.DataFrame(self.reports.clusters.list()["results"]) @added(version="2.1.3") @beta @track def delete_cluster_report(self, cluster_report_id: str): """ Delete Cluster Report .. code-block:: from relevanceai import Client client = Client() client.delete_cluster_report("cluster_id_goes_here") """ return self.reports.clusters.delete(cluster_report_id) @added(version="2.1.3") @beta @track def store_cluster_report(self, report_name: str, report: dict): """ Store the cluster data. .. code-block:: from relevanceai import Client client = Client() client.store_cluster_report("sample", {"value": 3}) """ response: dict = self.reports.clusters.create( name=report_name, report=self.json_encoder(report) ) print( f"You can now access your report at https://cloud.relevance.ai/report/cluster/{self.region}/{response['_id']}" ) return response def disable_analytics_tracking(self): """Disable analytics tracking if you would prefer not to send usage data to improve the product. Analytics allows us to improve your experience by examining the most popular flows, dedicating more resources to popular product features and improve user experience. """ self.config["mixpanel.is_tracking_enabled"] = False
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 15945, 29908, 1123, 2608, 749, 319, 29902, 29915, 29879, 2967, 12477, 770, 448, 19434, 1304, 304, 6464, 322, 2130, 278, 13373, 24541, 770, 470, 2233, 5402, 29949, 567, 770, 29889, 29871, 450, 27878, 2760, 982, 304, 1480, 297, 338, 773, 29901, 6317, 775, 29899, 1271, 1057, 515, 29527, 749, 1794, 1053, 12477, 3132, 353, 12477, 580, 3132, 29889, 1761, 29918, 14538, 1691, 580, 13, 3644, 278, 1404, 2307, 9906, 1009, 2060, 322, 3450, 1820, 29892, 896, 508, 13, 1188, 297, 445, 982, 29901, 13, 13, 636, 775, 29899, 1271, 1057, 13, 13, 1678, 515, 29527, 749, 1794, 1053, 12477, 13, 1678, 2060, 353, 5124, 13, 1678, 7882, 29918, 1989, 353, 5124, 13, 1678, 3132, 353, 12477, 29898, 4836, 29922, 4836, 29892, 7882, 29918, 1989, 29922, 2754, 29918, 1989, 29892, 16119, 29918, 5416, 29922, 17445, 29918, 5416, 29897, 13, 1678, 3132, 29889, 1761, 29918, 14538, 1691, 580, 13, 13, 3644, 366, 817, 304, 1735, 596, 5993, 29892, 3763, 1065, 29901, 13, 13, 636, 775, 29899, 1271, 1057, 13, 13, 1678, 515, 29527, 749, 1794, 1053, 12477, 13, 1678, 3132, 353, 12477, 29898, 6979, 543, 856, 1159, 13, 13, 15945, 29908, 13, 5215, 2897, 13, 5215, 337, 13, 3166, 18883, 1639, 1053, 15796, 13, 5215, 318, 5416, 13, 5215, 679, 3364, 13, 5215, 11701, 408, 10518, 13, 5215, 16114, 1199, 13, 13, 3166, 2967, 29953, 29946, 1053, 289, 29953, 29946, 13808, 408, 21822, 13, 3166, 19229, 1053, 360, 919, 29892, 2391, 29892, 28379, 29892, 7761, 13, 13, 3166, 29527, 749, 1794, 3032, 2754, 1053, 3450, 4032, 13, 13, 3166, 1574, 29918, 13239, 29889, 1514, 29918, 13239, 1053, 28197, 12177, 13, 13, 3166, 29527, 749, 1794, 29889, 4645, 29889, 3952, 6774, 1053, 334, 13, 13, 3166, 29527, 749, 1794, 29889, 3075, 1934, 29889, 12523, 1053, 3450, 2392, 13, 3166, 29527, 749, 1794, 29889, 3075, 1934, 29889, 19158, 1053, 11946, 1179, 13, 3166, 29527, 749, 1794, 29889, 24713, 1053, 13373, 24541, 13, 13, 3166, 29527, 749, 1794, 29889, 13239, 29889, 19557, 4097, 29889, 7054, 22026, 1053, 5702, 29892, 12439, 13, 3166, 29527, 749, 1794, 29889, 13239, 29889, 19557, 4097, 29889, 3259, 1053, 21762, 29892, 2715, 13, 3166, 29527, 749, 1794, 29889, 13239, 29889, 2917, 29918, 28084, 262, 1053, 12782, 29924, 861, 262, 13, 3166, 29527, 749, 1794, 29889, 4645, 29889, 8173, 1053, 28540, 29924, 861, 262, 13, 3166, 29527, 749, 1794, 29889, 4645, 29889, 3372, 4097, 1053, 6607, 4097, 13, 13, 13, 1990, 12477, 29898, 8787, 4032, 29892, 12782, 29924, 861, 262, 29892, 28540, 29924, 861, 262, 29892, 6607, 4097, 1125, 13, 1678, 822, 4770, 2344, 12035, 13, 4706, 1583, 29892, 13, 4706, 5993, 29901, 28379, 29961, 710, 29962, 353, 6213, 29892, 13, 4706, 15585, 403, 29901, 6120, 353, 5852, 29892, 13, 268, 1125, 13, 4706, 9995, 13, 4706, 25455, 278, 3132, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 9072, 13, 13, 4706, 5993, 29901, 851, 13, 9651, 887, 508, 11417, 278, 5993, 1244, 565, 2712, 817, 304, 367, 11086, 287, 13, 13, 4706, 9025, 29918, 3827, 29918, 21027, 29901, 6120, 29892, 851, 13, 9651, 26460, 304, 1596, 714, 278, 7274, 1754, 29892, 565, 376, 8159, 29908, 278, 3573, 674, 367, 13350, 408, 1532, 29889, 13, 4706, 9995, 13, 13, 4706, 565, 5993, 338, 6213, 29901, 13, 9651, 5993, 353, 4817, 580, 13, 9651, 1596, 29898, 13, 18884, 376, 3644, 366, 1996, 1661, 29899, 1639, 4925, 5993, 10760, 29892, 366, 508, 731, 5993, 29922, 17794, 13, 9651, 1723, 13, 13, 4706, 1583, 29889, 6979, 353, 5993, 13, 4706, 1583, 29889, 11944, 9409, 353, 1889, 29918, 6979, 29898, 6979, 29897, 13, 4706, 2428, 2141, 1649, 2344, 12035, 1311, 29889, 11944, 9409, 29897, 13, 13, 4706, 565, 2897, 29889, 657, 6272, 703, 18525, 29918, 16244, 29903, 1159, 1275, 376, 20652, 1115, 13, 9651, 1596, 29898, 29888, 29908, 21027, 7274, 304, 29901, 426, 1311, 29889, 3827, 29918, 21027, 29918, 29888, 2084, 27195, 13, 13, 4706, 396, 6864, 1474, 278, 1494, 881, 367, 20592, 4153, 515, 13, 4706, 396, 1583, 29889, 11944, 9409, 29892, 541, 3013, 363, 1286, 29889, 13, 4706, 313, 13, 9651, 1583, 29889, 4836, 29892, 13, 9651, 1583, 29889, 2754, 29918, 1989, 29892, 13, 9651, 1583, 29889, 12803, 29892, 13, 9651, 1583, 29889, 17445, 29918, 5416, 29892, 13, 4706, 1723, 353, 1583, 29889, 11944, 9409, 29889, 5451, 29918, 6979, 580, 13, 13, 4706, 1583, 29889, 3188, 29918, 2271, 353, 5120, 29918, 517, 29918, 2271, 29898, 1311, 29889, 12803, 29897, 13, 4706, 1583, 29889, 3188, 29918, 292, 342, 29918, 2271, 353, 5120, 29918, 517, 29918, 2271, 29898, 1311, 29889, 12803, 29897, 13, 13, 4706, 1018, 29901, 13, 9651, 1583, 3032, 842, 29918, 28084, 15119, 29918, 3539, 29918, 1989, 580, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1209, 13, 13, 4706, 1583, 3032, 1693, 1598, 580, 13, 13, 4706, 396, 1304, 304, 4744, 13, 4706, 565, 15585, 403, 29901, 13, 9651, 565, 1583, 29889, 3198, 29918, 5150, 7295, 13, 18884, 1596, 29898, 25510, 29889, 29956, 6670, 3217, 2303, 29918, 2303, 1799, 10461, 29889, 4830, 29898, 1311, 29889, 4836, 876, 13, 9651, 1683, 29901, 13, 18884, 12020, 3450, 2392, 29898, 25510, 29889, 4519, 6227, 29918, 2303, 1799, 10461, 29897, 13, 13, 4706, 396, 3462, 1661, 16679, 3620, 304, 2304, 2030, 5837, 310, 23800, 10701, 322, 11799, 13, 4706, 396, 1583, 29889, 7851, 29918, 3225, 29879, 353, 13373, 24541, 29898, 13, 4706, 396, 268, 16140, 29922, 1311, 29889, 11944, 9409, 29892, 13, 4706, 396, 268, 8783, 29918, 333, 543, 613, 13, 4706, 396, 13742, 29918, 7851, 29918, 3225, 29879, 13, 4706, 396, 1583, 29889, 7851, 29918, 7638, 353, 13373, 24541, 29898, 13, 4706, 396, 268, 16140, 29922, 1311, 29889, 11944, 9409, 29892, 13, 4706, 396, 268, 8783, 29918, 333, 543, 613, 13, 4706, 396, 13742, 29918, 7851, 29918, 7638, 13, 13, 1678, 732, 1693, 1598, 13, 1678, 822, 903, 1693, 1598, 29898, 1311, 1125, 13, 4706, 736, 13, 13, 1678, 822, 903, 842, 29918, 28084, 15119, 29918, 3539, 29918, 1989, 29898, 1311, 1125, 13, 4706, 16114, 1199, 29889, 3539, 29918, 1989, 353, 21822, 29898, 1311, 29889, 28084, 15119, 29918, 3539, 29918, 1989, 467, 13808, 703, 9420, 29899, 29947, 1159, 13, 13, 1678, 822, 903, 657, 29918, 6979, 29898, 1311, 1125, 13, 4706, 396, 14402, 29901, 2845, 671, 7090, 470, 1820, 5393, 3577, 13, 4706, 5993, 353, 679, 3364, 29889, 657, 3364, 29898, 29888, 29908, 21786, 362, 5993, 29901, 1159, 13, 4706, 736, 5993, 13, 13, 1678, 822, 1423, 29918, 5150, 29898, 1311, 1125, 13, 4706, 1596, 29898, 29888, 29908, 17918, 292, 304, 426, 1311, 29889, 12803, 29913, 856, 1159, 13, 4706, 736, 1583, 29889, 1761, 29918, 14538, 1691, 580, 13, 13, 1678, 732, 11294, 13, 1678, 822, 1653, 29918, 24713, 29898, 1311, 29892, 8783, 29918, 333, 29901, 851, 29892, 10938, 29901, 28379, 29961, 21533, 29962, 353, 6213, 1125, 13, 4706, 9995, 13, 4706, 319, 8783, 508, 3787, 10701, 304, 367, 17371, 29892, 27387, 29892, 22289, 322, 11404, 630, 313, 29764, 304, 1530, 5942, 297, 29004, 29892, 323, 1849, 297, 3758, 29892, 11374, 267, 297, 1260, 6288, 7974, 467, 13, 4706, 319, 13988, 322, 7136, 4682, 310, 26393, 4051, 338, 393, 366, 508, 3787, 1716, 596, 15562, 322, 12047, 297, 278, 1021, 1842, 29889, 1932, 22146, 278, 10938, 310, 263, 8783, 322, 23800, 596, 1914, 4608, 671, 278, 25557, 313, 1975, 411, 29897, 11119, 8111, 27508, 363, 278, 1746, 1024, 29892, 322, 6084, 278, 3309, 310, 278, 4608, 297, 8783, 29918, 11010, 29889, 320, 29876, 13, 13, 4706, 1152, 1342, 29901, 13, 13, 4706, 6317, 775, 29899, 1271, 1057, 13, 9651, 426, 13, 18884, 376, 4704, 29918, 3027, 29918, 8111, 29918, 1115, 29871, 29896, 29900, 29906, 29946, 29892, 13, 18884, 376, 4704, 29918, 726, 29918, 8216, 29918, 8111, 27508, 584, 29871, 29896, 29906, 29947, 13, 9651, 500, 13, 13, 4706, 4525, 526, 278, 1746, 4072, 6969, 297, 1749, 20035, 29901, 6796, 726, 613, 376, 21574, 613, 376, 1256, 613, 376, 8977, 613, 376, 305, 18801, 613, 376, 8111, 613, 376, 29812, 8111, 16862, 320, 29876, 13, 13, 4706, 1152, 1342, 29901, 13, 13, 4706, 6317, 775, 29899, 1271, 1057, 13, 13, 9651, 426, 13, 18884, 376, 4704, 29918, 726, 29918, 8216, 29908, 584, 376, 726, 613, 13, 18884, 376, 9175, 29908, 584, 376, 21574, 613, 13, 18884, 376, 11600, 29918, 1256, 29908, 584, 376, 1256, 613, 13, 18884, 376, 4704, 29918, 726, 29879, 29918, 29812, 29918, 1115, 376, 305, 18801, 613, 13, 18884, 376, 4704, 29918, 726, 29918, 29812, 8111, 27508, 584, 29871, 29896, 29900, 29906, 29946, 13, 9651, 500, 13, 13, 4706, 887, 1016, 29915, 29873, 505, 304, 6084, 278, 10938, 310, 1432, 2323, 1746, 746, 4969, 263, 8783, 29892, 408, 26393, 4051, 674, 6336, 6459, 278, 8210, 848, 1134, 363, 1269, 1746, 313, 345, 14359, 674, 367, 6336, 15659, 491, 967, 11119, 8111, 27508, 25557, 467, 9969, 627, 366, 884, 1016, 29915, 29873, 2337, 505, 304, 671, 445, 16248, 304, 1653, 263, 8783, 408, 847, 14538, 1691, 29914, 8645, 29895, 29918, 7851, 674, 10115, 322, 1653, 278, 8783, 322, 10938, 408, 366, 4635, 716, 10701, 29889, 320, 29876, 13, 13, 4706, 3940, 29901, 13, 13, 9651, 448, 319, 8783, 1024, 29914, 333, 508, 871, 1712, 1090, 4878, 8721, 29892, 12569, 29892, 23400, 3221, 322, 3694, 29889, 13, 9651, 448, 11119, 333, 29908, 338, 21676, 408, 278, 1820, 322, 1178, 310, 263, 1842, 29889, 13, 9651, 448, 9038, 263, 10938, 338, 731, 363, 263, 8783, 372, 2609, 367, 10551, 287, 29889, 960, 372, 756, 304, 367, 10551, 287, 29892, 3477, 29880, 895, 278, 3509, 8783, 16248, 29889, 13, 13, 4706, 1152, 901, 2472, 1048, 12047, 1423, 714, 278, 525, 12877, 5281, 29915, 4004, 29892, 5786, 29889, 4478, 29889, 8111, 470, 714, 12618, 472, 2045, 597, 276, 2608, 749, 29889, 1794, 29914, 7312, 29889, 1152, 901, 2472, 1048, 521, 18801, 322, 19875, 12047, 1423, 714, 20035, 29889, 4478, 29889, 29812, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 8783, 29918, 333, 29901, 851, 13, 9651, 450, 5412, 1024, 310, 596, 8783, 13, 4706, 10938, 584, 9657, 13, 9651, 1102, 2603, 363, 22146, 278, 1746, 393, 526, 12047, 322, 967, 3309, 13, 13, 4706, 8741, 13, 4706, 448, 1378, 29899, 13, 4706, 6317, 775, 29899, 1271, 1057, 13, 13, 9651, 515, 29527, 749, 1794, 1053, 12477, 13, 9651, 3132, 353, 12477, 580, 13, 9651, 3132, 29889, 3258, 29918, 24713, 703, 11249, 29918, 24713, 29918, 333, 1159, 13, 13, 4706, 9995, 13, 4706, 10938, 353, 6571, 565, 10938, 338, 6213, 1683, 10938, 13, 4706, 736, 1583, 29889, 14538, 1691, 29889, 3258, 29898, 24713, 29918, 333, 29892, 10938, 29922, 11010, 29897, 13, 13, 1678, 732, 11294, 13, 1678, 822, 1051, 29918, 14538, 1691, 29898, 1311, 29892, 26952, 29922, 8824, 1125, 13, 4706, 9995, 1293, 13373, 294, 1691, 13, 13, 4706, 8741, 13, 4706, 448, 1378, 29899, 13, 13, 4706, 6317, 775, 29899, 1271, 1057, 13, 13, 9651, 515, 29527, 749, 1794, 1053, 12477, 13, 9651, 3132, 353, 12477, 580, 13, 9651, 3132, 29889, 1761, 29918, 14538, 1691, 580, 13, 13, 4706, 9995, 13, 4706, 565, 26952, 29901, 13, 9651, 1583, 29889, 2158, 29918, 14592, 3377, 29918, 4906, 29898, 13, 18884, 376, 3492, 508, 1776, 599, 596, 20035, 472, 2045, 597, 9274, 29889, 276, 2608, 749, 29889, 1794, 29914, 14538, 1691, 12975, 13, 9651, 1723, 13, 4706, 20035, 353, 1583, 29889, 14538, 1691, 29889, 1761, 580, 13, 4706, 20035, 3366, 14538, 1691, 3108, 353, 12705, 29898, 14538, 1691, 3366, 14538, 1691, 20068, 13, 4706, 736, 20035, 13, 13, 1678, 732, 11294, 13, 1678, 822, 5217, 29918, 24713, 29898, 1311, 29892, 8783, 29918, 333, 1125, 13, 4706, 9995, 13, 4706, 21267, 263, 8783, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 5634, 13, 4706, 8783, 29918, 333, 29901, 851, 13, 9651, 450, 3553, 310, 263, 8783, 13, 13, 4706, 8741, 13, 4706, 448, 1378, 13, 13, 4706, 6317, 775, 29899, 1271, 1057, 13, 13, 9651, 515, 29527, 749, 1794, 1053, 12477, 13, 9651, 3132, 353, 12477, 580, 13, 9651, 3132, 29889, 8143, 29918, 24713, 703, 11249, 29918, 24713, 29918, 333, 1159, 13, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 14538, 1691, 29889, 8143, 29898, 24713, 29918, 333, 29897, 13, 13, 1678, 732, 11294, 13, 1678, 822, 13373, 24541, 29898, 13, 4706, 1583, 29892, 13, 4706, 8783, 29918, 333, 29901, 851, 29892, 13, 4706, 4235, 29901, 28379, 29961, 1293, 29961, 710, 5262, 353, 6213, 29892, 13, 4706, 1967, 29918, 9621, 29901, 28379, 29961, 1293, 29961, 710, 5262, 353, 6213, 29892, 13, 4706, 10348, 29918, 9621, 29901, 28379, 29961, 1293, 29961, 710, 5262, 353, 6213, 29892, 13, 4706, 12141, 29918, 9621, 29901, 28379, 29961, 21533, 29961, 710, 29892, 2391, 5262, 353, 6213, 29892, 13, 4706, 1426, 29918, 9621, 29901, 28379, 29961, 1293, 29961, 710, 5262, 353, 6213, 29892, 13, 268, 1125, 13, 4706, 4235, 353, 5159, 565, 4235, 338, 6213, 1683, 4235, 13, 4706, 1967, 29918, 9621, 353, 5159, 565, 1967, 29918, 9621, 338, 6213, 1683, 1967, 29918, 9621, 13, 4706, 10348, 29918, 9621, 353, 5159, 565, 10348, 29918, 9621, 338, 6213, 1683, 10348, 29918, 9621, 13, 4706, 12141, 29918, 9621, 353, 6571, 565, 12141, 29918, 9621, 338, 6213, 1683, 12141, 29918, 9621, 13, 4706, 1426, 29918, 9621, 353, 5159, 565, 1426, 29918, 9621, 338, 6213, 1683, 1426, 29918, 9621, 13, 13, 4706, 6528, 29918, 3198, 353, 337, 29889, 4478, 703, 29985, 29961, 29874, 29899, 29920, 29905, 29881, 3032, 29899, 10062, 29938, 613, 8783, 29918, 333, 29897, 13, 13, 4706, 565, 6528, 29918, 3198, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 3258, 29918, 24713, 29898, 24713, 29918, 333, 29897, 13, 4706, 1683, 29901, 13, 9651, 12020, 7865, 2392, 29898, 13, 18884, 376, 24713, 29918, 333, 1818, 1712, 871, 263, 10296, 310, 5224, 4878, 322, 29914, 272, 22868, 29915, 322, 29914, 272, 17411, 29915, 322, 29914, 272, 525, 6169, 29908, 13, 9651, 1723, 13, 13, 4706, 736, 13373, 24541, 29898, 13, 9651, 16140, 29922, 1311, 29889, 11944, 9409, 29892, 13, 9651, 8783, 29918, 333, 29922, 24713, 29918, 333, 29892, 13, 9651, 4235, 29922, 9621, 29892, 13, 9651, 1967, 29918, 9621, 29922, 3027, 29918, 9621, 29892, 13, 9651, 10348, 29918, 9621, 29922, 18494, 29918, 9621, 29892, 13, 9651, 12141, 29918, 9621, 29922, 28970, 29918, 9621, 29892, 13, 9651, 1426, 29918, 9621, 29922, 726, 29918, 9621, 29892, 13, 4706, 1723, 13, 13, 1678, 835, 2233, 504, 3241, 13, 13, 1678, 732, 11294, 13, 1678, 822, 2233, 5402, 29949, 567, 29898, 13, 4706, 1583, 29892, 13, 4706, 8783, 29918, 333, 29901, 851, 29892, 13, 4706, 4608, 29918, 9621, 29901, 1051, 29892, 13, 4706, 13995, 29901, 851, 29892, 13, 4706, 1904, 29922, 8516, 29892, 13, 4706, 3579, 19290, 29892, 13, 268, 1125, 13, 4706, 515, 29527, 749, 1794, 29889, 3372, 800, 29918, 1482, 29889, 19594, 29889, 3554, 1053, 2233, 5402, 29949, 567, 13, 13, 4706, 736, 2233, 5402, 29949, 567, 29898, 13, 9651, 16140, 29922, 1311, 29889, 11944, 9409, 29892, 13, 9651, 8783, 29918, 333, 29922, 24713, 29918, 333, 29892, 13, 9651, 4608, 29918, 9621, 29922, 8111, 29918, 9621, 29892, 13, 9651, 13995, 29922, 19973, 29892, 13, 9651, 1904, 29922, 4299, 29892, 13, 9651, 3579, 19290, 29892, 13, 4706, 1723, 13, 13, 1678, 732, 11294, 13, 1678, 822, 3323, 6821, 5402, 29949, 567, 29898, 13, 4706, 1583, 29892, 13, 4706, 16140, 29892, 13, 4706, 13995, 29892, 13, 4706, 8783, 29892, 13, 4706, 1904, 29892, 13, 4706, 4608, 29918, 9621, 29901, 1051, 29892, 13, 4706, 3847, 29918, 2671, 29901, 851, 29892, 13, 268, 1125, 13, 4706, 9995, 13, 4706, 3323, 2233, 5402, 438, 567, 29889, 13, 4706, 9995, 13, 4706, 515, 29527, 749, 1794, 29889, 3372, 800, 29889, 19594, 29889, 1491, 1053, 3323, 6821, 5402, 29949, 567, 13, 13, 4706, 736, 3323, 6821, 5402, 29949, 567, 29898, 13, 9651, 16140, 29922, 1311, 29889, 11944, 9409, 29892, 13, 9651, 13995, 29922, 19973, 29892, 13, 9651, 8783, 29922, 24713, 29892, 13, 9651, 1904, 29922, 4299, 29892, 13, 9651, 4608, 29918, 9621, 29922, 8111, 29918, 9621, 29892, 13, 9651, 3847, 29918, 2671, 29922, 3560, 29918, 2671, 29892, 13, 4706, 1723, 13, 13, 1678, 822, 903, 842, 29918, 21707, 29918, 517, 29918, 369, 15828, 29898, 1311, 1125, 13, 4706, 396, 4803, 445, 363, 13490, 13, 4706, 1583, 29889, 2917, 3366, 21027, 29889, 21027, 29918, 5563, 3108, 353, 376, 11690, 29908, 13, 13, 1678, 732, 11294, 13, 1678, 822, 3638, 29918, 24713, 29898, 13, 4706, 1583, 29892, 13, 4706, 8783, 29918, 333, 29901, 851, 29892, 13, 4706, 19870, 29918, 4836, 29901, 851, 29892, 13, 4706, 19870, 29918, 2754, 29918, 1989, 29901, 851, 29892, 13, 268, 1125, 13, 4706, 9995, 13, 4706, 15076, 385, 5375, 263, 8783, 29889, 1152, 445, 29892, 366, 1818, 1073, 1009, 3450, 1820, 29889, 13, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 28400, 13, 13, 4706, 8783, 29918, 333, 29901, 851, 13, 9651, 450, 1024, 310, 278, 8783, 13, 4706, 19870, 29918, 4836, 29901, 851, 13, 9651, 450, 2060, 1024, 393, 674, 7150, 278, 8783, 13, 4706, 19870, 29918, 2754, 29918, 1989, 29901, 851, 13, 9651, 450, 2060, 3450, 1820, 393, 674, 7150, 278, 8783, 13, 13, 13, 4706, 8741, 13, 4706, 448, 26589, 13, 13, 4706, 6317, 775, 29899, 1271, 1057, 13, 13, 9651, 3132, 353, 12477, 580, 13, 9651, 3132, 29889, 6717, 29918, 24713, 29898, 13, 18884, 8783, 29918, 333, 543, 690, 2842, 613, 13, 18884, 19870, 29918, 4836, 543, 856, 613, 13, 18884, 19870, 29918, 2754, 29918, 1989, 543, 17794, 13, 9651, 1723, 13, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 6406, 29889, 6717, 29918, 24713, 29898, 13, 9651, 8783, 29918, 333, 29922, 24713, 29918, 333, 29892, 13, 9651, 19870, 29918, 4836, 29922, 13556, 2147, 29918, 4836, 29892, 13, 9651, 19870, 29918, 2754, 29918, 1989, 29922, 13556, 2147, 29918, 2754, 29918, 1989, 29892, 13, 4706, 1723, 13, 13, 1678, 732, 11294, 13, 1678, 822, 7150, 29918, 24713, 29898, 13, 4706, 1583, 29892, 13, 4706, 8783, 29918, 333, 29901, 851, 29892, 13, 4706, 10004, 29918, 4836, 29901, 851, 29892, 13, 4706, 10004, 29918, 2754, 29918, 1989, 29901, 851, 29892, 13, 268, 1125, 13, 4706, 9995, 13, 4706, 3599, 2418, 385, 5375, 263, 8783, 29889, 13, 13, 4706, 8741, 13, 4706, 448, 26589, 13, 4706, 8653, 3132, 353, 12477, 580, 13, 4706, 8653, 3132, 29889, 6406, 29889, 13556, 573, 29918, 24713, 29898, 13, 9651, 8783, 29918, 333, 543, 690, 2842, 613, 13, 9651, 10004, 29918, 4836, 543, 856, 613, 13, 9651, 10004, 29918, 2754, 29918, 1989, 543, 17794, 13, 4706, 1723, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 28400, 13, 13, 4706, 8783, 29918, 333, 29901, 851, 13, 9651, 450, 1024, 310, 278, 8783, 13, 4706, 10004, 29918, 4836, 29901, 851, 13, 9651, 450, 2060, 1024, 393, 674, 3638, 278, 8783, 13, 4706, 10004, 29918, 2754, 29918, 1989, 29901, 851, 13, 9651, 450, 2060, 3450, 1820, 393, 674, 3638, 278, 8783, 13, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 6406, 29889, 13556, 573, 29918, 24713, 29898, 13, 9651, 8783, 29918, 333, 29922, 24713, 29918, 333, 29892, 13, 9651, 10004, 29918, 4836, 29922, 15452, 29918, 4836, 29892, 13, 9651, 10004, 29918, 2754, 29918, 1989, 29922, 15452, 29918, 2754, 29918, 1989, 29892, 13, 4706, 1723, 13, 13, 1678, 732, 11294, 13, 1678, 822, 17432, 29918, 24713, 29898, 13, 4706, 1583, 29892, 13, 4706, 2752, 29918, 24713, 29918, 333, 29901, 851, 29892, 13, 4706, 716, 29918, 24713, 29918, 333, 29901, 28379, 29961, 710, 29962, 353, 6213, 29892, 13, 4706, 2752, 29918, 4836, 29901, 28379, 29961, 710, 29962, 353, 6213, 29892, 13, 4706, 2752, 29918, 2754, 29918, 1989, 29901, 28379, 29961, 710, 29962, 353, 6213, 29892, 13, 4706, 2060, 29901, 28379, 29961, 710, 29962, 353, 6213, 29892, 13, 4706, 7882, 29918, 1989, 29901, 28379, 29961, 710, 29962, 353, 6213, 29892, 13, 268, 1125, 13, 4706, 396, 1763, 437, 445, 881, 367, 1067, 28259, 263, 8783, 297, 263, 2060, 13, 4706, 9995, 13, 4706, 2233, 650, 263, 8783, 515, 1790, 1404, 29915, 29879, 9279, 964, 596, 2060, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 8783, 29918, 333, 29901, 13, 9651, 450, 8783, 304, 3509, 13, 4706, 2752, 29918, 24713, 29918, 333, 29901, 13, 9651, 450, 2441, 8783, 13, 4706, 2752, 29918, 4836, 29901, 13, 9651, 450, 2441, 2060, 304, 3509, 515, 13, 4706, 2752, 29918, 2754, 29918, 1989, 29901, 13, 9651, 450, 2441, 3450, 1820, 310, 278, 2060, 13, 4706, 2060, 29901, 13, 9651, 450, 2441, 2060, 13, 4706, 7882, 29918, 1989, 29901, 13, 9651, 450, 2441, 3450, 1820, 13, 13, 4706, 8741, 13, 4706, 448, 28400, 13, 13, 4706, 6317, 775, 29899, 1271, 1057, 13, 13, 9651, 3132, 353, 12477, 580, 13, 9651, 3132, 29889, 16513, 29918, 24713, 29898, 13, 18884, 8783, 29918, 333, 543, 690, 2842, 613, 13, 18884, 2752, 29918, 4836, 543, 856, 613, 13, 18884, 2752, 29918, 2754, 29918, 1989, 543, 17794, 13, 9651, 1723, 13, 13, 4706, 9995, 13, 4706, 565, 2752, 29918, 2754, 29918, 1989, 338, 6213, 29901, 13, 9651, 2752, 29918, 2754, 29918, 1989, 353, 1583, 29889, 2754, 29918, 1989, 13, 9651, 2752, 29918, 4836, 353, 1583, 29889, 4836, 13, 13, 4706, 565, 716, 29918, 24713, 29918, 333, 338, 6213, 29901, 13, 9651, 716, 29918, 24713, 29918, 333, 353, 2752, 29918, 24713, 29918, 333, 13, 13, 4706, 736, 1583, 29889, 6406, 29889, 8552, 29918, 1079, 647, 29918, 24713, 29898, 13, 9651, 8783, 29918, 333, 29922, 1482, 29918, 24713, 29918, 333, 29892, 13, 9651, 2752, 29918, 24713, 29918, 333, 29922, 4993, 29918, 24713, 29918, 333, 29892, 13, 9651, 2752, 29918, 4836, 29922, 4993, 29918, 4836, 29892, 13, 9651, 2752, 29918, 2754, 29918, 1989, 29922, 4993, 29918, 2754, 29918, 1989, 29892, 13, 9651, 2060, 29922, 4836, 29892, 13, 9651, 7882, 29918, 1989, 29922, 2754, 29918, 1989, 29892, 13, 4706, 1723, 13, 13, 1678, 732, 6799, 13, 1678, 822, 9282, 29898, 1311, 1125, 13, 4706, 515, 29527, 749, 1794, 17255, 2344, 1649, 1053, 4770, 3259, 1649, 13, 13, 4706, 5195, 29943, 1001, 1430, 4741, 29918, 4219, 353, 285, 29908, 991, 597, 276, 2608, 749, 1794, 29889, 949, 386, 287, 12332, 29889, 601, 29914, 264, 19248, 1649, 3259, 1649, 6822, 29908, 13, 4706, 22986, 1799, 10461, 353, 285, 29908, 3492, 508, 1284, 596, 9282, 1244, 426, 25866, 1001, 1430, 4741, 29918, 4219, 29913, 1213, 13, 4706, 1596, 29898, 2303, 1799, 10461, 29897, 13, 13, 1678, 10561, 353, 9282, 13, 13, 1678, 822, 2740, 29918, 932, 29898, 1311, 29892, 8783, 29918, 333, 29901, 28379, 29961, 710, 29962, 353, 6213, 1125, 13, 4706, 565, 8783, 29918, 333, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 2158, 29918, 4478, 29918, 14592, 3377, 29918, 2271, 29898, 24713, 29918, 333, 29897, 13, 4706, 25342, 756, 5552, 29898, 1311, 29892, 11119, 24713, 29918, 333, 29908, 1125, 13, 9651, 1583, 29889, 2158, 29918, 4478, 29918, 14592, 3377, 29918, 2271, 29898, 1311, 3032, 24713, 29918, 333, 29897, 13, 4706, 25342, 756, 5552, 29898, 1311, 29892, 376, 24713, 29918, 333, 29908, 1125, 13, 9651, 1583, 29889, 2158, 29918, 4478, 29918, 14592, 3377, 29918, 2271, 29898, 1311, 29889, 24713, 29918, 333, 29897, 13, 4706, 1683, 29901, 13, 9651, 1596, 703, 3492, 508, 2048, 596, 2740, 623, 472, 2045, 597, 9274, 29889, 276, 2608, 749, 29889, 1794, 1159, 13, 13, 1678, 732, 23959, 29898, 3259, 543, 29896, 29889, 29896, 29889, 29941, 1159, 13, 1678, 732, 11294, 13, 1678, 822, 2740, 29918, 14538, 1691, 29898, 1311, 29892, 2346, 29901, 851, 1125, 13, 4706, 9995, 13, 4706, 11856, 1549, 596, 20035, 29889, 13, 4706, 9995, 13, 4706, 736, 518, 29916, 363, 921, 297, 1583, 29889, 1761, 29918, 14538, 1691, 580, 3366, 14538, 1691, 3108, 565, 2346, 297, 921, 29962, 13, 13, 1678, 732, 23959, 29898, 3259, 543, 29906, 29889, 29896, 29889, 29941, 1159, 13, 1678, 732, 3571, 13, 1678, 822, 1051, 29918, 19594, 29918, 276, 4011, 29898, 1311, 1125, 13, 4706, 9995, 13, 13, 4706, 2391, 599, 9867, 13676, 29889, 13, 13, 4706, 6317, 775, 29899, 1271, 1057, 13, 13, 9651, 515, 29527, 749, 1794, 1053, 12477, 13, 9651, 3132, 353, 12477, 580, 13, 9651, 3132, 29889, 1761, 29918, 19594, 29918, 276, 4011, 580, 13, 13, 4706, 9995, 13, 4706, 736, 10518, 29889, 17271, 29898, 1311, 29889, 276, 4011, 29889, 695, 504, 414, 29889, 1761, 580, 3366, 9902, 20068, 13, 13, 1678, 732, 23959, 29898, 3259, 543, 29906, 29889, 29896, 29889, 29941, 1159, 13, 1678, 732, 3571, 13, 1678, 732, 11294, 13, 1678, 822, 5217, 29918, 19594, 29918, 12276, 29898, 1311, 29892, 9867, 29918, 12276, 29918, 333, 29901, 851, 1125, 13, 4706, 9995, 13, 13, 4706, 21267, 2233, 5402, 13969, 13, 13, 4706, 6317, 775, 29899, 1271, 1057, 13, 13, 9651, 515, 29527, 749, 1794, 1053, 12477, 13, 9651, 3132, 353, 12477, 580, 13, 9651, 3132, 29889, 8143, 29918, 19594, 29918, 12276, 703, 19594, 29918, 333, 29918, 1484, 267, 29918, 4150, 1159, 13, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 276, 4011, 29889, 695, 504, 414, 29889, 8143, 29898, 19594, 29918, 12276, 29918, 333, 29897, 13, 13, 1678, 732, 23959, 29898, 3259, 543, 29906, 29889, 29896, 29889, 29941, 1159, 13, 1678, 732, 3571, 13, 1678, 732, 11294, 13, 1678, 822, 3787, 29918, 19594, 29918, 12276, 29898, 1311, 29892, 3461, 29918, 978, 29901, 851, 29892, 3461, 29901, 9657, 1125, 13, 4706, 9995, 13, 13, 4706, 14491, 278, 9867, 848, 29889, 13, 13, 4706, 6317, 775, 29899, 1271, 1057, 13, 13, 9651, 515, 29527, 749, 1794, 1053, 12477, 13, 9651, 3132, 353, 12477, 580, 13, 9651, 3132, 29889, 8899, 29918, 19594, 29918, 12276, 703, 11249, 613, 8853, 1767, 1115, 29871, 29941, 1800, 13, 13, 4706, 9995, 13, 4706, 2933, 29901, 9657, 353, 1583, 29889, 276, 4011, 29889, 695, 504, 414, 29889, 3258, 29898, 13, 9651, 1024, 29922, 12276, 29918, 978, 29892, 3461, 29922, 1311, 29889, 3126, 29918, 3977, 6119, 29898, 12276, 29897, 13, 4706, 1723, 13, 4706, 1596, 29898, 13, 9651, 285, 29908, 3492, 508, 1286, 2130, 596, 3461, 472, 2045, 597, 9274, 29889, 276, 2608, 749, 29889, 1794, 29914, 12276, 29914, 19594, 19248, 1311, 29889, 12803, 6822, 29912, 5327, 1839, 29918, 333, 2033, 5038, 13, 4706, 1723, 13, 4706, 736, 2933, 13, 13, 1678, 822, 11262, 29918, 7054, 22026, 29918, 11294, 292, 29898, 1311, 1125, 13, 4706, 9995, 4205, 519, 16114, 1199, 23110, 565, 366, 723, 5821, 451, 304, 3638, 8744, 13, 4706, 848, 304, 11157, 278, 3234, 29889, 11597, 22026, 6511, 502, 304, 11157, 596, 7271, 13, 4706, 491, 4392, 2827, 278, 1556, 5972, 24536, 29892, 8856, 1218, 901, 7788, 304, 5972, 13, 4706, 3234, 5680, 322, 11157, 1404, 7271, 29889, 13, 4706, 9995, 13, 4706, 1583, 29889, 2917, 3366, 28084, 15119, 29889, 275, 29918, 11294, 292, 29918, 17590, 3108, 353, 7700, 13, 2 ]
trainer.py
Karan0110/digit-recognition
1
92279
<filename>trainer.py<gh_stars>1-10 import pickle import numpy as np from mnist import MNIST from neural_network import NeuralNetwork def one_hot_encode(x, num_categories): encoding = np.zeros(num_categories) encoding[x] = 1. return encoding def one_hot_decode(x): return x.argmax() def get_data(train_test_split=0.9): mndata = MNIST('./MNIST') X, y = mndata.load_training() #converts images into flat array with brightness in [0, 1], instead of [0, 255] X = [np.array(i).reshape((-1,)) / 255 for i in X] #converts digit into one-hot encoding y = [one_hot_encode(i, 10) for i in y[:-1]] train_test_divide = int(len(X) * train_test_split) X_train, X_test = X[:train_test_divide], X[train_test_divide:] y_train, y_test = y[:train_test_divide], y[train_test_divide:] return X_train, X_test, y_train, y_test def get_prediction(net, inputs): outputs = net.forward_propagate(inputs) return one_hot_decode(outputs) def get_accuracy(net, X, y): correct = 0 for inputs, expected_outputs in zip(X, y): prediction = get_prediction(net, inputs) if prediction == one_hot_decode(expected_outputs): correct += 1 return correct / len(X) np.random.seed(1) net = NeuralNetwork((28 ** 2, 16, 16, 10)) print("Getting data...") X_train, X_test, y_train, y_test = get_data() print("Training...") net.fit(X_train, y_train, minibatch_size=10, num_epochs=50000, learning_rate=.5, reporting=100) print("Saving neural network...") with open('network.ann', 'wb') as f: pickle.dump(net, f) print("Finding accuracy...") training_accuracy = get_accuracy(net, X_train, y_train) testing_accuracy = get_accuracy(net, X_test, y_test) print("Accuracy for training data: {}%".format(training_accuracy * 100)) print("Accuracy for testing data: {}%".format(testing_accuracy * 100)) #92-93% #92-93%
[ 1, 529, 9507, 29958, 3018, 4983, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 5839, 280, 13, 13, 5215, 12655, 408, 7442, 13, 3166, 28597, 391, 1053, 341, 29940, 9047, 13, 13, 3166, 19677, 29918, 11618, 1053, 2448, 3631, 13724, 13, 13, 1753, 697, 29918, 8711, 29918, 12508, 29898, 29916, 29892, 954, 29918, 20683, 1125, 13, 12, 22331, 353, 7442, 29889, 3298, 359, 29898, 1949, 29918, 20683, 29897, 13, 12, 22331, 29961, 29916, 29962, 353, 29871, 29896, 29889, 13, 13, 12, 2457, 8025, 13, 13, 1753, 697, 29918, 8711, 29918, 13808, 29898, 29916, 1125, 13, 12, 2457, 921, 29889, 1191, 3317, 580, 13, 13, 1753, 679, 29918, 1272, 29898, 14968, 29918, 1688, 29918, 5451, 29922, 29900, 29889, 29929, 1125, 13, 12, 29885, 299, 532, 353, 341, 29940, 9047, 877, 6904, 29924, 29940, 9047, 1495, 13, 12, 29990, 29892, 343, 353, 286, 299, 532, 29889, 1359, 29918, 26495, 580, 13, 13, 12, 29937, 535, 369, 1372, 4558, 964, 12151, 1409, 411, 11785, 2264, 297, 518, 29900, 29892, 29871, 29896, 1402, 2012, 310, 518, 29900, 29892, 29871, 29906, 29945, 29945, 29962, 13, 12, 29990, 353, 518, 9302, 29889, 2378, 29898, 29875, 467, 690, 14443, 3552, 29899, 29896, 29892, 876, 847, 29871, 29906, 29945, 29945, 363, 474, 297, 1060, 29962, 13, 13, 12, 29937, 535, 369, 1372, 13615, 964, 697, 29899, 8711, 8025, 13, 12, 29891, 353, 518, 650, 29918, 8711, 29918, 12508, 29898, 29875, 29892, 29871, 29896, 29900, 29897, 363, 474, 297, 343, 7503, 29899, 29896, 5262, 13, 13, 12, 14968, 29918, 1688, 29918, 4563, 680, 353, 938, 29898, 2435, 29898, 29990, 29897, 334, 7945, 29918, 1688, 29918, 5451, 29897, 13, 12, 29990, 29918, 14968, 29892, 1060, 29918, 1688, 353, 1060, 7503, 14968, 29918, 1688, 29918, 4563, 680, 1402, 1060, 29961, 14968, 29918, 1688, 29918, 4563, 680, 17531, 13, 12, 29891, 29918, 14968, 29892, 343, 29918, 1688, 353, 343, 7503, 14968, 29918, 1688, 29918, 4563, 680, 1402, 343, 29961, 14968, 29918, 1688, 29918, 4563, 680, 17531, 13, 13, 12, 2457, 1060, 29918, 14968, 29892, 1060, 29918, 1688, 29892, 343, 29918, 14968, 29892, 343, 29918, 1688, 13, 13, 1753, 679, 29918, 11965, 2463, 29898, 1212, 29892, 10970, 1125, 13, 12, 4905, 29879, 353, 7787, 29889, 11333, 29918, 7728, 351, 403, 29898, 2080, 29879, 29897, 13, 13, 12, 2457, 697, 29918, 8711, 29918, 13808, 29898, 4905, 29879, 29897, 13, 13, 1753, 679, 29918, 562, 2764, 4135, 29898, 1212, 29892, 1060, 29892, 343, 1125, 13, 12, 15728, 353, 29871, 29900, 13, 13, 12, 1454, 10970, 29892, 3806, 29918, 4905, 29879, 297, 14319, 29898, 29990, 29892, 343, 1125, 13, 12, 12, 11965, 2463, 353, 679, 29918, 11965, 2463, 29898, 1212, 29892, 10970, 29897, 13, 12, 12, 361, 18988, 1275, 697, 29918, 8711, 29918, 13808, 29898, 9684, 29918, 4905, 29879, 1125, 13, 12, 12, 12, 15728, 4619, 29871, 29896, 13, 13, 12, 2457, 1959, 847, 7431, 29898, 29990, 29897, 13, 13, 9302, 29889, 8172, 29889, 26776, 29898, 29896, 29897, 13, 13, 1212, 353, 2448, 3631, 13724, 3552, 29906, 29947, 3579, 29871, 29906, 29892, 29871, 29896, 29953, 29892, 29871, 29896, 29953, 29892, 29871, 29896, 29900, 876, 13, 13, 2158, 703, 2577, 1259, 848, 856, 1159, 13, 13, 29990, 29918, 14968, 29892, 1060, 29918, 1688, 29892, 343, 29918, 14968, 29892, 343, 29918, 1688, 353, 679, 29918, 1272, 580, 13, 13, 2158, 703, 5323, 2827, 856, 1159, 13, 13, 1212, 29889, 9202, 29898, 29990, 29918, 14968, 29892, 343, 29918, 14968, 29892, 1375, 747, 905, 29918, 2311, 29922, 29896, 29900, 29892, 954, 29918, 1022, 2878, 29879, 29922, 29945, 29900, 29900, 29900, 29900, 29892, 6509, 29918, 10492, 21098, 29945, 29892, 23415, 29922, 29896, 29900, 29900, 29897, 13, 13, 2158, 703, 29903, 5555, 19677, 3564, 856, 1159, 13, 2541, 1722, 877, 11618, 29889, 812, 742, 525, 29893, 29890, 1495, 408, 285, 29901, 13, 12, 23945, 280, 29889, 15070, 29898, 1212, 29892, 285, 29897, 13, 13, 2158, 703, 29943, 4015, 13600, 856, 1159, 13, 13, 26495, 29918, 562, 2764, 4135, 353, 679, 29918, 562, 2764, 4135, 29898, 1212, 29892, 1060, 29918, 14968, 29892, 343, 29918, 14968, 29897, 13, 13424, 29918, 562, 2764, 4135, 353, 679, 29918, 562, 2764, 4135, 29898, 1212, 29892, 1060, 29918, 1688, 29892, 343, 29918, 1688, 29897, 13, 13, 2158, 703, 7504, 332, 4135, 363, 6694, 848, 29901, 6571, 29995, 1642, 4830, 29898, 26495, 29918, 562, 2764, 4135, 334, 29871, 29896, 29900, 29900, 876, 13, 2158, 703, 7504, 332, 4135, 363, 6724, 848, 29901, 6571, 29995, 1642, 4830, 29898, 13424, 29918, 562, 2764, 4135, 334, 29871, 29896, 29900, 29900, 876, 13, 13, 29937, 29929, 29906, 29899, 29929, 29941, 29995, 13, 29937, 29929, 29906, 29899, 29929, 29941, 29995, 13, 13, 2 ]
setup.py
perslev/sleep-utils
1
97102
<filename>setup.py from setuptools import setup, find_packages with open('README.md') as readme_file: readme = readme_file.read() with open("requirements.txt") as req_file: requirements = list(filter(None, req_file.read().split("\n"))) __version__ = None with open("psg_utils/version.py") as version_file: exec(version_file.read()) if __version__ is None: raise ValueError("Did not find __version__ in version.py file.") setup( name='psg-utils', version=__version__, description='A collection of Python utility classes and functions for loading and processing Polysomnography (PSG) sleep study data.', long_description=readme, long_description_content_type='text/markdown', author='<NAME>', author_email='<EMAIL>', url='https://github.com/perslev/psg-utils', packages=find_packages(), package_dir={'psg_utils': 'psg_utils'}, include_package_data=True, install_requires=requirements, classifiers=['Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11'] )
[ 1, 529, 9507, 29958, 14669, 29889, 2272, 13, 3166, 731, 21245, 8789, 1053, 6230, 29892, 1284, 29918, 8318, 13, 13, 2541, 1722, 877, 16310, 2303, 29889, 3487, 1495, 408, 1303, 1004, 29918, 1445, 29901, 13, 1678, 1303, 1004, 353, 1303, 1004, 29918, 1445, 29889, 949, 580, 13, 13, 2541, 1722, 703, 12277, 1860, 29889, 3945, 1159, 408, 12428, 29918, 1445, 29901, 13, 1678, 11780, 353, 1051, 29898, 4572, 29898, 8516, 29892, 12428, 29918, 1445, 29889, 949, 2141, 5451, 14182, 29876, 29908, 4961, 13, 13, 1649, 3259, 1649, 353, 6213, 13, 2541, 1722, 703, 567, 29887, 29918, 13239, 29914, 3259, 29889, 2272, 1159, 408, 1873, 29918, 1445, 29901, 13, 1678, 2279, 29898, 3259, 29918, 1445, 29889, 949, 3101, 13, 361, 4770, 3259, 1649, 338, 6213, 29901, 13, 1678, 12020, 7865, 2392, 703, 9260, 451, 1284, 4770, 3259, 1649, 297, 1873, 29889, 2272, 934, 23157, 13, 13, 14669, 29898, 13, 1678, 1024, 2433, 567, 29887, 29899, 13239, 742, 13, 1678, 1873, 29922, 1649, 3259, 1649, 29892, 13, 1678, 6139, 2433, 29909, 4333, 310, 5132, 19725, 4413, 322, 3168, 363, 8363, 322, 9068, 2043, 952, 290, 29876, 5275, 313, 7024, 29954, 29897, 8709, 6559, 848, 29889, 742, 13, 1678, 1472, 29918, 8216, 29922, 949, 1004, 29892, 13, 1678, 1472, 29918, 8216, 29918, 3051, 29918, 1853, 2433, 726, 29914, 3502, 3204, 742, 13, 1678, 4148, 2433, 29966, 5813, 29958, 742, 13, 1678, 4148, 29918, 5269, 2433, 29966, 26862, 6227, 29958, 742, 13, 1678, 3142, 2433, 991, 597, 3292, 29889, 510, 29914, 6774, 2608, 29914, 567, 29887, 29899, 13239, 742, 13, 1678, 9741, 29922, 2886, 29918, 8318, 3285, 13, 1678, 3577, 29918, 3972, 3790, 29915, 567, 29887, 29918, 13239, 2396, 13, 462, 525, 567, 29887, 29918, 13239, 16675, 13, 1678, 3160, 29918, 5113, 29918, 1272, 29922, 5574, 29892, 13, 1678, 2601, 29918, 276, 339, 2658, 29922, 12277, 1860, 29892, 13, 1678, 770, 14903, 29922, 1839, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29953, 742, 13, 462, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29955, 742, 13, 462, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29947, 742, 13, 462, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29929, 742, 13, 462, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29896, 29900, 742, 13, 462, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29896, 29896, 2033, 13, 29897, 13, 2 ]
tests/functional/tabloid/test_optimizer_index_navigation.py
FirebirdSQL/firebird-qa
1
146885
#coding:utf-8 # # id: functional.tabloid.optimizer_index_navigation # title: Check that optimizer takes in account presense of index and does navigation instead of external sort. # decription: # Verified commit: https://github.com/FirebirdSQL/firebird/actions/runs/176006556 # Source message to dimitr: 20.07.2020 20:00. # # Checked on 3.0.7.33340 and 4.0.0.2114 (intermediate build with timestamp 20.07.2020 17:45) # # tracker_id: # min_versions: ['3.0'] # versions: 3.0 # qmid: None import pytest from firebird.qa import db_factory, isql_act, Action # version: 3.0 # resources: None substitutions_1 = [] init_script_1 = """""" db_1 = db_factory(sql_dialect=3, init=init_script_1) test_script_1 = """ recreate table t(x int); create index t_x_asc on t(x); create descending index t_x_dec on t(x); insert into t select rand()*1000 from rdb$types,rdb$types; commit; set statistics index t_x_asc; set statistics index t_x_dec; commit; set planonly; select * from t as t1 where x>=0.5; -- NO 'plan order' must be here; bitmap is enough! select * from t as t2 where x>=0.5 order by x; -- here PLAN ORDER is much efficient than bitmap + PLAN SORT select * from t as t3 where x<=0.5; -- NO 'plan order' must be here; bitmap is enough! select * from t as t4 where x<=0.5 order by x desc; -- here PLAN ORDER is much efficient than bitmap + PLAN SORT """ act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1) expected_stdout_1 = """ PLAN (T1 INDEX (T_X_ASC)) PLAN (T2 ORDER T_X_ASC) PLAN (T3 INDEX (T_X_ASC)) PLAN (T4 ORDER T_X_DEC) """ @pytest.mark.version('>=3.0') def test_1(act_1: Action): act_1.expected_stdout = expected_stdout_1 act_1.execute() assert act_1.clean_stdout == act_1.clean_expected_stdout
[ 1, 396, 29883, 3689, 29901, 9420, 29899, 29947, 13, 29937, 13, 29937, 1178, 29901, 965, 13303, 29889, 3891, 417, 333, 29889, 20640, 3950, 29918, 2248, 29918, 15466, 13, 29937, 3611, 29901, 4706, 5399, 393, 5994, 3950, 4893, 297, 3633, 2225, 1947, 310, 2380, 322, 947, 11322, 2012, 310, 7029, 2656, 29889, 13, 29937, 316, 3395, 29901, 1678, 13, 29937, 462, 259, 1798, 2164, 9063, 29901, 2045, 597, 3292, 29889, 510, 29914, 18654, 18513, 4176, 29914, 8696, 18513, 29914, 7387, 29914, 3389, 29879, 29914, 29896, 29955, 29953, 29900, 29900, 29953, 29945, 29945, 29953, 13, 29937, 462, 259, 7562, 2643, 304, 3964, 277, 29878, 29901, 29871, 29906, 29900, 29889, 29900, 29955, 29889, 29906, 29900, 29906, 29900, 29871, 29906, 29900, 29901, 29900, 29900, 29889, 13, 29937, 18884, 13, 29937, 462, 259, 5399, 287, 373, 29871, 29941, 29889, 29900, 29889, 29955, 29889, 29941, 29941, 29941, 29946, 29900, 322, 29871, 29946, 29889, 29900, 29889, 29900, 29889, 29906, 29896, 29896, 29946, 313, 1639, 13847, 2048, 411, 14334, 29871, 29906, 29900, 29889, 29900, 29955, 29889, 29906, 29900, 29906, 29900, 29871, 29896, 29955, 29901, 29946, 29945, 29897, 13, 29937, 462, 29871, 13, 29937, 1020, 4937, 29918, 333, 29901, 1678, 13, 29937, 1375, 29918, 26100, 29901, 6024, 29941, 29889, 29900, 2033, 13, 29937, 6910, 29901, 418, 29941, 29889, 29900, 13, 29937, 3855, 6563, 29901, 308, 6213, 13, 13, 5215, 11451, 1688, 13, 3166, 3974, 18513, 29889, 25621, 1053, 4833, 29918, 14399, 29892, 338, 1519, 29918, 627, 29892, 9123, 13, 13, 29937, 1873, 29901, 29871, 29941, 29889, 29900, 13, 29937, 7788, 29901, 6213, 13, 13, 22492, 5008, 29879, 29918, 29896, 353, 5159, 13, 13, 2344, 29918, 2154, 29918, 29896, 353, 9995, 15945, 29908, 13, 13, 2585, 29918, 29896, 353, 4833, 29918, 14399, 29898, 2850, 29918, 15321, 781, 29922, 29941, 29892, 2069, 29922, 2344, 29918, 2154, 29918, 29896, 29897, 13, 13, 1688, 29918, 2154, 29918, 29896, 353, 9995, 13, 1678, 337, 3258, 1591, 260, 29898, 29916, 938, 416, 13, 1678, 1653, 2380, 260, 29918, 29916, 29918, 6151, 373, 260, 29898, 29916, 416, 13, 1678, 1653, 5153, 2548, 2380, 260, 29918, 29916, 29918, 7099, 373, 260, 29898, 29916, 416, 13, 1678, 4635, 964, 260, 1831, 20088, 580, 29930, 29896, 29900, 29900, 29900, 515, 364, 2585, 29938, 8768, 29892, 29878, 2585, 29938, 8768, 29936, 13, 1678, 9063, 29936, 13, 1678, 731, 13964, 2380, 260, 29918, 29916, 29918, 6151, 29936, 13, 1678, 731, 13964, 2380, 260, 29918, 29916, 29918, 7099, 29936, 13, 1678, 9063, 29936, 13, 1678, 731, 3814, 6194, 29936, 13, 418, 13, 1678, 1831, 334, 515, 260, 408, 260, 29896, 988, 921, 18572, 29900, 29889, 29945, 29936, 1192, 11698, 525, 9018, 1797, 29915, 1818, 367, 1244, 29936, 21170, 338, 3307, 29991, 13, 13, 1678, 1831, 334, 515, 260, 408, 260, 29906, 988, 921, 18572, 29900, 29889, 29945, 1797, 491, 921, 29936, 1192, 1244, 16507, 2190, 15606, 338, 1568, 8543, 1135, 21170, 718, 16507, 2190, 317, 8476, 13, 13, 1678, 1831, 334, 515, 260, 408, 260, 29941, 988, 921, 14065, 29900, 29889, 29945, 29936, 1192, 11698, 525, 9018, 1797, 29915, 1818, 367, 1244, 29936, 21170, 338, 3307, 29991, 13, 13, 1678, 1831, 334, 515, 260, 408, 260, 29946, 988, 921, 14065, 29900, 29889, 29945, 1797, 491, 921, 5153, 29936, 1192, 1244, 16507, 2190, 15606, 338, 1568, 8543, 1135, 21170, 718, 16507, 2190, 317, 8476, 13, 15945, 29908, 13, 13, 627, 29918, 29896, 353, 338, 1519, 29918, 627, 877, 2585, 29918, 29896, 742, 1243, 29918, 2154, 29918, 29896, 29892, 23697, 29879, 29922, 22492, 5008, 29879, 29918, 29896, 29897, 13, 13, 9684, 29918, 25393, 29918, 29896, 353, 9995, 13, 1678, 16507, 2190, 313, 29911, 29896, 2672, 19577, 313, 29911, 29918, 29990, 29918, 28599, 876, 13, 13, 1678, 16507, 2190, 313, 29911, 29906, 15606, 323, 29918, 29990, 29918, 28599, 29897, 13, 13, 1678, 16507, 2190, 313, 29911, 29941, 2672, 19577, 313, 29911, 29918, 29990, 29918, 28599, 876, 13, 13, 1678, 16507, 2190, 313, 29911, 29946, 15606, 323, 29918, 29990, 29918, 2287, 29907, 29897, 13, 15945, 29908, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 3259, 877, 18572, 29941, 29889, 29900, 1495, 13, 1753, 1243, 29918, 29896, 29898, 627, 29918, 29896, 29901, 9123, 1125, 13, 1678, 1044, 29918, 29896, 29889, 9684, 29918, 25393, 353, 3806, 29918, 25393, 29918, 29896, 13, 1678, 1044, 29918, 29896, 29889, 7978, 580, 13, 1678, 4974, 1044, 29918, 29896, 29889, 14941, 29918, 25393, 1275, 1044, 29918, 29896, 29889, 14941, 29918, 9684, 29918, 25393, 13, 13, 2 ]
Second_Day/Second_Day_Aggrigation_Query.py
vijayingale/Adv_Python_Trainig
0
1612715
from pymongo import MongoClient try: myclient = MongoClient("mongodb://%s:%[email protected]" % ('myUserAdmin', '<PASSWORD>')) # #create collection print("\n\t .Connection Successful : ") mydb = myclient['database'] # collection = mydb['test2'] # # profile = [ # {"user":"ram" , "title": "Python"}, # {"user": "ramesh", "title": "Java"}, # {"user":"ramnath" , "title": "C"}, # {"user":"ramesh" , "title": "C++"}, # {"user":"ramoji" , "title": "Android"} # ] # # collection.insert_many(profile) # # agg_result = collection.aggregate( # [ # { # "$group": # { # "_id":"$user", # "num_lang":{"$sum" : 1} # } # } # ] # ) # # print("\n\t Result : ") # for i in agg_result: # print(i) collection = mydb['test3'] profile = [ {"Telgu_Films ":{"user": "rajnikat", "title": "Megastar"}}, {"user": "chiranjivi", "title": "Megastar"}, {"user": "Allu_Arjun", "title": "Stylish_Star"}, {"user": "Yash", "title": "Power_Star"}, {"user": "ramoji", "title": "Film_city"} ] collection.insert_many(profile) agg_result = collection.aggregate( [ { "$group": { "_id": "$user", "num_lang": {"$sum": 1} } } ] ) print("\n\t Result : ") for i in agg_result: print(i) except ConnectionError as e: print("Errorr" ,e)
[ 1, 515, 282, 962, 7443, 1053, 18294, 4032, 13, 2202, 29901, 13, 1678, 590, 4645, 353, 18294, 4032, 703, 23264, 597, 29995, 29879, 16664, 29879, 29992, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29908, 1273, 6702, 1357, 2659, 12754, 742, 12801, 25711, 17013, 29958, 8785, 13, 1678, 396, 396, 3258, 4333, 13, 1678, 1596, 14182, 29876, 29905, 29873, 869, 5350, 21397, 1319, 584, 16521, 13, 1678, 590, 2585, 353, 590, 4645, 1839, 9803, 2033, 13, 1678, 396, 4333, 353, 590, 2585, 1839, 1688, 29906, 2033, 13, 1678, 396, 13, 1678, 396, 8722, 353, 518, 13, 1678, 396, 268, 8853, 1792, 4710, 2572, 29908, 1919, 376, 3257, 1115, 376, 11980, 10758, 13, 1678, 396, 268, 8853, 1792, 1115, 376, 29878, 1280, 29882, 613, 376, 3257, 1115, 376, 8404, 10758, 13, 1678, 396, 268, 8853, 1792, 4710, 2572, 29876, 493, 29908, 1919, 376, 3257, 1115, 376, 29907, 10758, 13, 1678, 396, 268, 8853, 1792, 4710, 29878, 1280, 29882, 29908, 1919, 376, 3257, 1115, 376, 29907, 1817, 10758, 13, 1678, 396, 268, 8853, 1792, 4710, 2572, 29877, 2397, 29908, 1919, 376, 3257, 1115, 376, 8136, 9092, 13, 1678, 396, 4514, 13, 1678, 396, 13, 1678, 396, 4333, 29889, 7851, 29918, 13011, 29898, 10185, 29897, 13, 1678, 396, 13, 1678, 396, 946, 29887, 29918, 2914, 353, 4333, 29889, 26193, 403, 29898, 13, 1678, 396, 268, 518, 13, 1678, 396, 308, 426, 13, 1678, 396, 308, 3908, 2972, 1115, 13, 1678, 396, 632, 426, 13, 1678, 396, 18884, 11119, 333, 4710, 29938, 1792, 613, 13, 1678, 396, 462, 376, 1949, 29918, 3893, 28819, 29938, 2083, 29908, 584, 29871, 29896, 29913, 13, 1678, 396, 632, 500, 13, 1678, 396, 308, 500, 13, 1678, 396, 268, 4514, 13, 1678, 396, 1723, 13, 1678, 396, 13, 1678, 396, 1596, 14182, 29876, 29905, 29873, 7867, 584, 16521, 13, 1678, 396, 363, 474, 297, 946, 29887, 29918, 2914, 29901, 13, 1678, 396, 268, 1596, 29898, 29875, 29897, 13, 13, 1678, 4333, 353, 590, 2585, 1839, 1688, 29941, 2033, 13, 13, 1678, 8722, 353, 518, 13, 4706, 8853, 29911, 295, 2543, 29918, 3434, 1516, 29242, 6377, 1792, 1115, 376, 10665, 5585, 271, 613, 376, 3257, 1115, 376, 29924, 387, 579, 279, 29908, 11656, 13, 4706, 8853, 1792, 1115, 376, 305, 381, 273, 29926, 8107, 613, 376, 3257, 1115, 376, 29924, 387, 579, 279, 10758, 13, 4706, 8853, 1792, 1115, 376, 3596, 29884, 29918, 1433, 29926, 348, 613, 376, 3257, 1115, 376, 855, 29891, 1674, 29918, 16213, 10758, 13, 4706, 8853, 1792, 1115, 376, 29979, 1161, 613, 376, 3257, 1115, 376, 21472, 29918, 16213, 10758, 13, 4706, 8853, 1792, 1115, 376, 2572, 29877, 2397, 613, 376, 3257, 1115, 376, 3434, 29885, 29918, 12690, 9092, 13, 1678, 4514, 13, 13, 1678, 4333, 29889, 7851, 29918, 13011, 29898, 10185, 29897, 13, 13, 1678, 946, 29887, 29918, 2914, 353, 4333, 29889, 26193, 403, 29898, 13, 4706, 518, 13, 9651, 426, 13, 18884, 3908, 2972, 1115, 13, 462, 1678, 426, 13, 462, 4706, 11119, 333, 1115, 3908, 1792, 613, 13, 462, 4706, 376, 1949, 29918, 3893, 1115, 8853, 29938, 2083, 1115, 29871, 29896, 29913, 13, 462, 1678, 500, 13, 9651, 500, 13, 4706, 4514, 13, 1678, 1723, 13, 13, 1678, 1596, 14182, 29876, 29905, 29873, 7867, 584, 16521, 13, 1678, 363, 474, 297, 946, 29887, 29918, 2914, 29901, 13, 4706, 1596, 29898, 29875, 29897, 13, 13, 19499, 15160, 2392, 408, 321, 29901, 13, 1678, 1596, 703, 2392, 29878, 29908, 1919, 29872, 29897, 2 ]
tests/test_linalg.py
tanlin2013/TNpy
1
124489
import unittest import numpy as np from tnpy.linalg import KrylovExpm class TestLinAlg(unittest.TestCase): def test_eigshmv(self): # self.assertEqual(True, False) pass class TestKrylovExpm(unittest.TestCase): def test_construct_krylov_space(self): mat = np.random.random((50, 50)) v0 = np.random.random(50) kexpm = KrylovExpm(1e-3, mat, v0) kexpm.construct_krylov_space() if __name__ == '__main__': unittest.main()
[ 1, 1053, 443, 27958, 13, 5215, 12655, 408, 7442, 13, 3166, 260, 29876, 2272, 29889, 29880, 979, 29887, 1053, 476, 719, 5590, 1252, 3358, 13, 13, 13, 1990, 4321, 11667, 22461, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 13, 1678, 822, 1243, 29918, 29872, 335, 845, 29324, 29898, 1311, 1125, 13, 4706, 396, 1583, 29889, 9294, 9843, 29898, 5574, 29892, 7700, 29897, 13, 4706, 1209, 13, 13, 13, 1990, 4321, 29968, 719, 5590, 1252, 3358, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 13, 1678, 822, 1243, 29918, 11433, 29918, 29895, 719, 5590, 29918, 3493, 29898, 1311, 1125, 13, 4706, 1775, 353, 7442, 29889, 8172, 29889, 8172, 3552, 29945, 29900, 29892, 29871, 29945, 29900, 876, 13, 4706, 325, 29900, 353, 7442, 29889, 8172, 29889, 8172, 29898, 29945, 29900, 29897, 13, 13, 4706, 413, 735, 3358, 353, 476, 719, 5590, 1252, 3358, 29898, 29896, 29872, 29899, 29941, 29892, 1775, 29892, 325, 29900, 29897, 13, 4706, 413, 735, 3358, 29889, 11433, 29918, 29895, 719, 5590, 29918, 3493, 580, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 2 ]
scripts/compute_translation.py
Tom556/structural-probes
0
171834
from argparse import ArgumentParser from collections import defaultdict import numpy as np import torch import h5py from tqdm import tqdm from pytorch_pretrained_bert import BertTokenizer LAYER_NUM = 12 FEATURE_DIM = 768 def match_tokenized_to_untokenized(tokenized_sent, untokenized_sent): '''Aligns tokenized and untokenized sentence given subwords "##" prefixed Assuming that each subword token that does not start a new word is prefixed by two hashes, "##", computes an alignment between the un-subword-tokenized and subword-tokenized sentences. Args: tokenized_sent: a list of strings describing a subword-tokenized sentence untokenized_sent: a list of strings describing a sentence, no subword tok. Returns: A dictionary of type {int: list(int)} mapping each untokenized sentence index to a list of subword-tokenized sentence indices ''' mapping = defaultdict(list) untokenized_sent_index = 0 tokenized_sent_index = 1 while (untokenized_sent_index < len(untokenized_sent) and tokenized_sent_index < len(tokenized_sent)): while (tokenized_sent_index + 1 < len(tokenized_sent) and tokenized_sent[tokenized_sent_index + 1].startswith('##')): mapping[untokenized_sent_index].append(tokenized_sent_index) tokenized_sent_index += 1 mapping[untokenized_sent_index].append(tokenized_sent_index) untokenized_sent_index += 1 tokenized_sent_index += 1 return mapping if __name__ == '__main__': argp = ArgumentParser() argp.add_argument('hdf5_file') argp.add_argument('sentences_raw') argp.add_argument('translation_npz') args = argp.parse_args() subword_tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased') with open(args.sentences_raw, 'r') as in_sents: sentences = in_sents.readlines() hf = h5py.File(args.hdf5_file, 'r') indices = list(hf.keys()) translation = np.zeros((LAYER_NUM, FEATURE_DIM)) for index, sent in tqdm(zip(sorted([int(x) for x in indices]), sentences), desc='Averaging sentence vectors'): sent = sent.strip() tokenized_sent = subword_tokenizer.wordpiece_tokenizer.tokenize('[CLS] ' + sent + ' [SEP]') untokenized_sent = sent.split(' ') untok_tok_mapping = match_tokenized_to_untokenized(tokenized_sent, untokenized_sent) feature_stack = hf[str(index)] for layer_idx in range(LAYER_NUM): single_layer_features = feature_stack[layer_idx] assert single_layer_features.shape[0] == len(tokenized_sent) single_layer_features = torch.tensor( [np.mean(single_layer_features[untok_tok_mapping[i][0]:untok_tok_mapping[i][-1] + 1, :], axis=0) for i in range(len(untokenized_sent))]) assert single_layer_features.shape[0] == len(sent.split(' ')) translation[layer_idx, :] -= single_layer_features.numpy().mean(axis=0) translation /= len(sentences) np.savez(args.translation_npz, translation)
[ 1, 515, 1852, 5510, 1053, 23125, 11726, 13, 3166, 16250, 1053, 2322, 8977, 13, 5215, 12655, 408, 7442, 13, 5215, 4842, 305, 13, 5215, 298, 29945, 2272, 13, 3166, 260, 29939, 18933, 1053, 260, 29939, 18933, 13, 3166, 282, 3637, 25350, 29918, 1457, 3018, 1312, 29918, 2151, 1053, 16662, 6066, 3950, 13, 13, 18799, 1001, 29918, 13967, 353, 29871, 29896, 29906, 13, 16359, 1299, 11499, 29918, 4571, 29924, 353, 29871, 29955, 29953, 29947, 13, 13, 13, 1753, 1993, 29918, 6979, 1891, 29918, 517, 29918, 348, 6979, 1891, 29898, 6979, 1891, 29918, 18616, 29892, 443, 6979, 1891, 29918, 18616, 1125, 13, 1678, 14550, 2499, 647, 29879, 5993, 1891, 322, 443, 6979, 1891, 10541, 2183, 1014, 9303, 376, 2277, 29908, 10944, 287, 13, 13, 1678, 17090, 393, 1269, 1014, 1742, 5993, 393, 947, 451, 1369, 263, 716, 1734, 338, 10944, 287, 13, 1678, 491, 1023, 6608, 267, 29892, 376, 2277, 613, 2912, 267, 385, 22239, 1546, 278, 443, 29899, 1491, 1742, 29899, 6979, 1891, 13, 1678, 322, 1014, 1742, 29899, 6979, 1891, 25260, 29889, 13, 13, 1678, 826, 3174, 29901, 13, 418, 5993, 1891, 29918, 18616, 29901, 263, 1051, 310, 6031, 20766, 263, 1014, 1742, 29899, 6979, 1891, 10541, 13, 418, 443, 6979, 1891, 29918, 18616, 29901, 263, 1051, 310, 6031, 20766, 263, 10541, 29892, 694, 1014, 1742, 304, 29895, 29889, 13, 1678, 16969, 29901, 13, 418, 319, 8600, 310, 1134, 426, 524, 29901, 1051, 29898, 524, 2915, 10417, 1269, 443, 6979, 1891, 10541, 13, 418, 2380, 304, 263, 1051, 310, 1014, 1742, 29899, 6979, 1891, 10541, 16285, 13, 1678, 14550, 13, 1678, 10417, 353, 2322, 8977, 29898, 1761, 29897, 13, 1678, 443, 6979, 1891, 29918, 18616, 29918, 2248, 353, 29871, 29900, 13, 1678, 5993, 1891, 29918, 18616, 29918, 2248, 353, 29871, 29896, 13, 1678, 1550, 313, 348, 6979, 1891, 29918, 18616, 29918, 2248, 529, 7431, 29898, 348, 6979, 1891, 29918, 18616, 29897, 322, 13, 965, 5993, 1891, 29918, 18616, 29918, 2248, 529, 7431, 29898, 6979, 1891, 29918, 18616, 22164, 13, 4706, 1550, 313, 6979, 1891, 29918, 18616, 29918, 2248, 718, 29871, 29896, 529, 7431, 29898, 6979, 1891, 29918, 18616, 29897, 322, 13, 1669, 5993, 1891, 29918, 18616, 29961, 6979, 1891, 29918, 18616, 29918, 2248, 718, 29871, 29896, 1822, 27382, 2541, 877, 2277, 8785, 29901, 13, 9651, 10417, 29961, 348, 6979, 1891, 29918, 18616, 29918, 2248, 1822, 4397, 29898, 6979, 1891, 29918, 18616, 29918, 2248, 29897, 13, 9651, 5993, 1891, 29918, 18616, 29918, 2248, 4619, 29871, 29896, 13, 4706, 10417, 29961, 348, 6979, 1891, 29918, 18616, 29918, 2248, 1822, 4397, 29898, 6979, 1891, 29918, 18616, 29918, 2248, 29897, 13, 4706, 443, 6979, 1891, 29918, 18616, 29918, 2248, 4619, 29871, 29896, 13, 4706, 5993, 1891, 29918, 18616, 29918, 2248, 4619, 29871, 29896, 13, 1678, 736, 10417, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1852, 29886, 353, 23125, 11726, 580, 13, 1678, 1852, 29886, 29889, 1202, 29918, 23516, 877, 29882, 2176, 29945, 29918, 1445, 1495, 13, 1678, 1852, 29886, 29889, 1202, 29918, 23516, 877, 18616, 2063, 29918, 1610, 1495, 13, 1678, 1852, 29886, 29889, 1202, 29918, 23516, 877, 3286, 18411, 29918, 9302, 29920, 1495, 13, 1678, 6389, 353, 1852, 29886, 29889, 5510, 29918, 5085, 580, 13, 13, 1678, 1014, 1742, 29918, 6979, 3950, 353, 16662, 6066, 3950, 29889, 3166, 29918, 1457, 3018, 1312, 877, 2151, 29899, 3188, 29899, 4713, 6504, 950, 29899, 29883, 1463, 1495, 13, 13, 1678, 411, 1722, 29898, 5085, 29889, 18616, 2063, 29918, 1610, 29892, 525, 29878, 1495, 408, 297, 29918, 29879, 1237, 29901, 13, 4706, 25260, 353, 297, 29918, 29879, 1237, 29889, 949, 9012, 580, 13, 13, 1678, 298, 29888, 353, 298, 29945, 2272, 29889, 2283, 29898, 5085, 29889, 29882, 2176, 29945, 29918, 1445, 29892, 525, 29878, 1495, 13, 1678, 16285, 353, 1051, 29898, 29882, 29888, 29889, 8149, 3101, 13, 13, 1678, 13962, 353, 7442, 29889, 3298, 359, 3552, 18799, 1001, 29918, 13967, 29892, 383, 29923, 1299, 11499, 29918, 4571, 29924, 876, 13, 13, 1678, 363, 2380, 29892, 2665, 297, 260, 29939, 18933, 29898, 7554, 29898, 24582, 4197, 524, 29898, 29916, 29897, 363, 921, 297, 16285, 11724, 25260, 511, 5153, 2433, 29909, 369, 6751, 10541, 12047, 29374, 13, 4706, 2665, 353, 2665, 29889, 17010, 580, 13, 4706, 5993, 1891, 29918, 18616, 353, 1014, 1742, 29918, 6979, 3950, 29889, 1742, 12343, 346, 29918, 6979, 3950, 29889, 6979, 675, 877, 29961, 6154, 29903, 29962, 525, 718, 2665, 718, 525, 518, 1660, 29925, 29962, 1495, 13, 4706, 443, 6979, 1891, 29918, 18616, 353, 2665, 29889, 5451, 877, 25710, 13, 4706, 443, 17082, 29918, 17082, 29918, 20698, 353, 1993, 29918, 6979, 1891, 29918, 517, 29918, 348, 6979, 1891, 29898, 6979, 1891, 29918, 18616, 29892, 443, 6979, 1891, 29918, 18616, 29897, 13, 4706, 4682, 29918, 1429, 353, 298, 29888, 29961, 710, 29898, 2248, 4638, 13, 13, 4706, 363, 7546, 29918, 13140, 297, 3464, 29898, 18799, 1001, 29918, 13967, 1125, 13, 9651, 2323, 29918, 13148, 29918, 22100, 353, 4682, 29918, 1429, 29961, 13148, 29918, 13140, 29962, 13, 9651, 4974, 2323, 29918, 13148, 29918, 22100, 29889, 12181, 29961, 29900, 29962, 1275, 7431, 29898, 6979, 1891, 29918, 18616, 29897, 13, 13, 9651, 2323, 29918, 13148, 29918, 22100, 353, 4842, 305, 29889, 20158, 29898, 13, 18884, 518, 9302, 29889, 12676, 29898, 14369, 29918, 13148, 29918, 22100, 29961, 12578, 29895, 29918, 17082, 29918, 20698, 29961, 29875, 3816, 29900, 5387, 12578, 29895, 29918, 17082, 29918, 20698, 29961, 29875, 3816, 29899, 29896, 29962, 718, 29871, 29896, 29892, 584, 1402, 9685, 29922, 29900, 29897, 13, 462, 363, 474, 297, 3464, 29898, 2435, 29898, 348, 6979, 1891, 29918, 18616, 876, 2314, 13, 13, 9651, 4974, 2323, 29918, 13148, 29918, 22100, 29889, 12181, 29961, 29900, 29962, 1275, 7431, 29898, 18616, 29889, 5451, 877, 525, 876, 13, 13, 9651, 13962, 29961, 13148, 29918, 13140, 29892, 584, 29962, 22361, 2323, 29918, 13148, 29918, 22100, 29889, 23749, 2141, 12676, 29898, 8990, 29922, 29900, 29897, 13, 13, 1678, 13962, 847, 29922, 7431, 29898, 18616, 2063, 29897, 13, 13, 1678, 7442, 29889, 7620, 29920, 29898, 5085, 29889, 3286, 18411, 29918, 9302, 29920, 29892, 13962, 29897, 13, 2 ]
HOP_Learning_Algorithm/classification_mnist.py
DingjunB/Honors-Thesis
1
1614298
<filename>HOP_Learning_Algorithm/classification_mnist.py #classification_mnist.py # #Semi-supervised classification example: #This script shows how to construct a weight matrix for the whole #MNIST dataset, using precomputed kNN data, randomly select some #training data, run Laplace and Poisson Learning, and compute accuracy. import graphlearning as gl #Load labels, knndata, and build 10-nearest neighbor weight matrix labels = gl.load_labels('mnist') I,J,D = gl.load_kNN_data('mnist',metric='vae') W = gl.weight_matrix(I,J,D,10) #Equivalently, we can compute knndata from scratch #X = gl.load_dataset('mnist',metric='vae') #labels = gl.load_labels('mnist') #I,J,D = gl.knnsearch_annoy(X,10) #W = gl.weight_matrix(I,J,D,10) #Randomly chose training datapoints num_train_per_class = 1 train_ind = gl.randomize_labels(labels, num_train_per_class) train_labels = labels[train_ind] #Run Laplace and Poisson learning labels_laplace = gl.graph_ssl(W,train_ind,train_labels,algorithm='laplace') labels_poisson = gl.graph_ssl(W,train_ind,train_labels,algorithm='poisson') #Compute and print accuracy print('Laplace learning: %.2f%%'%gl.accuracy(labels,labels_laplace,num_train_per_class)) print('Poisson learning: %.2f%%'%gl.accuracy(labels,labels_poisson,num_train_per_class))
[ 1, 529, 9507, 29958, 29950, 4590, 29918, 29931, 799, 1076, 29918, 22461, 4540, 29914, 1990, 2450, 29918, 23521, 391, 29889, 2272, 13, 29937, 1990, 2450, 29918, 23521, 391, 29889, 2272, 13, 29937, 13, 29937, 29903, 14208, 29899, 9136, 11292, 12965, 1342, 29901, 13, 29937, 4013, 2471, 3697, 920, 304, 3386, 263, 7688, 4636, 363, 278, 3353, 13, 29937, 29924, 29940, 9047, 8783, 29892, 773, 758, 12097, 287, 413, 10262, 848, 29892, 20459, 1831, 777, 29871, 13, 29937, 26495, 848, 29892, 1065, 20298, 1265, 322, 3929, 17387, 29257, 29892, 322, 10272, 13600, 29889, 13, 5215, 3983, 21891, 408, 3144, 13, 13, 29937, 5896, 11073, 29892, 889, 299, 532, 29892, 322, 2048, 29871, 29896, 29900, 29899, 28502, 342, 12307, 7688, 4636, 13, 21134, 353, 3144, 29889, 1359, 29918, 21134, 877, 23521, 391, 1495, 13, 29902, 29892, 29967, 29892, 29928, 353, 3144, 29889, 1359, 29918, 29895, 10262, 29918, 1272, 877, 23521, 391, 742, 16414, 2433, 1564, 29872, 1495, 13, 29956, 353, 3144, 29889, 7915, 29918, 5344, 29898, 29902, 29892, 29967, 29892, 29928, 29892, 29896, 29900, 29897, 13, 13, 29937, 6108, 2561, 2705, 29892, 591, 508, 10272, 889, 299, 532, 515, 22728, 13, 29937, 29990, 353, 3144, 29889, 1359, 29918, 24713, 877, 23521, 391, 742, 16414, 2433, 1564, 29872, 1495, 13, 29937, 21134, 353, 3144, 29889, 1359, 29918, 21134, 877, 23521, 391, 1495, 13, 29937, 29902, 29892, 29967, 29892, 29928, 353, 3144, 29889, 3959, 29876, 4478, 29918, 7665, 29891, 29898, 29990, 29892, 29896, 29900, 29897, 13, 29937, 29956, 353, 3144, 29889, 7915, 29918, 5344, 29898, 29902, 29892, 29967, 29892, 29928, 29892, 29896, 29900, 29897, 13, 13, 29937, 17875, 368, 12784, 6694, 1418, 481, 2461, 29879, 13, 1949, 29918, 14968, 29918, 546, 29918, 1990, 353, 29871, 29896, 29871, 13, 14968, 29918, 513, 353, 3144, 29889, 8172, 675, 29918, 21134, 29898, 21134, 29892, 954, 29918, 14968, 29918, 546, 29918, 1990, 29897, 13, 14968, 29918, 21134, 353, 11073, 29961, 14968, 29918, 513, 29962, 13, 13, 29937, 6558, 20298, 1265, 322, 3929, 17387, 6509, 13, 21134, 29918, 433, 6689, 353, 3144, 29889, 4262, 29918, 16265, 29898, 29956, 29892, 14968, 29918, 513, 29892, 14968, 29918, 21134, 29892, 20567, 2433, 433, 6689, 1495, 13, 21134, 29918, 1129, 17387, 353, 3144, 29889, 4262, 29918, 16265, 29898, 29956, 29892, 14968, 29918, 513, 29892, 14968, 29918, 21134, 29892, 20567, 2433, 1129, 17387, 1495, 13, 13, 29937, 20606, 29872, 322, 1596, 13600, 13, 2158, 877, 29931, 481, 1265, 6509, 29901, 18695, 29906, 29888, 7686, 29915, 29995, 3820, 29889, 562, 2764, 4135, 29898, 21134, 29892, 21134, 29918, 433, 6689, 29892, 1949, 29918, 14968, 29918, 546, 29918, 1990, 876, 13, 2158, 877, 9837, 17387, 6509, 29901, 18695, 29906, 29888, 7686, 29915, 29995, 3820, 29889, 562, 2764, 4135, 29898, 21134, 29892, 21134, 29918, 1129, 17387, 29892, 1949, 29918, 14968, 29918, 546, 29918, 1990, 876, 13, 2 ]
test/test_import.py
And2Devel/qpylib
18
1604457
from qpylib import qpylib def test_submodules_imported(): assert qpylib.app_qpylib is not None assert qpylib.asset_qpylib is not None assert qpylib.json_qpylib is not None assert qpylib.log_qpylib is not None assert qpylib.offense_qpylib is not None assert qpylib.rest_qpylib is not None assert qpylib.util_qpylib is not None
[ 1, 515, 3855, 2272, 1982, 1053, 3855, 2272, 1982, 13, 13, 1753, 1243, 29918, 1491, 7576, 29918, 5215, 287, 7295, 13, 1678, 4974, 3855, 2272, 1982, 29889, 932, 29918, 29939, 2272, 1982, 338, 451, 6213, 13, 1678, 4974, 3855, 2272, 1982, 29889, 24129, 29918, 29939, 2272, 1982, 338, 451, 6213, 13, 1678, 4974, 3855, 2272, 1982, 29889, 3126, 29918, 29939, 2272, 1982, 338, 451, 6213, 13, 1678, 4974, 3855, 2272, 1982, 29889, 1188, 29918, 29939, 2272, 1982, 338, 451, 6213, 13, 1678, 4974, 3855, 2272, 1982, 29889, 2696, 1947, 29918, 29939, 2272, 1982, 338, 451, 6213, 13, 1678, 4974, 3855, 2272, 1982, 29889, 5060, 29918, 29939, 2272, 1982, 338, 451, 6213, 13, 1678, 4974, 3855, 2272, 1982, 29889, 4422, 29918, 29939, 2272, 1982, 338, 451, 6213, 13, 2 ]
index.py
ReeLeeSama/Ticket-system
1
25172
import discord import asyncio import aiofiles from discord.ext import commands intents = discord.Intents.all() client = commands.Bot(command_prefix=commands.when_mentioned_or('!'),intents=intents) client.ticket_configs = {} @client.command() async def ping(ctx): embed=discord.Embed(title="Bot Ping",description=f"My ping is {round(client.latency * 1000)}ms ",color=discord.Colour.gold()) await ctx.reply(embed=embed) @client.event async def on_ready(): print("Bot is online") @client.event async def on_raw_reaction_add(payload): #When a reaction is added if payload.member.id != client.user.id and str(payload.emoji) == u"\U0001F3AB": #Checks if the reaction is not made by a bot an emoji is "🎫" msg_id, channel_id, category_id = client.ticket_configs[payload.guild_id] if payload.message_id == msg_id: #checks if the reaction message is equal to the message id in ticket_configs.txt guild = client.get_guild(payload.guild_id) for category in guild.categories: if category.id == category_id: break channel = guild.get_channel(channel_id) #gets the channel id ticket_channel = await category.create_text_channel(f"ticket-{payload.member.display_name}", topic=f"Ticket for {payload.member.display_name}.", permission_synced=True) #Creates a ticket as "ticket_channel" f = open(f"tickets/{ticket_channel.id}.txt", "w") #Opens a folder called "tickets" and inside it creates a file with the channel id. Usefull for transcripts f.close() #closes the file await ticket_channel.set_permissions(payload.member, read_messages=True, send_messages=True) # Adds the member to the ticket mention_member = f"{payload.member.mention}" message = await channel.fetch_message(msg_id) await message.remove_reaction(payload.emoji, payload.member) #Removes the reaction for the message where you react to make a ticket creation_embed=discord.Embed(title="Ticket Created",description="Thank you for creating a ticket and make sure that the ticket follows our ticket guidelines and explain the ticket creation reason in detail so our staff can help you.",color=discord.Colour.blurple()) await ticket_channel.send(mention_member,embed=creation_embed) # Mentions the member and sends the embded to the channel where the ticket is created. @client.command() async def close(ctx): channel = ctx.channel if channel.name.startswith("ticket"): #checks if a channel name starts with "ticket" await ctx.reply("Are you sure you want to close the ticket? Reply with ``confirm`` to close the ticket.") #Will ask the user to confirm to close the ticket await client.wait_for("message",check=lambda m: m.channel == ctx.channel and m.author == ctx.author and m.content == "confirm",timeout=10) #Wait for a message with content "confirm" and makes sure that the command runner is the message sender and waits for reply for 10 seconds. await channel.delete() #If the message is "confirm" it will delete the channel closer = ctx.author.mention transcript_chan = client.get_channel(803399751487717396) #channel to send the ticket transcript to. await transcript_chan.send(closer,file=discord.File(f"tickets/{channel.id}.txt")) #Sends the file to the transcript channel and mentions the ticket closer there. else: return @client.command() @commands.has_permissions(administrator=True) async def config(ctx, msg: discord.Message=None, category: discord.CategoryChannel=None): #Usage = !config "message_id category_id" to get the ids enable deveoper mode and right click the message that will be used to create tickets and the category id is the category where the tickets will be created. if msg is None or category is None: #If a message id or category id is not provided. error_embed=discord.Embed(title="Ticket Configuration Failed",description="Failed to configure. Either an argument is missing or an invalid argument was passed.",color=discord.Colour.red()) await ctx.channel.send(embed=error_embed) return client.ticket_configs[ctx.guild.id] = [msg.id, msg.channel.id, category.id] #Resets the configuration async with aiofiles.open("ticket_configs.txt", mode="r") as file: data = await file.readlines() async with aiofiles.open("ticket_configs.txt", mode="w") as file: await file.write(f"{ctx.guild.id} {msg.id} {msg.channel.id} {category.id}\n") for line in data: if int(line.split(" ")[0]) != ctx.guild.id: await file.write(line) await msg.add_reaction(u"\U0001F3AB") # Adds reaction to the message and when someone reacts to this emoji it will create a ticket. await ctx.channel.send("Successfully configured the ticket system.") # If you get thsi it means that the ticket system has been configured successfully. @client.event async def on_message(message): await client.process_commands(message)#processes the command if message.channel.name.startswith("ticket"): #check if the channel name starts with "ticket" f = open(f"tickets/{message.channel.id}.txt", "a") # Opens the channel id in the tickets folder f.write(f"{message.author} : {message.content}\n") # Write the message author and the message he sent f.close() #closesthe file client.run("your_bot_token_here")
[ 1, 1053, 2313, 536, 13, 5215, 408, 948, 3934, 13, 5215, 263, 601, 5325, 13, 13, 13, 3166, 2313, 536, 29889, 1062, 1053, 8260, 13, 13, 524, 1237, 353, 2313, 536, 29889, 2928, 1237, 29889, 497, 580, 13, 4645, 353, 8260, 29889, 29933, 327, 29898, 6519, 29918, 13506, 29922, 26381, 29889, 8256, 29918, 358, 28487, 29918, 272, 877, 29991, 5477, 524, 1237, 29922, 524, 1237, 29897, 13, 4645, 29889, 29873, 8522, 29918, 2917, 29879, 353, 6571, 13, 13, 29992, 4645, 29889, 6519, 580, 13, 12674, 822, 24543, 29898, 13073, 1125, 13, 1678, 8297, 29922, 2218, 16090, 29889, 6026, 2580, 29898, 3257, 543, 29933, 327, 349, 292, 613, 8216, 29922, 29888, 29908, 3421, 24543, 338, 426, 14486, 29898, 4645, 29889, 29880, 2579, 1270, 334, 29871, 29896, 29900, 29900, 29900, 2915, 1516, 9162, 2780, 29922, 2218, 16090, 29889, 1625, 473, 29889, 29887, 1025, 3101, 13, 1678, 7272, 12893, 29889, 3445, 368, 29898, 17987, 29922, 17987, 29897, 13, 13, 29992, 4645, 29889, 3696, 13, 12674, 822, 373, 29918, 2040, 7295, 13, 1678, 1596, 703, 29933, 327, 338, 7395, 1159, 13, 13, 13, 29992, 4645, 29889, 3696, 13, 12674, 822, 373, 29918, 1610, 29918, 276, 2467, 29918, 1202, 29898, 23813, 1125, 396, 10401, 263, 19848, 338, 2715, 13, 1678, 565, 20092, 29889, 14242, 29889, 333, 2804, 3132, 29889, 1792, 29889, 333, 322, 851, 29898, 23813, 29889, 15810, 2397, 29897, 1275, 318, 26732, 29965, 29900, 29900, 29900, 29896, 29943, 29941, 2882, 1115, 396, 5596, 29879, 565, 278, 19848, 338, 451, 1754, 491, 263, 9225, 385, 953, 29877, 2397, 338, 376, 243, 162, 145, 174, 29908, 13, 4706, 10191, 29918, 333, 29892, 8242, 29918, 333, 29892, 7663, 29918, 333, 353, 3132, 29889, 29873, 8522, 29918, 2917, 29879, 29961, 23813, 29889, 2543, 789, 29918, 333, 29962, 29871, 13, 13, 4706, 565, 20092, 29889, 4906, 29918, 333, 1275, 10191, 29918, 333, 29901, 396, 3198, 29879, 565, 278, 19848, 2643, 338, 5186, 304, 278, 2643, 1178, 297, 23381, 29918, 2917, 29879, 29889, 3945, 13, 9651, 1410, 789, 353, 3132, 29889, 657, 29918, 2543, 789, 29898, 23813, 29889, 2543, 789, 29918, 333, 29897, 13, 13, 9651, 363, 7663, 297, 1410, 789, 29889, 20683, 29901, 13, 18884, 565, 7663, 29889, 333, 1275, 7663, 29918, 333, 29901, 13, 462, 1678, 2867, 13, 13, 9651, 8242, 353, 1410, 789, 29889, 657, 29918, 12719, 29898, 12719, 29918, 333, 29897, 396, 20078, 278, 8242, 1178, 13, 13, 9651, 23381, 29918, 12719, 353, 7272, 7663, 29889, 3258, 29918, 726, 29918, 12719, 29898, 29888, 29908, 29873, 8522, 29899, 29912, 23813, 29889, 14242, 29889, 4990, 29918, 978, 17671, 11261, 29922, 29888, 29908, 29911, 8522, 363, 426, 23813, 29889, 14242, 29889, 4990, 29918, 978, 1836, 613, 10751, 29918, 19274, 1133, 29922, 5574, 29897, 396, 9832, 1078, 263, 23381, 408, 376, 29873, 8522, 29918, 12719, 29908, 13, 9651, 285, 353, 1722, 29898, 29888, 29908, 24667, 1691, 19248, 29873, 8522, 29918, 12719, 29889, 333, 1836, 3945, 613, 376, 29893, 1159, 396, 11746, 575, 263, 4138, 2000, 376, 24667, 1691, 29908, 322, 2768, 372, 10017, 263, 934, 411, 278, 8242, 1178, 29889, 4803, 8159, 363, 1301, 924, 29879, 13, 9651, 285, 29889, 5358, 580, 396, 11291, 267, 278, 934, 13, 9651, 7272, 23381, 29918, 12719, 29889, 842, 29918, 17858, 6847, 29898, 23813, 29889, 14242, 29892, 1303, 29918, 19158, 29922, 5574, 29892, 3638, 29918, 19158, 29922, 5574, 29897, 396, 3462, 29879, 278, 4509, 304, 278, 23381, 13, 9651, 3585, 29918, 14242, 353, 285, 29908, 29912, 23813, 29889, 14242, 29889, 358, 291, 5038, 29871, 13, 9651, 2643, 353, 7272, 8242, 29889, 9155, 29918, 4906, 29898, 7645, 29918, 333, 29897, 13, 9651, 7272, 2643, 29889, 5992, 29918, 276, 2467, 29898, 23813, 29889, 15810, 2397, 29892, 20092, 29889, 14242, 29897, 396, 7301, 586, 267, 278, 19848, 363, 278, 2643, 988, 366, 7657, 304, 1207, 263, 23381, 13, 9651, 11265, 29918, 17987, 29922, 2218, 16090, 29889, 6026, 2580, 29898, 3257, 543, 29911, 8522, 6760, 630, 613, 8216, 543, 25271, 366, 363, 4969, 263, 23381, 322, 1207, 1854, 393, 278, 23381, 4477, 1749, 23381, 1410, 10652, 1475, 322, 5649, 278, 23381, 11265, 2769, 297, 9493, 577, 1749, 13925, 508, 1371, 366, 19602, 2780, 29922, 2218, 16090, 29889, 1625, 473, 29889, 2204, 332, 552, 3101, 13, 9651, 7272, 23381, 29918, 12719, 29889, 6717, 29898, 358, 291, 29918, 14242, 29892, 17987, 29922, 1037, 362, 29918, 17987, 29897, 396, 341, 296, 1080, 278, 4509, 322, 16003, 278, 953, 6448, 287, 304, 278, 8242, 988, 278, 23381, 338, 2825, 29889, 13, 13, 13, 29992, 4645, 29889, 6519, 580, 13, 12674, 822, 3802, 29898, 13073, 1125, 13, 1678, 8242, 353, 12893, 29889, 12719, 13, 1678, 565, 8242, 29889, 978, 29889, 27382, 2541, 703, 29873, 8522, 29908, 1125, 396, 3198, 29879, 565, 263, 8242, 1024, 8665, 411, 376, 29873, 8522, 29908, 13, 4706, 7272, 12893, 29889, 3445, 368, 703, 17506, 366, 1854, 366, 864, 304, 3802, 278, 23381, 29973, 10088, 368, 411, 4954, 26897, 16159, 304, 3802, 278, 23381, 23157, 396, 12984, 2244, 278, 1404, 304, 9659, 304, 3802, 278, 23381, 13, 4706, 7272, 3132, 29889, 10685, 29918, 1454, 703, 4906, 613, 3198, 29922, 2892, 29871, 286, 29901, 286, 29889, 12719, 1275, 12893, 29889, 12719, 322, 286, 29889, 8921, 1275, 12893, 29889, 8921, 322, 286, 29889, 3051, 1275, 376, 26897, 613, 15619, 29922, 29896, 29900, 29897, 396, 15716, 363, 263, 2643, 411, 2793, 376, 26897, 29908, 322, 3732, 1854, 393, 278, 1899, 28877, 338, 278, 2643, 10004, 322, 11324, 1169, 363, 8908, 363, 29871, 29896, 29900, 6923, 29889, 13, 4706, 7272, 8242, 29889, 8143, 580, 396, 3644, 278, 2643, 338, 376, 26897, 29908, 372, 674, 5217, 278, 8242, 13, 4706, 17649, 353, 12893, 29889, 8921, 29889, 358, 291, 29871, 13, 4706, 1301, 924, 29918, 5083, 353, 3132, 29889, 657, 29918, 12719, 29898, 29947, 29900, 29941, 29941, 29929, 29929, 29955, 29945, 29896, 29946, 29947, 29955, 29955, 29896, 29955, 29941, 29929, 29953, 29897, 396, 12719, 304, 3638, 278, 23381, 1301, 924, 304, 29889, 13, 4706, 7272, 1301, 924, 29918, 5083, 29889, 6717, 29898, 11291, 261, 29892, 1445, 29922, 2218, 16090, 29889, 2283, 29898, 29888, 29908, 24667, 1691, 19248, 12719, 29889, 333, 1836, 3945, 5783, 396, 29903, 1975, 278, 934, 304, 278, 1301, 924, 8242, 322, 26649, 278, 23381, 17649, 727, 29889, 13, 1678, 1683, 29901, 13, 4706, 736, 13, 13, 29992, 4645, 29889, 6519, 580, 13, 29992, 26381, 29889, 5349, 29918, 17858, 6847, 29898, 6406, 2132, 1061, 29922, 5574, 29897, 13, 12674, 822, 2295, 29898, 13073, 29892, 10191, 29901, 2313, 536, 29889, 3728, 29922, 8516, 29892, 7663, 29901, 2313, 536, 29889, 10900, 13599, 29922, 8516, 1125, 396, 27573, 353, 29871, 1738, 2917, 376, 4906, 29918, 333, 7663, 29918, 333, 29908, 304, 679, 278, 18999, 9025, 28542, 3372, 4464, 322, 1492, 2828, 278, 2643, 393, 674, 367, 1304, 304, 1653, 16892, 1691, 322, 278, 7663, 1178, 338, 278, 7663, 988, 278, 16892, 1691, 674, 367, 2825, 29889, 13, 1678, 565, 10191, 338, 6213, 470, 7663, 338, 6213, 29901, 396, 3644, 263, 2643, 1178, 470, 7663, 1178, 338, 451, 4944, 29889, 13, 4706, 1059, 29918, 17987, 29922, 2218, 16090, 29889, 6026, 2580, 29898, 3257, 543, 29911, 8522, 20999, 18390, 613, 8216, 543, 17776, 304, 10822, 29889, 20370, 385, 2980, 338, 4567, 470, 385, 8340, 2980, 471, 4502, 19602, 2780, 29922, 2218, 16090, 29889, 1625, 473, 29889, 1127, 3101, 13, 4706, 7272, 12893, 29889, 12719, 29889, 6717, 29898, 17987, 29922, 2704, 29918, 17987, 29897, 13, 4706, 736, 13, 13, 1678, 3132, 29889, 29873, 8522, 29918, 2917, 29879, 29961, 13073, 29889, 2543, 789, 29889, 333, 29962, 353, 518, 7645, 29889, 333, 29892, 10191, 29889, 12719, 29889, 333, 29892, 7663, 29889, 333, 29962, 396, 1666, 1691, 278, 5285, 13, 13, 1678, 7465, 411, 263, 601, 5325, 29889, 3150, 703, 29873, 8522, 29918, 2917, 29879, 29889, 3945, 613, 4464, 543, 29878, 1159, 408, 934, 29901, 13, 4706, 848, 353, 7272, 934, 29889, 949, 9012, 580, 13, 13, 1678, 7465, 411, 263, 601, 5325, 29889, 3150, 703, 29873, 8522, 29918, 2917, 29879, 29889, 3945, 613, 4464, 543, 29893, 1159, 408, 934, 29901, 13, 4706, 7272, 934, 29889, 3539, 29898, 29888, 29908, 29912, 13073, 29889, 2543, 789, 29889, 333, 29913, 426, 7645, 29889, 333, 29913, 426, 7645, 29889, 12719, 29889, 333, 29913, 426, 7320, 29889, 333, 1012, 29876, 1159, 13, 13, 4706, 363, 1196, 297, 848, 29901, 13, 9651, 565, 938, 29898, 1220, 29889, 5451, 703, 376, 9601, 29900, 2314, 2804, 12893, 29889, 2543, 789, 29889, 333, 29901, 13, 18884, 7272, 934, 29889, 3539, 29898, 1220, 29897, 13, 13, 1678, 7272, 10191, 29889, 1202, 29918, 276, 2467, 29898, 29884, 26732, 29965, 29900, 29900, 29900, 29896, 29943, 29941, 2882, 1159, 396, 3462, 29879, 19848, 304, 278, 2643, 322, 746, 4856, 7657, 29879, 304, 445, 953, 29877, 2397, 372, 674, 1653, 263, 23381, 29889, 13, 1678, 7272, 12893, 29889, 12719, 29889, 6717, 703, 14191, 3730, 13252, 278, 23381, 1788, 23157, 396, 960, 366, 679, 266, 1039, 372, 2794, 393, 278, 23381, 1788, 756, 1063, 13252, 8472, 29889, 13, 13, 29992, 4645, 29889, 3696, 13, 12674, 822, 373, 29918, 4906, 29898, 4906, 1125, 13, 1678, 7272, 3132, 29889, 5014, 29918, 26381, 29898, 4906, 29897, 29937, 5014, 267, 278, 1899, 13, 1678, 565, 2643, 29889, 12719, 29889, 978, 29889, 27382, 2541, 703, 29873, 8522, 29908, 1125, 396, 3198, 565, 278, 8242, 1024, 8665, 411, 376, 29873, 8522, 29908, 13, 4706, 285, 353, 1722, 29898, 29888, 29908, 24667, 1691, 19248, 4906, 29889, 12719, 29889, 333, 1836, 3945, 613, 376, 29874, 1159, 396, 6461, 575, 278, 8242, 1178, 297, 278, 16892, 1691, 4138, 13, 4706, 285, 29889, 3539, 29898, 29888, 29908, 29912, 4906, 29889, 8921, 29913, 584, 426, 4906, 29889, 3051, 1012, 29876, 1159, 396, 14350, 278, 2643, 4148, 322, 278, 2643, 540, 2665, 13, 4706, 285, 29889, 5358, 580, 396, 11291, 342, 354, 934, 13, 308, 13, 4645, 29889, 3389, 703, 8066, 29918, 7451, 29918, 6979, 29918, 4150, 1159, 13, 2 ]
LeetCode/Easy/SymetricTree.py
ukayaj620/cp-solution
1
41931
<reponame>ukayaj620/cp-solution<gh_stars>1-10 class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def isMirror(self, left: TreeNode, right: TreeNode) -> bool: if left is None and right is None: return True elif left is not None and right is not None: inner = self.isMirror(left.right, right.left) outer = self.isMirror(left.left, right.right) return left.val == right.val and inner and outer return False def isSymmetric(self, root: TreeNode) -> bool: return root is None or self.isMirror(root.left, root.right)
[ 1, 529, 276, 1112, 420, 29958, 2679, 388, 1175, 29953, 29906, 29900, 29914, 6814, 29899, 2929, 918, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 1990, 15472, 4247, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 659, 29922, 29900, 29892, 2175, 29922, 8516, 29892, 1492, 29922, 8516, 1125, 13, 4706, 1583, 29889, 791, 353, 659, 13, 4706, 1583, 29889, 1563, 353, 2175, 13, 4706, 1583, 29889, 1266, 353, 1492, 13, 13, 13, 1990, 24380, 29901, 13, 1678, 822, 338, 29924, 381, 729, 29898, 1311, 29892, 2175, 29901, 15472, 4247, 29892, 1492, 29901, 15472, 4247, 29897, 1599, 6120, 29901, 13, 4706, 565, 2175, 338, 6213, 322, 1492, 338, 6213, 29901, 13, 9651, 736, 5852, 13, 4706, 25342, 2175, 338, 451, 6213, 322, 1492, 338, 451, 6213, 29901, 13, 9651, 6426, 353, 1583, 29889, 275, 29924, 381, 729, 29898, 1563, 29889, 1266, 29892, 1492, 29889, 1563, 29897, 13, 9651, 11420, 353, 1583, 29889, 275, 29924, 381, 729, 29898, 1563, 29889, 1563, 29892, 1492, 29889, 1266, 29897, 13, 9651, 736, 2175, 29889, 791, 1275, 1492, 29889, 791, 322, 6426, 322, 11420, 13, 308, 13, 4706, 736, 7700, 13, 308, 13, 1678, 822, 338, 25548, 16414, 29898, 1311, 29892, 3876, 29901, 15472, 4247, 29897, 1599, 6120, 29901, 13, 4706, 736, 3876, 338, 6213, 470, 1583, 29889, 275, 29924, 381, 729, 29898, 4632, 29889, 1563, 29892, 3876, 29889, 1266, 29897, 13, 308, 2 ]
extras.py
pyaf/severstal-steel-defect-detection
0
26027
import os from tqdm import tqdm import numpy as np import pandas as pd import os import pdb import cv2 import time import json import torch import random import scipy import logging import traceback import numpy as np from datetime import datetime # from config import HOME from tensorboard_logger import log_value, log_images from matplotlib import pyplot as plt plt.switch_backend("agg") def logger_init(save_folder): mkdir(save_folder) logging.basicConfig( filename=os.path.join(save_folder, "log.txt"), filemode="a", level=logging.DEBUG, format="%(asctime)s %(message)s", datefmt="%H:%M:%S", ) console = logging.StreamHandler() logger = logging.getLogger(__name__) logger.addHandler(console) return logger def plot_ROC(roc, targets, predictions, phase, epoch, folder): roc_plot_folder = os.path.join(folder, "ROC_plots") mkdir(os.path.join(roc_plot_folder)) fpr, tpr, thresholds = roc_curve(targets, predictions) roc_plot_name = "ROC_%s_%s_%0.4f" % (phase, epoch, roc) roc_plot_path = os.path.join(roc_plot_folder, roc_plot_name + ".jpg") fig = plt.figure(figsize=(10, 5)) plt.plot([0, 1], [0, 1], linestyle="--") plt.plot(fpr, tpr, marker=".") plt.legend(["diagonal-line", roc_plot_name]) fig.savefig(roc_plot_path, bbox_inches="tight", pad_inches=0) plt.close(fig) # see footnote [1] plot = cv2.imread(roc_plot_path) log_images(roc_plot_name, [plot], epoch) def print_time(log, start, string): diff = time.time() - start log(string + ": %02d:%02d" % (diff // 60, diff % 60)) def iter_log(log, phase, epoch, iteration, epoch_size, loss, start): diff = time.time() - start log( "%s epoch: %d (%d/%d) loss: %.4f || %02d:%02d", phase, epoch, iteration, epoch_size, loss.item(), diff // 60, diff % 60, ) def mkdir(folder): if not os.path.exists(folder): os.mkdir(folder) def save_hyperparameters(trainer, remark): hp_file = os.path.join(trainer.save_folder, "parameters.txt") time_now = datetime.now() augmentations = trainer.dataloaders["train"].dataset.transforms.transforms # pdb.set_trace() string_to_write = ( f"Time: {time_now}\n" + f"model_name: {trainer.model_name}\n" + f"train_df_name: {trainer.train_df_name}\n" #+ f"images_folder: {trainer.images_folder}\n" + f"resume: {trainer.resume}\n" + f"pretrained: {trainer.pretrained}\n" + f"pretrained_path: {trainer.pretrained_path}\n" + f"folder: {trainer.folder}\n" + f"fold: {trainer.fold}\n" + f"total_folds: {trainer.total_folds}\n" + f"num_samples: {trainer.num_samples}\n" + f"sampling class weights: {trainer.class_weights}\n" + f"size: {trainer.size}\n" + f"top_lr: {trainer.top_lr}\n" + f"base_lr: {trainer.base_lr}\n" + f"num_workers: {trainer.num_workers}\n" + f"batchsize: {trainer.batch_size}\n" + f"momentum: {trainer.momentum}\n" + f"mean: {trainer.mean}\n" + f"std: {trainer.std}\n" + f"start_epoch: {trainer.start_epoch}\n" + f"augmentations: {augmentations}\n" + f"criterion: {trainer.criterion}\n" + f"optimizer: {trainer.optimizer}\n" + f"remark: {remark}\n" ) with open(hp_file, "a") as f: f.write(string_to_write) print(string_to_write) def seed_pytorch(seed=69): random.seed(seed) os.environ["PYTHONHASHSEED"] = str(seed) np.random.seed(seed) torch.cuda.manual_seed(seed) torch.backends.cudnn.deterministic = True
[ 1, 1053, 2897, 13, 3166, 260, 29939, 18933, 1053, 260, 29939, 18933, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 5215, 2897, 13, 5215, 282, 2585, 13, 5215, 13850, 29906, 13, 5215, 931, 13, 5215, 4390, 13, 5215, 4842, 305, 13, 5215, 4036, 13, 5215, 4560, 2272, 13, 5215, 12183, 13, 5215, 9637, 1627, 13, 5215, 12655, 408, 7442, 13, 3166, 12865, 1053, 12865, 13, 13, 29937, 515, 2295, 1053, 29832, 2303, 13, 3166, 12489, 3377, 29918, 21707, 1053, 1480, 29918, 1767, 29892, 1480, 29918, 8346, 13, 3166, 22889, 1053, 11451, 5317, 408, 14770, 13, 13, 572, 29873, 29889, 15123, 29918, 27852, 703, 16170, 1159, 13, 13, 13, 1753, 17927, 29918, 2344, 29898, 7620, 29918, 12083, 1125, 13, 1678, 29356, 29898, 7620, 29918, 12083, 29897, 13, 1678, 12183, 29889, 16121, 3991, 29898, 13, 4706, 10422, 29922, 359, 29889, 2084, 29889, 7122, 29898, 7620, 29918, 12083, 29892, 376, 1188, 29889, 3945, 4968, 13, 4706, 934, 8513, 543, 29874, 613, 13, 4706, 3233, 29922, 21027, 29889, 18525, 29892, 13, 4706, 3402, 543, 29995, 29898, 294, 312, 603, 29897, 29879, 1273, 29898, 4906, 29897, 29879, 613, 13, 4706, 2635, 23479, 543, 29995, 29950, 16664, 29924, 16664, 29903, 613, 13, 1678, 1723, 13, 1678, 2991, 353, 12183, 29889, 3835, 4598, 580, 13, 1678, 17927, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 1678, 17927, 29889, 1202, 4598, 29898, 11058, 29897, 13, 1678, 736, 17927, 13, 13, 13, 13, 1753, 6492, 29918, 1672, 29907, 29898, 10198, 29892, 22525, 29892, 27303, 29892, 8576, 29892, 21502, 305, 29892, 4138, 1125, 13, 1678, 696, 29883, 29918, 5317, 29918, 12083, 353, 2897, 29889, 2084, 29889, 7122, 29898, 12083, 29892, 376, 1672, 29907, 29918, 26762, 1159, 13, 1678, 29356, 29898, 359, 29889, 2084, 29889, 7122, 29898, 10198, 29918, 5317, 29918, 12083, 876, 13, 1678, 285, 558, 29892, 260, 558, 29892, 266, 3781, 3361, 353, 696, 29883, 29918, 2764, 345, 29898, 5182, 29879, 29892, 27303, 29897, 13, 1678, 696, 29883, 29918, 5317, 29918, 978, 353, 376, 1672, 29907, 29918, 29995, 29879, 29918, 29995, 29879, 29918, 29995, 29900, 29889, 29946, 29888, 29908, 1273, 313, 21646, 29892, 21502, 305, 29892, 696, 29883, 29897, 13, 1678, 696, 29883, 29918, 5317, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 10198, 29918, 5317, 29918, 12083, 29892, 696, 29883, 29918, 5317, 29918, 978, 718, 11393, 6173, 1159, 13, 1678, 2537, 353, 14770, 29889, 4532, 29898, 1003, 2311, 7607, 29896, 29900, 29892, 29871, 29945, 876, 13, 1678, 14770, 29889, 5317, 4197, 29900, 29892, 29871, 29896, 1402, 518, 29900, 29892, 29871, 29896, 1402, 6276, 342, 1508, 543, 489, 1159, 13, 1678, 14770, 29889, 5317, 29898, 29888, 558, 29892, 260, 558, 29892, 17456, 543, 23157, 13, 1678, 14770, 29889, 26172, 29898, 3366, 6051, 351, 7177, 29899, 1220, 613, 696, 29883, 29918, 5317, 29918, 978, 2314, 13, 1678, 2537, 29889, 7620, 1003, 29898, 10198, 29918, 5317, 29918, 2084, 29892, 289, 1884, 29918, 262, 6609, 543, 29873, 523, 613, 17132, 29918, 262, 6609, 29922, 29900, 29897, 13, 1678, 14770, 29889, 5358, 29898, 1003, 29897, 29871, 396, 1074, 3661, 6812, 518, 29896, 29962, 13, 13, 1678, 6492, 353, 13850, 29906, 29889, 326, 949, 29898, 10198, 29918, 5317, 29918, 2084, 29897, 13, 1678, 1480, 29918, 8346, 29898, 10198, 29918, 5317, 29918, 978, 29892, 518, 5317, 1402, 21502, 305, 29897, 13, 13, 13, 1753, 1596, 29918, 2230, 29898, 1188, 29892, 1369, 29892, 1347, 1125, 13, 1678, 2923, 353, 931, 29889, 2230, 580, 448, 1369, 13, 1678, 1480, 29898, 1807, 718, 29242, 1273, 29900, 29906, 29881, 16664, 29900, 29906, 29881, 29908, 1273, 313, 12765, 849, 29871, 29953, 29900, 29892, 2923, 1273, 29871, 29953, 29900, 876, 13, 13, 13, 13, 1753, 4256, 29918, 1188, 29898, 1188, 29892, 8576, 29892, 21502, 305, 29892, 12541, 29892, 21502, 305, 29918, 2311, 29892, 6410, 29892, 1369, 1125, 13, 1678, 2923, 353, 931, 29889, 2230, 580, 448, 1369, 13, 1678, 1480, 29898, 13, 4706, 11860, 29879, 21502, 305, 29901, 1273, 29881, 313, 29995, 29881, 22584, 29881, 29897, 6410, 29901, 18695, 29946, 29888, 3830, 1273, 29900, 29906, 29881, 16664, 29900, 29906, 29881, 613, 13, 4706, 8576, 29892, 13, 4706, 21502, 305, 29892, 13, 4706, 12541, 29892, 13, 4706, 21502, 305, 29918, 2311, 29892, 13, 4706, 6410, 29889, 667, 3285, 13, 4706, 2923, 849, 29871, 29953, 29900, 29892, 13, 4706, 2923, 1273, 29871, 29953, 29900, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 29356, 29898, 12083, 1125, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 12083, 1125, 13, 4706, 2897, 29889, 11256, 3972, 29898, 12083, 29897, 13, 13, 13, 1753, 4078, 29918, 24947, 16744, 29898, 3018, 4983, 29892, 8509, 1125, 13, 1678, 298, 29886, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 29898, 3018, 4983, 29889, 7620, 29918, 12083, 29892, 376, 16744, 29889, 3945, 1159, 13, 1678, 931, 29918, 3707, 353, 12865, 29889, 3707, 580, 13, 1678, 18765, 800, 353, 1020, 4983, 29889, 29881, 2075, 29877, 24574, 3366, 14968, 16862, 24713, 29889, 9067, 29879, 29889, 9067, 29879, 13, 1678, 396, 282, 2585, 29889, 842, 29918, 15003, 580, 13, 1678, 1347, 29918, 517, 29918, 3539, 353, 313, 13, 4706, 285, 29908, 2481, 29901, 426, 2230, 29918, 3707, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 4299, 29918, 978, 29901, 426, 3018, 4983, 29889, 4299, 29918, 978, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 14968, 29918, 2176, 29918, 978, 29901, 426, 3018, 4983, 29889, 14968, 29918, 2176, 29918, 978, 1012, 29876, 29908, 13, 4706, 396, 29974, 285, 29908, 8346, 29918, 12083, 29901, 426, 3018, 4983, 29889, 8346, 29918, 12083, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 690, 2017, 29901, 426, 3018, 4983, 29889, 690, 2017, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 1457, 3018, 1312, 29901, 426, 3018, 4983, 29889, 1457, 3018, 1312, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 1457, 3018, 1312, 29918, 2084, 29901, 426, 3018, 4983, 29889, 1457, 3018, 1312, 29918, 2084, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 12083, 29901, 426, 3018, 4983, 29889, 12083, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 8771, 29901, 426, 3018, 4983, 29889, 8771, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 7827, 29918, 29888, 3361, 29901, 426, 3018, 4983, 29889, 7827, 29918, 29888, 3361, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 1949, 29918, 27736, 29901, 426, 3018, 4983, 29889, 1949, 29918, 27736, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 13445, 10335, 770, 18177, 29901, 426, 3018, 4983, 29889, 1990, 29918, 705, 5861, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 2311, 29901, 426, 3018, 4983, 29889, 2311, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 3332, 29918, 29212, 29901, 426, 3018, 4983, 29889, 3332, 29918, 29212, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 3188, 29918, 29212, 29901, 426, 3018, 4983, 29889, 3188, 29918, 29212, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 1949, 29918, 1287, 414, 29901, 426, 3018, 4983, 29889, 1949, 29918, 1287, 414, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 16175, 2311, 29901, 426, 3018, 4983, 29889, 16175, 29918, 2311, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 29885, 2932, 398, 29901, 426, 3018, 4983, 29889, 29885, 2932, 398, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 12676, 29901, 426, 3018, 4983, 29889, 12676, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 4172, 29901, 426, 3018, 4983, 29889, 4172, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 2962, 29918, 1022, 2878, 29901, 426, 3018, 4983, 29889, 2962, 29918, 1022, 2878, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 2987, 358, 800, 29901, 426, 2987, 358, 800, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 29883, 5385, 291, 29901, 426, 3018, 4983, 29889, 29883, 5385, 291, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 20640, 3950, 29901, 426, 3018, 4983, 29889, 20640, 3950, 1012, 29876, 29908, 13, 4706, 718, 285, 29908, 26294, 29901, 426, 26294, 1012, 29876, 29908, 13, 1678, 1723, 13, 13, 1678, 411, 1722, 29898, 28887, 29918, 1445, 29892, 376, 29874, 1159, 408, 285, 29901, 13, 4706, 285, 29889, 3539, 29898, 1807, 29918, 517, 29918, 3539, 29897, 13, 1678, 1596, 29898, 1807, 29918, 517, 29918, 3539, 29897, 13, 13, 13, 1753, 16717, 29918, 2272, 7345, 305, 29898, 26776, 29922, 29953, 29929, 1125, 13, 1678, 4036, 29889, 26776, 29898, 26776, 29897, 13, 1678, 2897, 29889, 21813, 3366, 20055, 4690, 1164, 29950, 24943, 1660, 3352, 3108, 353, 851, 29898, 26776, 29897, 13, 1678, 7442, 29889, 8172, 29889, 26776, 29898, 26776, 29897, 13, 1678, 4842, 305, 29889, 29883, 6191, 29889, 11288, 29918, 26776, 29898, 26776, 29897, 13, 1678, 4842, 305, 29889, 1627, 1975, 29889, 29883, 566, 15755, 29889, 4801, 837, 262, 4695, 353, 5852, 13, 13, 13, 2 ]
tests/actions/test_transfer_tokens_action.py
0xOmarA/RadixLib
32
93502
from radixlib.actions import TransferTokens from typing import Dict, Any import unittest class TestTransferTokensAction(unittest.TestCase): """ Unit tests for the TransferTokens action of mutable tokens """ ActionDict: Dict[str, Any] = { "from_account": { "address": "tdx1qspqqecwh3tgsgz92l4d4f0e4egmfe86049dj75pgq347fkkfmg84pgx9um0v" }, "to_account": { "address": "tdx1qspsl85c9cpgm8t906zewv66quyg6d4gdlru2q9ujgk0u66c8kw2t6caan5qa" }, "amount": { "value": "100000000000000000000", "token_identifier": { "rri": "xrd_tr1qyf0x76s" } }, "type": "TransferTokens" } def test_from_dict(self): """ Tests the derivation of the mainnet wallet addresses from the public key """ # The action loaded from the dictionary mint: TransferTokens = TransferTokens.from_dict(self.ActionDict) # Asserting that the TransferTokens object understood the content of the dictionary self.assertEqual(mint.to_account.address, self.ActionDict['to_account']['address']) self.assertEqual(mint.from_account.address, self.ActionDict['from_account']['address']) self.assertEqual(mint.amount, int(self.ActionDict['amount']['value'])) self.assertEqual(mint.token_rri, self.ActionDict['amount']['token_identifier']['rri']) def test_to_dict(self): """ Tests the conversion of the token account to a dictionary """ # The account loaded from the dictionary account: TransferTokens = TransferTokens.from_dict(self.ActionDict) self.assertEqual(account.to_dict(), self.ActionDict)
[ 1, 515, 2971, 861, 1982, 29889, 7387, 1053, 17934, 29911, 554, 575, 13, 3166, 19229, 1053, 360, 919, 29892, 3139, 13, 5215, 443, 27958, 13, 13, 1990, 4321, 4300, 571, 29911, 554, 575, 4276, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 9995, 13223, 6987, 363, 278, 17934, 29911, 554, 575, 3158, 310, 26691, 18897, 9995, 13, 13, 1678, 9123, 21533, 29901, 360, 919, 29961, 710, 29892, 3139, 29962, 353, 426, 13, 4706, 376, 3166, 29918, 10149, 1115, 426, 13, 9651, 376, 7328, 1115, 376, 1594, 29916, 29896, 29939, 1028, 24349, 687, 1332, 29941, 29873, 3174, 18828, 29929, 29906, 29880, 29946, 29881, 29946, 29888, 29900, 29872, 29946, 387, 29885, 1725, 29947, 29953, 29900, 29946, 29929, 19776, 29955, 29945, 4061, 29939, 29941, 29946, 29955, 29888, 6859, 24826, 29887, 29947, 29946, 4061, 29916, 29929, 398, 29900, 29894, 29908, 13, 4706, 2981, 13, 4706, 376, 517, 29918, 10149, 1115, 426, 13, 9651, 376, 7328, 1115, 376, 1594, 29916, 29896, 29939, 29879, 567, 29880, 29947, 29945, 29883, 29929, 29883, 4061, 29885, 29947, 29873, 29929, 29900, 29953, 29274, 29894, 29953, 29953, 339, 4790, 29953, 29881, 29946, 29887, 11671, 582, 29906, 29939, 29929, 8016, 29887, 29895, 29900, 29884, 29953, 29953, 29883, 29947, 11022, 29906, 29873, 29953, 1113, 273, 29945, 25621, 29908, 13, 4706, 2981, 13, 4706, 376, 14506, 1115, 426, 13, 9651, 376, 1767, 1115, 376, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 613, 13, 9651, 376, 6979, 29918, 25378, 1115, 426, 13, 18884, 376, 29878, 374, 1115, 376, 29916, 5499, 29918, 509, 29896, 29939, 29891, 29888, 29900, 29916, 29955, 29953, 29879, 29908, 13, 9651, 500, 13, 4706, 2981, 13, 4706, 376, 1853, 1115, 376, 4300, 571, 29911, 554, 575, 29908, 13, 1678, 500, 13, 13, 1678, 822, 1243, 29918, 3166, 29918, 8977, 29898, 1311, 1125, 13, 4706, 9995, 4321, 29879, 278, 7750, 362, 310, 278, 1667, 1212, 17042, 1026, 14157, 515, 278, 970, 1820, 9995, 13, 13, 4706, 396, 450, 3158, 7500, 515, 278, 8600, 13, 4706, 20559, 29901, 17934, 29911, 554, 575, 353, 17934, 29911, 554, 575, 29889, 3166, 29918, 8977, 29898, 1311, 29889, 4276, 21533, 29897, 13, 13, 4706, 396, 1094, 643, 1259, 393, 278, 17934, 29911, 554, 575, 1203, 11098, 278, 2793, 310, 278, 8600, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29885, 524, 29889, 517, 29918, 10149, 29889, 7328, 29892, 1583, 29889, 4276, 21533, 1839, 517, 29918, 10149, 16215, 7328, 11287, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29885, 524, 29889, 3166, 29918, 10149, 29889, 7328, 29892, 1583, 29889, 4276, 21533, 1839, 3166, 29918, 10149, 16215, 7328, 11287, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29885, 524, 29889, 14506, 29892, 938, 29898, 1311, 29889, 4276, 21533, 1839, 14506, 16215, 1767, 25901, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29885, 524, 29889, 6979, 29918, 29878, 374, 29892, 1583, 29889, 4276, 21533, 1839, 14506, 16215, 6979, 29918, 25378, 16215, 29878, 374, 11287, 13, 13, 1678, 822, 1243, 29918, 517, 29918, 8977, 29898, 1311, 1125, 13, 4706, 9995, 4321, 29879, 278, 11301, 310, 278, 5993, 3633, 304, 263, 8600, 9995, 13, 13, 4706, 396, 450, 3633, 7500, 515, 278, 8600, 13, 4706, 3633, 29901, 17934, 29911, 554, 575, 353, 17934, 29911, 554, 575, 29889, 3166, 29918, 8977, 29898, 1311, 29889, 4276, 21533, 29897, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 10149, 29889, 517, 29918, 8977, 3285, 1583, 29889, 4276, 21533, 29897, 2 ]
codes/mdp_utils.py
oskali/mit_cassandra
0
137518
<reponame>oskali/mit_cassandra<filename>codes/mdp_utils.py<gh_stars>0 #%% Libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm # progress bar from copy import deepcopy from sklearn.cluster import KMeans, AgglomerativeClustering, Birch from sklearn.preprocessing import LabelEncoder from sklearn.linear_model import LogisticRegression, LogisticRegressionCV from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import RandomForestClassifier # from xgboost import XGBClassifier from collections import Counter from itertools import groupby from operator import itemgetter import os import warnings warnings.filterwarnings("ignore") from mdp_testing import R2_value_training, training_value_error, get_MDP, \ predict_cluster, R2_value_testing, testing_value_error, error_per_ID, MDPTrainingError, prediction_score from data_utils import save_model ############################################################################# # Splitter algorithm with cross-validation ############################################################################# # splitter() is the wrap-up function. Takes as parameters a dataframe df, # a time-horizon T, a number of features pfeatures, an indexer k, and a max # number of iterations and performs the algorithm until all contradictions are # resolved or until the max number of iterations is reached # Plots the trajectory of testing metrics during splitting process # Returns the final resulting dataframe # initializeClusters() takes as input a dataframe, a time horizon T, # a clustering algorithm, a number of clusters n_clusters, # and a random seed (optional) and returns a dataframe # with two new columns 'CLUSTER' and 'NEXT_CLUSTER' def initializeClusters(df, # pandas dataFrame: MUST contain a "RISK" column clustering='Agglomerative', # string: clustering algorithm n_clusters= None, distance_threshold= 0.1, # number of clusters random_state=0): # random seed for the clustering df = df.copy() if clustering == 'KMeans': output = KMeans( n_clusters=n_clusters, random_state=random_state).fit( np.array(df.RISK).reshape(-1, 1)).labels_ elif clustering == 'Agglomerative': output = AgglomerativeClustering( n_clusters=n_clusters, distance_threshold=distance_threshold).fit( np.array(df.RISK).reshape(-1, 1)).labels_ elif clustering == 'Birch': output = Birch( n_clusters=n_clusters).fit( np.array(df.RISK).reshape(-1, 1)).labels_ else: output = LabelEncoder().fit_transform(np.array(df.RISK).reshape(-1, 1)) df['CLUSTER'] = output df['NEXT_CLUSTER'] = df.groupby('ID')['CLUSTER'].shift(-1) # df.loc[df['ID'] != df['ID'].shift(-1), 'NEXT_CLUSTER'] = 'None' return(df) ############################################################################# ############################################################################# # Function for the Iterations # findConstradiction() takes as input a dataframe and returns the tuple with # initial cluster and action that have the most number of contradictions or # (-1, -1) if no such cluster existss def findContradiction(df, # pandas dataFrame th): # integer: threshold split size X = df.loc[:, ['CLUSTER', 'NEXT_CLUSTER', 'ACTION']] X = X[X.NEXT_CLUSTER != 'None'] count = X.groupby(['CLUSTER', 'ACTION'])['NEXT_CLUSTER'].nunique() contradictions = list(count[list(count > 1)].index) if len(contradictions) > 0: ncontradictions = [sum(list(X.query('CLUSTER == @i[0]').query( 'ACTION == @i[1]').groupby('NEXT_CLUSTER')['ACTION'].count(). sort_values(ascending=False))[1:]) for i in contradictions] if max(ncontradictions) > th: selectedCont = contradictions[ncontradictions.index( max(ncontradictions))] return(selectedCont) return((-1, -1)) # contradiction() outputs one found contradiction given a dataframe, # a cluster and a an action or (None, None) if none is found def contradiction(df, # pandas dataFrame i, # integer: initial clusters a): # integer: action taken nc = list(df.query('CLUSTER == @i').query( 'ACTION == @a').query('NEXT_CLUSTER != "None"')['NEXT_CLUSTER']) if len(nc) == 1: return (None, None) else: return a, multimode(nc)[0] # multimode() returns a list of the most frequently occurring values. # Will return more than one result if there are multiple modes # or an empty list if *data* is empty. def multimode(data): counts = Counter(iter(data)).most_common() maxcount, mode_items = next(groupby(counts, key=itemgetter(1)), (0, [])) return list(map(itemgetter(0), mode_items)) # split() takes as input a dataframe, an initial cluster, an action, a target_colname # cluster that is a contradiction c, a time horizon T, then number of features, # and an iterator k (that is the indexer of the next cluster), as well as the # predictive classification algorithm used # and returns a new dataframe with the contradiction resolved # MAKE SURE TO CHECK the number to ensure group creation has all features!! *** def split(df, # pandas dataFrame i, # integer: initial cluster a, # integer: action taken c, # integer: target cluster pfeatures, # integer: number of features k, # integer: intedexer for next cluster classification='LogisticRegression', random_state=0): # string: classification aglo g1 = df[(df['CLUSTER'] == i) & ( df['ACTION'] == a) & (df['NEXT_CLUSTER'] == c)] g2 = df[(df['CLUSTER'] == i) & ( df['ACTION'] == a) & (df['NEXT_CLUSTER'] != c) & ( df['NEXT_CLUSTER'] != 'None')] g3 = df[(df['CLUSTER'] == i) & ( ((df['ACTION'] == a) & (df['NEXT_CLUSTER'] == 'None')) | ( df['ACTION'] != a))] groups = [g1, g2, g3] data = {} for j in range(len(groups)): d = pd.DataFrame(groups[j].iloc[:, 2:2+pfeatures].values.tolist()) data[j] = d data[0].insert(data[0].shape[1], "GROUP", np.zeros(data[0].shape[0])) data[1].insert(data[1].shape[1], "GROUP", np.ones(data[1].shape[0])) training = pd.concat([data[0], data[1]]) tr_X = training.loc[:, ~(training.columns == "GROUP")] tr_y = training.loc[:, "GROUP"] if classification == 'LogisticRegression': m = LogisticRegression(solver='liblinear', random_state=random_state) elif classification == 'LogisticRegressionCV': m = LogisticRegressionCV(random_state=random_state) elif classification == 'DecisionTreeClassifier': m = DecisionTreeClassifier(random_state=random_state) elif classification == 'RandomForestClassifier': m = RandomForestClassifier(random_state=random_state) elif classification == 'XGBClassifier': m = XGBClassifier(random_state=random_state) else: m = LogisticRegression(solver='liblinear') m.fit(tr_X, tr_y.values.ravel()) ids = g2.index.values test_X = data[2] if len(test_X) != 0: Y = m.predict(test_X) g3.insert(g3.shape[1], "GROUP", Y) id2 = g3.loc[g3["GROUP"] == 1].index.values ids = np.concatenate((ids, id2)) df.loc[df.index.isin(ids), 'CLUSTER'] = k newids = ids-1 df.loc[(df.index.isin(newids)) & (df['ID']== df['ID'].shift(-1)), 'NEXT_CLUSTER'] = k return df # (MDP GRID SEARCH FUNCTION) # Splitting function from the MDP learning algorithm def splitter(df, # pandas dataFrame actions, pfeatures, # integer: number of features th, # integer: threshold for minimum split df_test=None, testing=False, classification='LogisticRegression', # string: classification alg it=6, # integer: max number of clusters h=5, OutputFlag=1, n=-1, random_state=0, plot=False, save=False, savepath=None): #If we plot error # initializing lists for error & accuracy data training_R2 = [] testing_R2 = [] # training_acc = [] # testing_acc = [] testing_error = [] training_error = [] k = df['CLUSTER'].nunique() #initial number of clusters nc = k df_new = deepcopy(df) # Setting progress bar-------------- if OutputFlag >= 1: split_bar = tqdm(range(it-k)) else: split_bar = range(it-k) # split_bar.set_description("Splitting...") # Setting progress bar-------------- for i in split_bar: # split_bar.set_description("Splitting... |#Clusters:%s" %(nc)) cont = False c, a = findContradiction(df_new, th) # print('Iteration',i+1, '| #Clusters=',nc+1, '------------------------') if c != -1: #if OutputFlag == 1: #print('Cluster Content') #print(df_new.groupby( #['CLUSTER', 'OG_CLUSTER'])['ACTION'].count()) # finding contradictions and splitting a, b = contradiction(df_new, c, a) # if OutputFlag == 1: # print('Cluster splitted', c,'| Action causing contradiction:', a, '| Cluster most elements went to:', b) df_new = split(df_new, c, a, b, pfeatures, nc, classification, random_state=random_state) # error and accuracy calculations R2_train = R2_value_training(df_new, actions=actions, pfeatures=pfeatures, n_cluster=nc+1, complete=True, OutputFlag=OutputFlag) if testing: # model = predict_cluster(df_new, pfeatures) model = None R2_test = R2_value_testing(df_test, df_new, model, pfeatures, actions=actions, n_cluster=nc+1, OutputFlag=OutputFlag) test_error = testing_value_error(df_test.copy(), df_new, model, actions=actions, pfeatures=pfeatures, n_cluster=nc+1, relative=True, h=h, OutputFlag=OutputFlag) testing_R2.append(R2_test) testing_error.append(test_error) # train_acc = training_accuracy(df_new)[0] # test_acc = testing_accuracy(df_test, df_new, model, pfeatures)[0] P_df,R_df = get_MDP(df_new, complete=True, actions=actions, pfeatures=pfeatures, n_cluster=nc+1, OutputFlag=0) train_error = training_value_error(df_new, P_df=P_df, R_df=R_df, relative=True, h=h, OutputFlag=OutputFlag) training_R2.append(R2_train) training_error.append(train_error) # training_acc.append(train_acc) # testing_acc.append(test_acc) # printing error and accuracy values # if OutputFlag == 1: # print('training value R2:', R2_train) # print('training accuracy:', train_acc) # print('testing accuracy:', test_acc) # print('training value error:', train_error) # if testing: # print('testing value R2:', R2_test) # print('testing value error:', test_error) # print('predictions:', get_predictions(df_new)) # print(df_new.head()) cont = True nc += 1 if not cont: break if nc >= it: break # if OutputFlag == 1: # print(df_new.groupby(['CLUSTER', 'OG_CLUSTER'])['ACTION'].count()) # plotting functions # Plotting accuracy and value R2 # fig1, ax1 = plt.subplots() its = np.arange(k+1, nc+1) # ax1.plot(its, training_R2, label= "Training R2") # if testing: # ax1.plot(its, testing_R2, label = "Testing R2") # #ax1.plot(its, training_acc, label = "Training Accuracy") # #ax1.plot(its, testing_acc, label = "Testing Accuracy") # if n>0: # ax1.axvline(x=n,linestyle='--',color='r') #Plotting vertical line at #cluster =n # ax1.set_ylim(0,1) # ax1.set_xlabel('# of Clusters') # ax1.set_ylabel('R2 or Accuracy %') # ax1.set_title('R2 and Accuracy During Splitting') # ax1.legend() # Plotting value error E((v_est - v_true)^2) FOR COVID: plotting MAPE # for training if plot: fig2, ax2 = plt.subplots() ax2.plot(its, training_error, label="Training Error") if testing: ax2.plot(its, testing_error, label="Testing Error") if n > 0: ax2.axvline(x=n, linestyle='--', color='r') #Plotting vertical line at #cluster =n ax2.set_ylim(0) ax2.set_xlabel('# of Clusters') ax2.set_ylabel('Cases MAPE error') ax2.set_title('MAPE error by number of clusters') ax2.legend() if save: plt.savefig(savepath) if OutputFlag >= 2: plt.show(block=False) else: plt.close() df_train_error = pd.DataFrame(list(zip(its, training_error)), \ columns=['Clusters', 'Error']) if testing: df_test_error = pd.DataFrame(list(zip(its, testing_error)), \ columns=['Clusters', 'Error']) return df_new, df_train_error, df_test_error return df_new, training_error, testing_error # (MDP FUNCTION) # Fitting function for a single fold, def fit_cv_fold(split_idx, df, clustering, n_clusters, clustering_distance_threshold, pfeatures, actions, splitting_threshold, classification, n_iter, horizon, n, OutputFlag=0, random_state=1234, mode="ID", save=False, savepath="", plot=False): if mode == "ALL": idx, (train_idx, test_idx) = split_idx # train_idx, _ = split_idx / _, train_idx = split_idx df_test = df.loc[train_idx].groupby("ID").tail(horizon).reset_index(drop=True).copy() df_train = df.loc[train_idx].groupby("ID").apply(lambda x: x.head(-horizon)).reset_index(drop=True).copy() elif mode == "TIME_CV": idx, (train_idx, test_idx) = split_idx df_train = pd.concat( [df.loc[train_idx], df.loc[test_idx].groupby("ID").apply(lambda x: x.head(-horizon)).reset_index(drop=True)] ).copy().reset_index(drop=True) df_test = df.loc[test_idx].groupby("ID").tail(horizon).reset_index(drop=True).copy() elif mode == "ID": idx, (train_idx, test_idx) = split_idx df_train = df.loc[train_idx].copy() df_test = df.loc[test_idx].copy() else: if OutputFlag >= 1: print("TrainingError : 'mode' must be a string : either 'TIME', 'ALL' or 'ID' ") raise MDPTrainingError ################################################################# # Initialize Clusters df_train = initializeClusters(df_train, clustering=clustering, n_clusters=n_clusters, distance_threshold=clustering_distance_threshold, random_state=random_state) # k = df_train['CLUSTER'].nunique() ################################################################# ################################################################# # Run Iterative Learning Algorithm df_train, training_error, testing_error = splitter(df_train, actions=actions, pfeatures=pfeatures, th=splitting_threshold, df_test=df_test, testing=True, classification=classification, it=n_iter, h=horizon, OutputFlag=OutputFlag, n=n, random_state=random_state, plot=plot, save=save, savepath=os.path.join(savepath, "plot_{}.PNG".format(idx))) m = predict_cluster(df_train, pfeatures) try: df_err, E_v = error_per_ID(df_test=df_test, df_new=df_train, model=m, actions=actions, n_cluster=n_clusters, pfeatures=pfeatures, relative=True, h=horizon, OutputFlag=OutputFlag) except: df_err, E_v = None, None return testing_error, training_error, df_err, E_v
[ 1, 529, 276, 1112, 420, 29958, 359, 29895, 2606, 29914, 2415, 29918, 29883, 465, 10738, 29966, 9507, 29958, 18137, 29914, 3487, 29886, 29918, 13239, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 7686, 365, 4626, 4314, 30004, 13, 5215, 11701, 408, 10518, 30004, 13, 5215, 12655, 408, 7442, 30004, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 30004, 13, 3166, 260, 29939, 18933, 1053, 260, 29939, 18933, 29871, 396, 6728, 2594, 30004, 13, 3166, 3509, 1053, 6483, 8552, 30004, 13, 3166, 2071, 19668, 29889, 19594, 1053, 476, 6816, 550, 29892, 319, 1505, 29880, 12392, 1230, 6821, 504, 3241, 29892, 17853, 305, 30004, 13, 3166, 2071, 19668, 29889, 1457, 19170, 1053, 15796, 8566, 6119, 30004, 13, 3166, 2071, 19668, 29889, 10660, 29918, 4299, 1053, 4522, 4695, 4597, 23881, 29892, 4522, 4695, 4597, 23881, 15633, 30004, 13, 3166, 2071, 19668, 29889, 8336, 1053, 3826, 2459, 9643, 2385, 3709, 30004, 13, 3166, 2071, 19668, 29889, 24031, 1053, 16968, 2831, 342, 2385, 3709, 30004, 13, 29937, 515, 921, 29887, 17079, 1053, 1060, 7210, 2385, 3709, 30004, 13, 3166, 16250, 1053, 315, 5336, 30004, 13, 3166, 4256, 8504, 1053, 2318, 1609, 30004, 13, 3166, 5455, 1053, 2944, 657, 357, 30004, 13, 5215, 2897, 30004, 13, 30004, 13, 5215, 18116, 30004, 13, 25442, 886, 29889, 4572, 25442, 886, 703, 17281, 1159, 30004, 13, 30004, 13, 3166, 286, 6099, 29918, 13424, 1053, 390, 29906, 29918, 1767, 29918, 26495, 29892, 6694, 29918, 1767, 29918, 2704, 29892, 679, 29918, 5773, 29925, 29892, 320, 30004, 13, 1678, 8500, 29918, 19594, 29892, 390, 29906, 29918, 1767, 29918, 13424, 29892, 6724, 29918, 1767, 29918, 2704, 29892, 1059, 29918, 546, 29918, 1367, 29892, 341, 11191, 5323, 2827, 2392, 29892, 18988, 29918, 13628, 30004, 13, 30004, 13, 3166, 848, 29918, 13239, 1053, 4078, 29918, 4299, 30004, 13, 13383, 13383, 13383, 13383, 7346, 4136, 29937, 30004, 13, 29937, 26178, 357, 5687, 411, 4891, 29899, 18157, 30004, 13, 30004, 13, 13383, 13383, 13383, 13383, 7346, 4136, 29937, 30004, 13, 30004, 13, 29937, 6219, 357, 580, 338, 278, 12244, 29899, 786, 740, 29889, 323, 6926, 408, 4128, 263, 12205, 4489, 11167, 13, 29937, 263, 931, 29899, 2015, 18162, 323, 29892, 263, 1353, 310, 5680, 282, 22100, 29892, 385, 2380, 261, 413, 29892, 322, 263, 4236, 30004, 13, 29937, 1353, 310, 24372, 322, 23233, 278, 5687, 2745, 599, 27877, 1080, 526, 30004, 13, 29937, 11527, 470, 2745, 278, 4236, 1353, 310, 24372, 338, 7450, 30004, 13, 29937, 1858, 1862, 278, 23324, 706, 310, 6724, 21556, 2645, 24368, 1889, 30004, 13, 29937, 16969, 278, 2186, 9819, 12205, 30004, 13, 30004, 13, 30004, 13, 29937, 11905, 6821, 504, 414, 580, 4893, 408, 1881, 263, 12205, 29892, 263, 931, 28205, 323, 11167, 13, 29937, 263, 16993, 3241, 5687, 29892, 263, 1353, 310, 24554, 302, 29918, 695, 504, 414, 11167, 13, 29937, 322, 263, 4036, 16717, 313, 25253, 29897, 322, 3639, 263, 12205, 30004, 13, 29937, 411, 1023, 716, 4341, 525, 6154, 17321, 1001, 29915, 322, 525, 29940, 12194, 29918, 6154, 17321, 1001, 29915, 30004, 13, 1753, 11905, 6821, 504, 414, 29898, 2176, 29892, 29871, 396, 11701, 848, 4308, 29901, 341, 17321, 1712, 263, 376, 29934, 3235, 29968, 29908, 1897, 30004, 13, 462, 539, 16993, 3241, 2433, 29909, 1505, 29880, 12392, 1230, 742, 29871, 396, 1347, 29901, 16993, 3241, 5687, 30004, 13, 462, 539, 302, 29918, 695, 504, 414, 29922, 6213, 11167, 13, 462, 539, 5418, 29918, 386, 12268, 29922, 29871, 29900, 29889, 29896, 29892, 29871, 396, 1353, 310, 24554, 30004, 13, 462, 539, 4036, 29918, 3859, 29922, 29900, 1125, 29871, 396, 4036, 16717, 363, 278, 16993, 3241, 30004, 13, 1678, 4489, 353, 4489, 29889, 8552, 26471, 13, 1678, 565, 16993, 3241, 1275, 525, 29968, 6816, 550, 2396, 30004, 13, 4706, 1962, 353, 476, 6816, 550, 29898, 30004, 13, 18884, 302, 29918, 695, 504, 414, 29922, 29876, 29918, 695, 504, 414, 29892, 4036, 29918, 3859, 29922, 8172, 29918, 3859, 467, 9202, 29898, 30004, 13, 462, 4706, 7442, 29889, 2378, 29898, 2176, 29889, 29934, 3235, 29968, 467, 690, 14443, 6278, 29896, 29892, 29871, 29896, 8106, 21134, 29918, 30004, 13, 1678, 25342, 16993, 3241, 1275, 525, 29909, 1505, 29880, 12392, 1230, 2396, 30004, 13, 4706, 1962, 353, 319, 1505, 29880, 12392, 1230, 6821, 504, 3241, 29898, 30004, 13, 9651, 302, 29918, 695, 504, 414, 29922, 29876, 29918, 695, 504, 414, 29892, 5418, 29918, 386, 12268, 29922, 19244, 29918, 386, 12268, 467, 9202, 29898, 30004, 13, 462, 1678, 7442, 29889, 2378, 29898, 2176, 29889, 29934, 3235, 29968, 467, 690, 14443, 6278, 29896, 29892, 29871, 29896, 8106, 21134, 29918, 30004, 13, 1678, 25342, 16993, 3241, 1275, 525, 29933, 381, 305, 2396, 30004, 13, 4706, 1962, 353, 17853, 305, 29898, 30004, 13, 9651, 302, 29918, 695, 504, 414, 29922, 29876, 29918, 695, 504, 414, 467, 9202, 29898, 30004, 13, 462, 1678, 7442, 29889, 2378, 29898, 2176, 29889, 29934, 3235, 29968, 467, 690, 14443, 6278, 29896, 29892, 29871, 29896, 8106, 21134, 29918, 30004, 13, 1678, 1683, 29901, 30004, 13, 4706, 1962, 353, 15796, 8566, 6119, 2141, 9202, 29918, 9067, 29898, 9302, 29889, 2378, 29898, 2176, 29889, 29934, 3235, 29968, 467, 690, 14443, 6278, 29896, 29892, 29871, 29896, 876, 30004, 13, 1678, 4489, 1839, 6154, 17321, 1001, 2033, 353, 1962, 30004, 13, 1678, 4489, 1839, 29940, 12194, 29918, 6154, 17321, 1001, 2033, 353, 4489, 29889, 27789, 877, 1367, 1495, 1839, 6154, 17321, 1001, 13359, 10889, 6278, 29896, 8443, 13, 1678, 396, 4489, 29889, 2029, 29961, 2176, 1839, 1367, 2033, 2804, 4489, 1839, 1367, 13359, 10889, 6278, 29896, 511, 525, 29940, 12194, 29918, 6154, 17321, 1001, 2033, 353, 525, 8516, 29915, 30004, 13, 1678, 736, 29898, 2176, 8443, 13, 13383, 13383, 13383, 13383, 7346, 4136, 29937, 30004, 13, 30004, 13, 30004, 13, 13383, 13383, 13383, 13383, 7346, 4136, 29937, 30004, 13, 29937, 6680, 363, 278, 20504, 800, 30004, 13, 30004, 13, 29937, 1284, 1168, 710, 328, 2463, 580, 4893, 408, 1881, 263, 12205, 322, 3639, 278, 18761, 411, 30004, 13, 29937, 2847, 9867, 322, 3158, 393, 505, 278, 1556, 1353, 310, 27877, 1080, 470, 30004, 13, 29937, 8521, 29896, 29892, 448, 29896, 29897, 565, 694, 1316, 9867, 1863, 893, 30004, 13, 1753, 1284, 1168, 29576, 2463, 29898, 2176, 29892, 396, 11701, 848, 4308, 30004, 13, 462, 418, 266, 1125, 396, 6043, 29901, 16897, 6219, 2159, 30004, 13, 1678, 1060, 353, 4489, 29889, 2029, 7503, 29892, 6024, 6154, 17321, 1001, 742, 525, 29940, 12194, 29918, 6154, 17321, 1001, 742, 525, 24705, 2033, 29962, 30004, 13, 1678, 1060, 353, 1060, 29961, 29990, 29889, 29940, 12194, 29918, 6154, 17321, 1001, 2804, 525, 8516, 2033, 30004, 13, 1678, 2302, 353, 1060, 29889, 27789, 18959, 6154, 17321, 1001, 742, 525, 24705, 11287, 1839, 29940, 12194, 29918, 6154, 17321, 1001, 13359, 29876, 13092, 26471, 13, 1678, 27877, 1080, 353, 1051, 29898, 2798, 29961, 1761, 29898, 2798, 1405, 29871, 29896, 29897, 1822, 2248, 8443, 13, 1678, 565, 7431, 29898, 9996, 328, 919, 1080, 29897, 1405, 29871, 29900, 29901, 30004, 13, 4706, 302, 9996, 328, 919, 1080, 353, 518, 2083, 29898, 1761, 29898, 29990, 29889, 1972, 877, 6154, 17321, 1001, 1275, 732, 29875, 29961, 29900, 29962, 2824, 1972, 29898, 30004, 13, 9651, 525, 24705, 1275, 732, 29875, 29961, 29896, 29962, 2824, 27789, 877, 29940, 12194, 29918, 6154, 17321, 1001, 1495, 1839, 24705, 13359, 2798, 2141, 30004, 13, 462, 462, 1678, 2656, 29918, 5975, 29898, 6151, 2548, 29922, 8824, 876, 29961, 29896, 29901, 2314, 363, 474, 297, 27877, 1080, 29962, 30004, 13, 4706, 565, 4236, 29898, 29876, 9996, 328, 919, 1080, 29897, 1405, 266, 29901, 30004, 13, 9651, 4629, 1323, 353, 27877, 1080, 29961, 29876, 9996, 328, 919, 1080, 29889, 2248, 29898, 30004, 13, 18884, 4236, 29898, 29876, 9996, 328, 919, 1080, 28166, 30004, 13, 9651, 736, 29898, 8391, 1323, 8443, 13, 1678, 736, 3552, 29899, 29896, 29892, 448, 29896, 876, 30004, 13, 30004, 13, 30004, 13, 29937, 23949, 580, 14391, 697, 1476, 23949, 2183, 263, 12205, 11167, 13, 29937, 263, 9867, 322, 263, 385, 3158, 470, 313, 8516, 29892, 6213, 29897, 565, 5642, 338, 1476, 30004, 13, 1753, 23949, 29898, 2176, 29892, 29871, 396, 11701, 848, 4308, 30004, 13, 462, 29871, 474, 29892, 29871, 396, 6043, 29901, 2847, 24554, 30004, 13, 462, 29871, 263, 1125, 29871, 396, 6043, 29901, 3158, 4586, 30004, 13, 1678, 302, 29883, 353, 1051, 29898, 2176, 29889, 1972, 877, 6154, 17321, 1001, 1275, 732, 29875, 2824, 1972, 29898, 30004, 13, 9651, 525, 24705, 1275, 732, 29874, 2824, 1972, 877, 29940, 12194, 29918, 6154, 17321, 1001, 2804, 376, 8516, 29908, 1495, 1839, 29940, 12194, 29918, 6154, 17321, 1001, 2033, 8443, 13, 1678, 565, 7431, 29898, 17608, 29897, 1275, 29871, 29896, 29901, 30004, 13, 4706, 736, 313, 8516, 29892, 6213, 8443, 13, 1678, 1683, 29901, 30004, 13, 4706, 736, 263, 29892, 1773, 326, 356, 29898, 17608, 9601, 29900, 29962, 30004, 13, 30004, 13, 30004, 13, 29937, 1773, 326, 356, 580, 3639, 263, 1051, 310, 278, 1556, 13672, 13920, 292, 1819, 22993, 13, 29937, 2811, 736, 901, 1135, 697, 1121, 565, 727, 526, 2999, 18893, 30004, 13, 29937, 470, 385, 4069, 1051, 565, 334, 1272, 29930, 338, 4069, 22993, 13, 1753, 1773, 326, 356, 29898, 1272, 1125, 30004, 13, 1678, 18139, 353, 315, 5336, 29898, 1524, 29898, 1272, 8106, 3242, 29918, 9435, 26471, 13, 1678, 4236, 2798, 29892, 4464, 29918, 7076, 353, 2446, 29898, 27789, 29898, 2798, 29879, 29892, 1820, 29922, 667, 657, 357, 29898, 29896, 8243, 313, 29900, 29892, 5159, 876, 30004, 13, 1678, 736, 1051, 29898, 1958, 29898, 667, 657, 357, 29898, 29900, 511, 4464, 29918, 7076, 876, 30004, 13, 30004, 13, 30004, 13, 29937, 6219, 580, 4893, 408, 1881, 263, 12205, 29892, 385, 2847, 9867, 29892, 385, 3158, 29892, 263, 3646, 29918, 1054, 978, 30004, 13, 29937, 9867, 393, 338, 263, 23949, 274, 29892, 263, 931, 28205, 323, 29892, 769, 1353, 310, 5680, 11167, 13, 29937, 322, 385, 20380, 413, 313, 5747, 338, 278, 2380, 261, 310, 278, 2446, 9867, 511, 408, 1532, 408, 278, 30004, 13, 29937, 8500, 573, 12965, 5687, 1304, 30004, 13, 29937, 322, 3639, 263, 716, 12205, 411, 278, 23949, 11527, 30004, 13, 29937, 14861, 6059, 317, 11499, 7495, 23557, 278, 1353, 304, 9801, 2318, 11265, 756, 599, 5680, 6824, 18610, 30004, 13, 1753, 6219, 29898, 2176, 29892, 29871, 396, 11701, 848, 4308, 30004, 13, 3986, 474, 29892, 29871, 396, 6043, 29901, 2847, 9867, 30004, 13, 3986, 263, 29892, 29871, 396, 6043, 29901, 3158, 4586, 30004, 13, 3986, 274, 29892, 29871, 396, 6043, 29901, 3646, 9867, 30004, 13, 3986, 282, 22100, 29892, 29871, 396, 6043, 29901, 1353, 310, 5680, 30004, 13, 3986, 413, 29892, 29871, 396, 6043, 29901, 938, 287, 735, 261, 363, 2446, 9867, 30004, 13, 3986, 12965, 2433, 3403, 4695, 4597, 23881, 23592, 13, 3986, 4036, 29918, 3859, 29922, 29900, 1125, 29871, 396, 1347, 29901, 12965, 946, 417, 30004, 13, 30004, 13, 1678, 330, 29896, 353, 4489, 15625, 2176, 1839, 6154, 17321, 1001, 2033, 1275, 474, 29897, 669, 313, 30004, 13, 9651, 4489, 1839, 24705, 2033, 1275, 263, 29897, 669, 313, 2176, 1839, 29940, 12194, 29918, 6154, 17321, 1001, 2033, 1275, 274, 4638, 30004, 13, 1678, 330, 29906, 353, 4489, 15625, 2176, 1839, 6154, 17321, 1001, 2033, 1275, 474, 29897, 669, 313, 30004, 13, 9651, 4489, 1839, 24705, 2033, 1275, 263, 29897, 669, 313, 2176, 1839, 29940, 12194, 29918, 6154, 17321, 1001, 2033, 2804, 274, 29897, 669, 313, 30004, 13, 462, 1678, 4489, 1839, 29940, 12194, 29918, 6154, 17321, 1001, 2033, 2804, 525, 8516, 1495, 29962, 30004, 13, 1678, 330, 29941, 353, 4489, 15625, 2176, 1839, 6154, 17321, 1001, 2033, 1275, 474, 29897, 669, 313, 30004, 13, 9651, 5135, 2176, 1839, 24705, 2033, 1275, 263, 29897, 669, 313, 2176, 1839, 29940, 12194, 29918, 6154, 17321, 1001, 2033, 1275, 525, 8516, 8785, 891, 313, 30004, 13, 462, 1678, 4489, 1839, 24705, 2033, 2804, 263, 28166, 30004, 13, 1678, 6471, 353, 518, 29887, 29896, 29892, 330, 29906, 29892, 330, 29941, 29962, 30004, 13, 1678, 848, 353, 6571, 30004, 13, 30004, 13, 1678, 363, 432, 297, 3464, 29898, 2435, 29898, 13155, 22164, 30004, 13, 30004, 13, 4706, 270, 353, 10518, 29889, 17271, 29898, 13155, 29961, 29926, 1822, 309, 542, 7503, 29892, 29871, 29906, 29901, 29906, 29974, 29886, 22100, 1822, 5975, 29889, 25027, 391, 3101, 30004, 13, 30004, 13, 4706, 848, 29961, 29926, 29962, 353, 270, 30004, 13, 30004, 13, 1678, 848, 29961, 29900, 1822, 7851, 29898, 1272, 29961, 29900, 1822, 12181, 29961, 29896, 1402, 376, 26284, 613, 7442, 29889, 3298, 359, 29898, 1272, 29961, 29900, 1822, 12181, 29961, 29900, 12622, 30004, 13, 1678, 848, 29961, 29896, 1822, 7851, 29898, 1272, 29961, 29896, 1822, 12181, 29961, 29896, 1402, 376, 26284, 613, 7442, 29889, 2873, 29898, 1272, 29961, 29896, 1822, 12181, 29961, 29900, 12622, 30004, 13, 30004, 13, 1678, 6694, 353, 10518, 29889, 17685, 4197, 1272, 29961, 29900, 1402, 848, 29961, 29896, 24960, 30004, 13, 30004, 13, 1678, 534, 29918, 29990, 353, 6694, 29889, 2029, 7503, 29892, 3695, 29898, 26495, 29889, 13099, 1275, 376, 26284, 13531, 30004, 13, 1678, 534, 29918, 29891, 353, 6694, 29889, 2029, 7503, 29892, 376, 26284, 3108, 30004, 13, 30004, 13, 1678, 565, 12965, 1275, 525, 3403, 4695, 4597, 23881, 2396, 30004, 13, 4706, 286, 353, 4522, 4695, 4597, 23881, 29898, 2929, 369, 2433, 1982, 10660, 742, 4036, 29918, 3859, 29922, 8172, 29918, 3859, 8443, 13, 1678, 25342, 12965, 1275, 525, 3403, 4695, 4597, 23881, 15633, 2396, 30004, 13, 4706, 286, 353, 4522, 4695, 4597, 23881, 15633, 29898, 8172, 29918, 3859, 29922, 8172, 29918, 3859, 8443, 13, 1678, 25342, 12965, 1275, 525, 6185, 2459, 9643, 2385, 3709, 2396, 30004, 13, 4706, 286, 353, 3826, 2459, 9643, 2385, 3709, 29898, 8172, 29918, 3859, 29922, 8172, 29918, 3859, 8443, 13, 1678, 25342, 12965, 1275, 525, 17875, 2831, 342, 2385, 3709, 2396, 30004, 13, 4706, 286, 353, 16968, 2831, 342, 2385, 3709, 29898, 8172, 29918, 3859, 29922, 8172, 29918, 3859, 8443, 13, 1678, 25342, 12965, 1275, 525, 29990, 7210, 2385, 3709, 2396, 30004, 13, 4706, 286, 353, 1060, 7210, 2385, 3709, 29898, 8172, 29918, 3859, 29922, 8172, 29918, 3859, 8443, 13, 30004, 13, 1678, 1683, 29901, 30004, 13, 4706, 286, 353, 4522, 4695, 4597, 23881, 29898, 2929, 369, 2433, 1982, 10660, 1495, 30004, 13, 30004, 13, 1678, 286, 29889, 9202, 29898, 509, 29918, 29990, 29892, 534, 29918, 29891, 29889, 5975, 29889, 336, 955, 3101, 30004, 13, 30004, 13, 1678, 18999, 353, 330, 29906, 29889, 2248, 29889, 5975, 30004, 13, 30004, 13, 1678, 1243, 29918, 29990, 353, 848, 29961, 29906, 29962, 30004, 13, 1678, 565, 7431, 29898, 1688, 29918, 29990, 29897, 2804, 29871, 29900, 29901, 30004, 13, 4706, 612, 353, 286, 29889, 27711, 29898, 1688, 29918, 29990, 8443, 13, 4706, 330, 29941, 29889, 7851, 29898, 29887, 29941, 29889, 12181, 29961, 29896, 1402, 376, 26284, 613, 612, 8443, 13, 4706, 1178, 29906, 353, 330, 29941, 29889, 2029, 29961, 29887, 29941, 3366, 26284, 3108, 1275, 29871, 29896, 1822, 2248, 29889, 5975, 30004, 13, 4706, 18999, 353, 7442, 29889, 535, 29883, 2579, 403, 3552, 4841, 29892, 1178, 29906, 876, 30004, 13, 30004, 13, 1678, 4489, 29889, 2029, 29961, 2176, 29889, 2248, 29889, 275, 262, 29898, 4841, 511, 525, 6154, 17321, 1001, 2033, 353, 413, 30004, 13, 1678, 716, 4841, 353, 18999, 29899, 29896, 30004, 13, 1678, 4489, 29889, 2029, 15625, 2176, 29889, 2248, 29889, 275, 262, 29898, 1482, 4841, 876, 669, 313, 2176, 1839, 1367, 2033, 1360, 4489, 1839, 1367, 13359, 10889, 6278, 29896, 8243, 525, 29940, 12194, 29918, 6154, 17321, 1001, 2033, 353, 413, 30004, 13, 30004, 13, 1678, 736, 4489, 30004, 13, 30004, 13, 30004, 13, 29937, 313, 5773, 29925, 18016, 1367, 3725, 1718, 3210, 383, 28700, 8443, 13, 29937, 317, 572, 5367, 740, 515, 278, 341, 11191, 6509, 5687, 30004, 13, 1753, 6219, 357, 29898, 2176, 29892, 29871, 396, 11701, 848, 4308, 30004, 13, 632, 8820, 11167, 13, 632, 282, 22100, 29892, 29871, 396, 6043, 29901, 1353, 310, 5680, 30004, 13, 632, 266, 29892, 29871, 396, 6043, 29901, 16897, 363, 9212, 6219, 30004, 13, 632, 4489, 29918, 1688, 29922, 8516, 11167, 13, 632, 6724, 29922, 8824, 11167, 13, 632, 12965, 2433, 3403, 4695, 4597, 23881, 742, 29871, 396, 1347, 29901, 12965, 3093, 30004, 13, 632, 372, 29922, 29953, 29892, 29871, 396, 6043, 29901, 4236, 1353, 310, 24554, 30004, 13, 632, 298, 29922, 29945, 11167, 13, 632, 10604, 21979, 29922, 29896, 11167, 13, 632, 302, 10457, 29896, 11167, 13, 632, 4036, 29918, 3859, 29922, 29900, 11167, 13, 632, 6492, 29922, 8824, 11167, 13, 632, 4078, 29922, 8824, 11167, 13, 632, 4078, 2084, 29922, 8516, 1125, 29871, 396, 3644, 591, 6492, 1059, 30004, 13, 1678, 396, 2847, 5281, 8857, 363, 1059, 669, 13600, 848, 30004, 13, 1678, 6694, 29918, 29934, 29906, 353, 5159, 30004, 13, 1678, 6724, 29918, 29934, 29906, 353, 5159, 30004, 13, 1678, 396, 6694, 29918, 5753, 353, 5159, 30004, 13, 1678, 396, 6724, 29918, 5753, 353, 5159, 30004, 13, 1678, 6724, 29918, 2704, 353, 5159, 30004, 13, 1678, 6694, 29918, 2704, 353, 5159, 30004, 13, 1678, 413, 353, 4489, 1839, 6154, 17321, 1001, 13359, 29876, 13092, 580, 396, 11228, 1353, 310, 24554, 30004, 13, 1678, 302, 29883, 353, 413, 30004, 13, 1678, 4489, 29918, 1482, 353, 6483, 8552, 29898, 2176, 8443, 13, 30004, 13, 1678, 396, 21605, 6728, 2594, 9072, 489, 30004, 13, 1678, 565, 10604, 21979, 6736, 29871, 29896, 29901, 30004, 13, 4706, 6219, 29918, 1646, 353, 260, 29939, 18933, 29898, 3881, 29898, 277, 29899, 29895, 876, 30004, 13, 1678, 1683, 29901, 30004, 13, 4706, 6219, 29918, 1646, 353, 3464, 29898, 277, 29899, 29895, 8443, 13, 1678, 396, 6219, 29918, 1646, 29889, 842, 29918, 8216, 703, 29903, 572, 5367, 856, 1159, 30004, 13, 1678, 396, 21605, 6728, 2594, 9072, 489, 30004, 13, 1678, 363, 474, 297, 6219, 29918, 1646, 29901, 30004, 13, 4706, 396, 6219, 29918, 1646, 29889, 842, 29918, 8216, 703, 29903, 572, 5367, 856, 891, 29937, 6821, 504, 414, 16664, 29879, 29908, 1273, 29898, 17608, 876, 30004, 13, 4706, 640, 353, 7700, 30004, 13, 4706, 274, 29892, 263, 353, 1284, 1168, 29576, 2463, 29898, 2176, 29918, 1482, 29892, 266, 8443, 13, 4706, 396, 1596, 877, 13463, 362, 742, 29875, 29974, 29896, 29892, 525, 29989, 396, 6821, 504, 414, 29922, 742, 17608, 29974, 29896, 29892, 525, 2683, 1378, 1495, 30004, 13, 4706, 565, 274, 2804, 448, 29896, 29901, 30004, 13, 9651, 396, 361, 10604, 21979, 1275, 29871, 29896, 29901, 30004, 13, 18884, 396, 2158, 877, 6821, 5402, 10576, 1495, 30004, 13, 18884, 396, 2158, 29898, 2176, 29918, 1482, 29889, 27789, 29898, 30004, 13, 462, 9651, 396, 1839, 6154, 17321, 1001, 742, 525, 29949, 29954, 29918, 6154, 17321, 1001, 11287, 1839, 24705, 13359, 2798, 3101, 30004, 13, 30004, 13, 9651, 396, 9138, 27877, 1080, 322, 24368, 30004, 13, 9651, 263, 29892, 289, 353, 23949, 29898, 2176, 29918, 1482, 29892, 274, 29892, 263, 8443, 13, 30004, 13, 9651, 396, 565, 10604, 21979, 1275, 29871, 29896, 29901, 30004, 13, 18884, 396, 1596, 877, 6821, 5402, 8536, 4430, 742, 274, 5501, 29989, 9123, 10805, 23949, 29901, 742, 263, 29892, 525, 29989, 2233, 5402, 1556, 3161, 3512, 304, 29901, 742, 289, 8443, 13, 9651, 4489, 29918, 1482, 353, 6219, 29898, 2176, 29918, 1482, 29892, 274, 29892, 263, 29892, 289, 29892, 282, 22100, 29892, 302, 29883, 29892, 12965, 29892, 4036, 29918, 3859, 29922, 8172, 29918, 3859, 8443, 13, 30004, 13, 9651, 396, 1059, 322, 13600, 17203, 30004, 13, 30004, 13, 9651, 390, 29906, 29918, 14968, 353, 390, 29906, 29918, 1767, 29918, 26495, 29898, 2176, 29918, 1482, 29892, 8820, 29922, 7387, 29892, 282, 22100, 29922, 29886, 22100, 29892, 302, 29918, 19594, 29922, 17608, 29974, 29896, 29892, 4866, 29922, 5574, 29892, 10604, 21979, 29922, 6466, 21979, 8443, 13, 30004, 13, 9651, 565, 6724, 29901, 30004, 13, 18884, 396, 1904, 353, 8500, 29918, 19594, 29898, 2176, 29918, 1482, 29892, 282, 22100, 8443, 13, 18884, 1904, 353, 6213, 30004, 13, 18884, 390, 29906, 29918, 1688, 353, 390, 29906, 29918, 1767, 29918, 13424, 29898, 2176, 29918, 1688, 29892, 4489, 29918, 1482, 29892, 1904, 29892, 282, 22100, 29892, 8820, 29922, 7387, 29892, 302, 29918, 19594, 29922, 17608, 29974, 29896, 29892, 10604, 21979, 29922, 6466, 21979, 8443, 13, 18884, 1243, 29918, 2704, 353, 6724, 29918, 1767, 29918, 2704, 29898, 2176, 29918, 1688, 29889, 8552, 3285, 4489, 29918, 1482, 29892, 1904, 11167, 13, 462, 462, 462, 8820, 29922, 7387, 11167, 13, 462, 462, 462, 282, 22100, 29922, 29886, 22100, 29892, 302, 29918, 19594, 29922, 17608, 29974, 29896, 11167, 13, 462, 462, 462, 6198, 29922, 5574, 29892, 298, 29922, 29882, 11167, 13, 462, 462, 462, 10604, 21979, 29922, 6466, 21979, 8443, 13, 18884, 6724, 29918, 29934, 29906, 29889, 4397, 29898, 29934, 29906, 29918, 1688, 8443, 13, 18884, 6724, 29918, 2704, 29889, 4397, 29898, 1688, 29918, 2704, 8443, 13, 9651, 396, 7945, 29918, 5753, 353, 6694, 29918, 562, 2764, 4135, 29898, 2176, 29918, 1482, 9601, 29900, 29962, 30004, 13, 9651, 396, 1243, 29918, 5753, 353, 6724, 29918, 562, 2764, 4135, 29898, 2176, 29918, 1688, 29892, 4489, 29918, 1482, 29892, 1904, 29892, 282, 22100, 9601, 29900, 29962, 30004, 13, 9651, 349, 29918, 2176, 29892, 29934, 29918, 2176, 353, 679, 29918, 5773, 29925, 29898, 2176, 29918, 1482, 29892, 4866, 29922, 5574, 29892, 8820, 29922, 7387, 29892, 282, 22100, 29922, 29886, 22100, 11167, 13, 462, 18884, 302, 29918, 19594, 29922, 17608, 29974, 29896, 29892, 29871, 10604, 21979, 29922, 29900, 8443, 13, 9651, 7945, 29918, 2704, 353, 6694, 29918, 1767, 29918, 2704, 29898, 2176, 29918, 1482, 29892, 349, 29918, 2176, 29922, 29925, 29918, 2176, 29892, 390, 29918, 2176, 29922, 29934, 29918, 2176, 29892, 6198, 29922, 5574, 29892, 298, 29922, 29882, 29892, 10604, 21979, 29922, 6466, 21979, 8443, 13, 9651, 6694, 29918, 29934, 29906, 29889, 4397, 29898, 29934, 29906, 29918, 14968, 8443, 13, 9651, 6694, 29918, 2704, 29889, 4397, 29898, 14968, 29918, 2704, 8443, 13, 9651, 396, 6694, 29918, 5753, 29889, 4397, 29898, 14968, 29918, 5753, 8443, 13, 9651, 396, 6724, 29918, 5753, 29889, 4397, 29898, 1688, 29918, 5753, 8443, 13, 30004, 13, 9651, 396, 14010, 1059, 322, 13600, 1819, 30004, 13, 9651, 396, 565, 10604, 21979, 1275, 29871, 29896, 29901, 30004, 13, 9651, 396, 259, 1596, 877, 26495, 995, 390, 29906, 29901, 742, 390, 29906, 29918, 14968, 8443, 13, 9651, 396, 259, 1596, 877, 26495, 13600, 29901, 742, 7945, 29918, 5753, 8443, 13, 9651, 396, 259, 1596, 877, 13424, 13600, 29901, 742, 1243, 29918, 5753, 8443, 13, 9651, 396, 259, 1596, 877, 26495, 995, 1059, 29901, 742, 7945, 29918, 2704, 8443, 13, 9651, 396, 259, 565, 6724, 29901, 30004, 13, 9651, 396, 539, 1596, 877, 13424, 995, 390, 29906, 29901, 742, 390, 29906, 29918, 1688, 8443, 13, 9651, 396, 539, 1596, 877, 13424, 995, 1059, 29901, 742, 1243, 29918, 2704, 8443, 13, 9651, 396, 1596, 877, 27711, 1080, 29901, 742, 679, 29918, 27711, 1080, 29898, 2176, 29918, 1482, 876, 30004, 13, 9651, 396, 1596, 29898, 2176, 29918, 1482, 29889, 2813, 3101, 30004, 13, 9651, 640, 353, 5852, 30004, 13, 9651, 302, 29883, 4619, 29871, 29896, 30004, 13, 4706, 565, 451, 640, 29901, 30004, 13, 9651, 2867, 30004, 13, 4706, 565, 302, 29883, 6736, 372, 29901, 30004, 13, 9651, 2867, 30004, 13, 1678, 396, 565, 10604, 21979, 1275, 29871, 29896, 29901, 30004, 13, 1678, 396, 259, 1596, 29898, 2176, 29918, 1482, 29889, 27789, 18959, 6154, 17321, 1001, 742, 525, 29949, 29954, 29918, 6154, 17321, 1001, 11287, 1839, 24705, 13359, 2798, 3101, 30004, 13, 30004, 13, 1678, 396, 6492, 1259, 3168, 30004, 13, 1678, 396, 18399, 1259, 13600, 322, 995, 390, 29906, 30004, 13, 1678, 396, 1678, 2537, 29896, 29892, 4853, 29896, 353, 14770, 29889, 1491, 26762, 26471, 13, 1678, 967, 353, 7442, 29889, 279, 927, 29898, 29895, 29974, 29896, 29892, 302, 29883, 29974, 29896, 8443, 13, 1678, 396, 1678, 4853, 29896, 29889, 5317, 29898, 1169, 29892, 6694, 29918, 29934, 29906, 29892, 3858, 29922, 376, 5323, 2827, 390, 29906, 1159, 30004, 13, 1678, 396, 1678, 565, 6724, 29901, 30004, 13, 1678, 396, 4706, 4853, 29896, 29889, 5317, 29898, 1169, 29892, 6724, 29918, 29934, 29906, 29892, 3858, 353, 376, 3057, 292, 390, 29906, 1159, 30004, 13, 1678, 396, 1678, 396, 1165, 29896, 29889, 5317, 29898, 1169, 29892, 6694, 29918, 5753, 29892, 3858, 353, 376, 5323, 2827, 4831, 332, 4135, 1159, 30004, 13, 1678, 396, 1678, 396, 1165, 29896, 29889, 5317, 29898, 1169, 29892, 6724, 29918, 5753, 29892, 3858, 353, 376, 3057, 292, 4831, 332, 4135, 1159, 30004, 13, 1678, 396, 1678, 565, 302, 29958, 29900, 29901, 30004, 13, 1678, 396, 4706, 4853, 29896, 29889, 1165, 29894, 1220, 29898, 29916, 29922, 29876, 29892, 1915, 342, 1508, 2433, 489, 742, 2780, 2433, 29878, 1495, 396, 20867, 1259, 11408, 1196, 472, 396, 19594, 353, 29876, 30004, 13, 1678, 396, 1678, 4853, 29896, 29889, 842, 29918, 29891, 2576, 29898, 29900, 29892, 29896, 8443, 13, 1678, 396, 1678, 4853, 29896, 29889, 842, 29918, 29916, 1643, 14237, 310, 2233, 504, 414, 1495, 30004, 13, 1678, 396, 1678, 4853, 29896, 29889, 842, 29918, 29891, 1643, 877, 29934, 29906, 470, 4831, 332, 4135, 1273, 1495, 30004, 13, 1678, 396, 1678, 4853, 29896, 29889, 842, 29918, 3257, 877, 29934, 29906, 322, 4831, 332, 4135, 7133, 317, 572, 5367, 1495, 30004, 13, 1678, 396, 1678, 4853, 29896, 29889, 26172, 26471, 13, 30004, 13, 1678, 396, 18399, 1259, 995, 1059, 382, 3552, 29894, 29918, 342, 448, 325, 29918, 3009, 4887, 29906, 29897, 15842, 19937, 29901, 6492, 1259, 341, 3301, 29923, 30004, 13, 1678, 396, 363, 6694, 30004, 13, 1678, 565, 6492, 29901, 30004, 13, 4706, 2537, 29906, 29892, 4853, 29906, 353, 14770, 29889, 1491, 26762, 26471, 13, 4706, 4853, 29906, 29889, 5317, 29898, 1169, 29892, 6694, 29918, 2704, 29892, 3858, 543, 5323, 2827, 4829, 1159, 30004, 13, 4706, 565, 6724, 29901, 30004, 13, 9651, 4853, 29906, 29889, 5317, 29898, 1169, 29892, 6724, 29918, 2704, 29892, 3858, 543, 3057, 292, 4829, 1159, 30004, 13, 4706, 565, 302, 1405, 29871, 29900, 29901, 30004, 13, 9651, 4853, 29906, 29889, 1165, 29894, 1220, 29898, 29916, 29922, 29876, 29892, 6276, 342, 1508, 2433, 489, 742, 2927, 2433, 29878, 1495, 396, 20867, 1259, 11408, 1196, 472, 396, 19594, 353, 29876, 30004, 13, 4706, 4853, 29906, 29889, 842, 29918, 29891, 2576, 29898, 29900, 8443, 13, 4706, 4853, 29906, 29889, 842, 29918, 29916, 1643, 14237, 310, 2233, 504, 414, 1495, 30004, 13, 4706, 4853, 29906, 29889, 842, 29918, 29891, 1643, 877, 29907, 2129, 341, 3301, 29923, 1059, 1495, 30004, 13, 4706, 4853, 29906, 29889, 842, 29918, 3257, 877, 1529, 4162, 1059, 491, 1353, 310, 24554, 1495, 30004, 13, 4706, 4853, 29906, 29889, 26172, 26471, 13, 4706, 565, 4078, 29901, 30004, 13, 9651, 14770, 29889, 7620, 1003, 29898, 7620, 2084, 8443, 13, 4706, 565, 10604, 21979, 6736, 29871, 29906, 29901, 30004, 13, 9651, 14770, 29889, 4294, 29898, 1271, 29922, 8824, 8443, 13, 4706, 1683, 29901, 30004, 13, 9651, 14770, 29889, 5358, 26471, 13, 30004, 13, 1678, 4489, 29918, 14968, 29918, 2704, 353, 10518, 29889, 17271, 29898, 1761, 29898, 7554, 29898, 1169, 29892, 6694, 29918, 2704, 8243, 320, 30004, 13, 462, 462, 29871, 4341, 29922, 1839, 6821, 504, 414, 742, 525, 2392, 2033, 8443, 13, 1678, 565, 6724, 29901, 30004, 13, 4706, 4489, 29918, 1688, 29918, 2704, 353, 10518, 29889, 17271, 29898, 1761, 29898, 7554, 29898, 1169, 29892, 6724, 29918, 2704, 8243, 320, 30004, 13, 462, 462, 29871, 4341, 29922, 1839, 6821, 504, 414, 742, 525, 2392, 2033, 8443, 13, 4706, 736, 4489, 29918, 1482, 29892, 4489, 29918, 14968, 29918, 2704, 29892, 4489, 29918, 1688, 29918, 2704, 30004, 13, 30004, 13, 1678, 736, 4489, 29918, 1482, 29892, 6694, 29918, 2704, 29892, 6724, 29918, 2704, 30004, 13, 30004, 13, 30004, 13, 29937, 313, 5773, 29925, 383, 28700, 8443, 13, 29937, 383, 5367, 740, 363, 263, 2323, 900, 29881, 11167, 13, 1753, 6216, 29918, 11023, 29918, 8771, 29898, 5451, 29918, 13140, 11167, 13, 18884, 4489, 11167, 13, 18884, 16993, 3241, 11167, 13, 18884, 302, 29918, 695, 504, 414, 11167, 13, 18884, 16993, 3241, 29918, 19244, 29918, 386, 12268, 11167, 13, 18884, 282, 22100, 11167, 13, 18884, 8820, 11167, 13, 18884, 24368, 29918, 386, 12268, 11167, 13, 18884, 12965, 11167, 13, 18884, 302, 29918, 1524, 11167, 13, 18884, 28205, 11167, 13, 18884, 302, 11167, 13, 18884, 10604, 21979, 29922, 29900, 11167, 13, 18884, 4036, 29918, 3859, 29922, 29896, 29906, 29941, 29946, 11167, 13, 18884, 4464, 543, 1367, 15231, 13, 18884, 4078, 29922, 8824, 11167, 13, 18884, 4078, 2084, 543, 15231, 13, 18884, 6492, 29922, 8824, 1125, 30004, 13, 30004, 13, 1678, 565, 4464, 1275, 376, 9818, 1115, 30004, 13, 30004, 13, 4706, 22645, 29892, 313, 14968, 29918, 13140, 29892, 1243, 29918, 13140, 29897, 353, 6219, 29918, 13140, 29871, 396, 7945, 29918, 13140, 29892, 903, 353, 6219, 29918, 13140, 29871, 847, 17117, 7945, 29918, 13140, 353, 6219, 29918, 13140, 30004, 13, 4706, 4489, 29918, 1688, 353, 4489, 29889, 2029, 29961, 14968, 29918, 13140, 1822, 27789, 703, 1367, 2564, 18237, 29898, 2015, 18162, 467, 12071, 29918, 2248, 29898, 8865, 29922, 5574, 467, 8552, 26471, 13, 4706, 4489, 29918, 14968, 353, 4489, 29889, 2029, 29961, 14968, 29918, 13140, 1822, 27789, 703, 1367, 2564, 7302, 29898, 2892, 921, 29901, 921, 29889, 2813, 6278, 2015, 18162, 8106, 12071, 29918, 2248, 29898, 8865, 29922, 5574, 467, 8552, 26471, 13, 30004, 13, 1678, 25342, 4464, 1275, 376, 15307, 29918, 15633, 1115, 30004, 13, 30004, 13, 4706, 22645, 29892, 313, 14968, 29918, 13140, 29892, 1243, 29918, 13140, 29897, 353, 6219, 29918, 13140, 30004, 13, 4706, 4489, 29918, 14968, 353, 10518, 29889, 17685, 29898, 30004, 13, 9651, 518, 2176, 29889, 2029, 29961, 14968, 29918, 13140, 1402, 30004, 13, 632, 4489, 29889, 2029, 29961, 1688, 29918, 13140, 1822, 27789, 703, 1367, 2564, 7302, 29898, 2892, 921, 29901, 921, 29889, 2813, 6278, 2015, 18162, 8106, 12071, 29918, 2248, 29898, 8865, 29922, 5574, 4638, 30004, 13, 4706, 13742, 8552, 2141, 12071, 29918, 2248, 29898, 8865, 29922, 5574, 8443, 13, 4706, 4489, 29918, 1688, 353, 4489, 29889, 2029, 29961, 1688, 29918, 13140, 1822, 27789, 703, 1367, 2564, 18237, 29898, 2015, 18162, 467, 12071, 29918, 2248, 29898, 8865, 29922, 5574, 467, 8552, 26471, 13, 30004, 13, 1678, 25342, 4464, 1275, 376, 1367, 1115, 30004, 13, 30004, 13, 4706, 22645, 29892, 313, 14968, 29918, 13140, 29892, 1243, 29918, 13140, 29897, 353, 6219, 29918, 13140, 30004, 13, 4706, 4489, 29918, 14968, 353, 4489, 29889, 2029, 29961, 14968, 29918, 13140, 1822, 8552, 26471, 13, 4706, 4489, 29918, 1688, 353, 4489, 29889, 2029, 29961, 1688, 29918, 13140, 1822, 8552, 26471, 13, 30004, 13, 1678, 1683, 29901, 30004, 13, 4706, 565, 10604, 21979, 6736, 29871, 29896, 29901, 30004, 13, 9651, 1596, 703, 5323, 2827, 2392, 584, 525, 8513, 29915, 1818, 367, 263, 1347, 584, 2845, 525, 15307, 742, 525, 9818, 29915, 470, 525, 1367, 29915, 376, 8443, 13, 4706, 12020, 341, 11191, 5323, 2827, 2392, 30004, 13, 30004, 13, 1678, 835, 13383, 13383, 13383, 7346, 4136, 2277, 30004, 13, 1678, 396, 25455, 2233, 504, 414, 30004, 13, 1678, 4489, 29918, 14968, 353, 11905, 6821, 504, 414, 29898, 2176, 29918, 14968, 11167, 13, 462, 462, 29871, 16993, 3241, 29922, 695, 504, 3241, 11167, 13, 462, 462, 29871, 302, 29918, 695, 504, 414, 29922, 29876, 29918, 695, 504, 414, 11167, 13, 462, 462, 29871, 5418, 29918, 386, 12268, 29922, 695, 504, 3241, 29918, 19244, 29918, 386, 12268, 11167, 13, 462, 462, 29871, 4036, 29918, 3859, 29922, 8172, 29918, 3859, 8443, 13, 1678, 396, 413, 353, 4489, 29918, 14968, 1839, 6154, 17321, 1001, 13359, 29876, 13092, 26471, 13, 1678, 835, 13383, 13383, 13383, 7346, 4136, 2277, 30004, 13, 30004, 13, 1678, 835, 13383, 13383, 13383, 7346, 4136, 2277, 30004, 13, 1678, 396, 7525, 20504, 1230, 29257, 29068, 30004, 13, 30004, 13, 1678, 4489, 29918, 14968, 29892, 6694, 29918, 2704, 29892, 6724, 29918, 2704, 353, 6219, 357, 29898, 2176, 29918, 14968, 11167, 13, 462, 462, 462, 539, 8820, 29922, 7387, 11167, 13, 462, 462, 462, 539, 282, 22100, 29922, 29886, 22100, 11167, 13, 462, 462, 462, 539, 266, 29922, 23579, 5367, 29918, 386, 12268, 11167, 13, 462, 462, 462, 539, 4489, 29918, 1688, 29922, 2176, 29918, 1688, 11167, 13, 462, 462, 462, 539, 6724, 29922, 5574, 11167, 13, 462, 462, 462, 539, 12965, 29922, 1990, 2450, 11167, 13, 462, 462, 462, 539, 372, 29922, 29876, 29918, 1524, 11167, 13, 462, 462, 462, 539, 298, 29922, 2015, 18162, 11167, 13, 462, 462, 462, 539, 10604, 21979, 29922, 6466, 21979, 11167, 13, 462, 462, 462, 539, 302, 29922, 29876, 11167, 13, 462, 462, 462, 539, 4036, 29918, 3859, 29922, 8172, 29918, 3859, 11167, 13, 462, 462, 462, 539, 6492, 29922, 5317, 11167, 13, 462, 462, 462, 539, 4078, 29922, 7620, 11167, 13, 462, 462, 462, 539, 4078, 2084, 29922, 359, 29889, 2084, 29889, 7122, 29898, 7620, 2084, 29892, 376, 5317, 648, 1836, 29925, 9312, 1642, 4830, 29898, 13140, 4961, 30004, 13, 30004, 13, 1678, 286, 353, 8500, 29918, 19594, 29898, 2176, 29918, 14968, 29892, 282, 22100, 8443, 13, 1678, 1018, 29901, 30004, 13, 4706, 4489, 29918, 3127, 29892, 382, 29918, 29894, 353, 1059, 29918, 546, 29918, 1367, 29898, 2176, 29918, 1688, 29922, 2176, 29918, 1688, 29892, 4489, 29918, 1482, 29922, 2176, 29918, 14968, 29892, 1904, 29922, 29885, 29892, 8820, 29922, 7387, 29892, 302, 29918, 19594, 29922, 29876, 29918, 695, 504, 414, 11167, 13, 462, 462, 259, 282, 22100, 29922, 29886, 22100, 29892, 6198, 29922, 5574, 29892, 298, 29922, 2015, 18162, 29892, 10604, 21979, 29922, 6466, 21979, 8443, 13, 1678, 5174, 29901, 30004, 13, 4706, 4489, 29918, 3127, 29892, 382, 29918, 29894, 353, 6213, 29892, 6213, 30004, 13, 1678, 736, 6724, 29918, 2704, 29892, 6694, 29918, 2704, 29892, 4489, 29918, 3127, 29892, 382, 29918, 29894, 30004, 13, 2 ]
notebooks/run_pipeline.py
BenAjayiObe/cvd19-truth-finder
0
86302
import torch import argparse import code import prettytable from termcolor import colored from drqa import pipeline from drqa.retriever import utils # ------------------------------------------------------------------------------ # Drop in to interactive mode # ------------------------------------------------------------------------------ def process(question, candidates=None, top_n=1, n_docs=5): predictions = DrQA.process( question, candidates, top_n, n_docs, return_context=True ) table = prettytable.PrettyTable( ['Rank', 'Answer', 'Doc', 'Answer Score', 'Doc Score'] ) for i, p in enumerate(predictions, 1): table.add_row([i, p['span'], p['doc_id'], '%.5g' % p['span_score'], '%.5g' % p['doc_score']]) print('Top Predictions:') print(table) print('\nContexts:') for p in predictions: text = p['context']['text'] start = p['context']['start'] end = p['context']['end'] output = (text[:start] + colored(text[start: end], 'green', attrs=['bold']) + text[end:]) print('[ Doc = %s ]' % p['doc_id']) print(output + '\n') if __name__ == '__main__': # Arguments # args_reader_model="/home/ubuntu/cvd19-truth-finder/data/covid19/model/20200509-c9d21e14.mdl" # args_retriever_model="/home/ubuntu/cvd19-truth-finder/data/covid19/doc_ranker/doc-tfidf-ngram=2-hash=16777216-tokenizer=simple.npz" # args_doc_db="/home/ubuntu/cvd19-truth-finder/data/covid19/doc-db/doc.db" # args_tokenizer="spacy" # args_candidate_file=None # args_no_cuda=True # args_gpu=-1 args_reader_model="../data/covid19/model/20200509-c9d21e14.mdl" args_retriever_model="../data/covid19/full_doc_ranker/full_doc-tfidf-ngram=2-hash=16777216-tokenizer=simple.npz" args_doc_db="../data/covid19/doc-db/full_doc.db" args_tokenizer="spacy" args_candidate_file=None args_no_cuda=True args_gpu=-1 args_cuda = not args_no_cuda and torch.cuda.is_available() if args_cuda: torch.cuda.set_device(args_gpu) if args_candidate_file: candidates = set() with open(args_candidate_file) as f: for line in f: line = utils.normalize(line.strip()).lower() candidates.add(line) else: candidates = None DrQA = pipeline.DrQA( cuda=args_cuda, fixed_candidates=candidates, reader_model=args_reader_model, ranker_config={'options': {'tfidf_path': args_retriever_model}}, db_config={'options': {'db_path': args_doc_db}}, tokenizer=args_tokenizer ) process("How many people are infected?", top_n=10)
[ 1, 1053, 4842, 305, 13, 5215, 1852, 5510, 13, 5215, 775, 13, 5215, 5051, 2371, 13, 13, 3166, 1840, 2780, 1053, 28684, 13, 3166, 4192, 25621, 1053, 16439, 13, 3166, 4192, 25621, 29889, 276, 509, 347, 369, 1053, 3667, 29879, 13, 13, 29937, 448, 2683, 2683, 2683, 2683, 9072, 29899, 13, 29937, 20724, 297, 304, 28923, 4464, 13, 29937, 448, 2683, 2683, 2683, 2683, 9072, 29899, 13, 13, 13, 1753, 1889, 29898, 12470, 29892, 21669, 29922, 8516, 29892, 2246, 29918, 29876, 29922, 29896, 29892, 302, 29918, 2640, 29922, 29945, 1125, 13, 1678, 27303, 353, 4942, 29984, 29909, 29889, 5014, 29898, 13, 4706, 1139, 29892, 21669, 29892, 2246, 29918, 29876, 29892, 302, 29918, 2640, 29892, 736, 29918, 4703, 29922, 5574, 13, 1678, 1723, 13, 1678, 1591, 353, 5051, 2371, 29889, 6572, 4349, 3562, 29898, 13, 4706, 6024, 29934, 804, 742, 525, 22550, 742, 525, 14526, 742, 525, 22550, 2522, 487, 742, 525, 14526, 2522, 487, 2033, 13, 1678, 1723, 13, 1678, 363, 474, 29892, 282, 297, 26985, 29898, 27711, 1080, 29892, 29871, 29896, 1125, 13, 4706, 1591, 29889, 1202, 29918, 798, 4197, 29875, 29892, 282, 1839, 9653, 7464, 282, 1839, 1514, 29918, 333, 7464, 13, 462, 539, 14210, 29889, 29945, 29887, 29915, 1273, 282, 1839, 9653, 29918, 13628, 7464, 13, 462, 539, 14210, 29889, 29945, 29887, 29915, 1273, 282, 1839, 1514, 29918, 13628, 2033, 2314, 13, 1678, 1596, 877, 7031, 21099, 919, 1080, 29901, 1495, 13, 1678, 1596, 29898, 2371, 29897, 13, 1678, 1596, 28909, 29876, 2677, 29879, 29901, 1495, 13, 1678, 363, 282, 297, 27303, 29901, 13, 4706, 1426, 353, 282, 1839, 4703, 16215, 726, 2033, 13, 4706, 1369, 353, 282, 1839, 4703, 16215, 2962, 2033, 13, 4706, 1095, 353, 282, 1839, 4703, 16215, 355, 2033, 13, 4706, 1962, 353, 313, 726, 7503, 2962, 29962, 718, 13, 462, 29871, 28684, 29898, 726, 29961, 2962, 29901, 1095, 1402, 525, 12692, 742, 12421, 29879, 29922, 1839, 8934, 11287, 718, 13, 462, 29871, 1426, 29961, 355, 29901, 2314, 13, 4706, 1596, 877, 29961, 28197, 353, 1273, 29879, 4514, 29915, 1273, 282, 1839, 1514, 29918, 333, 11287, 13, 4706, 1596, 29898, 4905, 718, 11297, 29876, 1495, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 396, 11842, 9331, 13, 1678, 396, 6389, 29918, 16950, 29918, 4299, 13802, 5184, 29914, 8767, 29914, 11023, 29881, 29896, 29929, 29899, 509, 2806, 29899, 2886, 261, 29914, 1272, 29914, 24542, 333, 29896, 29929, 29914, 4299, 29914, 29906, 29900, 29906, 29900, 29900, 29945, 29900, 29929, 29899, 29883, 29929, 29881, 29906, 29896, 29872, 29896, 29946, 29889, 3487, 29880, 29908, 13, 1678, 396, 6389, 29918, 276, 509, 347, 369, 29918, 4299, 13802, 5184, 29914, 8767, 29914, 11023, 29881, 29896, 29929, 29899, 509, 2806, 29899, 2886, 261, 29914, 1272, 29914, 24542, 333, 29896, 29929, 29914, 1514, 29918, 661, 3946, 29914, 1514, 29899, 13264, 333, 29888, 29899, 29876, 1393, 29922, 29906, 29899, 8568, 29922, 29896, 29953, 29955, 29955, 29955, 29906, 29896, 29953, 29899, 6979, 3950, 29922, 12857, 29889, 9302, 29920, 29908, 13, 1678, 396, 6389, 29918, 1514, 29918, 2585, 13802, 5184, 29914, 8767, 29914, 11023, 29881, 29896, 29929, 29899, 509, 2806, 29899, 2886, 261, 29914, 1272, 29914, 24542, 333, 29896, 29929, 29914, 1514, 29899, 2585, 29914, 1514, 29889, 2585, 29908, 13, 1678, 396, 6389, 29918, 6979, 3950, 543, 1028, 4135, 29908, 13, 1678, 396, 6389, 29918, 29883, 5380, 403, 29918, 1445, 29922, 8516, 13, 1678, 396, 6389, 29918, 1217, 29918, 29883, 6191, 29922, 5574, 13, 1678, 396, 6389, 29918, 29887, 3746, 10457, 29896, 13, 13, 1678, 6389, 29918, 16950, 29918, 4299, 543, 6995, 1272, 29914, 24542, 333, 29896, 29929, 29914, 4299, 29914, 29906, 29900, 29906, 29900, 29900, 29945, 29900, 29929, 29899, 29883, 29929, 29881, 29906, 29896, 29872, 29896, 29946, 29889, 3487, 29880, 29908, 13, 1678, 6389, 29918, 276, 509, 347, 369, 29918, 4299, 543, 6995, 1272, 29914, 24542, 333, 29896, 29929, 29914, 8159, 29918, 1514, 29918, 661, 3946, 29914, 8159, 29918, 1514, 29899, 13264, 333, 29888, 29899, 29876, 1393, 29922, 29906, 29899, 8568, 29922, 29896, 29953, 29955, 29955, 29955, 29906, 29896, 29953, 29899, 6979, 3950, 29922, 12857, 29889, 9302, 29920, 29908, 13, 1678, 6389, 29918, 1514, 29918, 2585, 543, 6995, 1272, 29914, 24542, 333, 29896, 29929, 29914, 1514, 29899, 2585, 29914, 8159, 29918, 1514, 29889, 2585, 29908, 13, 1678, 6389, 29918, 6979, 3950, 543, 1028, 4135, 29908, 13, 1678, 6389, 29918, 29883, 5380, 403, 29918, 1445, 29922, 8516, 13, 1678, 6389, 29918, 1217, 29918, 29883, 6191, 29922, 5574, 13, 1678, 6389, 29918, 29887, 3746, 10457, 29896, 13, 13, 1678, 6389, 29918, 29883, 6191, 353, 451, 6389, 29918, 1217, 29918, 29883, 6191, 322, 4842, 305, 29889, 29883, 6191, 29889, 275, 29918, 16515, 580, 13, 1678, 565, 6389, 29918, 29883, 6191, 29901, 13, 4706, 4842, 305, 29889, 29883, 6191, 29889, 842, 29918, 10141, 29898, 5085, 29918, 29887, 3746, 29897, 13, 13, 1678, 565, 6389, 29918, 29883, 5380, 403, 29918, 1445, 29901, 13, 4706, 21669, 353, 731, 580, 13, 4706, 411, 1722, 29898, 5085, 29918, 29883, 5380, 403, 29918, 1445, 29897, 408, 285, 29901, 13, 9651, 363, 1196, 297, 285, 29901, 13, 18884, 1196, 353, 3667, 29879, 29889, 8945, 675, 29898, 1220, 29889, 17010, 16655, 13609, 580, 13, 18884, 21669, 29889, 1202, 29898, 1220, 29897, 13, 1678, 1683, 29901, 13, 4706, 21669, 353, 6213, 13, 13, 1678, 4942, 29984, 29909, 353, 16439, 29889, 25639, 29984, 29909, 29898, 13, 4706, 274, 6191, 29922, 5085, 29918, 29883, 6191, 29892, 13, 4706, 4343, 29918, 29883, 5380, 1078, 29922, 29883, 5380, 1078, 29892, 13, 4706, 9591, 29918, 4299, 29922, 5085, 29918, 16950, 29918, 4299, 29892, 13, 4706, 7115, 261, 29918, 2917, 3790, 29915, 6768, 2396, 11117, 13264, 333, 29888, 29918, 2084, 2396, 6389, 29918, 276, 509, 347, 369, 29918, 4299, 11656, 13, 4706, 4833, 29918, 2917, 3790, 29915, 6768, 2396, 11117, 2585, 29918, 2084, 2396, 6389, 29918, 1514, 29918, 2585, 11656, 13, 4706, 5993, 3950, 29922, 5085, 29918, 6979, 3950, 13, 1678, 1723, 13, 13, 1678, 1889, 703, 5328, 1784, 2305, 526, 3041, 26458, 29973, 613, 2246, 29918, 29876, 29922, 29896, 29900, 29897, 2 ]
ctf/nsec/2018/crypto/RC8_crypto/test_captcha.py
Sylhare/Flag
0
143722
<reponame>Sylhare/Flag import os import nose import json import captcha def load_json_config(function): def test_case(): path = 'tests/templates/' for file in os.listdir(path): if file.rsplit('.', 1)[-1] == 'json': with open(path + file) as f: params = json.load(f) function(params) test_case.__name__ = function.__name__ return test_case @load_json_config def test_captcha_solver(params): path = params.get('samples') if path is None: return for file in os.listdir(path): image = captcha.image_filter(path + file, params) result = captcha.solve(image, params) assert ''.join(map(str, result)) == file.rsplit('.', 1)[0] @load_json_config def test_get_image_by_url(params): for i in range(3): image_data = captcha.fetch(params['url']) image = captcha.image_filter(image_data, params) result = captcha.solve(image, params) assert len(result) == params.get('length', 4) assert all(x is not None for x in result)
[ 1, 529, 276, 1112, 420, 29958, 29903, 2904, 29882, 598, 29914, 21979, 13, 5215, 2897, 13, 5215, 26414, 13, 5215, 4390, 13, 5215, 4332, 5815, 13, 13, 13, 1753, 2254, 29918, 3126, 29918, 2917, 29898, 2220, 1125, 13, 1678, 822, 1243, 29918, 4878, 7295, 13, 4706, 2224, 353, 525, 21150, 29914, 20943, 22208, 13, 4706, 363, 934, 297, 2897, 29889, 1761, 3972, 29898, 2084, 1125, 13, 9651, 565, 934, 29889, 2288, 2830, 12839, 742, 29871, 29896, 9601, 29899, 29896, 29962, 1275, 525, 3126, 2396, 13, 18884, 411, 1722, 29898, 2084, 718, 934, 29897, 408, 285, 29901, 13, 462, 1678, 8636, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 462, 1678, 740, 29898, 7529, 29897, 13, 1678, 1243, 29918, 4878, 17255, 978, 1649, 353, 740, 17255, 978, 1649, 13, 1678, 736, 1243, 29918, 4878, 13, 13, 13, 29992, 1359, 29918, 3126, 29918, 2917, 13, 1753, 1243, 29918, 17885, 5815, 29918, 2929, 369, 29898, 7529, 1125, 13, 1678, 2224, 353, 8636, 29889, 657, 877, 27736, 1495, 13, 1678, 565, 2224, 338, 6213, 29901, 13, 4706, 736, 13, 1678, 363, 934, 297, 2897, 29889, 1761, 3972, 29898, 2084, 1125, 13, 4706, 1967, 353, 4332, 5815, 29889, 3027, 29918, 4572, 29898, 2084, 718, 934, 29892, 8636, 29897, 13, 4706, 1121, 353, 4332, 5815, 29889, 2929, 345, 29898, 3027, 29892, 8636, 29897, 13, 4706, 4974, 525, 4286, 7122, 29898, 1958, 29898, 710, 29892, 1121, 876, 1275, 934, 29889, 2288, 2830, 12839, 742, 29871, 29896, 9601, 29900, 29962, 13, 13, 13, 29992, 1359, 29918, 3126, 29918, 2917, 13, 1753, 1243, 29918, 657, 29918, 3027, 29918, 1609, 29918, 2271, 29898, 7529, 1125, 13, 1678, 363, 474, 297, 3464, 29898, 29941, 1125, 13, 4706, 1967, 29918, 1272, 353, 4332, 5815, 29889, 9155, 29898, 7529, 1839, 2271, 11287, 13, 4706, 1967, 353, 4332, 5815, 29889, 3027, 29918, 4572, 29898, 3027, 29918, 1272, 29892, 8636, 29897, 13, 4706, 1121, 353, 4332, 5815, 29889, 2929, 345, 29898, 3027, 29892, 8636, 29897, 13, 4706, 4974, 7431, 29898, 2914, 29897, 1275, 8636, 29889, 657, 877, 2848, 742, 29871, 29946, 29897, 13, 4706, 4974, 599, 29898, 29916, 338, 451, 6213, 363, 921, 297, 1121, 29897, 13, 2 ]
dataset/test_dataset.py
gallupliu/QA
3
94665
# encoding: utf-8 """ @author: gallupliu @contact: <EMAIL> @version: 1.0 @license: Apache Licence @file: test_dataset.py @time: 2018/2/20 20:02 """ # import tensorflow as tf # # # sequences = [[1, 2, 3], [4, 5, 1], [1, 2]] # sequences = [["1", "2", "3"], ["4", "5", "1"], ["1", "2"]] # label_sequences = [[0, 1, 0], [1, 0, 0], [1, 1]] # # # def make_example(sequence, labels): # # The object we return # ex = tf.train.SequenceExample() # # A non-sequential feature of our example # sequence_length = len(sequence) # ex.context.feature["length"].int64_list.value.append(sequence_length) # # Feature lists for the two sequential features of our example # fl_tokens = ex.feature_lists.feature_list["tokens"] # fl_labels = ex.feature_lists.feature_list["labels"] # for token, label in zip(sequence, labels): # # fl_tokens.feature.add().int64_list.value.append(token) # fl_tokens.feature.add().bytes_list.value.append(token) # fl_labels.feature.add().int64_list.value.append(label) # return ex # # # # Write all examples into a TFRecords file # # with tempfile.NamedTemporaryFile() as fp: # # writer = tf.python_io.TFRecordWriter(fp.name) # # for sequence, label_sequence in zip(sequences, label_sequences): # # ex = make_example(sequence, label_sequence) # # writer.write(ex.SerializeToString()) # # writer.close() # # with tf.python_io.TFRecordWriter('./test_0220.tfrecord') as writer: # for sequence, label_sequence in zip(sequences, label_sequences): # ex = make_example(sequence, label_sequence) # writer.write(ex.SerializeToString()) # # # # A single serialized example # # (You can read this from a file using TFRecordReader) # # ex = make_example([1, 2, 3], [0, 1, 0]).SerializeToString() # # ex = make_example(["1", "2", "3"], ["0", "1", "0"]).SerializeToString() # # Define how to parse the example # context_features = { # "length": tf.FixedLenFeature([], dtype=tf.int64) # } # sequence_features = { # # "tokens": tf.FixedLenSequenceFeature([], dtype=tf.int64), # "tokens": tf.FixedLenSequenceFeature([], dtype=tf.string), # "labels": tf.FixedLenSequenceFeature([], dtype=tf.int64) # } # # # Parse the example # context_parsed, sequence_parsed = tf.parse_single_sequence_example( # serialized=ex, # context_features=context_features, # sequence_features=sequence_features # ) import tensorflow as tf import os keys=[[1.0,2.0],[2.0,3.0]] sess=tf.InteractiveSession() sess.run(tf.global_variables_initializer()) def make_example(locale,age,score,times): example = tf.train.SequenceExample( context=tf.train.Features( feature={ "locale":tf.train.Feature(bytes_list=tf.train.BytesList(value=[bytes(locale,encoding='utf8')])), "age":tf.train.Feature(int64_list=tf.train.Int64List(value=[age])) }), feature_lists=tf.train.FeatureLists( feature_list={ "movie_rating":tf.train.FeatureList(feature=[tf.train.Feature(float_list=tf.train.FloatList(value=score)) for i in range(times)]) } ) ) return example.SerializeToString() context_features = { "locale": tf.FixedLenFeature([],dtype=tf.string), "age": tf.FixedLenFeature([],dtype=tf.int64) } sequence_features = { "movie_rating": tf.FixedLenSequenceFeature([3], dtype=tf.float32,allow_missing=True) } context_parsed, sequence_parsed = tf.parse_single_sequence_example(make_example("中国",24,[1.0,3.5,4.0],2),context_features=context_features,sequence_features=sequence_features) print(tf.contrib.learn.run_n(context_parsed)) print(tf.contrib.learn.run_n(sequence_parsed))
[ 1, 396, 8025, 29901, 23616, 29899, 29947, 13, 15945, 29908, 13, 29992, 8921, 29901, 11798, 786, 492, 29884, 29871, 13, 29992, 12346, 29901, 529, 26862, 6227, 29958, 13, 13, 29992, 3259, 29901, 29871, 29896, 29889, 29900, 13, 29992, 506, 1947, 29901, 13380, 10413, 663, 13, 29992, 1445, 29901, 1243, 29918, 24713, 29889, 2272, 13, 29992, 2230, 29901, 29871, 29906, 29900, 29896, 29947, 29914, 29906, 29914, 29906, 29900, 29871, 29906, 29900, 29901, 29900, 29906, 13, 13, 13, 15945, 29908, 13, 13, 29937, 1053, 26110, 408, 15886, 13, 29937, 13, 29937, 396, 15602, 353, 5519, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 1402, 518, 29946, 29892, 29871, 29945, 29892, 29871, 29896, 1402, 518, 29896, 29892, 29871, 29906, 5262, 13, 29937, 15602, 353, 518, 3366, 29896, 613, 376, 29906, 613, 376, 29941, 12436, 6796, 29946, 613, 376, 29945, 613, 376, 29896, 12436, 6796, 29896, 613, 376, 29906, 3108, 29962, 13, 29937, 3858, 29918, 6831, 2063, 353, 5519, 29900, 29892, 29871, 29896, 29892, 29871, 29900, 1402, 518, 29896, 29892, 29871, 29900, 29892, 29871, 29900, 1402, 518, 29896, 29892, 29871, 29896, 5262, 13, 29937, 13, 29937, 13, 29937, 822, 1207, 29918, 4773, 29898, 16506, 29892, 11073, 1125, 13, 29937, 268, 396, 450, 1203, 591, 736, 13, 29937, 268, 429, 353, 15886, 29889, 14968, 29889, 20529, 14023, 580, 13, 29937, 268, 396, 319, 1661, 29899, 6831, 2556, 4682, 310, 1749, 1342, 13, 29937, 268, 5665, 29918, 2848, 353, 7431, 29898, 16506, 29897, 13, 29937, 268, 429, 29889, 4703, 29889, 14394, 3366, 2848, 16862, 524, 29953, 29946, 29918, 1761, 29889, 1767, 29889, 4397, 29898, 16506, 29918, 2848, 29897, 13, 29937, 268, 396, 5169, 1535, 8857, 363, 278, 1023, 8617, 2556, 5680, 310, 1749, 1342, 13, 29937, 268, 1652, 29918, 517, 12360, 353, 429, 29889, 14394, 29918, 21513, 29889, 14394, 29918, 1761, 3366, 517, 12360, 3108, 13, 29937, 268, 1652, 29918, 21134, 353, 429, 29889, 14394, 29918, 21513, 29889, 14394, 29918, 1761, 3366, 21134, 3108, 13, 29937, 268, 363, 5993, 29892, 3858, 297, 14319, 29898, 16506, 29892, 11073, 1125, 13, 29937, 308, 396, 1652, 29918, 517, 12360, 29889, 14394, 29889, 1202, 2141, 524, 29953, 29946, 29918, 1761, 29889, 1767, 29889, 4397, 29898, 6979, 29897, 13, 29937, 308, 1652, 29918, 517, 12360, 29889, 14394, 29889, 1202, 2141, 13193, 29918, 1761, 29889, 1767, 29889, 4397, 29898, 6979, 29897, 13, 29937, 308, 1652, 29918, 21134, 29889, 14394, 29889, 1202, 2141, 524, 29953, 29946, 29918, 1761, 29889, 1767, 29889, 4397, 29898, 1643, 29897, 13, 29937, 268, 736, 429, 13, 29937, 13, 29937, 13, 29937, 396, 14350, 599, 6455, 964, 263, 323, 29943, 4789, 4339, 934, 13, 29937, 396, 411, 5694, 1445, 29889, 22175, 5776, 1971, 653, 2283, 580, 408, 285, 29886, 29901, 13, 29937, 396, 268, 9227, 353, 15886, 29889, 4691, 29918, 601, 29889, 8969, 9182, 10507, 29898, 18091, 29889, 978, 29897, 13, 29937, 396, 268, 363, 5665, 29892, 3858, 29918, 16506, 297, 14319, 29898, 6831, 2063, 29892, 3858, 29918, 6831, 2063, 1125, 13, 29937, 396, 308, 429, 353, 1207, 29918, 4773, 29898, 16506, 29892, 3858, 29918, 16506, 29897, 13, 29937, 396, 308, 9227, 29889, 3539, 29898, 735, 29889, 1748, 6646, 8246, 3101, 13, 29937, 396, 268, 9227, 29889, 5358, 580, 13, 29937, 13, 29937, 411, 29871, 15886, 29889, 4691, 29918, 601, 29889, 8969, 9182, 10507, 877, 6904, 1688, 29918, 29900, 29906, 29906, 29900, 29889, 13264, 11651, 1495, 408, 9227, 29901, 13, 29937, 268, 363, 5665, 29892, 3858, 29918, 16506, 297, 14319, 29898, 6831, 2063, 29892, 3858, 29918, 6831, 2063, 1125, 13, 29937, 308, 429, 353, 1207, 29918, 4773, 29898, 16506, 29892, 3858, 29918, 16506, 29897, 13, 29937, 308, 9227, 29889, 3539, 29898, 735, 29889, 1748, 6646, 8246, 3101, 13, 29937, 13, 29937, 13, 29937, 396, 319, 2323, 7797, 1891, 1342, 13, 29937, 396, 313, 3492, 508, 1303, 445, 515, 263, 934, 773, 323, 29943, 9182, 6982, 29897, 13, 29937, 396, 429, 353, 1207, 29918, 4773, 4197, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 1402, 518, 29900, 29892, 29871, 29896, 29892, 29871, 29900, 14664, 1748, 6646, 8246, 580, 13, 29937, 13, 29937, 429, 353, 1207, 29918, 4773, 29898, 3366, 29896, 613, 376, 29906, 613, 376, 29941, 12436, 6796, 29900, 613, 376, 29896, 613, 376, 29900, 3108, 467, 1748, 6646, 8246, 580, 13, 29937, 396, 22402, 920, 304, 6088, 278, 1342, 13, 29937, 3030, 29918, 22100, 353, 426, 13, 29937, 268, 376, 2848, 1115, 15886, 29889, 26262, 21515, 19132, 4197, 1402, 26688, 29922, 13264, 29889, 524, 29953, 29946, 29897, 13, 29937, 500, 13, 29937, 5665, 29918, 22100, 353, 426, 13, 29937, 268, 396, 376, 517, 12360, 1115, 15886, 29889, 26262, 21515, 20529, 19132, 4197, 1402, 26688, 29922, 13264, 29889, 524, 29953, 29946, 511, 13, 29937, 268, 376, 517, 12360, 1115, 15886, 29889, 26262, 21515, 20529, 19132, 4197, 1402, 26688, 29922, 13264, 29889, 1807, 511, 13, 29937, 268, 376, 21134, 1115, 15886, 29889, 26262, 21515, 20529, 19132, 4197, 1402, 26688, 29922, 13264, 29889, 524, 29953, 29946, 29897, 13, 29937, 500, 13, 29937, 13, 29937, 396, 20969, 278, 1342, 13, 29937, 3030, 29918, 862, 8485, 29892, 5665, 29918, 862, 8485, 353, 15886, 29889, 5510, 29918, 14369, 29918, 16506, 29918, 4773, 29898, 13, 29937, 268, 7797, 1891, 29922, 735, 29892, 13, 29937, 268, 3030, 29918, 22100, 29922, 4703, 29918, 22100, 29892, 13, 29937, 268, 5665, 29918, 22100, 29922, 16506, 29918, 22100, 13, 29937, 1723, 13, 13, 5215, 26110, 408, 15886, 13, 5215, 2897, 13, 8149, 29922, 8999, 29896, 29889, 29900, 29892, 29906, 29889, 29900, 16272, 29906, 29889, 29900, 29892, 29941, 29889, 29900, 5262, 13, 29879, 404, 29922, 13264, 29889, 4074, 4925, 7317, 580, 13, 29879, 404, 29889, 3389, 29898, 13264, 29889, 10945, 29918, 20897, 29918, 11228, 3950, 3101, 13, 13, 1753, 1207, 29918, 4773, 29898, 23337, 29892, 482, 29892, 13628, 29892, 3706, 1125, 13, 13, 1678, 1342, 353, 15886, 29889, 14968, 29889, 20529, 14023, 29898, 13, 4706, 3030, 29922, 13264, 29889, 14968, 29889, 8263, 3698, 29898, 13, 9651, 4682, 3790, 13, 9651, 376, 23337, 1115, 13264, 29889, 14968, 29889, 19132, 29898, 13193, 29918, 1761, 29922, 13264, 29889, 14968, 29889, 11207, 1293, 29898, 1767, 11759, 13193, 29898, 23337, 29892, 22331, 2433, 9420, 29947, 1495, 2314, 511, 13, 9651, 376, 482, 1115, 13264, 29889, 14968, 29889, 19132, 29898, 524, 29953, 29946, 29918, 1761, 29922, 13264, 29889, 14968, 29889, 2928, 29953, 29946, 1293, 29898, 1767, 11759, 482, 12622, 13, 4706, 500, 511, 13, 4706, 4682, 29918, 21513, 29922, 13264, 29889, 14968, 29889, 19132, 1293, 29879, 29898, 13, 9651, 4682, 29918, 1761, 3790, 13, 9651, 376, 27362, 29918, 29741, 1115, 13264, 29889, 14968, 29889, 19132, 1293, 29898, 14394, 11759, 13264, 29889, 14968, 29889, 19132, 29898, 7411, 29918, 1761, 29922, 13264, 29889, 14968, 29889, 11031, 1293, 29898, 1767, 29922, 13628, 876, 363, 474, 297, 3464, 29898, 3706, 29897, 2314, 13, 9651, 500, 13, 4706, 1723, 13, 1678, 1723, 13, 1678, 736, 1342, 29889, 1748, 6646, 8246, 580, 13, 13, 4703, 29918, 22100, 353, 426, 13, 1678, 376, 23337, 1115, 15886, 29889, 26262, 21515, 19132, 4197, 1402, 29881, 1853, 29922, 13264, 29889, 1807, 511, 13, 1678, 376, 482, 1115, 15886, 29889, 26262, 21515, 19132, 4197, 1402, 29881, 1853, 29922, 13264, 29889, 524, 29953, 29946, 29897, 13, 29913, 13, 16506, 29918, 22100, 353, 426, 13, 1678, 376, 27362, 29918, 29741, 1115, 15886, 29889, 26262, 21515, 20529, 19132, 4197, 29941, 1402, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29892, 9536, 29918, 27259, 29922, 5574, 29897, 13, 29913, 13, 13, 4703, 29918, 862, 8485, 29892, 5665, 29918, 862, 8485, 29871, 353, 15886, 29889, 5510, 29918, 14369, 29918, 16506, 29918, 4773, 29898, 5675, 29918, 4773, 703, 30275, 30356, 613, 29906, 29946, 17094, 29896, 29889, 29900, 29892, 29941, 29889, 29945, 29892, 29946, 29889, 29900, 1402, 29906, 511, 4703, 29918, 22100, 29922, 4703, 29918, 22100, 29892, 16506, 29918, 22100, 29922, 16506, 29918, 22100, 29897, 13, 13, 2158, 29898, 13264, 29889, 21570, 29889, 19668, 29889, 3389, 29918, 29876, 29898, 4703, 29918, 862, 8485, 876, 13, 2158, 29898, 13264, 29889, 21570, 29889, 19668, 29889, 3389, 29918, 29876, 29898, 16506, 29918, 862, 8485, 876, 2 ]
thaifin/stock.py
CircleOnCircles/thaifin
7
165445
<reponame>CircleOnCircles/thaifin import arrow import pandas as pd from fuzzywuzzy import process from thaifin.sources.finnomena import get_financial_sheet from thaifin.sources.finnomena import get_stock_list class Stock: @classmethod def search(cls, company_name: str, limit: int = 5): list_ = get_stock_list().data search_against = {x.thName + x.enName: x for x in list_} search_result = process.extract(company_name, search_against, limit=limit) return [cls(s[0].name) for s in search_result] @staticmethod def list_symbol(): list_ = get_stock_list().data return [s.name for s in list_] @staticmethod def find_symbol(symbol: str): list_ = get_stock_list().data return next(obj for obj in list_ if obj.name == symbol) def __init__(self, symbol: str): symbol = symbol.upper() self.info = self.find_symbol(symbol) self.fundamental = get_financial_sheet(self.info.security_id).data self.updated = arrow.utcnow() # self. @property def symbol(self): return self.info.name @property def company_name(self): return self.info.enName @property def thai_company_name(self): return self.info.thName @property def quarter_dataframe(self): df = pd.DataFrame([s.dict(exclude={"SecurityID"}) for s in self.fundamental]) # Quarter 9 means yearly values df = df[df.Quarter != 9] df["Time"] = df.Fiscal.astype(str) + "Q" + df.Quarter.astype(str) df = df.set_index("Time") df.index = pd.to_datetime(df.index).to_period("Q") df = df.drop(columns=["Fiscal", "Quarter"]) return df @property def yearly_dataframe(self): df = pd.DataFrame([s.dict(exclude={"SecurityID"}) for s in self.fundamental]) # Quarter 9 means yearly values df = df[df.Quarter == 9] df = df.set_index("Fiscal") df.index = pd.to_datetime(df.index, format="%Y").to_period("Y") df = df.drop(columns=["Quarter"]) return df def __repr__(self): return f'<Stock "{self.symbol}" - updated {self.updated.humanize()}>'
[ 1, 529, 276, 1112, 420, 29958, 23495, 280, 2951, 29907, 381, 7799, 29914, 15457, 361, 262, 13, 5215, 16578, 13, 5215, 11701, 408, 10518, 13, 3166, 285, 3365, 1537, 29893, 3365, 1537, 1053, 1889, 13, 13, 3166, 266, 29874, 361, 262, 29889, 29879, 2863, 29889, 29888, 2559, 28342, 1053, 679, 29918, 4951, 273, 1455, 29918, 9855, 13, 3166, 266, 29874, 361, 262, 29889, 29879, 2863, 29889, 29888, 2559, 28342, 1053, 679, 29918, 17712, 29918, 1761, 13, 13, 13, 1990, 10224, 29901, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 2740, 29898, 25932, 29892, 5001, 29918, 978, 29901, 851, 29892, 4046, 29901, 938, 353, 29871, 29945, 1125, 13, 4706, 1051, 29918, 353, 679, 29918, 17712, 29918, 1761, 2141, 1272, 13, 4706, 2740, 29918, 351, 475, 303, 353, 426, 29916, 29889, 386, 1170, 718, 921, 29889, 264, 1170, 29901, 921, 363, 921, 297, 1051, 29918, 29913, 13, 4706, 2740, 29918, 2914, 353, 1889, 29889, 21111, 29898, 14518, 29918, 978, 29892, 2740, 29918, 351, 475, 303, 29892, 4046, 29922, 13400, 29897, 13, 4706, 736, 518, 25932, 29898, 29879, 29961, 29900, 1822, 978, 29897, 363, 269, 297, 2740, 29918, 2914, 29962, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1051, 29918, 18098, 7295, 13, 4706, 1051, 29918, 353, 679, 29918, 17712, 29918, 1761, 2141, 1272, 13, 4706, 736, 518, 29879, 29889, 978, 363, 269, 297, 1051, 29918, 29962, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1284, 29918, 18098, 29898, 18098, 29901, 851, 1125, 13, 4706, 1051, 29918, 353, 679, 29918, 17712, 29918, 1761, 2141, 1272, 13, 4706, 736, 2446, 29898, 5415, 363, 5446, 297, 1051, 29918, 565, 5446, 29889, 978, 1275, 5829, 29897, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5829, 29901, 851, 1125, 13, 4706, 5829, 353, 5829, 29889, 21064, 580, 13, 4706, 1583, 29889, 3888, 353, 1583, 29889, 2886, 29918, 18098, 29898, 18098, 29897, 13, 4706, 1583, 29889, 27159, 11491, 353, 679, 29918, 4951, 273, 1455, 29918, 9855, 29898, 1311, 29889, 3888, 29889, 8926, 29918, 333, 467, 1272, 13, 4706, 1583, 29889, 21402, 353, 16578, 29889, 329, 29883, 3707, 580, 13, 4706, 396, 1583, 29889, 13, 13, 1678, 732, 6799, 13, 1678, 822, 5829, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 3888, 29889, 978, 13, 13, 1678, 732, 6799, 13, 1678, 822, 5001, 29918, 978, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 3888, 29889, 264, 1170, 13, 13, 1678, 732, 6799, 13, 1678, 822, 266, 1794, 29918, 14518, 29918, 978, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 3888, 29889, 386, 1170, 13, 13, 1678, 732, 6799, 13, 1678, 822, 12616, 29918, 1272, 2557, 29898, 1311, 1125, 13, 4706, 4489, 353, 10518, 29889, 17271, 4197, 29879, 29889, 8977, 29898, 735, 2325, 3790, 29908, 13228, 1367, 29908, 1800, 363, 269, 297, 1583, 29889, 27159, 11491, 2314, 13, 4706, 396, 751, 4254, 29871, 29929, 2794, 1629, 368, 1819, 13, 4706, 4489, 353, 4489, 29961, 2176, 29889, 2182, 4254, 2804, 29871, 29929, 29962, 13, 4706, 4489, 3366, 2481, 3108, 353, 4489, 29889, 29943, 275, 1052, 29889, 579, 668, 29898, 710, 29897, 718, 376, 29984, 29908, 718, 4489, 29889, 2182, 4254, 29889, 579, 668, 29898, 710, 29897, 13, 4706, 4489, 353, 4489, 29889, 842, 29918, 2248, 703, 2481, 1159, 13, 4706, 4489, 29889, 2248, 353, 10518, 29889, 517, 29918, 12673, 29898, 2176, 29889, 2248, 467, 517, 29918, 19145, 703, 29984, 1159, 13, 4706, 4489, 353, 4489, 29889, 8865, 29898, 13099, 29922, 3366, 29943, 275, 1052, 613, 376, 2182, 4254, 20068, 13, 4706, 736, 4489, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1629, 368, 29918, 1272, 2557, 29898, 1311, 1125, 13, 4706, 4489, 353, 10518, 29889, 17271, 4197, 29879, 29889, 8977, 29898, 735, 2325, 3790, 29908, 13228, 1367, 29908, 1800, 363, 269, 297, 1583, 29889, 27159, 11491, 2314, 13, 4706, 396, 751, 4254, 29871, 29929, 2794, 1629, 368, 1819, 13, 4706, 4489, 353, 4489, 29961, 2176, 29889, 2182, 4254, 1275, 29871, 29929, 29962, 13, 4706, 4489, 353, 4489, 29889, 842, 29918, 2248, 703, 29943, 275, 1052, 1159, 13, 4706, 4489, 29889, 2248, 353, 10518, 29889, 517, 29918, 12673, 29898, 2176, 29889, 2248, 29892, 3402, 543, 29995, 29979, 2564, 517, 29918, 19145, 703, 29979, 1159, 13, 4706, 4489, 353, 4489, 29889, 8865, 29898, 13099, 29922, 3366, 2182, 4254, 20068, 13, 4706, 736, 4489, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 736, 285, 29915, 29966, 20754, 384, 29850, 1311, 29889, 18098, 5038, 448, 4784, 426, 1311, 29889, 21402, 29889, 26029, 675, 28296, 16299, 13, 2 ]
mass-cat-index-wikisource.py
krls-ca/viquitexts-calaix-de-sastre
0
148733
<gh_stars>0 #!/usr/bin/python # -*- coding: utf-8 -*- import pywikibot, re, time from bs4 import BeautifulSoup from pywikibot.proofreadpage import ProofreadPage from pywikibot.proofreadpage import IndexPage def getCategoryNeeded(ql): if ql == 0: #WITHOUT_TEXT return u'[[Category:Testurik gabe]]' #Testurik gabe elif ql == 1: #Berrikusi gabe #NOT_PROOFREAD return u'[[Category:Berrikusi gabe]]' elif ql == 2: #Arazoak dakartza #PROBLEMATIC return u'[[Category:Arazoak dakartza]]' elif ql == 3: #Berrikusita #PROOFREAD return u'[[Category:Berrikusita]]' elif ql == 4: #VALIDATED #Balioztatua return u'[[Category:Balioztatua]]' categories = [u'[[Category:Testurik gabe]]', u'[[Category:Berrikusi gabe]]', u'[[Category:Arazoak dakartza]]', u'[[Category:Berrikusita]]', u'[[Category:Balioztatua]]', u'[[Category:Euskara]]'] done = [] def main(): site = pywikibot.Site("mul", "wikisource") arts = pywikibot.Category(site, u"Indizeak euskaraz").articles(recurse=1, reverse=True, content=False) '''indexPage = IndexPage(site, u'Index:Chantspopulaires00sall.pdf') pages = indexPage.page_gen(only_existing=True, content=True) for page in pages: if not page.isRedirectPage() and page.exists(): name = page.title() title = name.replace(u"Chantspopulaires00sall", u"Chants populaires du pays basque (1870)") print title #page.move(title, reason="File renamed in Wikimedia Commons", movetalkpage=True) raw_input('Are you sure? (y/n)') exit(0)''' for art in arts: print art.title() if art.title() not in done: indexPage = IndexPage(art) try: #indexPage.page_gen(only_existing=True, content=True, filter_ql=0) pages = indexPage.page_gen(only_existing=True, content=True) except ValueError as nopage: continue for page in pages: #print page.text if page.exists(): print page cat = getCategoryNeeded(page.quality_level) oldText = page.text #print cat print cat #newText = oldText.replace(u"[[Category:Euskara]]", "") #match = re.match(cat, oldText) if cat not in oldText: newText = oldText for oldCat in categories: if oldCat in newText: newText = newText.replace(oldCat, "") print newText headerFooter = re.findall(r"(<noinclude>(?:[\S\s]+?))(?:<\/noinclude>)", newText) if len(headerFooter) == 1: newText = newText.replace(u"<noinclude></noinclude>", u"<noinclude>{0}</noinclude>".format(cat)) else: footer = headerFooter[1] newText = newText.replace(footer, u"{0}\n{1}".format(footer, cat)) pywikibot.showDiff(oldText,newText) #raw_input('Are you sure? (y/n)') page.put(newText, comment = u'Added category {0}'.format(cat), minorEdit=True) #time.sleep(2) #raw_input('Are you sure? (y/n)') if __name__ == '__main__': main()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 4691, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 11451, 2851, 747, 327, 29892, 337, 29892, 931, 13, 3166, 24512, 29946, 1053, 25685, 29903, 1132, 13, 3166, 11451, 2851, 747, 327, 29889, 8017, 949, 3488, 1053, 18319, 949, 5074, 13, 3166, 11451, 2851, 747, 327, 29889, 8017, 949, 3488, 1053, 11374, 5074, 13, 13, 1753, 679, 10900, 8139, 19226, 29898, 1519, 1125, 13, 12, 361, 29871, 1519, 1275, 29871, 29900, 29901, 13, 12, 12, 29937, 29956, 1806, 8187, 2692, 29918, 16975, 13, 12, 12, 2457, 318, 29915, 8999, 10900, 29901, 3057, 332, 638, 330, 4302, 5262, 29915, 13, 12, 12, 29937, 3057, 332, 638, 330, 4302, 13, 12, 23681, 29871, 1519, 1275, 29871, 29896, 29901, 13, 12, 12, 29937, 17104, 5357, 375, 29875, 330, 4302, 13, 12, 12, 29937, 12256, 29918, 8618, 9800, 16310, 13, 12, 12, 2457, 318, 29915, 8999, 10900, 29901, 17104, 5357, 375, 29875, 330, 4302, 5262, 29915, 13, 12, 23681, 29871, 1519, 1275, 29871, 29906, 29901, 13, 12, 12, 29937, 29909, 336, 2502, 557, 270, 557, 442, 1362, 13, 12, 12, 29937, 8618, 29933, 1307, 29924, 1299, 2965, 13, 12, 12, 2457, 318, 29915, 8999, 10900, 29901, 29909, 336, 2502, 557, 270, 557, 442, 1362, 5262, 29915, 13, 12, 23681, 29871, 1519, 1275, 29871, 29941, 29901, 13, 12, 12, 29937, 17104, 5357, 375, 2028, 29871, 13, 12, 12, 29937, 8618, 9800, 16310, 13, 12, 12, 2457, 318, 29915, 8999, 10900, 29901, 17104, 5357, 375, 2028, 5262, 29915, 13, 12, 23681, 29871, 1519, 1275, 29871, 29946, 29901, 13, 12, 12, 29937, 26707, 3040, 29928, 13, 12, 12, 29937, 22031, 601, 2065, 271, 3357, 13, 12, 12, 2457, 318, 29915, 8999, 10900, 29901, 22031, 601, 2065, 271, 3357, 5262, 29915, 13, 13, 20683, 353, 518, 29884, 29915, 8999, 10900, 29901, 3057, 332, 638, 330, 4302, 5262, 742, 318, 29915, 8999, 10900, 29901, 17104, 5357, 375, 29875, 330, 4302, 5262, 742, 318, 29915, 8999, 10900, 29901, 29909, 336, 2502, 557, 270, 557, 442, 1362, 5262, 742, 318, 29915, 8999, 10900, 29901, 17104, 5357, 375, 2028, 5262, 742, 318, 29915, 8999, 10900, 29901, 22031, 601, 2065, 271, 3357, 5262, 742, 318, 29915, 8999, 10900, 29901, 29923, 17400, 2518, 5262, 2033, 13, 15091, 353, 5159, 13, 13, 1753, 1667, 7295, 13, 12, 2746, 353, 11451, 2851, 747, 327, 29889, 17033, 703, 16109, 613, 376, 2851, 275, 1167, 1159, 13, 12, 5708, 353, 11451, 2851, 747, 327, 29889, 10900, 29898, 2746, 29892, 318, 29908, 2568, 675, 557, 321, 375, 5689, 834, 2564, 18569, 29898, 276, 2764, 344, 29922, 29896, 29892, 11837, 29922, 5574, 29892, 2793, 29922, 8824, 29897, 13, 12, 12008, 2248, 5074, 353, 11374, 5074, 29898, 2746, 29892, 318, 29915, 3220, 29901, 1451, 424, 1028, 459, 352, 7147, 29900, 29900, 29879, 497, 29889, 5140, 1495, 13, 12, 12292, 353, 2380, 5074, 29889, 3488, 29918, 1885, 29898, 6194, 29918, 735, 15423, 29922, 5574, 29892, 2793, 29922, 5574, 29897, 13, 12, 1454, 1813, 297, 6515, 29901, 13, 12, 12, 361, 451, 1813, 29889, 275, 24735, 5074, 580, 322, 1813, 29889, 9933, 7295, 13, 12, 12, 12, 978, 353, 1813, 29889, 3257, 580, 13, 12, 12, 12, 3257, 353, 1024, 29889, 6506, 29898, 29884, 29908, 1451, 424, 1028, 459, 352, 7147, 29900, 29900, 29879, 497, 613, 318, 29908, 1451, 1934, 14938, 7147, 868, 9744, 2362, 802, 313, 29896, 29947, 29955, 29900, 25760, 13, 12, 12, 12, 2158, 3611, 13, 12, 12, 12, 29937, 3488, 29889, 11631, 29898, 3257, 29892, 2769, 543, 2283, 19533, 297, 7494, 3468, 613, 2351, 300, 2235, 3488, 29922, 5574, 29897, 13, 12, 12, 12, 1610, 29918, 2080, 877, 17506, 366, 1854, 29973, 313, 29891, 29914, 29876, 29897, 1495, 13, 12, 13322, 29898, 29900, 29897, 12008, 13, 12, 1454, 1616, 297, 16930, 29901, 13, 12, 12, 2158, 1616, 29889, 3257, 580, 13, 12, 12, 361, 1616, 29889, 3257, 580, 451, 297, 2309, 29901, 29871, 13, 12, 12, 12, 2248, 5074, 353, 11374, 5074, 29898, 442, 29897, 13, 12, 12, 12, 2202, 29901, 13, 12, 12, 12, 12, 29937, 2248, 5074, 29889, 3488, 29918, 1885, 29898, 6194, 29918, 735, 15423, 29922, 5574, 29892, 2793, 29922, 5574, 29892, 4175, 29918, 1519, 29922, 29900, 29897, 13, 12, 12, 12, 12, 12292, 353, 2380, 5074, 29889, 3488, 29918, 1885, 29898, 6194, 29918, 735, 15423, 29922, 5574, 29892, 2793, 29922, 5574, 29897, 13, 12, 12, 12, 19499, 7865, 2392, 408, 302, 459, 482, 29901, 13, 12, 12, 12, 12, 19878, 13, 12, 12, 12, 1454, 1813, 297, 6515, 29901, 13, 12, 12, 12, 12, 29937, 2158, 1813, 29889, 726, 13, 12, 12, 12, 12, 361, 1813, 29889, 9933, 7295, 13, 12, 12, 12, 12, 12, 2158, 1813, 13, 12, 12, 12, 12, 12, 4117, 353, 679, 10900, 8139, 19226, 29898, 3488, 29889, 29567, 29918, 5563, 29897, 13, 12, 12, 12, 12, 12, 1025, 1626, 353, 1813, 29889, 726, 13, 12, 12, 12, 12, 12, 29937, 2158, 6635, 13, 12, 12, 12, 12, 12, 2158, 6635, 13, 12, 12, 12, 12, 12, 29937, 1482, 1626, 353, 2030, 1626, 29889, 6506, 29898, 29884, 29908, 8999, 10900, 29901, 29923, 17400, 2518, 5262, 613, 20569, 13, 12, 12, 12, 12, 12, 29937, 4352, 353, 337, 29889, 4352, 29898, 4117, 29892, 2030, 1626, 29897, 13, 12, 12, 12, 12, 12, 361, 6635, 451, 297, 2030, 1626, 29901, 13, 12, 12, 12, 12, 12, 12, 1482, 1626, 353, 2030, 1626, 13, 12, 12, 12, 12, 12, 12, 1454, 2030, 9694, 297, 13997, 29901, 13, 12, 12, 12, 12, 12, 12, 12, 361, 2030, 9694, 297, 716, 1626, 29901, 13, 12, 12, 12, 12, 12, 12, 12, 12, 1482, 1626, 353, 716, 1626, 29889, 6506, 29898, 1025, 9694, 29892, 20569, 13, 12, 12, 12, 12, 12, 12, 2158, 716, 1626, 13, 12, 12, 12, 12, 12, 12, 6672, 13440, 261, 353, 337, 29889, 2886, 497, 29898, 29878, 29908, 29898, 29966, 1217, 2856, 5961, 25825, 7110, 29903, 29905, 29879, 10062, 29973, 876, 10780, 29901, 13505, 29914, 1217, 2856, 12948, 613, 716, 1626, 29897, 13, 12, 12, 12, 12, 12, 12, 361, 7431, 29898, 6672, 13440, 261, 29897, 1275, 29871, 29896, 29901, 13, 12, 12, 12, 12, 12, 12, 12, 1482, 1626, 353, 716, 1626, 29889, 6506, 29898, 29884, 29908, 29966, 1217, 2856, 2565, 1217, 2856, 28341, 318, 29908, 29966, 1217, 2856, 26208, 29900, 16040, 1217, 2856, 29958, 1642, 4830, 29898, 4117, 876, 13, 12, 12, 12, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 12, 12, 12, 21720, 353, 4839, 13440, 261, 29961, 29896, 29962, 13, 12, 12, 12, 12, 12, 12, 12, 1482, 1626, 353, 716, 1626, 29889, 6506, 29898, 21720, 29892, 318, 29908, 29912, 29900, 1012, 29876, 29912, 29896, 29913, 1642, 4830, 29898, 21720, 29892, 6635, 876, 13, 12, 12, 12, 12, 12, 12, 13, 12, 12, 12, 12, 12, 12, 2272, 2851, 747, 327, 29889, 4294, 26023, 29898, 1025, 1626, 29892, 1482, 1626, 29897, 13, 12, 12, 12, 12, 12, 12, 29937, 1610, 29918, 2080, 877, 17506, 366, 1854, 29973, 313, 29891, 29914, 29876, 29897, 1495, 13, 12, 12, 12, 12, 12, 12, 3488, 29889, 649, 29898, 1482, 1626, 29892, 3440, 353, 318, 29915, 2528, 287, 7663, 426, 29900, 29913, 4286, 4830, 29898, 4117, 511, 9461, 6103, 29922, 5574, 29897, 13, 12, 12, 12, 12, 29937, 2230, 29889, 17059, 29898, 29906, 29897, 13, 12, 12, 12, 29937, 1610, 29918, 2080, 877, 17506, 366, 1854, 29973, 313, 29891, 29914, 29876, 29897, 1495, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 12, 3396, 580, 2 ]
run_tests.py
Edux87/lemmes
0
1604118
# -*- coding: utf-8 -*- ''' The main test runner script. Usage: :: python run_tests.py Skip slow tests python run_tests.py fast When there's no Internet python run_tests.py no-internet ''' from __future__ import unicode_literals import nose import sys def main(): args = get_argv() success = nose.run(argv=args) sys.exit(0) if success else sys.exit(1) def get_argv(): args = [sys.argv[0], "tests", '--verbosity', '2'] attr_conditions = [] attr_conditions.append("not skip") attr_expression = " and ".join(attr_conditions) if attr_expression: args.extend(["-A", attr_expression]) return args if __name__ == '__main__': main()
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 12008, 13, 1576, 1667, 1243, 28877, 2471, 29889, 13, 27573, 29901, 4761, 13, 1678, 3017, 1065, 29918, 21150, 29889, 2272, 13, 15797, 666, 5232, 6987, 13, 1678, 3017, 1065, 29918, 21150, 29889, 2272, 5172, 13, 10401, 727, 29915, 29879, 694, 4685, 13, 1678, 3017, 1065, 29918, 21150, 29889, 2272, 694, 29899, 14168, 300, 13, 12008, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 5215, 26414, 13, 5215, 10876, 13, 13, 13, 1753, 1667, 7295, 13, 1678, 6389, 353, 679, 29918, 19218, 580, 13, 1678, 2551, 353, 26414, 29889, 3389, 29898, 19218, 29922, 5085, 29897, 13, 1678, 10876, 29889, 13322, 29898, 29900, 29897, 565, 2551, 1683, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 13, 1753, 679, 29918, 19218, 7295, 13, 1678, 6389, 353, 518, 9675, 29889, 19218, 29961, 29900, 1402, 376, 21150, 613, 525, 489, 18248, 359, 537, 742, 525, 29906, 2033, 13, 1678, 12421, 29918, 1116, 2187, 353, 5159, 13, 1678, 12421, 29918, 1116, 2187, 29889, 4397, 703, 1333, 14383, 1159, 13, 1678, 12421, 29918, 17471, 353, 376, 322, 11393, 7122, 29898, 5552, 29918, 1116, 2187, 29897, 13, 1678, 565, 12421, 29918, 17471, 29901, 13, 4706, 6389, 29889, 21843, 29898, 3366, 29899, 29909, 613, 12421, 29918, 17471, 2314, 13, 1678, 736, 6389, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1667, 580, 13, 2 ]
predict.py
harish-vnkt/multiscale-residual-network-pytorch
3
130808
<gh_stars>1-10 import argparse import os from model import MultiScaleResidualNetwork from dataset import * from torch.utils.data import DataLoader from utils import * from datetime import datetime import logging parser = argparse.ArgumentParser(description="Prediction arguments for MSRN Pytorch") # Data parser.add_argument("--data_root", type=str, required=True, help="Root directory of dataset") parser.add_argument("--data_set", type=str, choices=["Set14"], default="Set14", help="Data set to run prediction on") # Model parser.add_argument("--scale", type=int, required=True, choices=[2, 4], help="Scale of super-resolution") parser.add_argument("--model_file", type=str, required=True, help="Path to .pt file") parser.add_argument("--results_dir", type=str, required=True, help="Path to results directory") # Platform config parser.add_argument("--num_workers", type=int, default=os.cpu_count(), help="Number of cpu's used for data loading") parser.add_argument("--use_cpu", type=bool, default=False, help="Use CPU for training") if __name__ == "__main__": logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(levelname)s - %(filename)s : %(message)s") now = datetime.now() args = parser.parse_args() print(args) model = MultiScaleResidualNetwork(scale=args.scale, res_blocks=args.residual_blocks, res_in_features=args.residual_channels, res_out_features=args.residual_channels) logging.debug("Created model") data_set = None if args.data_set == "Set14": data_set = Set14(data_root=args.data_root, scale=args.scale) logging.debug("Created dataset") prediction_loader = DataLoader(data_set, batch_size=1, num_workers=args.num_workers, pin_memory=True) logging.debug("Created prediction loaders") if not args.use_cpu: device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') else: device = torch.device('cpu') logging.debug("Initialized device : %s", str(device)) checkpoint = torch.load(args.model_file) model.load_state_dict(checkpoint["model"]) model.to(device) model.eval() if not os.path.exists(args.results_dir): os.makedirs(args.results_dir) results_dir = os.path.join(args.results_dir, "x" + str(args.scale)) if not os.path.exists(results_dir): os.makedirs(results_dir) logging.debug("Initialized tensorboard directory") average_psnr = 0.0 with torch.no_grad(): for i, (hr_img, lr_img) in enumerate(prediction_loader): image_name = os.path.basename(data_set.hr_image_names[i]) hr_img_device = hr_img.to(device) lr_img_device = lr_img.to(device) hr_prediction = model(lr_img_device) average_psnr += get_psnr(hr_img_device, hr_prediction) write_results(hr_prediction, results_dir, image_name) average_psnr /= len(data_set) logging.info(f"Average PSNR : {average_psnr}")
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 1852, 5510, 13, 5215, 2897, 13, 3166, 1904, 1053, 14974, 17185, 1666, 333, 950, 13724, 13, 3166, 8783, 1053, 334, 13, 3166, 4842, 305, 29889, 13239, 29889, 1272, 1053, 3630, 10036, 13, 3166, 3667, 29879, 1053, 334, 13, 3166, 12865, 1053, 12865, 13, 5215, 12183, 13, 13, 16680, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 543, 23084, 2463, 6273, 363, 10888, 29934, 29940, 349, 3637, 25350, 1159, 13, 13, 29937, 3630, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 1272, 29918, 4632, 613, 1134, 29922, 710, 29892, 3734, 29922, 5574, 29892, 13, 462, 1678, 1371, 543, 10303, 3884, 310, 8783, 1159, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 1272, 29918, 842, 613, 1134, 29922, 710, 29892, 19995, 29922, 3366, 2697, 29896, 29946, 12436, 13, 462, 1678, 2322, 543, 2697, 29896, 29946, 613, 1371, 543, 1469, 731, 304, 1065, 18988, 373, 1159, 13, 13, 29937, 8125, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 7052, 613, 1134, 29922, 524, 29892, 3734, 29922, 5574, 29892, 19995, 11759, 29906, 29892, 29871, 29946, 1402, 13, 462, 1678, 1371, 543, 17185, 310, 2428, 29899, 9778, 918, 1159, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 4299, 29918, 1445, 613, 1134, 29922, 710, 29892, 3734, 29922, 5574, 29892, 13, 462, 1678, 1371, 543, 2605, 304, 869, 415, 934, 1159, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 9902, 29918, 3972, 613, 1134, 29922, 710, 29892, 3734, 29922, 5574, 29892, 13, 462, 1678, 1371, 543, 2605, 304, 2582, 3884, 1159, 13, 13, 29937, 28096, 2295, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 1949, 29918, 1287, 414, 613, 1134, 29922, 524, 29892, 2322, 29922, 359, 29889, 21970, 29918, 2798, 3285, 13, 462, 1678, 1371, 543, 4557, 310, 26403, 29915, 29879, 1304, 363, 848, 8363, 1159, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 1509, 29918, 21970, 613, 1134, 29922, 11227, 29892, 2322, 29922, 8824, 29892, 13, 462, 1678, 1371, 543, 11403, 10808, 363, 6694, 1159, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 13, 1678, 12183, 29889, 16121, 3991, 29898, 5563, 29922, 21027, 29889, 18525, 29892, 3402, 543, 29995, 29898, 294, 312, 603, 29897, 29879, 448, 1273, 29898, 5563, 978, 29897, 29879, 448, 1273, 29898, 9507, 29897, 29879, 584, 1273, 29898, 4906, 29897, 29879, 1159, 13, 13, 1678, 1286, 353, 12865, 29889, 3707, 580, 13, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 1596, 29898, 5085, 29897, 13, 13, 1678, 1904, 353, 14974, 17185, 1666, 333, 950, 13724, 29898, 7052, 29922, 5085, 29889, 7052, 29892, 620, 29918, 1271, 29879, 29922, 5085, 29889, 690, 333, 950, 29918, 1271, 29879, 29892, 13, 462, 462, 418, 620, 29918, 262, 29918, 22100, 29922, 5085, 29889, 690, 333, 950, 29918, 305, 12629, 29892, 620, 29918, 449, 29918, 22100, 29922, 5085, 29889, 690, 333, 950, 29918, 305, 12629, 29897, 13, 1678, 12183, 29889, 8382, 703, 20399, 1904, 1159, 13, 1678, 848, 29918, 842, 353, 6213, 13, 1678, 565, 6389, 29889, 1272, 29918, 842, 1275, 376, 2697, 29896, 29946, 1115, 13, 4706, 848, 29918, 842, 353, 3789, 29896, 29946, 29898, 1272, 29918, 4632, 29922, 5085, 29889, 1272, 29918, 4632, 29892, 6287, 29922, 5085, 29889, 7052, 29897, 13, 1678, 12183, 29889, 8382, 703, 20399, 8783, 1159, 13, 13, 1678, 18988, 29918, 12657, 353, 3630, 10036, 29898, 1272, 29918, 842, 29892, 9853, 29918, 2311, 29922, 29896, 29892, 954, 29918, 1287, 414, 29922, 5085, 29889, 1949, 29918, 1287, 414, 29892, 12534, 29918, 14834, 29922, 5574, 29897, 13, 1678, 12183, 29889, 8382, 703, 20399, 18988, 2254, 414, 1159, 13, 13, 1678, 565, 451, 6389, 29889, 1509, 29918, 21970, 29901, 13, 4706, 4742, 353, 4842, 305, 29889, 10141, 877, 29883, 6191, 29915, 565, 4842, 305, 29889, 29883, 6191, 29889, 275, 29918, 16515, 580, 1683, 525, 21970, 1495, 13, 1678, 1683, 29901, 13, 4706, 4742, 353, 4842, 305, 29889, 10141, 877, 21970, 1495, 13, 1678, 12183, 29889, 8382, 703, 15514, 1891, 4742, 584, 1273, 29879, 613, 851, 29898, 10141, 876, 13, 13, 1678, 1423, 3149, 353, 4842, 305, 29889, 1359, 29898, 5085, 29889, 4299, 29918, 1445, 29897, 13, 1678, 1904, 29889, 1359, 29918, 3859, 29918, 8977, 29898, 3198, 3149, 3366, 4299, 20068, 13, 1678, 1904, 29889, 517, 29898, 10141, 29897, 13, 1678, 1904, 29889, 14513, 580, 13, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 5085, 29889, 9902, 29918, 3972, 1125, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 5085, 29889, 9902, 29918, 3972, 29897, 13, 1678, 2582, 29918, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898, 5085, 29889, 9902, 29918, 3972, 29892, 376, 29916, 29908, 718, 851, 29898, 5085, 29889, 7052, 876, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 9902, 29918, 3972, 1125, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 9902, 29918, 3972, 29897, 13, 13, 1678, 12183, 29889, 8382, 703, 15514, 1891, 12489, 3377, 3884, 1159, 13, 13, 1678, 6588, 29918, 567, 22230, 353, 29871, 29900, 29889, 29900, 13, 1678, 411, 4842, 305, 29889, 1217, 29918, 5105, 7295, 13, 4706, 363, 474, 29892, 313, 1092, 29918, 2492, 29892, 301, 29878, 29918, 2492, 29897, 297, 26985, 29898, 11965, 2463, 29918, 12657, 1125, 13, 13, 9651, 1967, 29918, 978, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 1272, 29918, 842, 29889, 1092, 29918, 3027, 29918, 7039, 29961, 29875, 2314, 13, 9651, 22157, 29918, 2492, 29918, 10141, 353, 22157, 29918, 2492, 29889, 517, 29898, 10141, 29897, 13, 9651, 301, 29878, 29918, 2492, 29918, 10141, 353, 301, 29878, 29918, 2492, 29889, 517, 29898, 10141, 29897, 13, 13, 9651, 22157, 29918, 11965, 2463, 353, 1904, 29898, 29212, 29918, 2492, 29918, 10141, 29897, 13, 13, 9651, 6588, 29918, 567, 22230, 4619, 679, 29918, 567, 22230, 29898, 1092, 29918, 2492, 29918, 10141, 29892, 22157, 29918, 11965, 2463, 29897, 13, 13, 9651, 2436, 29918, 9902, 29898, 1092, 29918, 11965, 2463, 29892, 2582, 29918, 3972, 29892, 1967, 29918, 978, 29897, 13, 13, 1678, 6588, 29918, 567, 22230, 847, 29922, 7431, 29898, 1272, 29918, 842, 29897, 13, 1678, 12183, 29889, 3888, 29898, 29888, 29908, 29909, 19698, 11323, 16514, 584, 426, 12483, 482, 29918, 567, 22230, 27195, 13, 2 ]
excentury/command/config.py
LaudateCorpus1/excentury
0
5614
"""Config This module is in charge of providing all the necessary settings to the rest of the modules in excentury. """ import os import re import sys import textwrap import argparse from collections import OrderedDict from excentury.command import error, trace, import_mod DESC = """Edit a configuration file for excentury. Some actions performed by excentury can be overwritten by using configuration files. To see the values that the configuration file can overwrite use the `defaults` command. This will print a list of the keys and values excentury uses for the given command. """ RE = re.compile(r'\${(?P<key>.*?)}') RE_IF = re.compile( r'(?P<iftrue>.*?) IF\[\[(?P<cond>.*?)\]\]' ) RE_IFELSE = re.compile( r'(?P<iftrue>.*?) IF\[\[(?P<cond>.*?)\]\]ELSE (?P<iffalse>.*)' ) def disp(msg): """Wrapper around sys.stdout.write which is meant to behave as the print function but it does not add the newline character. """ sys.stdout.write(msg) def _replacer(*key_val): """Helper function for replace. Source: <http://stackoverflow.com/a/15221068/788553> """ replace_dict = dict(key_val) replacement_function = lambda match: replace_dict[match.group(0)] pattern = re.compile("|".join([re.escape(k) for k, _ in key_val]), re.M) return lambda string: pattern.sub(replacement_function, string) def replace(string, *key_val): """Replacement of strings done in one pass. Example: >>> replace("a < b && b < c", ('<', '&lt;'), ('&', '&amp;')) 'a &lt; b &amp;&amp; b &lt; c' Source: <http://stackoverflow.com/a/15221068/788553> """ return _replacer(*key_val)(string) class ConfigDispAction(argparse.Action): # pylint: disable=R0903 """Derived argparse Action class to use when displaying the configuration file and location.""" def __call__(self, parser, namespace, values, option_string=None): try: read_config(namespace) except IOError: disp('xcpp.config not found in %r\n' % namespace.cfg) else: disp('path to xcpp.config: "%s"\n' % namespace.cfg) with open('%s/xcpp.config' % namespace.cfg, 'r') as _fp: disp(_fp.read()) exit(0) def add_parser(subp, raw): "Add a parser to the main subparser. " tmpp = subp.add_parser('config', help='configure excentury', formatter_class=raw, description=textwrap.dedent(DESC)) tmpp.add_argument('var', type=str, nargs='?', default=None, help='Must be in the form of sec.key') tmpp.add_argument('-v', action='store_true', help='print config file location') tmpp.add_argument('--print', action=ConfigDispAction, nargs=0, help='print config file and exit') def _get_replacements(tokens, data, sec): """Helper function for _read_config. """ replacements = list() for token in tokens: if ':' in token: tsec, tkey = token.split(':') tval = '' if tsec in data: if tkey in data[tsec]: tval = data[tsec][tkey] else: if token in data[sec]: tval = data[sec][token] else: tval = '' replacements.append( ('${%s}' % token, tval) ) return replacements # pylint: disable=invalid-name # ARG and CFG are names that may be used in the configuration file. # ARG gives us access to the command line arguments and CFG gives us # access to the current configuration. Note that using CFG[key][sec] # is equivalent to ${key:sec}. These names go against the convention # so that they may be easy to spot in a configuration file. def _eval_condition(cond, ARG, CFG, line_num, fname): """Evaluates a string using the eval function. It prints a warning if there are any errors. Returns the result of the evaluation and an error number: 0 if everything is fine, 1 if there was an error. """ ARG.FILEPATH = '%s/%s/%s' % (ARG.cfg, CFG['xcpp']['path'], ARG.inputfile) try: # pylint: disable=eval-used # To be able to evaluate a condition without creating a whole # new parser we can use the eval function. We could have use # a python file as a configuration but then there would be # no simple structure to the files. cond = eval(cond) enum = 0 # pylint: disable=broad-except # Anything can go wrong during the execution of the `eval` # function. For this reason we must try to catch anything that # may come our way so that we may give out a warning message # and ignore it. except Exception as exception: cond = None enum = 1 trace( 'WARNING: error in line %d of %r: %s\n' % ( line_num, fname, exception.message ) ) return cond, enum def _read_config(fname, arg): """Simple parser to read configuration files. """ data = OrderedDict() sec = None line_num = 0 with open(fname, 'r') as fhandle: for line in fhandle: line_num += 1 if line[0] == '[': sec = line[1:-2] data[sec] = OrderedDict() elif '=' in line: tmp = line.split('=', 1) key = tmp[0].strip() val = tmp[1].strip() val = os.path.expandvars(val) replacements = _get_replacements( RE.findall(val), data, sec ) # pylint: disable=star-args if replacements: val = replace(val, *replacements) match = RE_IFELSE.match(val) if match: cond, enum = _eval_condition( match.group('cond'), arg, data, line_num, fname ) if enum == 1: continue groups = match.groups() val = groups[0] if cond else groups[2] else: match = RE_IF.match(val) if match: cond, enum = _eval_condition( match.group('cond'), arg, data, line_num, fname ) if enum == 1: continue if cond: val = match.group('iftrue') else: continue data[sec][key] = val return data def read_config(arg): """Read the configuration file xcpp.config""" path = arg.cfg if path == '.' and not os.path.exists('xcpp.config'): if 'XCPP_CONFIG_PATH' in os.environ: tmp_path = os.environ['XCPP_CONFIG_PATH'] if os.path.exists('%s/xcpp.config' % tmp_path): trace("Configured with: '%s/xcpp.config'\n" % tmp_path) path = tmp_path elif not os.path.exists('%s/xcpp.config' % path): error("ERROR: %s/xcpp.config does not exist\n" % path) arg.cfg = path try: config = _read_config('%s/xcpp.config' % path, arg) except IOError: config = OrderedDict() return config def run(arg): """Run command. """ config = read_config(arg) if arg.v: disp('path to xcpp.config: "%s"\n' % arg.cfg) if arg.var is None: for sec in config: disp('[%s]\n' % sec) for key in config[sec]: disp(' %s = %s\n' % (key, config[sec][key])) disp('\n') return try: command, var = arg.var.split('.', 1) except ValueError: error("ERROR: '%s' is not of the form sec.key\n" % arg.var) try: disp(config[command][var]+'\n') except KeyError: pass return def _update_single(cfg, name, defaults=None): "Helper function for get_cfg." if defaults: for var, val in defaults.iteritems(): cfg[name][var] = os.path.expandvars(str(val)) else: mod = import_mod('excentury.command.%s' % name) if hasattr(mod, "DEFAULTS"): for var, val in mod.DEFAULTS.iteritems(): cfg[name][var] = os.path.expandvars(val) def _update_from_file(cfg, name, cfg_file): "Helper function for get_cfg." if name in cfg_file: for var, val in cfg_file[name].iteritems(): cfg[name][var] = os.path.expandvars(val) def _update_from_arg(cfg, argdict, key): "Helper function for get_cfg." for var in cfg[key]: if var in argdict and argdict[var] is not None: cfg[key][var] = argdict[var] def get_cfg(arg, names, defaults=None): """Obtain the settings for a command. """ cfg = { 'xcpp': { 'root': '.', 'path': '.' } } cfg_file = read_config(arg) if 'xcpp' in cfg_file: for var, val in cfg_file['xcpp'].iteritems(): cfg['xcpp'][var] = os.path.expandvars(val) cfg['xcpp']['root'] = arg.cfg if isinstance(names, list): for name in names: cfg[name] = dict() _update_single(cfg, name) _update_from_file(cfg, name, cfg_file) else: if names != 'xcpp': cfg[names] = dict() _update_single(cfg, names, defaults) _update_from_file(cfg, names, cfg_file) argdict = vars(arg) if arg.parser_name in cfg: _update_from_arg(cfg, argdict, arg.parser_name) elif arg.parser_name == 'to' and arg.lang in cfg: _update_from_arg(cfg, argdict, arg.lang) _update_from_arg(cfg, argdict, 'xcpp') return cfg
[ 1, 9995, 3991, 13, 13, 4013, 3883, 338, 297, 8323, 310, 13138, 599, 278, 5181, 6055, 304, 13, 1552, 1791, 310, 278, 10585, 297, 429, 27371, 29889, 13, 13, 15945, 29908, 13, 13, 5215, 2897, 13, 5215, 337, 13, 5215, 10876, 13, 5215, 1426, 6312, 13, 5215, 1852, 5510, 13, 3166, 16250, 1053, 8170, 287, 21533, 13, 3166, 429, 27371, 29889, 6519, 1053, 1059, 29892, 9637, 29892, 1053, 29918, 1545, 13, 13, 2287, 7187, 353, 9995, 6103, 263, 5285, 934, 363, 429, 27371, 29889, 13, 13, 9526, 8820, 8560, 491, 429, 27371, 508, 367, 975, 17625, 491, 773, 13, 13305, 2066, 29889, 13, 13, 1762, 1074, 278, 1819, 393, 278, 5285, 934, 508, 26556, 671, 278, 13, 29952, 4381, 29879, 29952, 1899, 29889, 910, 674, 1596, 263, 1051, 310, 278, 6611, 322, 1819, 13, 735, 27371, 3913, 363, 278, 2183, 1899, 29889, 13, 13, 15945, 29908, 13, 13, 1525, 353, 337, 29889, 12198, 29898, 29878, 12764, 5303, 10780, 29925, 29966, 1989, 29958, 5575, 29973, 2915, 1495, 13, 1525, 29918, 6545, 353, 337, 29889, 12198, 29898, 13, 1678, 364, 29915, 10780, 29925, 29966, 361, 3009, 29958, 5575, 7897, 10762, 29905, 7110, 29961, 10780, 29925, 29966, 1116, 29958, 5575, 29973, 2144, 10725, 29962, 29915, 13, 29897, 13, 1525, 29918, 6545, 6670, 1660, 353, 337, 29889, 12198, 29898, 13, 1678, 364, 29915, 10780, 29925, 29966, 361, 3009, 29958, 5575, 7897, 10762, 29905, 7110, 29961, 10780, 29925, 29966, 1116, 29958, 5575, 29973, 2144, 10725, 29962, 6670, 1660, 22308, 29925, 29966, 2593, 1435, 29958, 5575, 16029, 13, 29897, 13, 13, 13, 1753, 12272, 29898, 7645, 1125, 13, 1678, 9995, 15646, 2820, 10876, 29889, 25393, 29889, 3539, 607, 338, 6839, 304, 23389, 408, 13, 1678, 278, 1596, 740, 541, 372, 947, 451, 788, 278, 25899, 2931, 29889, 9995, 13, 1678, 10876, 29889, 25393, 29889, 3539, 29898, 7645, 29897, 13, 13, 13, 1753, 903, 3445, 433, 2265, 10456, 1989, 29918, 791, 1125, 13, 1678, 9995, 10739, 740, 363, 5191, 29889, 13, 13, 1678, 7562, 29901, 529, 1124, 597, 2417, 29889, 510, 29914, 29874, 29914, 29896, 29945, 29906, 29906, 29896, 29900, 29953, 29947, 29914, 29955, 29947, 29947, 29945, 29945, 29941, 29958, 13, 1678, 9995, 13, 1678, 5191, 29918, 8977, 353, 9657, 29898, 1989, 29918, 791, 29897, 13, 1678, 16920, 29918, 2220, 353, 14013, 1993, 29901, 5191, 29918, 8977, 29961, 4352, 29889, 2972, 29898, 29900, 4638, 13, 1678, 4766, 353, 337, 29889, 12198, 703, 29989, 1642, 7122, 4197, 276, 29889, 21587, 29898, 29895, 29897, 363, 413, 29892, 903, 297, 1820, 29918, 791, 11724, 337, 29889, 29924, 29897, 13, 1678, 736, 14013, 1347, 29901, 4766, 29889, 1491, 29898, 3445, 9552, 29918, 2220, 29892, 1347, 29897, 13, 13, 13, 1753, 5191, 29898, 1807, 29892, 334, 1989, 29918, 791, 1125, 13, 1678, 9995, 5612, 9552, 310, 6031, 2309, 297, 697, 1209, 29889, 8741, 29901, 13, 13, 4706, 8653, 5191, 703, 29874, 529, 289, 2607, 289, 529, 274, 613, 6702, 29966, 742, 525, 29987, 1896, 29936, 5477, 6702, 29987, 742, 525, 29987, 1160, 29936, 8785, 13, 4706, 525, 29874, 669, 1896, 29936, 289, 669, 1160, 25359, 1160, 29936, 289, 669, 1896, 29936, 274, 29915, 13, 13, 1678, 7562, 29901, 529, 1124, 597, 2417, 29889, 510, 29914, 29874, 29914, 29896, 29945, 29906, 29906, 29896, 29900, 29953, 29947, 29914, 29955, 29947, 29947, 29945, 29945, 29941, 29958, 13, 13, 1678, 9995, 13, 1678, 736, 903, 3445, 433, 2265, 10456, 1989, 29918, 791, 5033, 1807, 29897, 13, 13, 13, 1990, 12782, 4205, 29886, 4276, 29898, 1191, 5510, 29889, 4276, 1125, 29871, 396, 282, 2904, 524, 29901, 11262, 29922, 29934, 29900, 29929, 29900, 29941, 13, 1678, 9995, 15383, 2347, 1852, 5510, 9123, 770, 304, 671, 746, 16384, 278, 13, 1678, 5285, 934, 322, 4423, 1213, 15945, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 13812, 29892, 7397, 29892, 1819, 29892, 2984, 29918, 1807, 29922, 8516, 1125, 13, 4706, 1018, 29901, 13, 9651, 1303, 29918, 2917, 29898, 22377, 29897, 13, 4706, 5174, 10663, 2392, 29901, 13, 9651, 12272, 877, 29916, 8223, 29889, 2917, 451, 1476, 297, 1273, 29878, 29905, 29876, 29915, 1273, 7397, 29889, 16859, 29897, 13, 4706, 1683, 29901, 13, 9651, 12272, 877, 2084, 304, 921, 8223, 29889, 2917, 29901, 11860, 29879, 26732, 29876, 29915, 1273, 7397, 29889, 16859, 29897, 13, 9651, 411, 1722, 877, 29995, 29879, 29914, 29916, 8223, 29889, 2917, 29915, 1273, 7397, 29889, 16859, 29892, 525, 29878, 1495, 408, 903, 18091, 29901, 13, 18884, 12272, 7373, 18091, 29889, 949, 3101, 13, 4706, 6876, 29898, 29900, 29897, 13, 13, 13, 1753, 788, 29918, 16680, 29898, 1491, 29886, 29892, 10650, 1125, 13, 1678, 376, 2528, 263, 13812, 304, 278, 1667, 1014, 16680, 29889, 376, 13, 1678, 27702, 407, 353, 1014, 29886, 29889, 1202, 29918, 16680, 877, 2917, 742, 1371, 2433, 17591, 429, 27371, 742, 13, 462, 965, 883, 2620, 29918, 1990, 29922, 1610, 29892, 13, 462, 965, 6139, 29922, 726, 6312, 29889, 7176, 296, 29898, 2287, 7187, 876, 13, 1678, 27702, 407, 29889, 1202, 29918, 23516, 877, 1707, 742, 1134, 29922, 710, 29892, 302, 5085, 2433, 29973, 742, 2322, 29922, 8516, 29892, 13, 462, 418, 1371, 2433, 29924, 504, 367, 297, 278, 883, 310, 5226, 29889, 1989, 1495, 13, 1678, 27702, 407, 29889, 1202, 29918, 23516, 877, 29899, 29894, 742, 3158, 2433, 8899, 29918, 3009, 742, 13, 462, 418, 1371, 2433, 2158, 2295, 934, 4423, 1495, 13, 1678, 27702, 407, 29889, 1202, 29918, 23516, 877, 489, 2158, 742, 3158, 29922, 3991, 4205, 29886, 4276, 29892, 13, 462, 418, 302, 5085, 29922, 29900, 29892, 13, 462, 418, 1371, 2433, 2158, 2295, 934, 322, 6876, 1495, 13, 13, 13, 1753, 903, 657, 29918, 3445, 4620, 4110, 29898, 517, 12360, 29892, 848, 29892, 5226, 1125, 13, 1678, 9995, 10739, 740, 363, 903, 949, 29918, 2917, 29889, 9995, 13, 1678, 1634, 4620, 4110, 353, 1051, 580, 13, 1678, 363, 5993, 297, 18897, 29901, 13, 4706, 565, 525, 11283, 297, 5993, 29901, 13, 9651, 260, 3471, 29892, 260, 1989, 353, 5993, 29889, 5451, 877, 29901, 1495, 13, 9651, 260, 791, 353, 6629, 13, 9651, 565, 260, 3471, 297, 848, 29901, 13, 18884, 565, 260, 1989, 297, 848, 29961, 29873, 3471, 5387, 13, 462, 1678, 260, 791, 353, 848, 29961, 29873, 3471, 3816, 29873, 1989, 29962, 13, 4706, 1683, 29901, 13, 9651, 565, 5993, 297, 848, 29961, 3471, 5387, 13, 18884, 260, 791, 353, 848, 29961, 3471, 3816, 6979, 29962, 13, 9651, 1683, 29901, 13, 18884, 260, 791, 353, 6629, 13, 4706, 1634, 4620, 4110, 29889, 4397, 29898, 13, 9651, 6702, 5303, 29995, 29879, 10162, 1273, 5993, 29892, 260, 791, 29897, 13, 4706, 1723, 13, 1678, 736, 1634, 4620, 4110, 13, 13, 13, 29937, 282, 2904, 524, 29901, 11262, 29922, 20965, 29899, 978, 13, 29937, 9033, 29954, 322, 17861, 29954, 526, 2983, 393, 1122, 367, 1304, 297, 278, 5285, 934, 29889, 13, 29937, 9033, 29954, 4076, 502, 2130, 304, 278, 1899, 1196, 6273, 322, 17861, 29954, 4076, 502, 13, 29937, 2130, 304, 278, 1857, 5285, 29889, 3940, 393, 773, 17861, 29954, 29961, 1989, 3816, 3471, 29962, 13, 29937, 338, 7126, 304, 6435, 1989, 29901, 3471, 1836, 4525, 2983, 748, 2750, 278, 15687, 13, 29937, 577, 393, 896, 1122, 367, 4780, 304, 9758, 297, 263, 5285, 934, 29889, 13, 1753, 903, 14513, 29918, 16122, 29898, 1116, 29892, 9033, 29954, 29892, 17861, 29954, 29892, 1196, 29918, 1949, 29892, 285, 978, 1125, 13, 1678, 9995, 29923, 4387, 1078, 263, 1347, 773, 278, 19745, 740, 29889, 739, 14677, 263, 13, 1678, 9177, 565, 727, 526, 738, 4436, 29889, 16969, 278, 1121, 310, 278, 13, 1678, 17983, 322, 385, 1059, 1353, 29901, 29871, 29900, 565, 4129, 338, 2691, 29892, 29871, 29896, 565, 13, 1678, 727, 471, 385, 1059, 29889, 9995, 13, 1678, 9033, 29954, 29889, 7724, 10145, 353, 14210, 29879, 22584, 29879, 22584, 29879, 29915, 1273, 313, 1718, 29954, 29889, 16859, 29892, 17861, 29954, 1839, 29916, 8223, 16215, 2084, 7464, 9033, 29954, 29889, 2080, 1445, 29897, 13, 1678, 1018, 29901, 13, 4706, 396, 282, 2904, 524, 29901, 11262, 29922, 14513, 29899, 3880, 13, 4706, 396, 1763, 367, 2221, 304, 14707, 263, 4195, 1728, 4969, 263, 3353, 13, 4706, 396, 716, 13812, 591, 508, 671, 278, 19745, 740, 29889, 1334, 1033, 505, 671, 13, 4706, 396, 263, 3017, 934, 408, 263, 5285, 541, 769, 727, 723, 367, 13, 4706, 396, 694, 2560, 3829, 304, 278, 2066, 29889, 13, 4706, 2148, 353, 19745, 29898, 1116, 29897, 13, 4706, 14115, 353, 29871, 29900, 13, 4706, 396, 282, 2904, 524, 29901, 11262, 29922, 6729, 328, 29899, 19499, 13, 4706, 396, 530, 1541, 292, 508, 748, 2743, 2645, 278, 8225, 310, 278, 421, 14513, 29952, 13, 4706, 396, 740, 29889, 1152, 445, 2769, 591, 1818, 1018, 304, 4380, 3099, 393, 13, 4706, 396, 1122, 2041, 1749, 982, 577, 393, 591, 1122, 2367, 714, 263, 9177, 2643, 13, 4706, 396, 322, 11455, 372, 29889, 13, 1678, 5174, 8960, 408, 3682, 29901, 13, 4706, 2148, 353, 6213, 13, 4706, 14115, 353, 29871, 29896, 13, 4706, 9637, 29898, 13, 9651, 525, 29956, 25614, 29901, 1059, 297, 1196, 1273, 29881, 310, 1273, 29878, 29901, 1273, 29879, 29905, 29876, 29915, 1273, 313, 13, 18884, 1196, 29918, 1949, 29892, 285, 978, 29892, 3682, 29889, 4906, 13, 9651, 1723, 13, 4706, 1723, 13, 1678, 736, 2148, 29892, 14115, 13, 13, 13, 1753, 903, 949, 29918, 2917, 29898, 29888, 978, 29892, 1852, 1125, 13, 1678, 9995, 15427, 13812, 304, 1303, 5285, 2066, 29889, 9995, 13, 1678, 848, 353, 8170, 287, 21533, 580, 13, 1678, 5226, 353, 6213, 13, 1678, 1196, 29918, 1949, 353, 29871, 29900, 13, 1678, 411, 1722, 29898, 29888, 978, 29892, 525, 29878, 1495, 408, 285, 8411, 29901, 13, 4706, 363, 1196, 297, 285, 8411, 29901, 13, 9651, 1196, 29918, 1949, 4619, 29871, 29896, 13, 9651, 565, 1196, 29961, 29900, 29962, 1275, 525, 1839, 29901, 13, 18884, 5226, 353, 1196, 29961, 29896, 13018, 29906, 29962, 13, 18884, 848, 29961, 3471, 29962, 353, 8170, 287, 21533, 580, 13, 9651, 25342, 525, 2433, 297, 1196, 29901, 13, 18884, 13128, 353, 1196, 29889, 5451, 877, 29922, 742, 29871, 29896, 29897, 13, 18884, 1820, 353, 13128, 29961, 29900, 1822, 17010, 580, 13, 18884, 659, 353, 13128, 29961, 29896, 1822, 17010, 580, 13, 18884, 659, 353, 2897, 29889, 2084, 29889, 18837, 16908, 29898, 791, 29897, 13, 18884, 1634, 4620, 4110, 353, 903, 657, 29918, 3445, 4620, 4110, 29898, 13, 462, 1678, 5195, 29889, 2886, 497, 29898, 791, 511, 848, 29892, 5226, 13, 18884, 1723, 13, 18884, 396, 282, 2904, 524, 29901, 11262, 29922, 8508, 29899, 5085, 13, 18884, 565, 1634, 4620, 4110, 29901, 13, 462, 1678, 659, 353, 5191, 29898, 791, 29892, 334, 3445, 4620, 4110, 29897, 13, 18884, 1993, 353, 5195, 29918, 6545, 6670, 1660, 29889, 4352, 29898, 791, 29897, 13, 18884, 565, 1993, 29901, 13, 462, 1678, 2148, 29892, 14115, 353, 903, 14513, 29918, 16122, 29898, 13, 462, 4706, 1993, 29889, 2972, 877, 1116, 5477, 1852, 29892, 848, 29892, 1196, 29918, 1949, 29892, 285, 978, 13, 462, 1678, 1723, 13, 462, 1678, 565, 14115, 1275, 29871, 29896, 29901, 13, 462, 4706, 6773, 13, 462, 1678, 6471, 353, 1993, 29889, 13155, 580, 13, 462, 1678, 659, 353, 6471, 29961, 29900, 29962, 565, 2148, 1683, 6471, 29961, 29906, 29962, 13, 18884, 1683, 29901, 13, 462, 1678, 1993, 353, 5195, 29918, 6545, 29889, 4352, 29898, 791, 29897, 13, 462, 1678, 565, 1993, 29901, 13, 462, 4706, 2148, 29892, 14115, 353, 903, 14513, 29918, 16122, 29898, 13, 462, 9651, 1993, 29889, 2972, 877, 1116, 5477, 1852, 29892, 848, 29892, 1196, 29918, 1949, 29892, 285, 978, 13, 462, 4706, 1723, 13, 462, 4706, 565, 14115, 1275, 29871, 29896, 29901, 13, 462, 9651, 6773, 13, 462, 4706, 565, 2148, 29901, 13, 462, 9651, 659, 353, 1993, 29889, 2972, 877, 361, 3009, 1495, 13, 462, 4706, 1683, 29901, 13, 462, 9651, 6773, 13, 18884, 848, 29961, 3471, 3816, 1989, 29962, 353, 659, 13, 1678, 736, 848, 13, 13, 13, 1753, 1303, 29918, 2917, 29898, 1191, 1125, 13, 1678, 9995, 6359, 278, 5285, 934, 921, 8223, 29889, 2917, 15945, 29908, 13, 1678, 2224, 353, 1852, 29889, 16859, 13, 1678, 565, 2224, 1275, 525, 6169, 322, 451, 2897, 29889, 2084, 29889, 9933, 877, 29916, 8223, 29889, 2917, 29374, 13, 4706, 565, 525, 29990, 6271, 29925, 29918, 25903, 29918, 10145, 29915, 297, 2897, 29889, 21813, 29901, 13, 9651, 13128, 29918, 2084, 353, 2897, 29889, 21813, 1839, 29990, 6271, 29925, 29918, 25903, 29918, 10145, 2033, 13, 9651, 565, 2897, 29889, 2084, 29889, 9933, 877, 29995, 29879, 29914, 29916, 8223, 29889, 2917, 29915, 1273, 13128, 29918, 2084, 1125, 13, 18884, 9637, 703, 3991, 2955, 411, 29901, 14210, 29879, 29914, 29916, 8223, 29889, 2917, 12764, 29876, 29908, 1273, 13128, 29918, 2084, 29897, 13, 18884, 2224, 353, 13128, 29918, 2084, 13, 1678, 25342, 451, 2897, 29889, 2084, 29889, 9933, 877, 29995, 29879, 29914, 29916, 8223, 29889, 2917, 29915, 1273, 2224, 1125, 13, 4706, 1059, 703, 11432, 29901, 1273, 29879, 29914, 29916, 8223, 29889, 2917, 947, 451, 1863, 29905, 29876, 29908, 1273, 2224, 29897, 13, 1678, 1852, 29889, 16859, 353, 2224, 13, 1678, 1018, 29901, 13, 4706, 2295, 353, 903, 949, 29918, 2917, 877, 29995, 29879, 29914, 29916, 8223, 29889, 2917, 29915, 1273, 2224, 29892, 1852, 29897, 13, 1678, 5174, 10663, 2392, 29901, 13, 4706, 2295, 353, 8170, 287, 21533, 580, 13, 1678, 736, 2295, 13, 13, 13, 1753, 1065, 29898, 1191, 1125, 13, 1678, 9995, 6558, 1899, 29889, 9995, 13, 1678, 2295, 353, 1303, 29918, 2917, 29898, 1191, 29897, 13, 1678, 565, 1852, 29889, 29894, 29901, 13, 4706, 12272, 877, 2084, 304, 921, 8223, 29889, 2917, 29901, 11860, 29879, 26732, 29876, 29915, 1273, 1852, 29889, 16859, 29897, 13, 1678, 565, 1852, 29889, 1707, 338, 6213, 29901, 13, 4706, 363, 5226, 297, 2295, 29901, 13, 9651, 12272, 877, 29961, 29995, 29879, 10725, 29876, 29915, 1273, 5226, 29897, 13, 9651, 363, 1820, 297, 2295, 29961, 3471, 5387, 13, 18884, 12272, 877, 29871, 1273, 29879, 353, 1273, 29879, 29905, 29876, 29915, 1273, 313, 1989, 29892, 2295, 29961, 3471, 3816, 1989, 12622, 13, 9651, 12272, 28909, 29876, 1495, 13, 4706, 736, 13, 1678, 1018, 29901, 13, 4706, 1899, 29892, 722, 353, 1852, 29889, 1707, 29889, 5451, 12839, 742, 29871, 29896, 29897, 13, 1678, 5174, 7865, 2392, 29901, 13, 4706, 1059, 703, 11432, 29901, 14210, 29879, 29915, 338, 451, 310, 278, 883, 5226, 29889, 1989, 29905, 29876, 29908, 1273, 1852, 29889, 1707, 29897, 13, 1678, 1018, 29901, 13, 4706, 12272, 29898, 2917, 29961, 6519, 3816, 1707, 10062, 12764, 29876, 1495, 13, 1678, 5174, 7670, 2392, 29901, 13, 4706, 1209, 13, 1678, 736, 13, 13, 13, 1753, 903, 5504, 29918, 14369, 29898, 16859, 29892, 1024, 29892, 21274, 29922, 8516, 1125, 13, 1678, 376, 10739, 740, 363, 679, 29918, 16859, 1213, 13, 1678, 565, 21274, 29901, 13, 4706, 363, 722, 29892, 659, 297, 21274, 29889, 1524, 7076, 7295, 13, 9651, 274, 16434, 29961, 978, 3816, 1707, 29962, 353, 2897, 29889, 2084, 29889, 18837, 16908, 29898, 710, 29898, 791, 876, 13, 1678, 1683, 29901, 13, 4706, 878, 353, 1053, 29918, 1545, 877, 735, 27371, 29889, 6519, 29889, 29995, 29879, 29915, 1273, 1024, 29897, 13, 4706, 565, 756, 5552, 29898, 1545, 29892, 376, 23397, 29903, 29908, 1125, 13, 9651, 363, 722, 29892, 659, 297, 878, 29889, 23397, 29903, 29889, 1524, 7076, 7295, 13, 18884, 274, 16434, 29961, 978, 3816, 1707, 29962, 353, 2897, 29889, 2084, 29889, 18837, 16908, 29898, 791, 29897, 13, 13, 13, 1753, 903, 5504, 29918, 3166, 29918, 1445, 29898, 16859, 29892, 1024, 29892, 274, 16434, 29918, 1445, 1125, 13, 1678, 376, 10739, 740, 363, 679, 29918, 16859, 1213, 13, 1678, 565, 1024, 297, 274, 16434, 29918, 1445, 29901, 13, 4706, 363, 722, 29892, 659, 297, 274, 16434, 29918, 1445, 29961, 978, 1822, 1524, 7076, 7295, 13, 9651, 274, 16434, 29961, 978, 3816, 1707, 29962, 353, 2897, 29889, 2084, 29889, 18837, 16908, 29898, 791, 29897, 13, 13, 13, 1753, 903, 5504, 29918, 3166, 29918, 1191, 29898, 16859, 29892, 1852, 8977, 29892, 1820, 1125, 13, 1678, 376, 10739, 740, 363, 679, 29918, 16859, 1213, 13, 1678, 363, 722, 297, 274, 16434, 29961, 1989, 5387, 13, 4706, 565, 722, 297, 1852, 8977, 322, 1852, 8977, 29961, 1707, 29962, 338, 451, 6213, 29901, 13, 9651, 274, 16434, 29961, 1989, 3816, 1707, 29962, 353, 1852, 8977, 29961, 1707, 29962, 13, 13, 13, 1753, 679, 29918, 16859, 29898, 1191, 29892, 2983, 29892, 21274, 29922, 8516, 1125, 13, 1678, 9995, 6039, 2408, 278, 6055, 363, 263, 1899, 29889, 9995, 13, 1678, 274, 16434, 353, 426, 13, 4706, 525, 29916, 8223, 2396, 426, 13, 9651, 525, 4632, 2396, 15300, 742, 13, 9651, 525, 2084, 2396, 525, 6169, 13, 4706, 500, 13, 1678, 500, 13, 1678, 274, 16434, 29918, 1445, 353, 1303, 29918, 2917, 29898, 1191, 29897, 13, 1678, 565, 525, 29916, 8223, 29915, 297, 274, 16434, 29918, 1445, 29901, 13, 4706, 363, 722, 29892, 659, 297, 274, 16434, 29918, 1445, 1839, 29916, 8223, 13359, 1524, 7076, 7295, 13, 9651, 274, 16434, 1839, 29916, 8223, 2033, 29961, 1707, 29962, 353, 2897, 29889, 2084, 29889, 18837, 16908, 29898, 791, 29897, 13, 1678, 274, 16434, 1839, 29916, 8223, 16215, 4632, 2033, 353, 1852, 29889, 16859, 13, 1678, 565, 338, 8758, 29898, 7039, 29892, 1051, 1125, 13, 4706, 363, 1024, 297, 2983, 29901, 13, 9651, 274, 16434, 29961, 978, 29962, 353, 9657, 580, 13, 9651, 903, 5504, 29918, 14369, 29898, 16859, 29892, 1024, 29897, 13, 9651, 903, 5504, 29918, 3166, 29918, 1445, 29898, 16859, 29892, 1024, 29892, 274, 16434, 29918, 1445, 29897, 13, 1678, 1683, 29901, 13, 4706, 565, 2983, 2804, 525, 29916, 8223, 2396, 13, 9651, 274, 16434, 29961, 7039, 29962, 353, 9657, 580, 13, 9651, 903, 5504, 29918, 14369, 29898, 16859, 29892, 2983, 29892, 21274, 29897, 13, 9651, 903, 5504, 29918, 3166, 29918, 1445, 29898, 16859, 29892, 2983, 29892, 274, 16434, 29918, 1445, 29897, 13, 1678, 1852, 8977, 353, 24987, 29898, 1191, 29897, 13, 1678, 565, 1852, 29889, 16680, 29918, 978, 297, 274, 16434, 29901, 13, 4706, 903, 5504, 29918, 3166, 29918, 1191, 29898, 16859, 29892, 1852, 8977, 29892, 1852, 29889, 16680, 29918, 978, 29897, 13, 1678, 25342, 1852, 29889, 16680, 29918, 978, 1275, 525, 517, 29915, 322, 1852, 29889, 3893, 297, 274, 16434, 29901, 13, 4706, 903, 5504, 29918, 3166, 29918, 1191, 29898, 16859, 29892, 1852, 8977, 29892, 1852, 29889, 3893, 29897, 13, 1678, 903, 5504, 29918, 3166, 29918, 1191, 29898, 16859, 29892, 1852, 8977, 29892, 525, 29916, 8223, 1495, 13, 1678, 736, 274, 16434, 13, 2 ]
.config/xmobar/getdate_fr.py
mdupuis13/dotfilez-dasboss-pc
0
112806
<reponame>mdupuis13/dotfilez-dasboss-pc<filename>.config/xmobar/getdate_fr.py #! /usr/bin/python3 import locale from datetime import datetime import sys import getopt import string locale.setlocale(locale.LC_ALL, '') loc = locale.getlocale() locale.setlocale(locale.LC_ALL, 'fr_CA.UTF-8') print('%s' % (string.capwords(datetime.now().strftime('%A, %d %B - %k:%M:%S')))) sys.exit(0)
[ 1, 529, 276, 1112, 420, 29958, 29885, 700, 25628, 29896, 29941, 29914, 6333, 1445, 29920, 29899, 17370, 29890, 2209, 29899, 6739, 29966, 9507, 15513, 2917, 29914, 29916, 29885, 22872, 29914, 657, 1256, 29918, 1341, 29889, 2272, 13, 29937, 29991, 847, 4855, 29914, 2109, 29914, 4691, 29941, 13, 5215, 15068, 13, 3166, 12865, 1053, 12865, 13, 5215, 10876, 13, 5215, 679, 3670, 13, 5215, 1347, 13, 13, 23337, 29889, 842, 23337, 29898, 23337, 29889, 12182, 29918, 9818, 29892, 27255, 13, 2029, 353, 15068, 29889, 657, 23337, 580, 13, 13, 23337, 29889, 842, 23337, 29898, 23337, 29889, 12182, 29918, 9818, 29892, 525, 1341, 29918, 5454, 29889, 10496, 29899, 29947, 1495, 13, 13, 2158, 877, 29995, 29879, 29915, 1273, 313, 1807, 29889, 5030, 9303, 29898, 12673, 29889, 3707, 2141, 710, 615, 603, 877, 29995, 29909, 29892, 1273, 29881, 1273, 29933, 448, 1273, 29895, 16664, 29924, 16664, 29903, 8785, 876, 13, 9675, 29889, 13322, 29898, 29900, 29897, 13, 2 ]
test_mnist/prepare_data.py
xuqinghan/learn_pytorch
0
1605689
import numpy as np from torchvision.datasets import mnist import torchvision.transforms as transforms from torch.utils.data import DataLoader batch_size_train = 64 batch_size_test = 128 learnrate = 0.01 transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize([0.5], [0.5])]) #download download = False dataset_train = mnist.MNIST('../data/mnist', train=True,transform=transform, download=download ) dataset_test = mnist.MNIST('../data/mnist', train=False,transform=transform ) loader_tr = DataLoader(dataset_train, batch_size=batch_size_train, shuffle=True) loader_ts = DataLoader(dataset_test, batch_size=batch_size_test, shuffle=False)
[ 1, 1053, 12655, 408, 7442, 13, 13, 3166, 4842, 305, 4924, 29889, 14538, 1691, 1053, 28597, 391, 13, 5215, 4842, 305, 4924, 29889, 9067, 29879, 408, 4327, 29879, 13, 3166, 4842, 305, 29889, 13239, 29889, 1272, 1053, 3630, 10036, 13, 13, 16175, 29918, 2311, 29918, 14968, 353, 29871, 29953, 29946, 13, 16175, 29918, 2311, 29918, 1688, 353, 29871, 29896, 29906, 29947, 13, 19668, 10492, 353, 29871, 29900, 29889, 29900, 29896, 13, 13, 13, 9067, 353, 4327, 29879, 29889, 1523, 4220, 4197, 9067, 29879, 29889, 1762, 29911, 6073, 3285, 4327, 29879, 29889, 19077, 675, 4197, 29900, 29889, 29945, 1402, 518, 29900, 29889, 29945, 2314, 2314, 13, 13, 29937, 10382, 13, 10382, 353, 7700, 13, 24713, 29918, 14968, 353, 28597, 391, 29889, 29924, 29940, 9047, 877, 6995, 1272, 29914, 23521, 391, 742, 7945, 29922, 5574, 29892, 9067, 29922, 9067, 29892, 5142, 29922, 10382, 1723, 13, 24713, 29918, 1688, 353, 28597, 391, 29889, 29924, 29940, 9047, 877, 6995, 1272, 29914, 23521, 391, 742, 7945, 29922, 8824, 29892, 9067, 29922, 9067, 1723, 13, 13, 12657, 29918, 509, 353, 3630, 10036, 29898, 24713, 29918, 14968, 29892, 9853, 29918, 2311, 29922, 16175, 29918, 2311, 29918, 14968, 29892, 528, 21897, 29922, 5574, 29897, 13, 12657, 29918, 1372, 353, 3630, 10036, 29898, 24713, 29918, 1688, 29892, 9853, 29918, 2311, 29922, 16175, 29918, 2311, 29918, 1688, 29892, 528, 21897, 29922, 8824, 29897, 2 ]
tests/core/base/test_computation.py
shhoalex/revgraph
9
85729
<reponame>shhoalex/revgraph import unittest import numpy as np from revgraph.core.base.tensor import Tensor class TensorImpl(Tensor): def forward(self): return class TensorGradientTestCase(unittest.TestCase): @classmethod def setUpClass(cls) -> None: cls.a = TensorImpl((3, 4), True) cls.b = TensorImpl((3, 4), True) def setUp(self) -> None: self.c = TensorImpl(None, True) self.c.register(self.a) self.c.register(self.b) self.c.new_context() def tearDown(self) -> None: del self.c def test_gradient_successfully_created(self): self.c.accumulate(self.a, np.ones((3,4))) self.assertEqual(self.c.shape, (3,4)) self.assertTrue((self.c.gradient == np.ones((3,4))).all()) def test_gradient_successfully_accumulated(self): self.c.accumulate(self.a, np.ones((3,4))) self.c.accumulate(self.b, np.ones((3,4))) result = np.full((3,4), 2) self.assertTrue((self.c.gradient == result).all()) def test_gradient_rejected_for_repeated_parent_node(self): self.c.accumulate(self.a, np.ones((3,4))) with self.assertRaises(ValueError): self.c.accumulate(self.a, np.ones((3,4))) def test_gradient_rejected_for_invalid_parent_node(self): self.c.accumulate(self.a, np.ones((3,4))) self.assertEqual(self.c.ctx[self.a], 0) with self.assertRaises(ValueError): self.c.accumulate(self.c, np.ones((3,4))) def test_context_completed_correctly(self): self.c.accumulate(self.a, np.ones((3,4))) self.assertFalse(self.c.context_completed()) self.c.accumulate(self.b, np.ones((3,4))) self.assertTrue(self.c.context_completed()) def test_context_completed_correctly_for_repeated_parent_node(self): self.c.register(self.a) self.c.new_context() self.c.accumulate(self.a, np.ones((3,4))) self.assertFalse(self.c.context_completed()) self.c.accumulate(self.a, np.ones((3, 4))) self.assertFalse(self.c.context_completed()) self.c.accumulate(self.b, np.ones((3,4))) self.assertTrue(self.c.context_completed()) class TensorUnbroadcastingTest(unittest.TestCase): def setUp(self) -> None: self.a = TensorImpl((1, 5), True) self.b = TensorImpl((5, 1), True) self.c = TensorImpl((3, 2), True) self.d = TensorImpl((), True) def tearDown(self) -> None: del self.a, self.b, self.c def test_unbroadcast_with_same_shape(self): m = np.ones((1,5)) result = self.a.unbroadcast(m) self.assertEqual(result.shape, (1,5)) self.assertTrue((result == np.array([[1,1,1,1,1]])).all()) m = np.ones((5,1)) result = self.b.unbroadcast(m) self.assertEqual(result.shape, (5,1)) self.assertTrue((result == np.array([[1, 1, 1, 1, 1]]).T).all()) def test_unbroadcast_with_different_row(self): m = np.ones((2,5)) result = self.a.unbroadcast(m) self.assertEqual(result.shape, (1,5)) self.assertTrue((result == np.array([[2,2,2,2,2]])).all()) m = np.ones((10,5)) result = self.a.unbroadcast(m) self.assertEqual(result.shape, (1,5)) self.assertTrue((result == np.array([[10,10,10,10,10]])).all()) m = np.ones((1,1)) result = self.b.unbroadcast(m) self.assertEqual(result.shape, (5,1)) self.assertTrue((result == np.array([[1, 1, 1, 1, 1]]).T).all()) def test_unbroadcast_with_different_col(self): m = np.ones((1,1)) result = self.a.unbroadcast(m) self.assertEqual(result.shape, (1,5)) self.assertTrue((result == np.array([[1,1,1,1,1]])).all()) m = np.ones((5,5)) result = self.b.unbroadcast(m) self.assertEqual(result.shape, (5,1)) self.assertTrue((result == np.array([[5,5,5,5,5]]).T).all()) def test_unbroadcast_with_extra_dimension(self): m = np.ones((5,)) result = self.a.unbroadcast(m) self.assertEqual(result.shape, (1,5)) self.assertTrue((result == np.array([[1,1,1,1,1]])).all()) def test_unbroadcast_with_different_col_and_row(self): m = np.ones((1,)) result = self.c.unbroadcast(m) self.assertEqual(result.shape, (3,2)) self.assertTrue((result == np.ones((3,2))).all()) def test_unbroadcast_with_invalid_shape(self): m = np.ones((3,3)) with self.assertRaises(ValueError): self.c.unbroadcast(m) m = np.ones((4,2)) with self.assertRaises(ValueError): self.c.unbroadcast(m) def test_unbroadcast_with_scalar(self): m = np.ones((3,3,3)) result = self.d.unbroadcast(m) self.assertTrue((result == np.int64(27)).all())
[ 1, 529, 276, 1112, 420, 29958, 845, 1251, 744, 29916, 29914, 13478, 4262, 13, 5215, 443, 27958, 13, 13, 5215, 12655, 408, 7442, 13, 13, 3166, 6664, 4262, 29889, 3221, 29889, 3188, 29889, 20158, 1053, 323, 6073, 13, 13, 13, 1990, 323, 6073, 6647, 29898, 29911, 6073, 1125, 13, 1678, 822, 6375, 29898, 1311, 1125, 13, 4706, 736, 13, 13, 13, 1990, 323, 6073, 25584, 993, 3057, 8259, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 731, 3373, 2385, 29898, 25932, 29897, 1599, 6213, 29901, 13, 4706, 1067, 29879, 29889, 29874, 353, 323, 6073, 6647, 3552, 29941, 29892, 29871, 29946, 511, 5852, 29897, 13, 4706, 1067, 29879, 29889, 29890, 353, 323, 6073, 6647, 3552, 29941, 29892, 29871, 29946, 511, 5852, 29897, 13, 13, 1678, 822, 731, 3373, 29898, 1311, 29897, 1599, 6213, 29901, 13, 4706, 1583, 29889, 29883, 353, 323, 6073, 6647, 29898, 8516, 29892, 5852, 29897, 13, 4706, 1583, 29889, 29883, 29889, 9573, 29898, 1311, 29889, 29874, 29897, 13, 4706, 1583, 29889, 29883, 29889, 9573, 29898, 1311, 29889, 29890, 29897, 13, 4706, 1583, 29889, 29883, 29889, 1482, 29918, 4703, 580, 13, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 29897, 1599, 6213, 29901, 13, 4706, 628, 1583, 29889, 29883, 13, 13, 1678, 822, 1243, 29918, 24970, 29918, 8698, 3730, 29918, 11600, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29883, 29889, 5753, 398, 5987, 29898, 1311, 29889, 29874, 29892, 7442, 29889, 2873, 3552, 29941, 29892, 29946, 4961, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1311, 29889, 29883, 29889, 12181, 29892, 313, 29941, 29892, 29946, 876, 13, 4706, 1583, 29889, 9294, 5574, 3552, 1311, 29889, 29883, 29889, 24970, 1275, 7442, 29889, 2873, 3552, 29941, 29892, 29946, 876, 467, 497, 3101, 13, 13, 1678, 822, 1243, 29918, 24970, 29918, 8698, 3730, 29918, 5753, 398, 7964, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29883, 29889, 5753, 398, 5987, 29898, 1311, 29889, 29874, 29892, 7442, 29889, 2873, 3552, 29941, 29892, 29946, 4961, 13, 4706, 1583, 29889, 29883, 29889, 5753, 398, 5987, 29898, 1311, 29889, 29890, 29892, 7442, 29889, 2873, 3552, 29941, 29892, 29946, 4961, 13, 4706, 1121, 353, 7442, 29889, 8159, 3552, 29941, 29892, 29946, 511, 29871, 29906, 29897, 13, 4706, 1583, 29889, 9294, 5574, 3552, 1311, 29889, 29883, 29889, 24970, 1275, 1121, 467, 497, 3101, 13, 13, 1678, 822, 1243, 29918, 24970, 29918, 276, 622, 287, 29918, 1454, 29918, 276, 412, 630, 29918, 3560, 29918, 3177, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29883, 29889, 5753, 398, 5987, 29898, 1311, 29889, 29874, 29892, 7442, 29889, 2873, 3552, 29941, 29892, 29946, 4961, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 1917, 2392, 1125, 13, 9651, 1583, 29889, 29883, 29889, 5753, 398, 5987, 29898, 1311, 29889, 29874, 29892, 7442, 29889, 2873, 3552, 29941, 29892, 29946, 4961, 13, 13, 1678, 822, 1243, 29918, 24970, 29918, 276, 622, 287, 29918, 1454, 29918, 20965, 29918, 3560, 29918, 3177, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29883, 29889, 5753, 398, 5987, 29898, 1311, 29889, 29874, 29892, 7442, 29889, 2873, 3552, 29941, 29892, 29946, 4961, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1311, 29889, 29883, 29889, 13073, 29961, 1311, 29889, 29874, 1402, 29871, 29900, 29897, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 1917, 2392, 1125, 13, 9651, 1583, 29889, 29883, 29889, 5753, 398, 5987, 29898, 1311, 29889, 29883, 29892, 7442, 29889, 2873, 3552, 29941, 29892, 29946, 4961, 13, 13, 1678, 822, 1243, 29918, 4703, 29918, 5729, 9446, 29918, 15728, 368, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29883, 29889, 5753, 398, 5987, 29898, 1311, 29889, 29874, 29892, 7442, 29889, 2873, 3552, 29941, 29892, 29946, 4961, 13, 4706, 1583, 29889, 9294, 8824, 29898, 1311, 29889, 29883, 29889, 4703, 29918, 5729, 9446, 3101, 13, 4706, 1583, 29889, 29883, 29889, 5753, 398, 5987, 29898, 1311, 29889, 29890, 29892, 7442, 29889, 2873, 3552, 29941, 29892, 29946, 4961, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 29883, 29889, 4703, 29918, 5729, 9446, 3101, 13, 13, 1678, 822, 1243, 29918, 4703, 29918, 5729, 9446, 29918, 15728, 368, 29918, 1454, 29918, 276, 412, 630, 29918, 3560, 29918, 3177, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29883, 29889, 9573, 29898, 1311, 29889, 29874, 29897, 13, 4706, 1583, 29889, 29883, 29889, 1482, 29918, 4703, 580, 13, 4706, 1583, 29889, 29883, 29889, 5753, 398, 5987, 29898, 1311, 29889, 29874, 29892, 7442, 29889, 2873, 3552, 29941, 29892, 29946, 4961, 13, 4706, 1583, 29889, 9294, 8824, 29898, 1311, 29889, 29883, 29889, 4703, 29918, 5729, 9446, 3101, 13, 4706, 1583, 29889, 29883, 29889, 5753, 398, 5987, 29898, 1311, 29889, 29874, 29892, 7442, 29889, 2873, 3552, 29941, 29892, 29871, 29946, 4961, 13, 4706, 1583, 29889, 9294, 8824, 29898, 1311, 29889, 29883, 29889, 4703, 29918, 5729, 9446, 3101, 13, 4706, 1583, 29889, 29883, 29889, 5753, 398, 5987, 29898, 1311, 29889, 29890, 29892, 7442, 29889, 2873, 3552, 29941, 29892, 29946, 4961, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 29883, 29889, 4703, 29918, 5729, 9446, 3101, 13, 13, 13, 1990, 323, 6073, 2525, 6729, 328, 4384, 292, 3057, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 29897, 1599, 6213, 29901, 13, 4706, 1583, 29889, 29874, 353, 323, 6073, 6647, 3552, 29896, 29892, 29871, 29945, 511, 5852, 29897, 13, 4706, 1583, 29889, 29890, 353, 323, 6073, 6647, 3552, 29945, 29892, 29871, 29896, 511, 5852, 29897, 13, 4706, 1583, 29889, 29883, 353, 323, 6073, 6647, 3552, 29941, 29892, 29871, 29906, 511, 5852, 29897, 13, 4706, 1583, 29889, 29881, 353, 323, 6073, 6647, 29898, 3285, 5852, 29897, 13, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 29897, 1599, 6213, 29901, 13, 4706, 628, 1583, 29889, 29874, 29892, 1583, 29889, 29890, 29892, 1583, 29889, 29883, 13, 13, 1678, 822, 1243, 29918, 348, 6729, 328, 4384, 29918, 2541, 29918, 17642, 29918, 12181, 29898, 1311, 1125, 13, 4706, 286, 353, 7442, 29889, 2873, 3552, 29896, 29892, 29945, 876, 13, 4706, 1121, 353, 1583, 29889, 29874, 29889, 348, 6729, 328, 4384, 29898, 29885, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2914, 29889, 12181, 29892, 313, 29896, 29892, 29945, 876, 13, 4706, 1583, 29889, 9294, 5574, 3552, 2914, 1275, 7442, 29889, 2378, 4197, 29961, 29896, 29892, 29896, 29892, 29896, 29892, 29896, 29892, 29896, 24960, 467, 497, 3101, 13, 13, 4706, 286, 353, 7442, 29889, 2873, 3552, 29945, 29892, 29896, 876, 13, 4706, 1121, 353, 1583, 29889, 29890, 29889, 348, 6729, 328, 4384, 29898, 29885, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2914, 29889, 12181, 29892, 313, 29945, 29892, 29896, 876, 13, 4706, 1583, 29889, 9294, 5574, 3552, 2914, 1275, 7442, 29889, 2378, 4197, 29961, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 5262, 467, 29911, 467, 497, 3101, 13, 13, 1678, 822, 1243, 29918, 348, 6729, 328, 4384, 29918, 2541, 29918, 29881, 15622, 29918, 798, 29898, 1311, 1125, 13, 4706, 286, 353, 7442, 29889, 2873, 3552, 29906, 29892, 29945, 876, 13, 4706, 1121, 353, 1583, 29889, 29874, 29889, 348, 6729, 328, 4384, 29898, 29885, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2914, 29889, 12181, 29892, 313, 29896, 29892, 29945, 876, 13, 4706, 1583, 29889, 9294, 5574, 3552, 2914, 1275, 7442, 29889, 2378, 4197, 29961, 29906, 29892, 29906, 29892, 29906, 29892, 29906, 29892, 29906, 24960, 467, 497, 3101, 13, 13, 4706, 286, 353, 7442, 29889, 2873, 3552, 29896, 29900, 29892, 29945, 876, 13, 4706, 1121, 353, 1583, 29889, 29874, 29889, 348, 6729, 328, 4384, 29898, 29885, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2914, 29889, 12181, 29892, 313, 29896, 29892, 29945, 876, 13, 4706, 1583, 29889, 9294, 5574, 3552, 2914, 1275, 7442, 29889, 2378, 4197, 29961, 29896, 29900, 29892, 29896, 29900, 29892, 29896, 29900, 29892, 29896, 29900, 29892, 29896, 29900, 24960, 467, 497, 3101, 13, 13, 4706, 286, 353, 7442, 29889, 2873, 3552, 29896, 29892, 29896, 876, 13, 4706, 1121, 353, 1583, 29889, 29890, 29889, 348, 6729, 328, 4384, 29898, 29885, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2914, 29889, 12181, 29892, 313, 29945, 29892, 29896, 876, 13, 4706, 1583, 29889, 9294, 5574, 3552, 2914, 1275, 7442, 29889, 2378, 4197, 29961, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 5262, 467, 29911, 467, 497, 3101, 13, 13, 1678, 822, 1243, 29918, 348, 6729, 328, 4384, 29918, 2541, 29918, 29881, 15622, 29918, 1054, 29898, 1311, 1125, 13, 4706, 286, 353, 7442, 29889, 2873, 3552, 29896, 29892, 29896, 876, 13, 4706, 1121, 353, 1583, 29889, 29874, 29889, 348, 6729, 328, 4384, 29898, 29885, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2914, 29889, 12181, 29892, 313, 29896, 29892, 29945, 876, 13, 4706, 1583, 29889, 9294, 5574, 3552, 2914, 1275, 7442, 29889, 2378, 4197, 29961, 29896, 29892, 29896, 29892, 29896, 29892, 29896, 29892, 29896, 24960, 467, 497, 3101, 13, 13, 4706, 286, 353, 7442, 29889, 2873, 3552, 29945, 29892, 29945, 876, 13, 4706, 1121, 353, 1583, 29889, 29890, 29889, 348, 6729, 328, 4384, 29898, 29885, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2914, 29889, 12181, 29892, 313, 29945, 29892, 29896, 876, 13, 4706, 1583, 29889, 9294, 5574, 3552, 2914, 1275, 7442, 29889, 2378, 4197, 29961, 29945, 29892, 29945, 29892, 29945, 29892, 29945, 29892, 29945, 5262, 467, 29911, 467, 497, 3101, 13, 13, 1678, 822, 1243, 29918, 348, 6729, 328, 4384, 29918, 2541, 29918, 17833, 29918, 6229, 2673, 29898, 1311, 1125, 13, 4706, 286, 353, 7442, 29889, 2873, 3552, 29945, 29892, 876, 13, 4706, 1121, 353, 1583, 29889, 29874, 29889, 348, 6729, 328, 4384, 29898, 29885, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2914, 29889, 12181, 29892, 313, 29896, 29892, 29945, 876, 13, 4706, 1583, 29889, 9294, 5574, 3552, 2914, 1275, 7442, 29889, 2378, 4197, 29961, 29896, 29892, 29896, 29892, 29896, 29892, 29896, 29892, 29896, 24960, 467, 497, 3101, 13, 13, 1678, 822, 1243, 29918, 348, 6729, 328, 4384, 29918, 2541, 29918, 29881, 15622, 29918, 1054, 29918, 392, 29918, 798, 29898, 1311, 1125, 13, 4706, 286, 353, 7442, 29889, 2873, 3552, 29896, 29892, 876, 13, 4706, 1121, 353, 1583, 29889, 29883, 29889, 348, 6729, 328, 4384, 29898, 29885, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2914, 29889, 12181, 29892, 313, 29941, 29892, 29906, 876, 13, 4706, 1583, 29889, 9294, 5574, 3552, 2914, 1275, 7442, 29889, 2873, 3552, 29941, 29892, 29906, 876, 467, 497, 3101, 13, 13, 1678, 822, 1243, 29918, 348, 6729, 328, 4384, 29918, 2541, 29918, 20965, 29918, 12181, 29898, 1311, 1125, 13, 4706, 286, 353, 7442, 29889, 2873, 3552, 29941, 29892, 29941, 876, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 1917, 2392, 1125, 13, 9651, 1583, 29889, 29883, 29889, 348, 6729, 328, 4384, 29898, 29885, 29897, 13, 13, 4706, 286, 353, 7442, 29889, 2873, 3552, 29946, 29892, 29906, 876, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 1917, 2392, 1125, 13, 9651, 1583, 29889, 29883, 29889, 348, 6729, 328, 4384, 29898, 29885, 29897, 13, 13, 1678, 822, 1243, 29918, 348, 6729, 328, 4384, 29918, 2541, 29918, 19529, 279, 29898, 1311, 1125, 13, 4706, 286, 353, 7442, 29889, 2873, 3552, 29941, 29892, 29941, 29892, 29941, 876, 13, 4706, 1121, 353, 1583, 29889, 29881, 29889, 348, 6729, 328, 4384, 29898, 29885, 29897, 13, 4706, 1583, 29889, 9294, 5574, 3552, 2914, 1275, 7442, 29889, 524, 29953, 29946, 29898, 29906, 29955, 8106, 497, 3101, 13, 2 ]
app/tree.py
fberanizo/teachingtool
0
126916
<filename>app/tree.py<gh_stars>0 # -*- coding: utf-8 -*- import numpy, pandas from sklearn.base import BaseEstimator, ClassifierMixin from collections import deque from . import gain, gini class DecisionTree: """Classe que implementa uma árvore de decisão para classificação.""" def __init__(self, X, y, attributes, attribute_selection_method='gain'): self.X = X self.y = y self.attributes = attributes self.attribute_selection_method = attribute_selection_method self.samples_size, self.input_size = X.shape self.id_pool = 1 self.remaining_attributes = list(range(len(attributes))) # Inicializa a árvore com a partição total dos dados de treinamento self.tree = dict([('id', 0), ('label', None), ('type', 'question'), ('partition', range(y.size)), ('X_partition', self.X), ('y_partition', self.y), ('value', None), ('parent', None), ('children', [])]) self.nodes = [] self.edges = [] # Mantém uma fila de nós que precisam ser completados self.queue = deque() self.queue.append(self.tree) def create_node(self): """Cria um nó da árvore de decisão. """ if len(self.queue) > 0: node = self.queue.popleft() # Cria uma aresta conectando este nó ao pai if node['parent'] is not None: self.edges.append((node['parent'], node['id'])) X_partition = node['X_partition'] y_partition = node['y_partition'] # Se os rótulos em y são todos da mesma classe C, então a decisão é C classes = numpy.unique(y_partition) if len(classes) == 1: node['label'] = classes[0] node['type'] = 'decision' self.nodes.append(node) return # Se a lista de atributos está vazia, então a decisão é a classe majoritária de y if len(self.remaining_attributes) == 0: unique, pos = numpy.unique(y_partition, return_inverse=True) counts = numpy.bincount(pos) node['label'] = unique[counts.argmax()] node['type'] = 'decision' self.nodes.append(node) return # Calcula métrica de seleção de atributo com base no critério definido no construtor attributes = self.calculate_attribute_selection_metric(X_partition, y_partition) # Escolhe o atributo com maior métrica best_attribute = max(attributes, key=lambda item: item['metric']) node['label'] = best_attribute['attribute'] self.nodes.append(node) self.remaining_attributes.remove(self.attributes.index(best_attribute['attribute'])) # Cria um nó para cada partição for partition, value in zip(best_attribute['partitions'], best_attribute['values']): child = dict([('id', self.id_pool), ('label', None), ('type', 'question'), ('partition', partition), ('X_partition', node['X_partition'][partition]), ('y_partition', node['y_partition'][partition]), ('value', value), ('parent', node['id']), ('children', [])]) node['children'].append(child) self.queue.append(child) self.id_pool += 1 def calculate_attribute_selection_metric(self, X_partition, y_partition): """Retorna um dict com métrica de seleção e as partições que o atributo realiza.""" if self.attribute_selection_method not in ['gain', 'gini']: raise Exception('Método de seleção de atributo não implementado.') else: attributes = [] for index in self.remaining_attributes: if self.attribute_selection_method == 'gain': metric, partitions, values = gain.gain(X_partition[:,index], y_partition) elif self.attribute_selection_method == 'gini': metric, partitions, values = gini.gini(X_partition[:,index], y_partition) attributes.append({'attribute': self.attributes[index], 'metric': metric, 'partitions': partitions, 'values': values}) return attributes
[ 1, 529, 9507, 29958, 932, 29914, 8336, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 12655, 29892, 11701, 13, 3166, 2071, 19668, 29889, 3188, 1053, 7399, 12787, 326, 1061, 29892, 4134, 3709, 29924, 861, 262, 13, 3166, 16250, 1053, 316, 802, 13, 3166, 869, 1053, 11581, 29892, 330, 2172, 13, 13, 1990, 3826, 2459, 9643, 29901, 13, 1678, 9995, 29907, 14537, 712, 2334, 29874, 3672, 28786, 29894, 487, 316, 22442, 1368, 1702, 20670, 8298, 1213, 15945, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1060, 29892, 343, 29892, 8393, 29892, 5352, 29918, 21731, 29918, 5696, 2433, 29887, 475, 29374, 13, 4706, 1583, 29889, 29990, 353, 1060, 13, 4706, 1583, 29889, 29891, 353, 343, 13, 4706, 1583, 29889, 15697, 353, 8393, 13, 4706, 1583, 29889, 12715, 29918, 21731, 29918, 5696, 353, 5352, 29918, 21731, 29918, 5696, 13, 4706, 1583, 29889, 27736, 29918, 2311, 29892, 1583, 29889, 2080, 29918, 2311, 353, 1060, 29889, 12181, 13, 4706, 1583, 29889, 333, 29918, 10109, 353, 29871, 29896, 13, 4706, 1583, 29889, 1745, 17225, 29918, 15697, 353, 1051, 29898, 3881, 29898, 2435, 29898, 15697, 4961, 13, 13, 4706, 396, 512, 5611, 6619, 263, 28786, 29894, 487, 419, 263, 760, 12556, 3001, 3248, 270, 2255, 316, 2578, 262, 4487, 13, 4706, 1583, 29889, 8336, 353, 9657, 4197, 877, 333, 742, 29871, 29900, 511, 6702, 1643, 742, 6213, 511, 6702, 1853, 742, 525, 12470, 5477, 6702, 16707, 742, 3464, 29898, 29891, 29889, 2311, 8243, 6702, 29990, 29918, 16707, 742, 1583, 29889, 29990, 511, 6702, 29891, 29918, 16707, 742, 1583, 29889, 29891, 511, 6702, 1767, 742, 6213, 511, 6702, 3560, 742, 6213, 511, 6702, 11991, 742, 518, 2314, 2314, 13, 4706, 1583, 29889, 18010, 353, 5159, 13, 4706, 1583, 29889, 287, 2710, 353, 5159, 13, 13, 4706, 396, 26873, 2249, 3672, 977, 29874, 316, 302, 7173, 712, 12132, 314, 724, 3315, 2255, 13, 4706, 1583, 29889, 9990, 353, 316, 802, 580, 13, 4706, 1583, 29889, 9990, 29889, 4397, 29898, 1311, 29889, 8336, 29897, 13, 13, 1678, 822, 1653, 29918, 3177, 29898, 1311, 1125, 13, 4706, 9995, 29907, 2849, 1922, 302, 29980, 1146, 28786, 29894, 487, 316, 22442, 1368, 29889, 9995, 13, 4706, 565, 7431, 29898, 1311, 29889, 9990, 29897, 1405, 29871, 29900, 29901, 13, 9651, 2943, 353, 1583, 29889, 9990, 29889, 7323, 1563, 580, 13, 13, 9651, 396, 315, 2849, 3672, 564, 4405, 378, 522, 1743, 4404, 302, 29980, 5017, 282, 1794, 13, 9651, 565, 2943, 1839, 3560, 2033, 338, 451, 6213, 29901, 13, 18884, 1583, 29889, 287, 2710, 29889, 4397, 3552, 3177, 1839, 3560, 7464, 2943, 1839, 333, 25901, 13, 13, 9651, 1060, 29918, 16707, 353, 2943, 1839, 29990, 29918, 16707, 2033, 13, 9651, 343, 29918, 16707, 353, 2943, 1839, 29891, 29918, 16707, 2033, 13, 13, 9651, 396, 922, 2897, 364, 15827, 19733, 953, 343, 12777, 10843, 1146, 4883, 655, 17792, 315, 29892, 28087, 263, 22442, 1368, 904, 315, 13, 9651, 4413, 353, 12655, 29889, 13092, 29898, 29891, 29918, 16707, 29897, 13, 9651, 565, 7431, 29898, 13203, 29897, 1275, 29871, 29896, 29901, 13, 18884, 2943, 1839, 1643, 2033, 353, 4413, 29961, 29900, 29962, 13, 18884, 2943, 1839, 1853, 2033, 353, 525, 7099, 2459, 29915, 13, 18884, 1583, 29889, 18010, 29889, 4397, 29898, 3177, 29897, 13, 18884, 736, 13, 13, 9651, 396, 922, 263, 15023, 316, 472, 1091, 20864, 7919, 325, 834, 423, 29892, 28087, 263, 22442, 1368, 904, 263, 17792, 4655, 277, 21925, 316, 343, 13, 9651, 565, 7431, 29898, 1311, 29889, 1745, 17225, 29918, 15697, 29897, 1275, 29871, 29900, 29901, 13, 18884, 5412, 29892, 926, 353, 12655, 29889, 13092, 29898, 29891, 29918, 16707, 29892, 736, 29918, 262, 3901, 29922, 5574, 29897, 13, 18884, 18139, 353, 12655, 29889, 2109, 2798, 29898, 1066, 29897, 13, 18884, 2943, 1839, 1643, 2033, 353, 5412, 29961, 2798, 29879, 29889, 1191, 3317, 580, 29962, 13, 18884, 2943, 1839, 1853, 2033, 353, 525, 7099, 2459, 29915, 13, 18884, 1583, 29889, 18010, 29889, 4397, 29898, 3177, 29897, 13, 18884, 736, 13, 13, 9651, 396, 20535, 29874, 8774, 509, 983, 316, 16954, 2340, 316, 472, 1091, 3066, 419, 2967, 694, 3994, 4894, 29877, 7403, 1941, 694, 378, 710, 3406, 13, 9651, 8393, 353, 1583, 29889, 15807, 403, 29918, 12715, 29918, 21731, 29918, 16414, 29898, 29990, 29918, 16707, 29892, 343, 29918, 16707, 29897, 13, 13, 9651, 396, 3423, 1054, 354, 288, 472, 1091, 3066, 419, 17136, 8774, 509, 983, 13, 9651, 1900, 29918, 12715, 353, 4236, 29898, 15697, 29892, 1820, 29922, 2892, 2944, 29901, 2944, 1839, 16414, 11287, 13, 13, 9651, 2943, 1839, 1643, 2033, 353, 1900, 29918, 12715, 1839, 12715, 2033, 13, 9651, 1583, 29889, 18010, 29889, 4397, 29898, 3177, 29897, 13, 13, 9651, 1583, 29889, 1745, 17225, 29918, 15697, 29889, 5992, 29898, 1311, 29889, 15697, 29889, 2248, 29898, 13318, 29918, 12715, 1839, 12715, 25901, 13, 13, 9651, 396, 315, 2849, 1922, 302, 29980, 1702, 9747, 760, 12556, 13, 9651, 363, 8877, 29892, 995, 297, 14319, 29898, 13318, 29918, 12715, 1839, 1595, 2187, 7464, 1900, 29918, 12715, 1839, 5975, 2033, 1125, 13, 18884, 2278, 353, 9657, 4197, 877, 333, 742, 1583, 29889, 333, 29918, 10109, 511, 6702, 1643, 742, 6213, 511, 6702, 1853, 742, 525, 12470, 5477, 6702, 16707, 742, 8877, 511, 6702, 29990, 29918, 16707, 742, 2943, 1839, 29990, 29918, 16707, 2033, 29961, 16707, 11724, 6702, 29891, 29918, 16707, 742, 2943, 1839, 29891, 29918, 16707, 2033, 29961, 16707, 11724, 6702, 1767, 742, 995, 511, 6702, 3560, 742, 2943, 1839, 333, 2033, 511, 6702, 11991, 742, 518, 2314, 2314, 13, 18884, 2943, 1839, 11991, 13359, 4397, 29898, 5145, 29897, 13, 18884, 1583, 29889, 9990, 29889, 4397, 29898, 5145, 29897, 13, 18884, 1583, 29889, 333, 29918, 10109, 4619, 29871, 29896, 13, 13, 1678, 822, 8147, 29918, 12715, 29918, 21731, 29918, 16414, 29898, 1311, 29892, 1060, 29918, 16707, 29892, 343, 29918, 16707, 1125, 13, 4706, 9995, 8015, 272, 1056, 1922, 9657, 419, 8774, 509, 983, 316, 16954, 2340, 321, 408, 17756, 5616, 712, 288, 472, 1091, 3066, 1855, 6619, 1213, 15945, 13, 4706, 565, 1583, 29889, 12715, 29918, 21731, 29918, 5696, 451, 297, 6024, 29887, 475, 742, 525, 29887, 2172, 2033, 29901, 13, 9651, 12020, 8960, 877, 29924, 1893, 8144, 316, 16954, 2340, 316, 472, 1091, 3066, 8145, 2334, 912, 29889, 1495, 13, 4706, 1683, 29901, 13, 9651, 8393, 353, 5159, 13, 9651, 363, 2380, 297, 1583, 29889, 1745, 17225, 29918, 15697, 29901, 13, 18884, 565, 1583, 29889, 12715, 29918, 21731, 29918, 5696, 1275, 525, 29887, 475, 2396, 13, 462, 1678, 12714, 29892, 23629, 29892, 1819, 353, 11581, 29889, 29887, 475, 29898, 29990, 29918, 16707, 7503, 29892, 2248, 1402, 343, 29918, 16707, 29897, 13, 18884, 25342, 1583, 29889, 12715, 29918, 21731, 29918, 5696, 1275, 525, 29887, 2172, 2396, 13, 462, 1678, 12714, 29892, 23629, 29892, 1819, 353, 330, 2172, 29889, 29887, 2172, 29898, 29990, 29918, 16707, 7503, 29892, 2248, 1402, 343, 29918, 16707, 29897, 13, 18884, 8393, 29889, 4397, 3319, 29915, 12715, 2396, 1583, 29889, 15697, 29961, 2248, 1402, 525, 16414, 2396, 12714, 29892, 525, 1595, 2187, 2396, 23629, 29892, 525, 5975, 2396, 1819, 1800, 13, 9651, 736, 8393, 13, 2 ]
opencv_py/feature_detection/corner_harris.py
yinleiCoder/interesting-python
0
192649
<filename>opencv_py/feature_detection/corner_harris.py<gh_stars>0 import cv2 import numpy as np """ Harris角点检测: 光滑地区,无论向哪里移动,衡量系数不变 边缘地址,垂直边缘移动时,衡量系数变化剧烈 在交点处,往哪个方向移动,衡量系数都变化剧烈 cornerHarris(img, dst, blockSize, ksize, k) blockSize: 检测窗口大小 ksize: Sobel的卷积核 k:权重系数,经验值,一般取0.02~0.04之间 """ img = cv2.imread(r'E:\PycharmProjects\funnyPython\opencv_py\data\imgs\chess.png') #灰度化 gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) blockSize = 2 ksize = 3 k = 0.04 dst = cv2.cornerHarris(gray_img, blockSize, ksize, k) # harris角点展示 img[dst > 0.01*dst.max()] = [0, 0, 255] cv2.imshow('harris', img) cv2.waitKey(0)
[ 1, 529, 9507, 29958, 3150, 11023, 29918, 2272, 29914, 14394, 29918, 29881, 2650, 428, 29914, 2616, 1089, 29918, 29882, 2749, 275, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 13850, 29906, 13, 5215, 12655, 408, 7442, 13, 15945, 29908, 13, 29950, 2749, 275, 31432, 30940, 233, 166, 131, 31851, 30383, 13, 268, 30867, 233, 190, 148, 30533, 30467, 30214, 31352, 235, 177, 189, 31331, 232, 150, 173, 30755, 31618, 30846, 30214, 235, 164, 164, 31180, 31185, 30354, 30413, 31462, 13, 268, 31993, 234, 191, 155, 30533, 31702, 30214, 232, 161, 133, 31157, 31993, 234, 191, 155, 31618, 30846, 30594, 30214, 235, 164, 164, 31180, 31185, 30354, 31462, 30705, 232, 140, 170, 234, 134, 139, 13, 268, 30505, 31398, 30940, 31548, 30214, 232, 193, 131, 232, 150, 173, 30502, 30525, 31331, 31618, 30846, 30214, 235, 164, 164, 31180, 31185, 30354, 30769, 31462, 30705, 232, 140, 170, 234, 134, 139, 13, 1678, 11155, 29950, 2749, 275, 29898, 2492, 29892, 29743, 29892, 2908, 3505, 29892, 413, 2311, 29892, 413, 29897, 13, 1678, 2908, 3505, 29901, 259, 233, 166, 131, 31851, 234, 173, 154, 30856, 30257, 30446, 13, 1678, 413, 2311, 29901, 25147, 295, 30210, 232, 144, 186, 234, 170, 178, 233, 163, 187, 13, 1678, 413, 30383, 233, 160, 134, 30908, 31185, 30354, 30214, 31412, 236, 173, 143, 30959, 30214, 30287, 235, 139, 175, 30683, 29900, 29889, 29900, 29906, 30022, 29900, 29889, 29900, 29946, 30577, 31016, 13, 15945, 29908, 13, 2492, 353, 13850, 29906, 29889, 326, 949, 29898, 29878, 29915, 29923, 3583, 29925, 3376, 2817, 25119, 29905, 7692, 1460, 11980, 29905, 3150, 11023, 29918, 2272, 29905, 1272, 29905, 2492, 29879, 29905, 305, 404, 29889, 2732, 1495, 13, 29937, 234, 132, 179, 30898, 30705, 13, 21012, 29918, 2492, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 2492, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29954, 22800, 29897, 13, 13, 1271, 3505, 353, 29871, 29906, 13, 2039, 675, 353, 29871, 29941, 13, 29895, 353, 29871, 29900, 29889, 29900, 29946, 13, 22992, 353, 13850, 29906, 29889, 2616, 1089, 29950, 2749, 275, 29898, 21012, 29918, 2492, 29892, 2908, 3505, 29892, 413, 2311, 29892, 413, 29897, 13, 29937, 298, 2749, 275, 31432, 30940, 31599, 30858, 13, 2492, 29961, 22992, 1405, 29871, 29900, 29889, 29900, 29896, 29930, 22992, 29889, 3317, 580, 29962, 353, 518, 29900, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 29962, 13, 13, 11023, 29906, 29889, 326, 4294, 877, 29882, 2749, 275, 742, 10153, 29897, 13, 11023, 29906, 29889, 10685, 2558, 29898, 29900, 29897, 13, 2 ]
accounts/admin.py
Gerard-007/musicalpacks
0
75089
from django.contrib import admin from .models import User from .forms import UserCreateForm from django.contrib.auth.models import Group from django.contrib.auth.admin import UserAdmin # Register your models here. class MyAdmin(UserAdmin): # The forms to add and change user instances # form = UserChangeForm add_form = UserCreateForm # The fields to be used in displaying the User model. # These override the definitions on the base UserAdmin # that reference specific fields on auth.User. list_display = ('username', 'email', 'date_joined', 'is_staff', 'is_active') list_filter = ('is_staff',) fieldsets = ( (None, {'fields': ('email', 'password')}), ('Personal info', {'fields': ('avatar', 'bio',)}), ('Permissions', {'fields': ('is_staff',)}), ) # add_fieldsets is not a standard ModelAdmin attribute. UserAdmin # overrides get_fieldsets to use this attribute when creating a user. add_fieldsets = ( (None, { 'classes': ('wide',), 'fields': ('username', 'email', '<PASSWORD>', '<PASSWORD>')} ), ) search_fields = ('username',) ordering = ('username',) filter_horizontal = () # Now register the new UserAdmin... admin.site.register(User, MyAdmin) # ... and, since we're not using Django's built-in permissions, # unregister the Group model from admin. admin.site.unregister(Group)
[ 1, 515, 9557, 29889, 21570, 1053, 4113, 13, 3166, 869, 9794, 1053, 4911, 13, 3166, 869, 9514, 1053, 4911, 4391, 2500, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9794, 1053, 6431, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 6406, 1053, 4911, 12754, 13, 13, 29937, 12577, 596, 4733, 1244, 29889, 13, 13, 1990, 1619, 12754, 29898, 2659, 12754, 1125, 13, 1678, 396, 450, 7190, 304, 788, 322, 1735, 1404, 8871, 13, 1678, 396, 883, 353, 4911, 7277, 2500, 13, 1678, 788, 29918, 689, 353, 4911, 4391, 2500, 13, 13, 1678, 396, 450, 4235, 304, 367, 1304, 297, 16384, 278, 4911, 1904, 29889, 13, 1678, 396, 4525, 5712, 278, 15848, 373, 278, 2967, 4911, 12754, 13, 1678, 396, 393, 3407, 2702, 4235, 373, 4817, 29889, 2659, 29889, 13, 1678, 1051, 29918, 4990, 353, 6702, 6786, 742, 525, 5269, 742, 525, 1256, 29918, 2212, 1312, 742, 525, 275, 29918, 303, 3470, 742, 525, 275, 29918, 4925, 1495, 13, 1678, 1051, 29918, 4572, 353, 6702, 275, 29918, 303, 3470, 742, 29897, 13, 1678, 1746, 7224, 353, 313, 13, 4706, 313, 8516, 29892, 11117, 9621, 2396, 6702, 5269, 742, 525, 5630, 1495, 9594, 13, 4706, 6702, 7435, 284, 5235, 742, 11117, 9621, 2396, 6702, 485, 14873, 742, 525, 24840, 742, 2915, 511, 13, 4706, 6702, 15737, 6847, 742, 11117, 9621, 2396, 6702, 275, 29918, 303, 3470, 742, 2915, 511, 13, 1678, 1723, 13, 1678, 396, 788, 29918, 2671, 7224, 338, 451, 263, 3918, 8125, 12754, 5352, 29889, 4911, 12754, 13, 1678, 396, 975, 24040, 679, 29918, 2671, 7224, 304, 671, 445, 5352, 746, 4969, 263, 1404, 29889, 13, 1678, 788, 29918, 2671, 7224, 353, 313, 13, 4706, 313, 8516, 29892, 426, 13, 9651, 525, 13203, 2396, 6702, 8157, 742, 511, 13, 9651, 525, 9621, 2396, 6702, 6786, 742, 525, 5269, 742, 12801, 25711, 17013, 29958, 742, 12801, 25711, 17013, 29958, 1495, 29913, 13, 4706, 10353, 13, 1678, 1723, 13, 1678, 2740, 29918, 9621, 353, 6702, 6786, 742, 29897, 13, 1678, 20520, 353, 6702, 6786, 742, 29897, 13, 1678, 4175, 29918, 22672, 353, 3861, 13, 13, 29937, 2567, 6036, 278, 716, 4911, 12754, 856, 13, 6406, 29889, 2746, 29889, 9573, 29898, 2659, 29892, 1619, 12754, 29897, 13, 29937, 2023, 322, 29892, 1951, 591, 29915, 276, 451, 773, 15337, 29915, 29879, 4240, 29899, 262, 11239, 29892, 13, 29937, 443, 9573, 278, 6431, 1904, 515, 4113, 29889, 13, 6406, 29889, 2746, 29889, 348, 9573, 29898, 4782, 29897, 13, 2 ]
R_ev3dev/help.py
thomasvolk/R_ev3dev
0
125098
<reponame>thomasvolk/R_ev3dev from R_ev3dev.interpreter import Command from R_ev3dev import version class Version(Command): """ show version """ def invoke(self, interpreter_context, args): return version.VERSION class Help(Command): """ show help """ def _doc(self, item): return item.__doc__.strip() if item.__doc__ else '' def _line(self, item): return "{} - {}".format(item.name, self._doc(item).split("\n")[0]) def _overview(self, commands): command_lines = [self._line(c) for c in commands] return """--- R_ev3 protocol language version {} author: <NAME> license: Apache License Version 2.0 source: https://github.com/thomasvolk/R_ev3dev possible commands: {} use help <command> for details ---""".format(version.VERSION, '\n '.join(command_lines)) def _details(self, command): return """--- {} {} ---""".format(command.name, self._doc(command)) def invoke(self, interpreter_context, args): if len(args) > 0: cmd = args[0] return self._details(interpreter_context.interpreter.commands[cmd]) else: return self._overview(interpreter_context.interpreter.commands.values())
[ 1, 529, 276, 1112, 420, 29958, 386, 18902, 1555, 29895, 29914, 29934, 29918, 5750, 29941, 3359, 13, 3166, 390, 29918, 5750, 29941, 3359, 29889, 1639, 1457, 357, 1053, 10516, 13, 3166, 390, 29918, 5750, 29941, 3359, 1053, 1873, 13, 13, 13, 1990, 10079, 29898, 6255, 1125, 13, 1678, 9995, 1510, 1873, 9995, 13, 1678, 822, 15928, 29898, 1311, 29892, 26997, 29918, 4703, 29892, 6389, 1125, 13, 4706, 736, 1873, 29889, 16358, 13, 13, 13, 1990, 22305, 29898, 6255, 1125, 13, 1678, 9995, 1510, 1371, 9995, 13, 13, 1678, 822, 903, 1514, 29898, 1311, 29892, 2944, 1125, 13, 4706, 736, 2944, 17255, 1514, 26914, 17010, 580, 565, 2944, 17255, 1514, 1649, 1683, 6629, 13, 13, 1678, 822, 903, 1220, 29898, 1311, 29892, 2944, 1125, 13, 4706, 736, 376, 8875, 448, 6571, 1642, 4830, 29898, 667, 29889, 978, 29892, 1583, 3032, 1514, 29898, 667, 467, 5451, 14182, 29876, 1159, 29961, 29900, 2314, 13, 13, 1678, 822, 903, 957, 1493, 29898, 1311, 29892, 8260, 1125, 13, 4706, 1899, 29918, 9012, 353, 518, 1311, 3032, 1220, 29898, 29883, 29897, 363, 274, 297, 8260, 29962, 13, 4706, 736, 9995, 5634, 13, 13, 29871, 390, 29918, 5750, 29941, 9608, 4086, 1873, 6571, 13, 13, 1678, 4148, 29901, 529, 5813, 29958, 13, 1678, 19405, 29901, 13380, 19245, 10079, 29871, 29906, 29889, 29900, 13, 1678, 2752, 29901, 2045, 597, 3292, 29889, 510, 29914, 386, 18902, 1555, 29895, 29914, 29934, 29918, 5750, 29941, 3359, 13, 13, 29871, 1950, 8260, 29901, 13, 13, 1678, 6571, 29871, 13, 13, 29871, 671, 1371, 529, 6519, 29958, 363, 4902, 13, 13, 5634, 15945, 1642, 4830, 29898, 3259, 29889, 16358, 29892, 11297, 29876, 1678, 15300, 7122, 29898, 6519, 29918, 9012, 876, 13, 13, 1678, 822, 903, 14144, 29898, 1311, 29892, 1899, 1125, 13, 4706, 736, 9995, 5634, 13, 13, 29871, 6571, 13, 13, 29871, 6571, 308, 13, 13, 5634, 15945, 1642, 4830, 29898, 6519, 29889, 978, 29892, 1583, 3032, 1514, 29898, 6519, 876, 13, 13, 1678, 822, 15928, 29898, 1311, 29892, 26997, 29918, 4703, 29892, 6389, 1125, 13, 4706, 565, 7431, 29898, 5085, 29897, 1405, 29871, 29900, 29901, 13, 9651, 9920, 353, 6389, 29961, 29900, 29962, 13, 9651, 736, 1583, 3032, 14144, 29898, 1639, 1457, 357, 29918, 4703, 29889, 1639, 1457, 357, 29889, 26381, 29961, 9006, 2314, 13, 4706, 1683, 29901, 13, 9651, 736, 1583, 3032, 957, 1493, 29898, 1639, 1457, 357, 29918, 4703, 29889, 1639, 1457, 357, 29889, 26381, 29889, 5975, 3101, 13, 2 ]
binary_classifiers/NaiveBayesPrimjer.py
zcikojevic/toxic-language-detection
1
118277
from sklearn.naive_bayes import BernoulliNB from run_binary_classifier import run param_grid = { 'bag_of_words__stop_words': ['english'], 'bag_of_words__ngram_range': [(1, 2)], 'bag_of_words__max_features': [500], 'dim_reduct__n_components': [300], 'normalizer__norm': ['l2'], 'classifier__alpha': [1.0], 'classifier__binarize': [0.0] } clf = BernoulliNB() run(param_grid, clf)
[ 1, 515, 2071, 19668, 29889, 1056, 573, 29918, 27495, 267, 1053, 6209, 5059, 492, 23189, 13, 3166, 1065, 29918, 19541, 29918, 1990, 3709, 1053, 1065, 13, 13, 3207, 29918, 7720, 353, 426, 13, 4706, 525, 23156, 29918, 974, 29918, 9303, 1649, 9847, 29918, 9303, 2396, 6024, 996, 1674, 7464, 13, 4706, 525, 23156, 29918, 974, 29918, 9303, 1649, 29876, 1393, 29918, 3881, 2396, 17288, 29896, 29892, 29871, 29906, 29897, 1402, 13, 4706, 525, 23156, 29918, 974, 29918, 9303, 1649, 3317, 29918, 22100, 2396, 518, 29945, 29900, 29900, 1402, 13, 4706, 525, 6229, 29918, 276, 2199, 1649, 29876, 29918, 14036, 2396, 518, 29941, 29900, 29900, 1402, 13, 4706, 525, 8945, 3950, 1649, 12324, 2396, 6024, 29880, 29906, 7464, 13, 4706, 525, 1990, 3709, 1649, 2312, 2396, 518, 29896, 29889, 29900, 1402, 13, 4706, 525, 1990, 3709, 1649, 2109, 279, 675, 2396, 518, 29900, 29889, 29900, 29962, 13, 29913, 13, 13, 695, 29888, 353, 6209, 5059, 492, 23189, 580, 13, 13, 3389, 29898, 3207, 29918, 7720, 29892, 1067, 29888, 29897, 13, 2 ]
photospicker/event/start_upload_event.py
l-vo/photos-picker
0
49845
class StartUploadEvent(object): """Event dispatched when an upload starts""" def __init__(self, filepath, upload_file_rank, files_to_upload): """ Constructor :param str filepath: file which starts to be uploaded :param int upload_file_rank: rank of the file in upload queue :param int files_to_upload: total files to upload count """ self._filepath = filepath self._upload_file_rank = upload_file_rank self._files_to_upload = files_to_upload @property def filepath(self): # pragma: no cover """ Getter for the file which starts to be uploaded :type: str """ return self._filepath @property def upload_file_rank(self): # pragma: no cover """ Getter for the rank of the file in upload queue :type: int """ return self._upload_file_rank @property def files_to_upload(self): # pragma: no cover """ Getter for the total files to upload count :rtype: int """ return self._files_to_upload
[ 1, 770, 7370, 17553, 2624, 29898, 3318, 1125, 13, 1678, 9995, 2624, 13916, 287, 746, 385, 6441, 8665, 15945, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 934, 2084, 29892, 6441, 29918, 1445, 29918, 10003, 29892, 2066, 29918, 517, 29918, 9009, 1125, 13, 4706, 9995, 13, 4706, 1281, 18769, 13, 13, 4706, 584, 3207, 851, 934, 2084, 29901, 934, 607, 8665, 304, 367, 20373, 13, 4706, 584, 3207, 938, 6441, 29918, 1445, 29918, 10003, 29901, 7115, 310, 278, 934, 297, 6441, 9521, 13, 4706, 584, 3207, 938, 2066, 29918, 517, 29918, 9009, 29901, 3001, 2066, 304, 6441, 2302, 13, 4706, 9995, 13, 4706, 1583, 3032, 1445, 2084, 353, 934, 2084, 13, 4706, 1583, 3032, 9009, 29918, 1445, 29918, 10003, 353, 6441, 29918, 1445, 29918, 10003, 13, 4706, 1583, 3032, 5325, 29918, 517, 29918, 9009, 353, 2066, 29918, 517, 29918, 9009, 13, 13, 1678, 732, 6799, 13, 1678, 822, 934, 2084, 29898, 1311, 1125, 29871, 396, 282, 23929, 29901, 694, 4612, 13, 4706, 9995, 13, 4706, 3617, 357, 363, 278, 934, 607, 8665, 304, 367, 20373, 13, 13, 4706, 584, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 1445, 2084, 13, 13, 1678, 732, 6799, 13, 1678, 822, 6441, 29918, 1445, 29918, 10003, 29898, 1311, 1125, 29871, 396, 282, 23929, 29901, 694, 4612, 13, 4706, 9995, 13, 4706, 3617, 357, 363, 278, 7115, 310, 278, 934, 297, 6441, 9521, 13, 13, 4706, 584, 1853, 29901, 938, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 9009, 29918, 1445, 29918, 10003, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2066, 29918, 517, 29918, 9009, 29898, 1311, 1125, 29871, 396, 282, 23929, 29901, 694, 4612, 13, 4706, 9995, 13, 4706, 3617, 357, 363, 278, 3001, 2066, 304, 6441, 2302, 13, 13, 4706, 584, 29878, 1853, 29901, 938, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 5325, 29918, 517, 29918, 9009, 13, 2 ]
src/device/migrations/0001_initial.py
Seedstars/reactnative-backend-base
8
78228
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import uuid import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='DeviceOrders', fields=[ ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, editable=False)), ('phone_number', models.CharField(max_length=16)), ('address', models.CharField(max_length=255, blank=True)), ('payment', models.CharField(default='P', max_length=1, choices=[('S', 'SIMPLE_PAY'), ('P', 'PAY_ON_DELIVERY')])), ('paid', models.CharField(default='N', max_length=1, choices=[('V', 'VERIFYING'), ('N', 'NOT_PAID'), ('P', 'PAID')])), ('date_request', models.DateTimeField(auto_now_add=True)), ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], ), ]
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 29892, 4733, 13, 3166, 9557, 29889, 5527, 1053, 6055, 13, 5215, 318, 5416, 13, 5215, 9557, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 9962, 353, 518, 13, 4706, 9725, 800, 29889, 2774, 932, 519, 29918, 10836, 29898, 11027, 29889, 20656, 29950, 29918, 11889, 29918, 20387, 29931, 511, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 11501, 2816, 8623, 742, 13, 9651, 4235, 11759, 13, 18884, 6702, 333, 742, 4733, 29889, 29965, 11150, 3073, 29898, 4381, 29922, 25118, 29889, 25118, 29946, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 28755, 29922, 8824, 29892, 3863, 519, 29922, 8824, 8243, 13, 18884, 6702, 6710, 29918, 4537, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29953, 8243, 13, 18884, 6702, 7328, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 9654, 29922, 5574, 8243, 13, 18884, 6702, 27825, 742, 4733, 29889, 27890, 29898, 4381, 2433, 29925, 742, 4236, 29918, 2848, 29922, 29896, 29892, 19995, 11759, 877, 29903, 742, 525, 5425, 3580, 1307, 29918, 7228, 29979, 5477, 6702, 29925, 742, 525, 7228, 29979, 29918, 1164, 29918, 2287, 5265, 5348, 29979, 1495, 2314, 511, 13, 18884, 6702, 3274, 333, 742, 4733, 29889, 27890, 29898, 4381, 2433, 29940, 742, 4236, 29918, 2848, 29922, 29896, 29892, 19995, 11759, 877, 29963, 742, 525, 5348, 6545, 29979, 4214, 5477, 6702, 29940, 742, 525, 12256, 29918, 7228, 1367, 5477, 6702, 29925, 742, 525, 7228, 1367, 1495, 2314, 511, 13, 18884, 6702, 1256, 29918, 3827, 742, 4733, 29889, 11384, 3073, 29898, 6921, 29918, 3707, 29918, 1202, 29922, 5574, 8243, 13, 18884, 6702, 1792, 742, 4733, 29889, 27755, 2558, 29898, 265, 29918, 8143, 29922, 14095, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 29889, 8618, 4330, 1783, 29892, 304, 29922, 11027, 29889, 20656, 29950, 29918, 11889, 29918, 20387, 29931, 8243, 13, 9651, 21251, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
cryptodoge/cmds/units.py
grayfallstown-cryptodoge/cryptodoge
10
24392
from typing import Dict # The rest of the codebase uses mojos everywhere. # Only use these units for user facing interfaces. units: Dict[str, int] = { "cryptodoge": 10 ** 6, # 1 cryptodoge (XCD) is 1,000,000 mojo (1 million) "mojo:": 1, "colouredcoin": 10 ** 3, # 1 coloured coin is 1000 colouredcoin mojos }
[ 1, 515, 19229, 1053, 360, 919, 13, 13, 29937, 450, 1791, 310, 278, 775, 3188, 3913, 2730, 14736, 16978, 29889, 13, 29937, 9333, 671, 1438, 10340, 363, 1404, 14870, 19510, 29889, 13, 348, 1169, 29901, 360, 919, 29961, 710, 29892, 938, 29962, 353, 426, 13, 1678, 376, 29883, 4641, 397, 21317, 1115, 29871, 29896, 29900, 3579, 29871, 29953, 29892, 29871, 396, 29871, 29896, 24941, 397, 21317, 313, 29990, 6530, 29897, 338, 29871, 29896, 29892, 29900, 29900, 29900, 29892, 29900, 29900, 29900, 2730, 2212, 313, 29896, 7284, 29897, 13, 1678, 376, 4346, 2212, 29901, 1115, 29871, 29896, 29892, 13, 1678, 376, 1054, 14076, 1111, 262, 1115, 29871, 29896, 29900, 3579, 29871, 29941, 29892, 29871, 396, 29871, 29896, 784, 14076, 19480, 338, 29871, 29896, 29900, 29900, 29900, 784, 14076, 1111, 262, 2730, 14736, 13, 29913, 13, 2 ]
town/equipment_shop_sell.py
tgruby/dungeon-hunt
3
1600537
import game_play.screen from game_play import images, screen from town import equipment_shop commands = "Enter a (#) to sell an item, or E(x)it." message = "Wonderful, we have been running low on good hardware! What are you " \ "willing to part with? " image = images.weapons_shop_logo # This function controls our interactions at the weapons store def paint(game, msg): return screen.paint_two_panes( game=game, commands=commands, messages=msg, left_pane_content=image, right_pane_content=draw_sell_list(game.character), sound=None, delay=0, interaction_type='key_press' ) def process(game, action): our_hero = game.character if action is None: return paint(game, message) # Leave and go back to the town if action.lower() == "x": game.current_controller = 'town.equipment_shop' return equipment_shop.process(game, None) # If Sell an item, enter another sub-controller if action.isdigit(): return sell_items(game, action) # If we don't know, just reshow page. return paint(game, message) def sell_items(game, action): hero = game.character item_number_picked = int(action) items_list = filtered_sell_list(hero) if item_number_picked > len(items_list)-1 or item_number_picked < 0: msg = "You do not have an item of that number!" else: selected_item = items_list[item_number_picked][4] selected_item_quantity = items_list[item_number_picked][0] if selected_item["type"] == "weapon" or selected_item["type"] == "armor" or selected_item["type"] == "shield": if selected_item["name"] == hero.equipped_weapon["name"] and selected_item_quantity == 1: msg = "You cannot sell equipped items!" elif hero.equipped_armor is not None and selected_item["name"] == hero.equipped_armor["name"] and selected_item_quantity == 1: msg = "You cannot sell equipped items!" elif hero.equipped_shield is not None and selected_item["name"] == hero.equipped_shield["name"] and selected_item_quantity == 1: msg = "You cannot sell equipped items!" else: hero.gold += selected_item["cost"] / 2 hero.inventory.remove(selected_item) msg = "You sold %s for %d gold." % (selected_item["name"], selected_item["cost"]/2) else: msg = "You cannot sell that item here!" return paint(game, msg) def draw_sell_list(our_hero): items = filtered_sell_list(our_hero) response = game_play.screen.medium_border + '\n' response += " # | Items | Type | Value " + '\n' response += game_play.screen.medium_border + '\n' for num, item in enumerate(items): response += game_play.screen.front_padding(str(num), 3) + " | " \ + game_play.screen.back_padding(str(item[0]) + " " + item[1], 16) + " | " \ + game_play.screen.front_padding(str(item[2]), 6) + " | " \ + game_play.screen.front_padding(str(round(item[3] / 2)), 4) + '\n' response += game_play.screen.medium_border + '\n' return response # Create a Filtered list of only items we can sell in the potion shop def filtered_sell_list(our_hero): filtered_list = [] items_list = game_play.screen.collapse_inventory_items(our_hero) for item in items_list: if item[2] == 'armor' or item[2] == 'shield' or item[2] == 'weapon': filtered_list.append(item) return filtered_list
[ 1, 1053, 3748, 29918, 1456, 29889, 10525, 13, 3166, 3748, 29918, 1456, 1053, 4558, 29892, 4315, 13, 3166, 4726, 1053, 21083, 29918, 19032, 13, 13, 26381, 353, 376, 10399, 263, 313, 29937, 29897, 304, 19417, 385, 2944, 29892, 470, 382, 29898, 29916, 29897, 277, 1213, 13, 4906, 353, 376, 29956, 8417, 1319, 29892, 591, 505, 1063, 2734, 4482, 373, 1781, 12837, 29991, 29871, 1724, 526, 366, 376, 320, 13, 3986, 376, 29893, 8873, 304, 760, 411, 29973, 376, 13, 3027, 353, 4558, 29889, 705, 481, 787, 29918, 19032, 29918, 14569, 13, 13, 13, 29937, 910, 740, 11761, 1749, 22060, 472, 278, 25340, 3787, 13, 1753, 10675, 29898, 11802, 29892, 10191, 1125, 13, 1678, 736, 4315, 29889, 29886, 2365, 29918, 10184, 29918, 8357, 267, 29898, 13, 4706, 3748, 29922, 11802, 29892, 13, 4706, 8260, 29922, 26381, 29892, 13, 4706, 7191, 29922, 7645, 29892, 13, 4706, 2175, 29918, 29886, 1662, 29918, 3051, 29922, 3027, 29892, 13, 4706, 1492, 29918, 29886, 1662, 29918, 3051, 29922, 4012, 29918, 29879, 514, 29918, 1761, 29898, 11802, 29889, 18609, 511, 13, 4706, 6047, 29922, 8516, 29892, 13, 4706, 9055, 29922, 29900, 29892, 13, 4706, 14881, 29918, 1853, 2433, 1989, 29918, 2139, 29915, 13, 1678, 1723, 13, 13, 13, 1753, 1889, 29898, 11802, 29892, 3158, 1125, 13, 1678, 1749, 29918, 29882, 1489, 353, 3748, 29889, 18609, 13, 1678, 565, 3158, 338, 6213, 29901, 13, 4706, 736, 10675, 29898, 11802, 29892, 2643, 29897, 13, 13, 1678, 396, 951, 1351, 322, 748, 1250, 304, 278, 4726, 13, 1678, 565, 3158, 29889, 13609, 580, 1275, 376, 29916, 1115, 13, 4706, 3748, 29889, 3784, 29918, 8299, 353, 525, 27734, 29889, 1686, 666, 358, 29918, 19032, 29915, 13, 4706, 736, 21083, 29918, 19032, 29889, 5014, 29898, 11802, 29892, 6213, 29897, 13, 13, 1678, 396, 960, 317, 514, 385, 2944, 29892, 3896, 1790, 1014, 29899, 8299, 13, 1678, 565, 3158, 29889, 275, 26204, 7295, 13, 4706, 736, 19417, 29918, 7076, 29898, 11802, 29892, 3158, 29897, 13, 13, 1678, 396, 960, 591, 1016, 29915, 29873, 1073, 29892, 925, 620, 3525, 1813, 29889, 13, 1678, 736, 10675, 29898, 11802, 29892, 2643, 29897, 13, 13, 13, 1753, 19417, 29918, 7076, 29898, 11802, 29892, 3158, 1125, 13, 1678, 13444, 353, 3748, 29889, 18609, 13, 1678, 2944, 29918, 4537, 29918, 29886, 17840, 353, 938, 29898, 2467, 29897, 13, 1678, 4452, 29918, 1761, 353, 22289, 29918, 29879, 514, 29918, 1761, 29898, 29882, 1489, 29897, 13, 1678, 565, 2944, 29918, 4537, 29918, 29886, 17840, 1405, 7431, 29898, 7076, 29918, 1761, 6817, 29896, 470, 2944, 29918, 4537, 29918, 29886, 17840, 529, 29871, 29900, 29901, 13, 4706, 10191, 353, 376, 3492, 437, 451, 505, 385, 2944, 310, 393, 1353, 3850, 13, 1678, 1683, 29901, 13, 4706, 4629, 29918, 667, 353, 4452, 29918, 1761, 29961, 667, 29918, 4537, 29918, 29886, 17840, 3816, 29946, 29962, 13, 4706, 4629, 29918, 667, 29918, 22640, 353, 4452, 29918, 1761, 29961, 667, 29918, 4537, 29918, 29886, 17840, 3816, 29900, 29962, 13, 4706, 565, 4629, 29918, 667, 3366, 1853, 3108, 1275, 376, 705, 481, 265, 29908, 470, 4629, 29918, 667, 3366, 1853, 3108, 1275, 376, 2817, 272, 29908, 470, 4629, 29918, 667, 3366, 1853, 3108, 1275, 376, 845, 969, 1115, 13, 9651, 565, 4629, 29918, 667, 3366, 978, 3108, 1275, 13444, 29889, 1686, 16242, 29918, 705, 481, 265, 3366, 978, 3108, 322, 4629, 29918, 667, 29918, 22640, 1275, 29871, 29896, 29901, 13, 18884, 10191, 353, 376, 3492, 2609, 19417, 1592, 16242, 4452, 3850, 13, 9651, 25342, 13444, 29889, 1686, 16242, 29918, 2817, 272, 338, 451, 6213, 322, 4629, 29918, 667, 3366, 978, 3108, 1275, 13444, 29889, 1686, 16242, 29918, 2817, 272, 3366, 978, 3108, 322, 4629, 29918, 667, 29918, 22640, 1275, 29871, 29896, 29901, 13, 18884, 10191, 353, 376, 3492, 2609, 19417, 1592, 16242, 4452, 3850, 13, 9651, 25342, 13444, 29889, 1686, 16242, 29918, 845, 969, 338, 451, 6213, 322, 4629, 29918, 667, 3366, 978, 3108, 1275, 13444, 29889, 1686, 16242, 29918, 845, 969, 3366, 978, 3108, 322, 4629, 29918, 667, 29918, 22640, 1275, 29871, 29896, 29901, 13, 18884, 10191, 353, 376, 3492, 2609, 19417, 1592, 16242, 4452, 3850, 13, 9651, 1683, 29901, 13, 18884, 13444, 29889, 29887, 1025, 4619, 4629, 29918, 667, 3366, 18253, 3108, 847, 29871, 29906, 13, 18884, 13444, 29889, 262, 23886, 29889, 5992, 29898, 8391, 29918, 667, 29897, 13, 18884, 10191, 353, 376, 3492, 5239, 1273, 29879, 363, 1273, 29881, 7684, 1213, 1273, 313, 8391, 29918, 667, 3366, 978, 12436, 4629, 29918, 667, 3366, 18253, 3108, 29914, 29906, 29897, 13, 4706, 1683, 29901, 13, 9651, 10191, 353, 376, 3492, 2609, 19417, 393, 2944, 1244, 3850, 13, 13, 1678, 736, 10675, 29898, 11802, 29892, 10191, 29897, 13, 13, 13, 1753, 4216, 29918, 29879, 514, 29918, 1761, 29898, 473, 29918, 29882, 1489, 1125, 13, 1678, 4452, 353, 22289, 29918, 29879, 514, 29918, 1761, 29898, 473, 29918, 29882, 1489, 29897, 13, 1678, 2933, 353, 3748, 29918, 1456, 29889, 10525, 29889, 27891, 29918, 11466, 718, 11297, 29876, 29915, 13, 1678, 2933, 4619, 376, 29871, 396, 891, 25085, 9651, 891, 5167, 259, 891, 7865, 376, 718, 11297, 29876, 29915, 13, 1678, 2933, 4619, 3748, 29918, 1456, 29889, 10525, 29889, 27891, 29918, 11466, 718, 11297, 29876, 29915, 13, 1678, 363, 954, 29892, 2944, 297, 26985, 29898, 7076, 1125, 13, 4706, 2933, 4619, 3748, 29918, 1456, 29889, 10525, 29889, 8862, 29918, 12791, 29898, 710, 29898, 1949, 511, 29871, 29941, 29897, 718, 376, 891, 376, 320, 13, 462, 1678, 718, 3748, 29918, 1456, 29889, 10525, 29889, 1627, 29918, 12791, 29898, 710, 29898, 667, 29961, 29900, 2314, 718, 376, 376, 718, 2944, 29961, 29896, 1402, 29871, 29896, 29953, 29897, 718, 376, 891, 376, 320, 13, 462, 1678, 718, 3748, 29918, 1456, 29889, 10525, 29889, 8862, 29918, 12791, 29898, 710, 29898, 667, 29961, 29906, 11724, 29871, 29953, 29897, 718, 376, 891, 376, 320, 13, 462, 1678, 718, 3748, 29918, 1456, 29889, 10525, 29889, 8862, 29918, 12791, 29898, 710, 29898, 14486, 29898, 667, 29961, 29941, 29962, 847, 29871, 29906, 8243, 29871, 29946, 29897, 718, 11297, 29876, 29915, 13, 1678, 2933, 4619, 3748, 29918, 1456, 29889, 10525, 29889, 27891, 29918, 11466, 718, 11297, 29876, 29915, 13, 1678, 736, 2933, 13, 13, 13, 29937, 6204, 263, 19916, 287, 1051, 310, 871, 4452, 591, 508, 19417, 297, 278, 3104, 291, 18296, 13, 1753, 22289, 29918, 29879, 514, 29918, 1761, 29898, 473, 29918, 29882, 1489, 1125, 13, 1678, 22289, 29918, 1761, 353, 5159, 13, 1678, 4452, 29918, 1761, 353, 3748, 29918, 1456, 29889, 10525, 29889, 27756, 29918, 262, 23886, 29918, 7076, 29898, 473, 29918, 29882, 1489, 29897, 13, 1678, 363, 2944, 297, 4452, 29918, 1761, 29901, 13, 4706, 565, 2944, 29961, 29906, 29962, 1275, 525, 2817, 272, 29915, 470, 2944, 29961, 29906, 29962, 1275, 525, 845, 969, 29915, 470, 2944, 29961, 29906, 29962, 1275, 525, 705, 481, 265, 2396, 13, 9651, 22289, 29918, 1761, 29889, 4397, 29898, 667, 29897, 13, 13, 1678, 736, 22289, 29918, 1761, 13, 2 ]
plot.py
Adiytisuman24/frog-jumping-1uestion
0
141457
<reponame>Adiytisuman24/frog-jumping-1uestion<filename>plot.py from matplotlib import pyplot as plt R=1 D =16 plt.plot(R,D) path= 1 for i in range(D, (R + D - 1)): path *= i; path //= (i - D + 1); plt.show()
[ 1, 529, 276, 1112, 420, 29958, 3253, 29875, 3637, 275, 7889, 29906, 29946, 29914, 29888, 9102, 29899, 29926, 3427, 292, 29899, 29896, 29884, 602, 29966, 9507, 29958, 5317, 29889, 2272, 13, 30004, 13, 3166, 22889, 1053, 11451, 5317, 408, 14770, 30004, 13, 29934, 29922, 29896, 30004, 13, 29928, 353, 29896, 29953, 30004, 13, 572, 29873, 29889, 5317, 29898, 29934, 29892, 29928, 8443, 13, 2084, 29922, 29871, 29896, 30004, 13, 1454, 474, 297, 3464, 29898, 29928, 29892, 313, 29934, 718, 360, 448, 29871, 29896, 22164, 30004, 13, 1678, 2224, 334, 29922, 474, 2104, 13, 1678, 2224, 849, 29922, 313, 29875, 448, 360, 718, 29871, 29896, 6075, 13, 30004, 13, 572, 29873, 29889, 4294, 26471, 13, 2 ]
aiida_restapi/aiida_db_mappings.py
janssenhenning/aiida-restapi
4
193203
# -*- coding: utf-8 -*- """The 'source of truth' for mapping AiiDA's database table models to pydantic models. Note in the future we may want to do this programmatically, however, there are two issues: - AiiDA uses both SQLAlchemy and Django backends, so one would need to be chosen - Neither model includes descriptions of fields """ from datetime import datetime from typing import Dict, Optional, Type from uuid import UUID from aiida import orm from pydantic import BaseModel, Field, Json class AuthInfo(BaseModel): """AiiDA AuthInfo SQL table fields.""" id: int = Field(description="Unique id (pk)") aiidauser_id: int = Field(description="Relates to user") dbcomputer_id: int = Field(description="Relates to computer") metadata: Json = Field(description="Metadata of the authorisation") auth_params: Json = Field(description="Parameters of the authorisation") enabled: bool = Field(description="Whether the computer is enabled", default=True) class Comment(BaseModel): """AiiDA Comment SQL table fields.""" id: int = Field(description="Unique id (pk)") uuid: UUID = Field(description="Universally unique id") ctime: datetime = Field(description="Creation time") mtime: datetime = Field(description="Last modification time") content: Optional[str] = Field(description="Content of the comment") user_id: int = Field(description="Created by user id (pk)") dbnode_id: int = Field(description="Associated node id (pk)") class Computer(BaseModel): """AiiDA Computer SQL table fields.""" id: int = Field(description="Unique id (pk)") uuid: UUID = Field(description="Universally unique id") name: str = Field(description="Computer name") hostname: str = Field(description="Identifier for the computer within the network") description: Optional[str] = Field(description="Description of the computer") scheduler_type: str = Field( description="Scheduler plugin type, to manage compute jobs" ) transport_type: str = Field( description="Transport plugin type, to manage file transfers" ) metadata: Json = Field(description="Metadata of the computer") class Group(BaseModel): """AiiDA Group SQL table fields.""" id: int = Field(description="Unique id (pk)") uuid: UUID = Field(description="Universally unique id") label: str = Field(description="Label of group") type_string: str = Field(description="type of the group") time: datetime = Field(description="Created time") description: Optional[str] = Field(description="Description of group") extras: Json = Field(description="extra data about for the group") user_id: int = Field(description="Created by user id (pk)") class Log(BaseModel): """AiiDA Log SQL table fields.""" id: int = Field(description="Unique id (pk)") uuid: UUID = Field(description="Universally unique id") time: datetime = Field(description="Creation time") loggername: str = Field(description="The loggers name") levelname: str = Field(description="The log level") message: Optional[str] = Field(description="The log message") metadata: Json = Field(description="Metadata associated with the log") dbnode_id: int = Field(description="Associated node id (pk)") class Node(BaseModel): """AiiDA Node SQL table fields.""" id: int = Field(description="Unique id (pk)") uuid: UUID = Field(description="Universally unique id") node_type: str = Field(description="Node type") process_type: str = Field(description="Process type") label: str = Field(description="Label of node") description: str = Field(description="Description of node") ctime: datetime = Field(description="Creation time") mtime: datetime = Field(description="Last modification time") user_id: int = Field(description="Created by user id (pk)") dbcomputer_id: Optional[int] = Field(description="Associated computer id (pk)") attributes: Json = Field( description="Attributes of the node (immutable after storing the node)", ) extras: Json = Field( description="Extra attributes of the node (mutable)", ) class User(BaseModel): """AiiDA User SQL table fields.""" id: int = Field(description="Unique id (pk)") email: str = Field(description="Email address of the user") first_name: Optional[str] = Field(description="First name of the user") last_name: Optional[str] = Field(description="Last name of the user") institution: Optional[str] = Field( description="Host institution or workplace of the user" ) class Link(BaseModel): """AiiDA Link SQL table fields.""" id: int = Field(description="Unique id (pk)") input_id: int = Field(description="Unique id (pk) of the input node") output_id: int = Field(description="Unique id (pk) of the output node") label: Optional[str] = Field(description="The label of the link") type: str = Field(description="The type of link") ORM_MAPPING: Dict[str, Type[BaseModel]] = { "AuthInfo": AuthInfo, "Comment": Comment, "Computer": Computer, "Group": Group, "Log": Log, "Node": Node, "User": User, "Link": Link, } def get_model_from_orm( orm_cls: Type[orm.Entity], allow_subclasses: bool = True ) -> Type[BaseModel]: """Return the pydantic model related to the orm class. :param allow_subclasses: Return the base class mapping for subclasses """ if orm_cls.__name__ in ORM_MAPPING: return ORM_MAPPING[orm_cls.__name__] if allow_subclasses and issubclass(orm_cls, orm.nodes.Node): return Node if allow_subclasses and issubclass(orm_cls, orm.Group): return Group raise KeyError(f"{orm_cls}")
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 1576, 525, 4993, 310, 8760, 29915, 363, 10417, 319, 2236, 7698, 29915, 29879, 2566, 1591, 4733, 304, 282, 2941, 7716, 4733, 29889, 13, 13, 9842, 297, 278, 5434, 591, 1122, 864, 304, 437, 445, 1824, 20300, 29892, 3138, 29892, 727, 526, 1023, 5626, 29901, 13, 29899, 319, 2236, 7698, 3913, 1716, 3758, 2499, 305, 6764, 322, 15337, 1250, 1975, 29892, 577, 697, 723, 817, 304, 367, 10434, 13, 29899, 2448, 2121, 1904, 7805, 2342, 1980, 310, 4235, 13, 15945, 29908, 13, 3166, 12865, 1053, 12865, 13, 3166, 19229, 1053, 360, 919, 29892, 28379, 29892, 5167, 13, 3166, 318, 5416, 1053, 501, 11150, 13, 13, 3166, 7468, 1458, 1053, 470, 29885, 13, 3166, 282, 2941, 7716, 1053, 7399, 3195, 29892, 8989, 29892, 14355, 13, 13, 13, 1990, 13189, 3401, 29898, 5160, 3195, 1125, 13, 1678, 9995, 29909, 2236, 7698, 13189, 3401, 3758, 1591, 4235, 1213, 15945, 13, 13, 1678, 1178, 29901, 938, 353, 8989, 29898, 8216, 543, 8110, 802, 1178, 313, 20571, 25760, 13, 1678, 7468, 1458, 1792, 29918, 333, 29901, 938, 353, 8989, 29898, 8216, 543, 9662, 1078, 304, 1404, 1159, 13, 1678, 4833, 12097, 261, 29918, 333, 29901, 938, 353, 8989, 29898, 8216, 543, 9662, 1078, 304, 6601, 1159, 13, 1678, 15562, 29901, 14355, 353, 8989, 29898, 8216, 543, 18417, 310, 278, 4148, 4371, 1159, 13, 1678, 4817, 29918, 7529, 29901, 14355, 353, 8989, 29898, 8216, 543, 11507, 310, 278, 4148, 4371, 1159, 13, 1678, 9615, 29901, 6120, 353, 8989, 29898, 8216, 543, 8809, 1979, 278, 6601, 338, 9615, 613, 2322, 29922, 5574, 29897, 13, 13, 13, 1990, 461, 29898, 5160, 3195, 1125, 13, 1678, 9995, 29909, 2236, 7698, 461, 3758, 1591, 4235, 1213, 15945, 13, 13, 1678, 1178, 29901, 938, 353, 8989, 29898, 8216, 543, 8110, 802, 1178, 313, 20571, 25760, 13, 1678, 318, 5416, 29901, 501, 11150, 353, 8989, 29898, 8216, 543, 11574, 635, 5412, 1178, 1159, 13, 1678, 274, 2230, 29901, 12865, 353, 8989, 29898, 8216, 543, 9832, 362, 931, 1159, 13, 1678, 286, 2230, 29901, 12865, 353, 8989, 29898, 8216, 543, 8897, 21733, 931, 1159, 13, 1678, 2793, 29901, 28379, 29961, 710, 29962, 353, 8989, 29898, 8216, 543, 3916, 310, 278, 3440, 1159, 13, 1678, 1404, 29918, 333, 29901, 938, 353, 8989, 29898, 8216, 543, 20399, 491, 1404, 1178, 313, 20571, 25760, 13, 1678, 4833, 3177, 29918, 333, 29901, 938, 353, 8989, 29898, 8216, 543, 29254, 630, 2943, 1178, 313, 20571, 25760, 13, 13, 13, 1990, 20972, 29898, 5160, 3195, 1125, 13, 1678, 9995, 29909, 2236, 7698, 20972, 3758, 1591, 4235, 1213, 15945, 13, 13, 1678, 1178, 29901, 938, 353, 8989, 29898, 8216, 543, 8110, 802, 1178, 313, 20571, 25760, 13, 1678, 318, 5416, 29901, 501, 11150, 353, 8989, 29898, 8216, 543, 11574, 635, 5412, 1178, 1159, 13, 1678, 1024, 29901, 851, 353, 8989, 29898, 8216, 543, 20606, 261, 1024, 1159, 13, 1678, 3495, 978, 29901, 851, 353, 8989, 29898, 8216, 543, 12889, 363, 278, 6601, 2629, 278, 3564, 1159, 13, 1678, 6139, 29901, 28379, 29961, 710, 29962, 353, 8989, 29898, 8216, 543, 9868, 310, 278, 6601, 1159, 13, 1678, 1364, 14952, 29918, 1853, 29901, 851, 353, 8989, 29898, 13, 4706, 6139, 543, 4504, 14952, 7079, 1134, 29892, 304, 10933, 10272, 17643, 29908, 13, 1678, 1723, 13, 1678, 8608, 29918, 1853, 29901, 851, 353, 8989, 29898, 13, 4706, 6139, 543, 27395, 7079, 1134, 29892, 304, 10933, 934, 1301, 25534, 29908, 13, 1678, 1723, 13, 1678, 15562, 29901, 14355, 353, 8989, 29898, 8216, 543, 18417, 310, 278, 6601, 1159, 13, 13, 13, 1990, 6431, 29898, 5160, 3195, 1125, 13, 1678, 9995, 29909, 2236, 7698, 6431, 3758, 1591, 4235, 1213, 15945, 13, 13, 1678, 1178, 29901, 938, 353, 8989, 29898, 8216, 543, 8110, 802, 1178, 313, 20571, 25760, 13, 1678, 318, 5416, 29901, 501, 11150, 353, 8989, 29898, 8216, 543, 11574, 635, 5412, 1178, 1159, 13, 1678, 3858, 29901, 851, 353, 8989, 29898, 8216, 543, 4775, 310, 2318, 1159, 13, 1678, 1134, 29918, 1807, 29901, 851, 353, 8989, 29898, 8216, 543, 1853, 310, 278, 2318, 1159, 13, 1678, 931, 29901, 12865, 353, 8989, 29898, 8216, 543, 20399, 931, 1159, 13, 1678, 6139, 29901, 28379, 29961, 710, 29962, 353, 8989, 29898, 8216, 543, 9868, 310, 2318, 1159, 13, 1678, 429, 10678, 29901, 14355, 353, 8989, 29898, 8216, 543, 17833, 848, 1048, 363, 278, 2318, 1159, 13, 1678, 1404, 29918, 333, 29901, 938, 353, 8989, 29898, 8216, 543, 20399, 491, 1404, 1178, 313, 20571, 25760, 13, 13, 13, 1990, 4522, 29898, 5160, 3195, 1125, 13, 1678, 9995, 29909, 2236, 7698, 4522, 3758, 1591, 4235, 1213, 15945, 13, 13, 1678, 1178, 29901, 938, 353, 8989, 29898, 8216, 543, 8110, 802, 1178, 313, 20571, 25760, 13, 1678, 318, 5416, 29901, 501, 11150, 353, 8989, 29898, 8216, 543, 11574, 635, 5412, 1178, 1159, 13, 1678, 931, 29901, 12865, 353, 8989, 29898, 8216, 543, 9832, 362, 931, 1159, 13, 1678, 1480, 29887, 4510, 29901, 851, 353, 8989, 29898, 8216, 543, 1576, 1480, 5743, 1024, 1159, 13, 1678, 3233, 978, 29901, 851, 353, 8989, 29898, 8216, 543, 1576, 1480, 3233, 1159, 13, 1678, 2643, 29901, 28379, 29961, 710, 29962, 353, 8989, 29898, 8216, 543, 1576, 1480, 2643, 1159, 13, 1678, 15562, 29901, 14355, 353, 8989, 29898, 8216, 543, 18417, 6942, 411, 278, 1480, 1159, 13, 1678, 4833, 3177, 29918, 333, 29901, 938, 353, 8989, 29898, 8216, 543, 29254, 630, 2943, 1178, 313, 20571, 25760, 13, 13, 13, 1990, 9071, 29898, 5160, 3195, 1125, 13, 1678, 9995, 29909, 2236, 7698, 9071, 3758, 1591, 4235, 1213, 15945, 13, 13, 1678, 1178, 29901, 938, 353, 8989, 29898, 8216, 543, 8110, 802, 1178, 313, 20571, 25760, 13, 1678, 318, 5416, 29901, 501, 11150, 353, 8989, 29898, 8216, 543, 11574, 635, 5412, 1178, 1159, 13, 1678, 2943, 29918, 1853, 29901, 851, 353, 8989, 29898, 8216, 543, 4247, 1134, 1159, 13, 1678, 1889, 29918, 1853, 29901, 851, 353, 8989, 29898, 8216, 543, 7032, 1134, 1159, 13, 1678, 3858, 29901, 851, 353, 8989, 29898, 8216, 543, 4775, 310, 2943, 1159, 13, 1678, 6139, 29901, 851, 353, 8989, 29898, 8216, 543, 9868, 310, 2943, 1159, 13, 1678, 274, 2230, 29901, 12865, 353, 8989, 29898, 8216, 543, 9832, 362, 931, 1159, 13, 1678, 286, 2230, 29901, 12865, 353, 8989, 29898, 8216, 543, 8897, 21733, 931, 1159, 13, 1678, 1404, 29918, 333, 29901, 938, 353, 8989, 29898, 8216, 543, 20399, 491, 1404, 1178, 313, 20571, 25760, 13, 1678, 4833, 12097, 261, 29918, 333, 29901, 28379, 29961, 524, 29962, 353, 8989, 29898, 8216, 543, 29254, 630, 6601, 1178, 313, 20571, 25760, 13, 1678, 8393, 29901, 14355, 353, 8989, 29898, 13, 4706, 6139, 543, 15801, 310, 278, 2943, 313, 326, 23975, 1156, 15446, 278, 2943, 19123, 13, 1678, 1723, 13, 1678, 429, 10678, 29901, 14355, 353, 8989, 29898, 13, 4706, 6139, 543, 18126, 8393, 310, 278, 2943, 313, 23975, 19123, 13, 1678, 1723, 13, 13, 13, 1990, 4911, 29898, 5160, 3195, 1125, 13, 1678, 9995, 29909, 2236, 7698, 4911, 3758, 1591, 4235, 1213, 15945, 13, 13, 1678, 1178, 29901, 938, 353, 8989, 29898, 8216, 543, 8110, 802, 1178, 313, 20571, 25760, 13, 1678, 4876, 29901, 851, 353, 8989, 29898, 8216, 543, 9823, 3211, 310, 278, 1404, 1159, 13, 1678, 937, 29918, 978, 29901, 28379, 29961, 710, 29962, 353, 8989, 29898, 8216, 543, 6730, 1024, 310, 278, 1404, 1159, 13, 1678, 1833, 29918, 978, 29901, 28379, 29961, 710, 29962, 353, 8989, 29898, 8216, 543, 8897, 1024, 310, 278, 1404, 1159, 13, 1678, 12666, 29901, 28379, 29961, 710, 29962, 353, 8989, 29898, 13, 4706, 6139, 543, 8514, 12666, 470, 664, 6689, 310, 278, 1404, 29908, 13, 1678, 1723, 13, 13, 13, 1990, 6645, 29898, 5160, 3195, 1125, 13, 1678, 9995, 29909, 2236, 7698, 6645, 3758, 1591, 4235, 1213, 15945, 13, 13, 1678, 1178, 29901, 938, 353, 8989, 29898, 8216, 543, 8110, 802, 1178, 313, 20571, 25760, 13, 1678, 1881, 29918, 333, 29901, 938, 353, 8989, 29898, 8216, 543, 8110, 802, 1178, 313, 20571, 29897, 310, 278, 1881, 2943, 1159, 13, 1678, 1962, 29918, 333, 29901, 938, 353, 8989, 29898, 8216, 543, 8110, 802, 1178, 313, 20571, 29897, 310, 278, 1962, 2943, 1159, 13, 1678, 3858, 29901, 28379, 29961, 710, 29962, 353, 8989, 29898, 8216, 543, 1576, 3858, 310, 278, 1544, 1159, 13, 1678, 1134, 29901, 851, 353, 8989, 29898, 8216, 543, 1576, 1134, 310, 1544, 1159, 13, 13, 13, 12054, 29918, 1529, 18009, 4214, 29901, 360, 919, 29961, 710, 29892, 5167, 29961, 5160, 3195, 5262, 353, 426, 13, 1678, 376, 6444, 3401, 1115, 13189, 3401, 29892, 13, 1678, 376, 20001, 1115, 461, 29892, 13, 1678, 376, 20606, 261, 1115, 20972, 29892, 13, 1678, 376, 4782, 1115, 6431, 29892, 13, 1678, 376, 3403, 1115, 4522, 29892, 13, 1678, 376, 4247, 1115, 9071, 29892, 13, 1678, 376, 2659, 1115, 4911, 29892, 13, 1678, 376, 6595, 1115, 6645, 29892, 13, 29913, 13, 13, 13, 1753, 679, 29918, 4299, 29918, 3166, 29918, 555, 29898, 13, 1678, 470, 29885, 29918, 25932, 29901, 5167, 29961, 555, 29889, 6691, 1402, 2758, 29918, 1491, 13203, 29901, 6120, 353, 5852, 13, 29897, 1599, 5167, 29961, 5160, 3195, 5387, 13, 1678, 9995, 11609, 278, 282, 2941, 7716, 1904, 4475, 304, 278, 470, 29885, 770, 29889, 13, 13, 1678, 584, 3207, 2758, 29918, 1491, 13203, 29901, 7106, 278, 2967, 770, 10417, 363, 1014, 13203, 13, 1678, 9995, 13, 1678, 565, 470, 29885, 29918, 25932, 17255, 978, 1649, 297, 6323, 29924, 29918, 1529, 18009, 4214, 29901, 13, 4706, 736, 6323, 29924, 29918, 1529, 18009, 4214, 29961, 555, 29918, 25932, 17255, 978, 1649, 29962, 13, 1678, 565, 2758, 29918, 1491, 13203, 322, 338, 1491, 1990, 29898, 555, 29918, 25932, 29892, 470, 29885, 29889, 18010, 29889, 4247, 1125, 13, 4706, 736, 9071, 13, 1678, 565, 2758, 29918, 1491, 13203, 322, 338, 1491, 1990, 29898, 555, 29918, 25932, 29892, 470, 29885, 29889, 4782, 1125, 13, 4706, 736, 6431, 13, 1678, 12020, 7670, 2392, 29898, 29888, 29908, 29912, 555, 29918, 25932, 27195, 13, 2 ]
clinnotes/reminders/forms.py
mattnickerson993/clinnotes2
0
13479
<filename>clinnotes/reminders/forms.py<gh_stars>0 from django import forms from .models import Reminder from clinnotes.users.models import EpisodeOfCare class ReminderForm(forms.ModelForm): class Meta: model = Reminder fields = ['category', 'title', 'details', 'episode_of_care'] def __init__(self, *args, **kwargs): user = kwargs.pop('user') super(ReminderForm, self).__init__(*args, **kwargs) self.fields['episode_of_care'].queryset = EpisodeOfCare.objects.filter(clinician=user)
[ 1, 529, 9507, 29958, 695, 262, 16953, 29914, 1745, 513, 414, 29914, 9514, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 9557, 1053, 7190, 13, 3166, 869, 9794, 1053, 5240, 4995, 13, 3166, 24899, 16953, 29889, 7193, 29889, 9794, 1053, 382, 12907, 2776, 29907, 598, 13, 13, 13, 1990, 5240, 4995, 2500, 29898, 9514, 29889, 3195, 2500, 1125, 13, 1678, 770, 20553, 29901, 29871, 13, 4706, 1904, 353, 5240, 4995, 13, 4706, 4235, 353, 6024, 7320, 742, 525, 3257, 742, 525, 14144, 742, 525, 1022, 275, 356, 29918, 974, 29918, 18020, 2033, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 1404, 353, 9049, 5085, 29889, 7323, 877, 1792, 1495, 13, 4706, 2428, 29898, 7301, 4995, 2500, 29892, 1583, 467, 1649, 2344, 1649, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 1583, 29889, 9621, 1839, 1022, 275, 356, 29918, 974, 29918, 18020, 13359, 1972, 842, 353, 382, 12907, 2776, 29907, 598, 29889, 12650, 29889, 4572, 29898, 695, 262, 8910, 29922, 1792, 29897, 2 ]
aula0705/matriz_fundamentos.py
fillipesouza/aulasdelogicaprogramacao
1
187868
from random import randint def cria_matriz(num_linhas, num_colunas): matriz = [] for i in range(num_linhas): linha = [] for j in range(num_colunas): linha.append(randint(0,10)) matriz.append(linha) return matriz def imprime_matriz(matriz): for i in range(len(matriz)): linha = matriz[i] # pega a linha correspondente for j in range(len(linha)): # um for para o numero de elementos da linha (colunas) print(matriz[i][j], end=' ') # da um espaco para cada coluna da linha print() # pula uma linha quando acabar as colunas da linha def imprime_uns(num_linhas, num_colunas): for i in range(num_linhas): for j in range(num_colunas): print('1', end=' ') print() matriz = cria_matriz(3, 4) # cria matriz 3x4 (3L x 4C) print(matriz) # imprime na forma primária (listas) imprime_matriz(matriz) # imprime na forma de matriz #imprime_uns(3, 4)
[ 1, 515, 4036, 1053, 20088, 524, 13, 1753, 274, 2849, 29918, 2922, 7485, 29898, 1949, 29918, 1915, 5349, 29892, 954, 29918, 1054, 17496, 1125, 13, 1678, 1775, 7485, 353, 5159, 13, 1678, 363, 474, 297, 3464, 29898, 1949, 29918, 1915, 5349, 1125, 13, 4706, 6276, 2350, 353, 5159, 13, 4706, 363, 432, 297, 3464, 29898, 1949, 29918, 1054, 17496, 1125, 13, 9651, 6276, 2350, 29889, 4397, 29898, 9502, 524, 29898, 29900, 29892, 29896, 29900, 876, 13, 4706, 1775, 7485, 29889, 4397, 29898, 1915, 2350, 29897, 13, 1678, 736, 1775, 7485, 13, 13, 1753, 527, 10080, 29918, 2922, 7485, 29898, 2922, 7485, 1125, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 2922, 7485, 22164, 13, 4706, 6276, 2350, 353, 1775, 7485, 29961, 29875, 29962, 29871, 396, 282, 2442, 263, 6276, 2350, 3928, 2016, 13, 4706, 363, 432, 297, 3464, 29898, 2435, 29898, 1915, 2350, 22164, 396, 1922, 363, 1702, 288, 17910, 316, 29290, 1146, 6276, 2350, 313, 1054, 17496, 29897, 13, 9651, 1596, 29898, 2922, 7485, 29961, 29875, 3816, 29926, 1402, 1095, 2433, 25710, 396, 1146, 1922, 5152, 11216, 1702, 9747, 784, 4347, 1146, 6276, 2350, 13, 4706, 1596, 580, 29871, 396, 282, 2497, 3672, 6276, 2350, 9836, 22998, 279, 408, 784, 17496, 1146, 6276, 2350, 13, 13, 1753, 527, 10080, 29918, 6948, 29898, 1949, 29918, 1915, 5349, 29892, 954, 29918, 1054, 17496, 1125, 13, 1678, 363, 474, 297, 3464, 29898, 1949, 29918, 1915, 5349, 1125, 13, 4706, 363, 432, 297, 3464, 29898, 1949, 29918, 1054, 17496, 1125, 13, 9651, 1596, 877, 29896, 742, 1095, 2433, 25710, 13, 4706, 1596, 580, 13, 13, 13, 2922, 7485, 353, 274, 2849, 29918, 2922, 7485, 29898, 29941, 29892, 29871, 29946, 29897, 396, 274, 2849, 1775, 7485, 29871, 29941, 29916, 29946, 313, 29941, 29931, 921, 29871, 29946, 29907, 29897, 13, 2158, 29898, 2922, 7485, 29897, 29871, 396, 527, 10080, 1055, 5954, 1903, 21925, 313, 1761, 294, 29897, 13, 326, 10080, 29918, 2922, 7485, 29898, 2922, 7485, 29897, 396, 527, 10080, 1055, 5954, 316, 1775, 7485, 13, 29937, 326, 10080, 29918, 6948, 29898, 29941, 29892, 29871, 29946, 29897, 13, 2 ]
PyFEM.py
Xianchao-Xu/PyFEM
0
89955
# coding: utf-8 # author: xuxc import os import platform import random import sys from PyQt5.QtCore import ( Qt, QSettings, QByteArray, PYQT_VERSION_STR ) from PyQt5.QtGui import ( QIcon, QKeySequence, QCloseEvent ) from PyQt5.QtWidgets import ( QApplication, QMainWindow, QVBoxLayout, QWidget, QFileDialog, QMessageBox, QAction, QTreeWidgetItem, ) from vtkmodules.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor as QVTKWidget from vtkmodules.vtkCommonCore import ( vtkPoints, vtkVersion ) from vtkmodules.vtkCommonDataModel import ( VTK_VERTEX, VTK_POLY_VERTEX, VTK_LINE, VTK_POLY_LINE, VTK_TRIANGLE, VTK_TRIANGLE_STRIP, VTK_POLYGON, VTK_PIXEL, VTK_QUAD, VTK_TETRA, VTK_VOXEL, VTK_HEXAHEDRON, VTK_WEDGE, VTK_PYRAMID, VTK_QUADRATIC_EDGE, VTK_QUADRATIC_TRIANGLE, VTK_QUADRATIC_QUAD, VTK_QUADRATIC_TETRA, VTK_QUADRATIC_HEXAHEDRON, vtkUnstructuredGrid ) from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera from vtkmodules.vtkInteractionWidgets import ( vtkLogoWidget, vtkLogoRepresentation, vtkOrientationMarkerWidget, vtkTextWidget, vtkTextRepresentation ) from vtkmodules.vtkIOImage import vtkJPEGReader from vtkmodules.vtkRenderingAnnotation import vtkAxesActor from vtkmodules.vtkRenderingCore import ( vtkActor, vtkDataSetMapper, vtkRenderer, vtkTextActor ) # noinspection PyUnresolvedReferences import vtkmodules.vtkRenderingOpenGL2 # 虽然后面没有用到,但必须导入这个,否则会报错 from ui.CentralWidget import ( CentralWidget, ColorPickerWidget ) from utility.FileParser import FileParser __version__ = '0.01.02' __author__ = 'XuXianchao' __organization__ = '仿真坊' __appname__ = 'PyFEM' VTK_ELEMENT_TYPE_TABLE = { 1: VTK_VERTEX, 2: VTK_POLY_VERTEX, 3: VTK_LINE, 4: VTK_POLY_LINE, 5: VTK_TRIANGLE, 6: VTK_TRIANGLE_STRIP, 7: VTK_POLYGON, 8: VTK_PIXEL, 9: VTK_QUAD, 10: VTK_TETRA, 11: VTK_VOXEL, 12: VTK_HEXAHEDRON, 13: VTK_WEDGE, 14: VTK_PYRAMID, 21: VTK_QUADRATIC_EDGE, 22: VTK_QUADRATIC_TRIANGLE, 23: VTK_QUADRATIC_QUAD, 24: VTK_QUADRATIC_TETRA, 25: VTK_QUADRATIC_HEXAHEDRON } class MainWindow(QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.setWindowTitle('{} - v{}'.format(__appname__, __version__)) # 设置中央窗体(中央窗体已从主程序中分离出去) self.central_widget = CentralWidget(self) self.central_widget.setObjectName('central_widget') self.setCentralWidget(self.central_widget) self.horizontal_splitter = self.central_widget.horizontal_splitter self.vertical_splitter = self.central_widget.vertical_splitter self.navigation_tab = self.central_widget.navigation_tab self.view_tab_widget = self.central_widget.view_tab_widget self.tree_widget = self.central_widget.tree_widget self.info_browser = self.central_widget.additional_tab_widget.info_browser # 添加其他控件 self.add_menu() # 添加菜单栏和工具栏 self.statusBar().showMessage('准备完毕', 5000) # 添加状态栏并显示相关信息 # vtk相关控件 self.vtk_widget = QVTKWidget() self.render_window = self.vtk_widget.GetRenderWindow() self.iren = self.render_window.GetInteractor() self.renderer = vtkRenderer() self.actor_index = 0 # actor的索引号 self.actors = dict() # actor字典 self.axes_actor = vtkAxesActor() self.logo_widget = vtkLogoWidget() # 用于放置logo,必须全局可用 self.text_widget = vtkTextWidget() # 用于放置软件名和版本号 self.marker_widget = vtkOrientationMarkerWidget() # 用于放置坐标轴 self.add_vtk_view() # 添加VTK视图 self.init_vtk_view() # VTK视图初始化 # 恢复上次关闭时的状态 self.load_settings() self.navigation_tab.node_size_spinbox.valueChanged.connect(self.node_size_changed) self.tree_widget.itemChanged.connect(self.show_hide_actor) @staticmethod def add_actions(target, actions): for action in actions: if action is None: target.addSeparator() else: target.addAction(action) def add_menu(self): self.add_file_menu() self.add_help_menu() def add_file_menu(self): file_menu = self.menuBar().addMenu('文件') file_menu.setObjectName('file_menu') file_toolbar = self.addToolBar('文件') file_toolbar.setObjectName('file_toolbar') file_new_action = self.create_action( '新建', self.file_new, QKeySequence.New, 'Icons/New.png', '新建文件') file_open_action = self.create_action( '打开', self.file_open, QKeySequence.Open, 'Icons/Open.png', '打开文件') file_exit_action = self.create_action( '退出', self.close, 'Ctrl+Q', 'Icons/Exit.png', '退出') self.add_actions(file_menu, (file_new_action, file_open_action, None, file_exit_action)) self.add_actions(file_toolbar, (file_new_action, file_open_action, file_exit_action)) def add_help_menu(self): help_menu = self.menuBar().addMenu('帮助') help_menu.setObjectName('help_menu') file_help_action = self.create_action( '帮助', self.file_help, icon="Icons/Help.png", tip='帮助') file_about_action = self.create_action( '关于', self.file_about, icon='Icons/About.png', tip='关于') file_license_action = self.create_action( '许可', self.file_license, QKeySequence.HelpContents, 'Icons/License.png', '许可') self.add_actions(help_menu, (file_help_action, None, file_about_action, file_license_action)) def add_vtk_view(self): vtk_view_tab = QWidget() vtk_view_tab.setObjectName('vtk_view_tab') self.view_tab_widget.addTab(vtk_view_tab, 'VTK视图') vtk_layout = QVBoxLayout(vtk_view_tab) vtk_layout.addWidget(self.vtk_widget) def closeEvent(self, a0: QCloseEvent) -> None: settings = QSettings() settings.setValue('MainWindow/Geometry', self.saveGeometry()) settings.setValue('MainWindow/State', self.saveState()) settings.setValue('MainWindow/HorizontalSplitter', self.horizontal_splitter.saveState()) settings.setValue('MainWindow/VerticalSplitter', self.vertical_splitter.saveState()) def create_action(self, text, slot=None, shortcut=None, icon=None, tip=None, checkable=False, signal='triggered'): action = QAction(text, self) if icon is not None: action.setIcon(QIcon(icon)) if shortcut is not None: action.setShortcut(shortcut) if tip is not None: action.setToolTip(tip) action.setStatusTip(tip) if slot is not None: getattr(action, signal).connect(slot) if checkable: action.setCheckable(True) return action def file_new(self): # 打开文件时,移除所有actor,并重新添加全局坐标轴,actor索引重置为1 for actor in self.actors.values(): self.renderer.RemoveActor(actor) self.axes_actor.AxisLabelsOff() self.renderer.AddActor(self.axes_actor) self.actor_index = 1 self.actors[self.actor_index] = self.axes_actor self.render_window.Render() # 移除模型树“网格”标签下的所有actor分支 item_index = self.tree_widget.top_level_names.index('网格') item = self.tree_widget.topLevelItem(item_index) children = [] for child in range(item.childCount()): children.append(item.child(child)) for child in children: item.removeChild(child) def file_open(self): supported_files_list = { '自定义{}文件': '*.fem'.format(__appname__), } supported_files = '支持的文件({})'.format(' '.join(supported_files_list.values())) format_filter = '所有文件(*.*);;' + supported_files for key, value in supported_files_list.items(): format_filter += ';;' + key + '({})'.format(value) filename, dialog_title = QFileDialog.getOpenFileName( self, '打开文件', '.', format_filter) if filename: if '*'+os.path.splitext(filename)[-1] not in supported_files_list.values(): self.info_browser.append("<font color='red'>错误:不支持的格式:{}<font>".format(filename)) return else: if os.path.splitext(filename)[-1] == '.fem': self.info_browser.append('正在打开文件:{}'.format(filename)) params = FileParser(filename) params.parse_fem() if params.succeed: if params.type == 'scatter': self.show_scatter(params) elif params.type == 'mesh': self.show_mesh(params) self.info_browser.append(params.msg) def file_help(self): QMessageBox.about( self, '帮助', """<p>{}暂无帮助文档,如需帮助,可联系作者: <p>邮箱: <EMAIL> """.format(__appname__) ) def file_about(self): QMessageBox.about( self, '关于{}'.format(__appname__), '''<b>{}</b> v{} <p>一个简单的有限元软件。 <p>作者:{} <p>知乎账号:悬臂梁 <p>公众号:仿真坊 <p>开发工具:Python {} - PyQt {} - VTK {}'''.format( __appname__, __version__, __author__, platform.python_version(), PYQT_VERSION_STR, vtkVersion.GetVTKVersion() ) ) def file_license(self): QMessageBox.about( self, '许可', '{}采用MIT开源协议进行许可'.format(__appname__) ) def init_vtk_view(self): self.renderer.SetBackground(0.9, 0.9, 0.9) self.render_window.AddRenderer(self.renderer) self.iren.SetInteractorStyle(vtkInteractorStyleTrackballCamera()) # 添加全局坐标轴 self.axes_actor.AxisLabelsOff() self.renderer.AddActor(self.axes_actor) self.actor_index += 1 self.actors[self.actor_index] = self.axes_actor # 模型树更新全局坐标轴信息 axes_actor_item = QTreeWidgetItem(self.tree_widget.topLevelItem(0)) axes_actor_item.setText(0, '全局坐标系') axes_actor_item.setCheckState(0, Qt.Checked) axes_actor_item.setText(1, '{}'.format(self.actor_index)) self.tree_widget.expandAll() # 添加logo png_reader = vtkJPEGReader() png_reader.SetFileName('Icons/qrcode.jpg') png_reader.Update(None) # 不加None的时候PyCharm要报"Parameter 'p_int' unfilled" logo_representation = vtkLogoRepresentation() logo_representation.SetImage(png_reader.GetOutput()) logo_representation.SetPosition(0.9, 0.03) logo_representation.SetPosition2(0.1, 0.1) logo_representation.GetImageProperty().SetOpacity(1.0) self.logo_widget.SetRepresentation(logo_representation) # logo_widget需要全局可用 self.logo_widget.SetInteractor(self.iren) self.logo_widget.On() self.logo_widget.ProcessEventsOff() # 添加软件名、版本号 text_actor = vtkTextActor() text_actor.SetInput('{}\nv{}'.format(__appname__, __version__)) text_actor.GetTextProperty().SetColor(0.1, 0.1, 0.1) text_representation = vtkTextRepresentation() text_representation.SetPosition(0.88, 0.88) text_representation.SetPosition2(0.1, 0.1) # representation需要在text_actor前面添加 self.text_widget.SetRepresentation(text_representation) # text_widget需要全局可用 self.text_widget.SetInteractor(self.iren) self.text_widget.SetTextActor(text_actor) self.text_widget.On() self.text_widget.ProcessEventsOff() # 添加坐标轴 axes_actor = vtkAxesActor() self.marker_widget.SetOrientationMarker(axes_actor) self.marker_widget.SetInteractor(self.iren) self.marker_widget.EnabledOn() self.marker_widget.InteractiveOff() self.renderer.ResetCamera() self.render_window.Render() def load_settings(self): settings = QSettings() self.restoreGeometry(settings.value('MainWindow/Geometry', type=QByteArray)) self.restoreState(settings.value('MainWindow/State', type=QByteArray)) self.horizontal_splitter.restoreState( settings.value('MainWindow/HorizontalSplitter', type=QByteArray)) self.vertical_splitter.restoreState( settings.value('MainWindow/VerticalSplitter', type=QByteArray)) def node_size_changed(self, i): actor_index = self.actor_index current_item = self.tree_widget.currentItem() if current_item: actor_index = int(current_item.text(1)) if actor_index > 1: self.actors[actor_index].GetProperty().SetPointSize(i) self.render_window.Render() def change_color(self, actor_index): color = self.sender().palette().window().color().name() r_hex = int(color[1:3], 16) g_hex = int(color[3:5], 16) b_hex = int(color[5:7], 16) r, g, b = r_hex/255, g_hex/255, b_hex/255 self.actors[actor_index].GetProperty().SetColor(r, g, b) self.render_window.Render() def show_hide_actor(self, item: QTreeWidgetItem): if item.text(1): actor_index = int(item.text(1)) if item.checkState(0) == Qt.Checked: self.actors[actor_index].VisibilityOn() elif item.checkState(0) == Qt.Unchecked: self.actors[actor_index].VisibilityOff() self.render_window.Render() def add_actor(self, actor, actor_name, actor_color, parent_name): self.actor_index += 1 self.actors[self.actor_index] = actor self.renderer.AddActor(actor) self.renderer.ResetCamera() self.render_window.Render() item_index = self.tree_widget.top_level_names.index(parent_name) basename = os.path.splitext(os.path.basename(actor_name))[0] mesh_item = QTreeWidgetItem(self.tree_widget.topLevelItem(item_index)) color_picker = ColorPickerWidget(color=actor_color) actor_index = self.actor_index color_picker.label.clicked.connect(lambda: self.change_color(actor_index)) mesh_item.setText(0, '{}'.format(basename)) mesh_item.setCheckState(0, Qt.Checked) mesh_item.setText(1, '{}'.format(self.actor_index)) self.tree_widget.setItemWidget(mesh_item, 2, color_picker) def show_mesh(self, params): node_ids = params.node_ids nodes = params.nodes element_types = params.element_types elements = params.elements points = vtkPoints() for index, node in enumerate(nodes): points.InsertPoint(index, node) grid = vtkUnstructuredGrid() grid.SetPoints(points) for index, element in enumerate(elements): connection = [node_ids.index(i) for i in element] grid.InsertNextCell(VTK_ELEMENT_TYPE_TABLE[element_types[index]], len(element), connection) mapper = vtkDataSetMapper() mapper.SetInputData(grid) actor = vtkActor() actor.SetMapper(mapper) r, g, b = random.randint(0, 255), random.randint(0, 255), random.randint(0, 255) actor.GetProperty().SetColor(r / 255, g / 255, b / 255) actor.GetProperty().SetPointSize(int(self.navigation_tab.node_size_spinbox.text())) actor.GetProperty().EdgeVisibilityOn() actor.GetProperty().RenderPointsAsSpheresOn() r_hex = hex(r)[2:].rjust(2, '0') g_hex = hex(g)[2:].rjust(2, '0') b_hex = hex(b)[2:].rjust(2, '0') actor_color = '#{}{}{}'.format(r_hex, g_hex, b_hex) self.add_actor(actor, params.filename, actor_color, '网格') def show_scatter(self, params): nodes = params.nodes points = vtkPoints() for index, value in enumerate(nodes): points.InsertPoint(index, value) grid = vtkUnstructuredGrid() grid.SetPoints(points) for i in range(len(nodes)): grid.InsertNextCell(VTK_VERTEX, 1, [i]) mapper = vtkDataSetMapper() mapper.SetInputData(grid) actor = vtkActor() actor.SetMapper(mapper) r, g, b = random.randint(0, 255), random.randint(0, 255), random.randint(0, 255) actor.GetProperty().SetColor(r/255, g/255, b/255) actor.GetProperty().SetPointSize(int(self.navigation_tab.node_size_spinbox.text())) actor.GetProperty().RenderPointsAsSpheresOn() r_hex = hex(r)[2:].rjust(2, '0') g_hex = hex(g)[2:].rjust(2, '0') b_hex = hex(b)[2:].rjust(2, '0') actor_color = '#{}{}{}'.format(r_hex, g_hex, b_hex) self.add_actor(actor, params.filename, actor_color, '网格') if __name__ == '__main__': app = QApplication(sys.argv) app.setApplicationName('{}'.format(__appname__)) app.setOrganizationName('{}'.format(__organization__)) win = MainWindow() win.show() app.exec_()
[ 1, 396, 14137, 29901, 23616, 29899, 29947, 13, 29937, 4148, 29901, 921, 1314, 29883, 13, 5215, 2897, 13, 5215, 7481, 13, 5215, 4036, 13, 5215, 10876, 13, 13, 3166, 10772, 17303, 29945, 29889, 17303, 9203, 1053, 313, 13, 1678, 14705, 29892, 13, 1678, 660, 9585, 29892, 13, 1678, 660, 12901, 2588, 29892, 13, 1678, 349, 29979, 29984, 29911, 29918, 16358, 29918, 10810, 13, 29897, 13, 3166, 10772, 17303, 29945, 29889, 17303, 28707, 1053, 313, 13, 1678, 660, 12492, 29892, 13, 1678, 660, 2558, 20529, 29892, 13, 1678, 660, 11123, 2624, 13, 29897, 13, 3166, 10772, 17303, 29945, 29889, 17303, 8801, 29879, 1053, 313, 13, 1678, 660, 4873, 29892, 13, 1678, 660, 6330, 5907, 29892, 13, 1678, 660, 29963, 3313, 3453, 29892, 13, 1678, 660, 8801, 29892, 13, 1678, 660, 2283, 7647, 29892, 13, 1678, 660, 3728, 3313, 29892, 13, 1678, 660, 4276, 29892, 13, 1678, 660, 9643, 8801, 2001, 29892, 13, 29897, 13, 13, 3166, 325, 11178, 7576, 29889, 17915, 29889, 29984, 29963, 29911, 29968, 10716, 5907, 4074, 7168, 1053, 660, 29963, 29911, 29968, 10716, 5907, 4074, 7168, 408, 660, 29963, 29911, 29968, 8801, 13, 3166, 325, 11178, 7576, 29889, 29894, 11178, 18877, 9203, 1053, 313, 13, 1678, 325, 11178, 20325, 29892, 13, 1678, 325, 11178, 6594, 13, 29897, 13, 3166, 325, 11178, 7576, 29889, 29894, 11178, 18877, 1469, 3195, 1053, 313, 13, 1678, 478, 29911, 29968, 29918, 5348, 4330, 29990, 29892, 13, 1678, 478, 29911, 29968, 29918, 29925, 5607, 29979, 29918, 5348, 4330, 29990, 29892, 13, 1678, 478, 29911, 29968, 29918, 18521, 29892, 13, 1678, 478, 29911, 29968, 29918, 29925, 5607, 29979, 29918, 18521, 29892, 13, 1678, 478, 29911, 29968, 29918, 29911, 3960, 19453, 1307, 29892, 13, 1678, 478, 29911, 29968, 29918, 29911, 3960, 19453, 1307, 29918, 1254, 3960, 29925, 29892, 13, 1678, 478, 29911, 29968, 29918, 29925, 5607, 29979, 29954, 1164, 29892, 13, 1678, 478, 29911, 29968, 29918, 2227, 29990, 6670, 29892, 13, 1678, 478, 29911, 29968, 29918, 13356, 3035, 29892, 13, 1678, 478, 29911, 29968, 29918, 29911, 2544, 4717, 29892, 13, 1678, 478, 29911, 29968, 29918, 24898, 29990, 6670, 29892, 13, 1678, 478, 29911, 29968, 29918, 29950, 5746, 29909, 29950, 3352, 29934, 1164, 29892, 13, 1678, 478, 29911, 29968, 29918, 29956, 3352, 1692, 29892, 13, 1678, 478, 29911, 29968, 29918, 20055, 25058, 1367, 29892, 13, 1678, 478, 29911, 29968, 29918, 13356, 3035, 29934, 1299, 2965, 29918, 3352, 1692, 29892, 13, 1678, 478, 29911, 29968, 29918, 13356, 3035, 29934, 1299, 2965, 29918, 29911, 3960, 19453, 1307, 29892, 13, 1678, 478, 29911, 29968, 29918, 13356, 3035, 29934, 1299, 2965, 29918, 13356, 3035, 29892, 13, 1678, 478, 29911, 29968, 29918, 13356, 3035, 29934, 1299, 2965, 29918, 29911, 2544, 4717, 29892, 13, 1678, 478, 29911, 29968, 29918, 13356, 3035, 29934, 1299, 2965, 29918, 29950, 5746, 29909, 29950, 3352, 29934, 1164, 29892, 13, 1678, 325, 11178, 2525, 4984, 2955, 5756, 13, 29897, 13, 3166, 325, 11178, 7576, 29889, 29894, 11178, 4074, 2467, 5568, 1053, 325, 11178, 4074, 7168, 5568, 17936, 2135, 20717, 13, 3166, 325, 11178, 7576, 29889, 29894, 11178, 4074, 2467, 8801, 29879, 1053, 313, 13, 1678, 325, 11178, 3403, 29877, 8801, 29892, 13, 1678, 325, 11178, 3403, 29877, 1123, 26081, 29892, 13, 1678, 325, 11178, 25231, 24619, 8801, 29892, 13, 1678, 325, 11178, 1626, 8801, 29892, 13, 1678, 325, 11178, 1626, 1123, 26081, 13, 29897, 13, 3166, 325, 11178, 7576, 29889, 29894, 11178, 5971, 2940, 1053, 325, 11178, 29967, 4162, 29954, 6982, 13, 3166, 325, 11178, 7576, 29889, 29894, 11178, 10716, 292, 21978, 1053, 325, 11178, 29909, 9100, 29909, 2801, 13, 3166, 325, 11178, 7576, 29889, 29894, 11178, 10716, 292, 9203, 1053, 313, 13, 1678, 325, 11178, 29909, 2801, 29892, 13, 1678, 325, 11178, 28449, 19968, 29892, 13, 1678, 325, 11178, 21323, 29892, 13, 1678, 325, 11178, 1626, 29909, 2801, 13, 29897, 13, 29937, 694, 1144, 27988, 10772, 2525, 9778, 1490, 1123, 10662, 13, 5215, 325, 11178, 7576, 29889, 29894, 11178, 10716, 292, 6585, 7239, 29906, 29871, 396, 29871, 235, 156, 192, 31516, 30822, 30806, 31423, 30417, 30406, 30780, 30214, 231, 192, 137, 31641, 236, 164, 190, 31943, 30752, 30810, 30502, 30214, 31191, 31403, 30437, 233, 141, 168, 31745, 13, 13, 3166, 14313, 29889, 23369, 1705, 8801, 1053, 313, 13, 1678, 8068, 8801, 29892, 13, 1678, 9159, 13954, 8801, 13, 29897, 13, 3166, 19725, 29889, 2283, 11726, 1053, 3497, 11726, 13, 13, 1649, 3259, 1649, 353, 525, 29900, 29889, 29900, 29896, 29889, 29900, 29906, 29915, 13, 1649, 8921, 1649, 353, 525, 29990, 29884, 29990, 713, 5815, 29877, 29915, 13, 1649, 6388, 2133, 1649, 353, 525, 231, 190, 194, 30848, 232, 160, 141, 29915, 13, 1649, 932, 978, 1649, 353, 525, 19737, 29943, 12665, 29915, 13, 13, 29963, 29911, 29968, 29918, 29923, 1307, 13780, 29918, 11116, 29918, 21009, 353, 426, 13, 268, 29896, 29901, 478, 29911, 29968, 29918, 5348, 4330, 29990, 29892, 13, 268, 29906, 29901, 478, 29911, 29968, 29918, 29925, 5607, 29979, 29918, 5348, 4330, 29990, 29892, 13, 268, 29941, 29901, 478, 29911, 29968, 29918, 18521, 29892, 13, 268, 29946, 29901, 478, 29911, 29968, 29918, 29925, 5607, 29979, 29918, 18521, 29892, 13, 268, 29945, 29901, 478, 29911, 29968, 29918, 29911, 3960, 19453, 1307, 29892, 13, 268, 29953, 29901, 478, 29911, 29968, 29918, 29911, 3960, 19453, 1307, 29918, 1254, 3960, 29925, 29892, 13, 268, 29955, 29901, 478, 29911, 29968, 29918, 29925, 5607, 29979, 29954, 1164, 29892, 13, 268, 29947, 29901, 478, 29911, 29968, 29918, 2227, 29990, 6670, 29892, 13, 268, 29929, 29901, 478, 29911, 29968, 29918, 13356, 3035, 29892, 13, 268, 29896, 29900, 29901, 478, 29911, 29968, 29918, 29911, 2544, 4717, 29892, 13, 268, 29896, 29896, 29901, 478, 29911, 29968, 29918, 24898, 29990, 6670, 29892, 13, 268, 29896, 29906, 29901, 478, 29911, 29968, 29918, 29950, 5746, 29909, 29950, 3352, 29934, 1164, 29892, 13, 268, 29896, 29941, 29901, 478, 29911, 29968, 29918, 29956, 3352, 1692, 29892, 13, 268, 29896, 29946, 29901, 478, 29911, 29968, 29918, 20055, 25058, 1367, 29892, 13, 268, 29906, 29896, 29901, 478, 29911, 29968, 29918, 13356, 3035, 29934, 1299, 2965, 29918, 3352, 1692, 29892, 13, 268, 29906, 29906, 29901, 478, 29911, 29968, 29918, 13356, 3035, 29934, 1299, 2965, 29918, 29911, 3960, 19453, 1307, 29892, 13, 268, 29906, 29941, 29901, 478, 29911, 29968, 29918, 13356, 3035, 29934, 1299, 2965, 29918, 13356, 3035, 29892, 13, 268, 29906, 29946, 29901, 478, 29911, 29968, 29918, 13356, 3035, 29934, 1299, 2965, 29918, 29911, 2544, 4717, 29892, 13, 268, 29906, 29945, 29901, 478, 29911, 29968, 29918, 13356, 3035, 29934, 1299, 2965, 29918, 29950, 5746, 29909, 29950, 3352, 29934, 1164, 13, 29913, 13, 13, 13, 1990, 4241, 5907, 29898, 29984, 6330, 5907, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 29898, 6330, 5907, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 842, 5907, 7030, 877, 8875, 448, 325, 8875, 4286, 4830, 22168, 932, 978, 1649, 29892, 4770, 3259, 1649, 876, 13, 13, 4706, 396, 29871, 30872, 30669, 30275, 232, 167, 177, 234, 173, 154, 30988, 30419, 30275, 232, 167, 177, 234, 173, 154, 30988, 31290, 31594, 30888, 31101, 31463, 30275, 30748, 234, 169, 190, 30544, 31475, 30409, 13, 4706, 1583, 29889, 25171, 29918, 8030, 353, 8068, 8801, 29898, 1311, 29897, 13, 4706, 1583, 29889, 25171, 29918, 8030, 29889, 842, 2061, 1170, 877, 25171, 29918, 8030, 1495, 13, 4706, 1583, 29889, 842, 23369, 1705, 8801, 29898, 1311, 29889, 25171, 29918, 8030, 29897, 13, 4706, 1583, 29889, 22672, 29918, 5451, 357, 353, 1583, 29889, 25171, 29918, 8030, 29889, 22672, 29918, 5451, 357, 13, 4706, 1583, 29889, 18575, 29918, 5451, 357, 353, 1583, 29889, 25171, 29918, 8030, 29889, 18575, 29918, 5451, 357, 13, 4706, 1583, 29889, 15466, 29918, 3891, 353, 1583, 29889, 25171, 29918, 8030, 29889, 15466, 29918, 3891, 13, 4706, 1583, 29889, 1493, 29918, 3891, 29918, 8030, 353, 1583, 29889, 25171, 29918, 8030, 29889, 1493, 29918, 3891, 29918, 8030, 13, 4706, 1583, 29889, 8336, 29918, 8030, 353, 1583, 29889, 25171, 29918, 8030, 29889, 8336, 29918, 8030, 13, 4706, 1583, 29889, 3888, 29918, 15965, 353, 1583, 29889, 25171, 29918, 8030, 29889, 1202, 3245, 29918, 3891, 29918, 8030, 29889, 3888, 29918, 15965, 13, 13, 4706, 396, 29871, 31538, 30666, 31149, 31221, 31617, 30631, 13, 4706, 1583, 29889, 1202, 29918, 6510, 580, 29871, 396, 29871, 31538, 30666, 31854, 31166, 233, 163, 146, 30503, 31041, 232, 136, 186, 233, 163, 146, 13, 4706, 1583, 29889, 4882, 4297, 2141, 4294, 3728, 877, 232, 138, 137, 232, 167, 138, 31366, 233, 178, 152, 742, 29871, 29945, 29900, 29900, 29900, 29897, 29871, 396, 29871, 31538, 30666, 31531, 31613, 233, 163, 146, 31666, 31542, 30858, 30990, 31057, 30689, 31021, 13, 13, 4706, 396, 325, 11178, 30990, 31057, 31617, 30631, 13, 4706, 1583, 29889, 29894, 11178, 29918, 8030, 353, 660, 29963, 29911, 29968, 8801, 580, 13, 4706, 1583, 29889, 9482, 29918, 7165, 353, 1583, 29889, 29894, 11178, 29918, 8030, 29889, 2577, 10716, 5907, 580, 13, 4706, 1583, 29889, 381, 264, 353, 1583, 29889, 9482, 29918, 7165, 29889, 2577, 4074, 7168, 580, 13, 4706, 1583, 29889, 9482, 261, 353, 325, 11178, 21323, 580, 13, 4706, 1583, 29889, 7168, 29918, 2248, 353, 29871, 29900, 29871, 396, 11339, 30210, 31836, 31674, 30850, 13, 4706, 1583, 29889, 627, 943, 353, 9657, 580, 29871, 396, 11339, 30578, 31259, 13, 4706, 1583, 29889, 1165, 267, 29918, 7168, 353, 325, 11178, 29909, 9100, 29909, 2801, 580, 13, 4706, 1583, 29889, 14569, 29918, 8030, 353, 325, 11178, 3403, 29877, 8801, 580, 29871, 396, 29871, 30406, 30909, 31182, 30669, 14569, 30214, 31641, 236, 164, 190, 30753, 31655, 30682, 30406, 13, 4706, 1583, 29889, 726, 29918, 8030, 353, 325, 11178, 1626, 8801, 580, 29871, 396, 29871, 30406, 30909, 31182, 30669, 235, 192, 178, 30631, 30548, 30503, 30845, 30346, 30850, 13, 4706, 1583, 29889, 22976, 29918, 8030, 353, 325, 11178, 25231, 24619, 8801, 580, 29871, 396, 29871, 30406, 30909, 31182, 30669, 232, 160, 147, 31062, 235, 192, 183, 13, 13, 4706, 1583, 29889, 1202, 29918, 29894, 11178, 29918, 1493, 580, 29871, 396, 29871, 31538, 30666, 29963, 29911, 29968, 31568, 30861, 13, 4706, 1583, 29889, 2344, 29918, 29894, 11178, 29918, 1493, 580, 29871, 396, 478, 29911, 29968, 31568, 30861, 31120, 31020, 30705, 13, 13, 4706, 396, 29871, 233, 132, 165, 31810, 30429, 30936, 31057, 236, 154, 176, 30594, 30210, 31531, 31613, 13, 4706, 1583, 29889, 1359, 29918, 11027, 580, 13, 13, 4706, 1583, 29889, 15466, 29918, 3891, 29889, 3177, 29918, 2311, 29918, 1028, 262, 1884, 29889, 1767, 7590, 29889, 6915, 29898, 1311, 29889, 3177, 29918, 2311, 29918, 15033, 29897, 13, 4706, 1583, 29889, 8336, 29918, 8030, 29889, 667, 7590, 29889, 6915, 29898, 1311, 29889, 4294, 29918, 11458, 29918, 7168, 29897, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 788, 29918, 7387, 29898, 5182, 29892, 8820, 1125, 13, 4706, 363, 3158, 297, 8820, 29901, 13, 9651, 565, 3158, 338, 6213, 29901, 13, 18884, 3646, 29889, 1202, 2008, 17954, 580, 13, 9651, 1683, 29901, 13, 18884, 3646, 29889, 1202, 4276, 29898, 2467, 29897, 13, 13, 1678, 822, 788, 29918, 6510, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1202, 29918, 1445, 29918, 6510, 580, 13, 4706, 1583, 29889, 1202, 29918, 8477, 29918, 6510, 580, 13, 13, 1678, 822, 788, 29918, 1445, 29918, 6510, 29898, 1311, 1125, 13, 4706, 934, 29918, 6510, 353, 1583, 29889, 6510, 4297, 2141, 1202, 6823, 877, 30333, 30631, 1495, 13, 4706, 934, 29918, 6510, 29889, 842, 2061, 1170, 877, 1445, 29918, 6510, 1495, 13, 4706, 934, 29918, 10154, 1646, 353, 1583, 29889, 1202, 12229, 4297, 877, 30333, 30631, 1495, 13, 4706, 934, 29918, 10154, 1646, 29889, 842, 2061, 1170, 877, 1445, 29918, 10154, 1646, 1495, 13, 4706, 934, 29918, 1482, 29918, 2467, 353, 1583, 29889, 3258, 29918, 2467, 29898, 13, 9651, 525, 30374, 30886, 742, 1583, 29889, 1445, 29918, 1482, 29892, 660, 2558, 20529, 29889, 4373, 29892, 525, 29902, 3200, 29914, 4373, 29889, 2732, 742, 525, 30374, 30886, 30333, 30631, 1495, 13, 4706, 934, 29918, 3150, 29918, 2467, 353, 1583, 29889, 3258, 29918, 2467, 29898, 13, 9651, 525, 31656, 31026, 742, 1583, 29889, 1445, 29918, 3150, 29892, 660, 2558, 20529, 29889, 6585, 29892, 525, 29902, 3200, 29914, 6585, 29889, 2732, 742, 525, 31656, 31026, 30333, 30631, 1495, 13, 4706, 934, 29918, 13322, 29918, 2467, 353, 1583, 29889, 3258, 29918, 2467, 29898, 13, 9651, 525, 236, 131, 131, 30544, 742, 1583, 29889, 5358, 29892, 525, 18069, 29974, 29984, 742, 525, 29902, 3200, 29914, 24365, 29889, 2732, 742, 525, 236, 131, 131, 30544, 1495, 13, 4706, 1583, 29889, 1202, 29918, 7387, 29898, 1445, 29918, 6510, 29892, 313, 1445, 29918, 1482, 29918, 2467, 29892, 934, 29918, 3150, 29918, 2467, 29892, 6213, 29892, 934, 29918, 13322, 29918, 2467, 876, 13, 4706, 1583, 29889, 1202, 29918, 7387, 29898, 1445, 29918, 10154, 1646, 29892, 313, 1445, 29918, 1482, 29918, 2467, 29892, 934, 29918, 3150, 29918, 2467, 29892, 934, 29918, 13322, 29918, 2467, 876, 13, 13, 1678, 822, 788, 29918, 8477, 29918, 6510, 29898, 1311, 1125, 13, 4706, 1371, 29918, 6510, 353, 1583, 29889, 6510, 4297, 2141, 1202, 6823, 877, 232, 187, 177, 31931, 1495, 13, 4706, 1371, 29918, 6510, 29889, 842, 2061, 1170, 877, 8477, 29918, 6510, 1495, 13, 4706, 934, 29918, 8477, 29918, 2467, 353, 1583, 29889, 3258, 29918, 2467, 29898, 13, 9651, 525, 232, 187, 177, 31931, 742, 1583, 29889, 1445, 29918, 8477, 29892, 9849, 543, 29902, 3200, 29914, 29648, 29889, 2732, 613, 6872, 2433, 232, 187, 177, 31931, 1495, 13, 4706, 934, 29918, 12717, 29918, 2467, 353, 1583, 29889, 3258, 29918, 2467, 29898, 13, 9651, 525, 31057, 30909, 742, 1583, 29889, 1445, 29918, 12717, 29892, 9849, 2433, 29902, 3200, 29914, 28173, 29889, 2732, 742, 6872, 2433, 31057, 30909, 1495, 13, 4706, 934, 29918, 506, 1947, 29918, 2467, 353, 1583, 29889, 3258, 29918, 2467, 29898, 13, 9651, 525, 235, 177, 187, 30682, 742, 1583, 29889, 1445, 29918, 506, 1947, 29892, 660, 2558, 20529, 29889, 29648, 21002, 29892, 525, 29902, 3200, 29914, 29931, 293, 1947, 29889, 2732, 742, 525, 235, 177, 187, 30682, 1495, 13, 4706, 1583, 29889, 1202, 29918, 7387, 29898, 8477, 29918, 6510, 29892, 313, 1445, 29918, 8477, 29918, 2467, 29892, 6213, 29892, 934, 29918, 12717, 29918, 2467, 29892, 934, 29918, 506, 1947, 29918, 2467, 876, 13, 13, 1678, 822, 788, 29918, 29894, 11178, 29918, 1493, 29898, 1311, 1125, 13, 4706, 325, 11178, 29918, 1493, 29918, 3891, 353, 660, 8801, 580, 13, 4706, 325, 11178, 29918, 1493, 29918, 3891, 29889, 842, 2061, 1170, 877, 29894, 11178, 29918, 1493, 29918, 3891, 1495, 13, 4706, 1583, 29889, 1493, 29918, 3891, 29918, 8030, 29889, 1202, 8863, 29898, 29894, 11178, 29918, 1493, 29918, 3891, 29892, 525, 29963, 29911, 29968, 31568, 30861, 1495, 13, 4706, 325, 11178, 29918, 2680, 353, 660, 29963, 3313, 3453, 29898, 29894, 11178, 29918, 1493, 29918, 3891, 29897, 13, 4706, 325, 11178, 29918, 2680, 29889, 1202, 8801, 29898, 1311, 29889, 29894, 11178, 29918, 8030, 29897, 13, 13, 1678, 822, 3802, 2624, 29898, 1311, 29892, 263, 29900, 29901, 660, 11123, 2624, 29897, 1599, 6213, 29901, 13, 4706, 6055, 353, 660, 9585, 580, 13, 4706, 6055, 29889, 842, 1917, 877, 6330, 5907, 29914, 7999, 7843, 742, 1583, 29889, 7620, 7999, 7843, 3101, 13, 4706, 6055, 29889, 842, 1917, 877, 6330, 5907, 29914, 2792, 742, 1583, 29889, 7620, 2792, 3101, 13, 4706, 6055, 29889, 842, 1917, 877, 6330, 5907, 29914, 24932, 18772, 357, 742, 1583, 29889, 22672, 29918, 5451, 357, 29889, 7620, 2792, 3101, 13, 4706, 6055, 29889, 842, 1917, 877, 6330, 5907, 29914, 29270, 18772, 357, 742, 1583, 29889, 18575, 29918, 5451, 357, 29889, 7620, 2792, 3101, 13, 13, 1678, 822, 1653, 29918, 2467, 29898, 1311, 29892, 1426, 29892, 21497, 29922, 8516, 29892, 21697, 29922, 8516, 29892, 9849, 29922, 8516, 29892, 13, 462, 418, 6872, 29922, 8516, 29892, 1423, 519, 29922, 8824, 29892, 7182, 2433, 21001, 287, 29374, 13, 4706, 3158, 353, 660, 4276, 29898, 726, 29892, 1583, 29897, 13, 4706, 565, 9849, 338, 451, 6213, 29901, 13, 9651, 3158, 29889, 842, 12492, 29898, 29984, 12492, 29898, 4144, 876, 13, 4706, 565, 21697, 338, 451, 6213, 29901, 13, 9651, 3158, 29889, 842, 21322, 7582, 29898, 12759, 7582, 29897, 13, 4706, 565, 6872, 338, 451, 6213, 29901, 13, 9651, 3158, 29889, 842, 12229, 29911, 666, 29898, 12632, 29897, 13, 9651, 3158, 29889, 842, 5709, 29911, 666, 29898, 12632, 29897, 13, 4706, 565, 21497, 338, 451, 6213, 29901, 13, 9651, 679, 5552, 29898, 2467, 29892, 7182, 467, 6915, 29898, 2536, 327, 29897, 13, 4706, 565, 1423, 519, 29901, 13, 9651, 3158, 29889, 842, 5596, 519, 29898, 5574, 29897, 13, 4706, 736, 3158, 13, 13, 1678, 822, 934, 29918, 1482, 29898, 1311, 1125, 13, 4706, 396, 29871, 31656, 31026, 30333, 30631, 30594, 30214, 31618, 31152, 30744, 30417, 7168, 30214, 31666, 30908, 30374, 31538, 30666, 30753, 31655, 232, 160, 147, 31062, 235, 192, 183, 30214, 7168, 31836, 31674, 30908, 30669, 30573, 29896, 13, 4706, 363, 11339, 297, 1583, 29889, 627, 943, 29889, 5975, 7295, 13, 9651, 1583, 29889, 9482, 261, 29889, 15941, 29909, 2801, 29898, 7168, 29897, 13, 13, 4706, 1583, 29889, 1165, 267, 29918, 7168, 29889, 16070, 4775, 29879, 6880, 580, 13, 4706, 1583, 29889, 9482, 261, 29889, 2528, 29909, 2801, 29898, 1311, 29889, 1165, 267, 29918, 7168, 29897, 13, 4706, 1583, 29889, 7168, 29918, 2248, 353, 29871, 29896, 13, 4706, 1583, 29889, 627, 943, 29961, 1311, 29889, 7168, 29918, 2248, 29962, 353, 1583, 29889, 1165, 267, 29918, 7168, 13, 13, 4706, 1583, 29889, 9482, 29918, 7165, 29889, 10716, 580, 13, 13, 4706, 396, 29871, 31618, 31152, 31382, 30883, 233, 163, 148, 30015, 31222, 31168, 30024, 31062, 234, 176, 193, 30557, 30210, 30744, 30417, 7168, 30748, 31541, 13, 4706, 2944, 29918, 2248, 353, 1583, 29889, 8336, 29918, 8030, 29889, 3332, 29918, 5563, 29918, 7039, 29889, 2248, 877, 31222, 31168, 1495, 13, 4706, 2944, 353, 1583, 29889, 8336, 29918, 8030, 29889, 3332, 10108, 2001, 29898, 667, 29918, 2248, 29897, 13, 4706, 4344, 353, 5159, 13, 4706, 363, 2278, 297, 3464, 29898, 667, 29889, 5145, 3981, 580, 1125, 13, 9651, 4344, 29889, 4397, 29898, 667, 29889, 5145, 29898, 5145, 876, 13, 4706, 363, 2278, 297, 4344, 29901, 13, 9651, 2944, 29889, 5992, 5938, 29898, 5145, 29897, 13, 13, 1678, 822, 934, 29918, 3150, 29898, 1311, 1125, 13, 4706, 6969, 29918, 5325, 29918, 1761, 353, 426, 13, 9651, 525, 30688, 30495, 31349, 8875, 30333, 30631, 2396, 525, 10521, 29888, 331, 4286, 4830, 22168, 932, 978, 1649, 511, 13, 4706, 500, 13, 4706, 6969, 29918, 5325, 353, 525, 31541, 31695, 30210, 30333, 30631, 3319, 1800, 4286, 4830, 877, 15300, 7122, 29898, 23765, 29918, 5325, 29918, 1761, 29889, 5975, 22130, 13, 4706, 3402, 29918, 4572, 353, 525, 30744, 30417, 30333, 30631, 10456, 5575, 416, 29936, 29915, 718, 6969, 29918, 5325, 13, 4706, 363, 1820, 29892, 995, 297, 6969, 29918, 5325, 29918, 1761, 29889, 7076, 7295, 13, 9651, 3402, 29918, 4572, 4619, 525, 7859, 29915, 718, 1820, 718, 525, 3319, 1800, 4286, 4830, 29898, 1767, 29897, 13, 4706, 10422, 29892, 7928, 29918, 3257, 353, 660, 2283, 7647, 29889, 657, 6585, 17020, 29898, 13, 9651, 1583, 29892, 525, 31656, 31026, 30333, 30631, 742, 15300, 742, 3402, 29918, 4572, 29897, 13, 4706, 565, 10422, 29901, 13, 9651, 565, 525, 29930, 18717, 359, 29889, 2084, 29889, 23579, 568, 486, 29898, 9507, 9601, 29899, 29896, 29962, 451, 297, 6969, 29918, 5325, 29918, 1761, 29889, 5975, 7295, 13, 18884, 1583, 29889, 3888, 29918, 15965, 29889, 4397, 28945, 5657, 2927, 2433, 1127, 11041, 31745, 235, 178, 178, 30383, 30413, 31541, 31695, 30210, 31168, 30607, 30383, 8875, 29966, 5657, 29958, 1642, 4830, 29898, 9507, 876, 13, 18884, 736, 13, 9651, 1683, 29901, 13, 18884, 565, 2897, 29889, 2084, 29889, 23579, 568, 486, 29898, 9507, 9601, 29899, 29896, 29962, 1275, 15300, 29888, 331, 2396, 13, 462, 1678, 1583, 29889, 3888, 29918, 15965, 29889, 4397, 877, 30724, 30505, 31656, 31026, 30333, 30631, 30383, 8875, 4286, 4830, 29898, 9507, 876, 13, 462, 1678, 8636, 353, 3497, 11726, 29898, 9507, 29897, 13, 462, 1678, 8636, 29889, 5510, 29918, 29888, 331, 580, 13, 462, 1678, 565, 8636, 29889, 29879, 1682, 3947, 29901, 13, 462, 4706, 565, 8636, 29889, 1853, 1275, 525, 1557, 2620, 2396, 13, 462, 9651, 1583, 29889, 4294, 29918, 1557, 2620, 29898, 7529, 29897, 13, 462, 4706, 25342, 8636, 29889, 1853, 1275, 525, 4467, 29882, 2396, 13, 462, 9651, 1583, 29889, 4294, 29918, 4467, 29882, 29898, 7529, 29897, 13, 462, 1678, 1583, 29889, 3888, 29918, 15965, 29889, 4397, 29898, 7529, 29889, 7645, 29897, 13, 13, 1678, 822, 934, 29918, 8477, 29898, 1311, 1125, 13, 4706, 660, 3728, 3313, 29889, 12717, 29898, 13, 9651, 1583, 29892, 525, 232, 187, 177, 31931, 742, 13, 9651, 9995, 29966, 29886, 29958, 8875, 233, 157, 133, 31352, 232, 187, 177, 31931, 30333, 233, 164, 166, 30214, 30847, 31383, 232, 187, 177, 31931, 30214, 30682, 31986, 31185, 30732, 30767, 30383, 13, 9651, 529, 29886, 29958, 236, 133, 177, 234, 177, 180, 29901, 529, 26862, 6227, 29958, 13, 9651, 5124, 1642, 4830, 22168, 932, 978, 1649, 29897, 13, 4706, 1723, 13, 13, 1678, 822, 934, 29918, 12717, 29898, 1311, 1125, 13, 4706, 660, 3728, 3313, 29889, 12717, 29898, 13, 9651, 1583, 29892, 525, 31057, 30909, 8875, 4286, 4830, 22168, 932, 978, 1649, 511, 13, 9651, 14550, 29966, 29890, 29958, 8875, 829, 29890, 29958, 325, 8875, 29871, 13, 9651, 529, 29886, 29958, 30287, 30502, 234, 177, 131, 31166, 30210, 30417, 31175, 30824, 235, 192, 178, 30631, 30267, 13, 9651, 529, 29886, 29958, 30732, 30767, 30383, 8875, 13, 9651, 529, 29886, 29958, 31043, 231, 188, 145, 235, 183, 169, 30850, 30383, 233, 133, 175, 235, 138, 133, 233, 165, 132, 13, 9651, 529, 29886, 29958, 30539, 231, 191, 154, 30850, 30383, 231, 190, 194, 30848, 232, 160, 141, 13, 9651, 529, 29886, 29958, 31026, 30910, 31041, 232, 136, 186, 30383, 11980, 6571, 448, 10772, 17303, 6571, 448, 478, 29911, 29968, 6571, 4907, 4286, 4830, 29898, 13, 18884, 4770, 932, 978, 1649, 29892, 13, 18884, 4770, 3259, 1649, 29892, 13, 18884, 4770, 8921, 1649, 29892, 13, 18884, 7481, 29889, 4691, 29918, 3259, 3285, 13, 18884, 349, 29979, 29984, 29911, 29918, 16358, 29918, 10810, 29892, 13, 18884, 325, 11178, 6594, 29889, 2577, 29963, 29911, 29968, 6594, 580, 13, 9651, 1723, 13, 4706, 1723, 13, 13, 1678, 822, 934, 29918, 506, 1947, 29898, 1311, 1125, 13, 4706, 660, 3728, 3313, 29889, 12717, 29898, 13, 9651, 1583, 29892, 525, 235, 177, 187, 30682, 742, 525, 8875, 236, 138, 138, 30406, 26349, 31026, 31193, 232, 144, 146, 235, 177, 177, 31174, 30448, 235, 177, 187, 30682, 4286, 4830, 22168, 932, 978, 1649, 29897, 13, 4706, 1723, 13, 13, 1678, 822, 2069, 29918, 29894, 11178, 29918, 1493, 29898, 1311, 1125, 13, 4706, 1583, 29889, 9482, 261, 29889, 2697, 10581, 29898, 29900, 29889, 29929, 29892, 29871, 29900, 29889, 29929, 29892, 29871, 29900, 29889, 29929, 29897, 13, 4706, 1583, 29889, 9482, 29918, 7165, 29889, 2528, 21323, 29898, 1311, 29889, 9482, 261, 29897, 13, 4706, 1583, 29889, 381, 264, 29889, 2697, 4074, 7168, 5568, 29898, 29894, 11178, 4074, 7168, 5568, 17936, 2135, 20717, 3101, 13, 13, 4706, 396, 29871, 31538, 30666, 30753, 31655, 232, 160, 147, 31062, 235, 192, 183, 13, 4706, 1583, 29889, 1165, 267, 29918, 7168, 29889, 16070, 4775, 29879, 6880, 580, 13, 4706, 1583, 29889, 9482, 261, 29889, 2528, 29909, 2801, 29898, 1311, 29889, 1165, 267, 29918, 7168, 29897, 13, 4706, 1583, 29889, 7168, 29918, 2248, 4619, 29871, 29896, 13, 4706, 1583, 29889, 627, 943, 29961, 1311, 29889, 7168, 29918, 2248, 29962, 353, 1583, 29889, 1165, 267, 29918, 7168, 13, 4706, 396, 29871, 31382, 30883, 233, 163, 148, 31100, 30374, 30753, 31655, 232, 160, 147, 31062, 235, 192, 183, 30689, 31021, 13, 4706, 27815, 29918, 7168, 29918, 667, 353, 660, 9643, 8801, 2001, 29898, 1311, 29889, 8336, 29918, 8030, 29889, 3332, 10108, 2001, 29898, 29900, 876, 13, 4706, 27815, 29918, 7168, 29918, 667, 29889, 12038, 29898, 29900, 29892, 525, 30753, 31655, 232, 160, 147, 31062, 31185, 1495, 13, 4706, 27815, 29918, 7168, 29918, 667, 29889, 842, 5596, 2792, 29898, 29900, 29892, 14705, 29889, 17817, 29897, 13, 4706, 27815, 29918, 7168, 29918, 667, 29889, 12038, 29898, 29896, 29892, 525, 8875, 4286, 4830, 29898, 1311, 29889, 7168, 29918, 2248, 876, 13, 4706, 1583, 29889, 8336, 29918, 8030, 29889, 18837, 3596, 580, 13, 13, 4706, 396, 29871, 31538, 30666, 14569, 13, 4706, 282, 865, 29918, 16950, 353, 325, 11178, 29967, 4162, 29954, 6982, 580, 13, 4706, 282, 865, 29918, 16950, 29889, 2697, 17020, 877, 29902, 3200, 29914, 29939, 29878, 401, 29889, 6173, 1495, 13, 4706, 282, 865, 29918, 16950, 29889, 6422, 29898, 8516, 29897, 29871, 396, 29871, 30413, 30666, 8516, 30210, 30594, 31974, 19737, 1451, 2817, 30698, 233, 141, 168, 29908, 9329, 525, 29886, 29918, 524, 29915, 443, 26940, 29908, 13, 4706, 20194, 29918, 276, 26081, 353, 325, 11178, 3403, 29877, 1123, 26081, 580, 13, 4706, 20194, 29918, 276, 26081, 29889, 2697, 2940, 29898, 2732, 29918, 16950, 29889, 2577, 6466, 3101, 13, 4706, 20194, 29918, 276, 26081, 29889, 2697, 8003, 29898, 29900, 29889, 29929, 29892, 29871, 29900, 29889, 29900, 29941, 29897, 13, 4706, 20194, 29918, 276, 26081, 29889, 2697, 8003, 29906, 29898, 29900, 29889, 29896, 29892, 29871, 29900, 29889, 29896, 29897, 13, 4706, 20194, 29918, 276, 26081, 29889, 2577, 2940, 4854, 2141, 2697, 11746, 5946, 29898, 29896, 29889, 29900, 29897, 13, 4706, 1583, 29889, 14569, 29918, 8030, 29889, 2697, 1123, 26081, 29898, 14569, 29918, 276, 26081, 29897, 29871, 396, 20194, 29918, 8030, 31383, 30698, 30753, 31655, 30682, 30406, 13, 4706, 1583, 29889, 14569, 29918, 8030, 29889, 2697, 4074, 7168, 29898, 1311, 29889, 381, 264, 29897, 13, 4706, 1583, 29889, 14569, 29918, 8030, 29889, 2951, 580, 13, 4706, 1583, 29889, 14569, 29918, 8030, 29889, 7032, 13634, 6880, 580, 13, 13, 4706, 396, 29871, 31538, 30666, 235, 192, 178, 30631, 30548, 30330, 30845, 30346, 30850, 13, 4706, 1426, 29918, 7168, 353, 325, 11178, 1626, 29909, 2801, 580, 13, 4706, 1426, 29918, 7168, 29889, 2697, 4290, 877, 29912, 1012, 29876, 29894, 8875, 4286, 4830, 22168, 932, 978, 1649, 29892, 4770, 3259, 1649, 876, 13, 4706, 1426, 29918, 7168, 29889, 2577, 1626, 4854, 2141, 2697, 3306, 29898, 29900, 29889, 29896, 29892, 29871, 29900, 29889, 29896, 29892, 29871, 29900, 29889, 29896, 29897, 13, 4706, 1426, 29918, 276, 26081, 353, 325, 11178, 1626, 1123, 26081, 580, 13, 4706, 1426, 29918, 276, 26081, 29889, 2697, 8003, 29898, 29900, 29889, 29947, 29947, 29892, 29871, 29900, 29889, 29947, 29947, 29897, 13, 4706, 1426, 29918, 276, 26081, 29889, 2697, 8003, 29906, 29898, 29900, 29889, 29896, 29892, 29871, 29900, 29889, 29896, 29897, 13, 4706, 396, 8954, 31383, 30698, 30505, 726, 29918, 7168, 30658, 30806, 31538, 30666, 13, 4706, 1583, 29889, 726, 29918, 8030, 29889, 2697, 1123, 26081, 29898, 726, 29918, 276, 26081, 29897, 29871, 396, 1426, 29918, 8030, 31383, 30698, 30753, 31655, 30682, 30406, 13, 4706, 1583, 29889, 726, 29918, 8030, 29889, 2697, 4074, 7168, 29898, 1311, 29889, 381, 264, 29897, 13, 4706, 1583, 29889, 726, 29918, 8030, 29889, 2697, 1626, 29909, 2801, 29898, 726, 29918, 7168, 29897, 13, 4706, 1583, 29889, 726, 29918, 8030, 29889, 2951, 580, 13, 4706, 1583, 29889, 726, 29918, 8030, 29889, 7032, 13634, 6880, 580, 13, 13, 4706, 396, 29871, 31538, 30666, 232, 160, 147, 31062, 235, 192, 183, 13, 4706, 27815, 29918, 7168, 353, 325, 11178, 29909, 9100, 29909, 2801, 580, 13, 4706, 1583, 29889, 22976, 29918, 8030, 29889, 2697, 25231, 24619, 29898, 1165, 267, 29918, 7168, 29897, 13, 4706, 1583, 29889, 22976, 29918, 8030, 29889, 2697, 4074, 7168, 29898, 1311, 29889, 381, 264, 29897, 13, 4706, 1583, 29889, 22976, 29918, 8030, 29889, 10861, 2951, 580, 13, 4706, 1583, 29889, 22976, 29918, 8030, 29889, 4074, 4925, 6880, 580, 13, 13, 4706, 1583, 29889, 9482, 261, 29889, 27175, 20717, 580, 13, 4706, 1583, 29889, 9482, 29918, 7165, 29889, 10716, 580, 13, 13, 1678, 822, 2254, 29918, 11027, 29898, 1311, 1125, 13, 4706, 6055, 353, 660, 9585, 580, 13, 4706, 1583, 29889, 5060, 487, 7999, 7843, 29898, 11027, 29889, 1767, 877, 6330, 5907, 29914, 7999, 7843, 742, 1134, 29922, 29984, 12901, 2588, 876, 13, 4706, 1583, 29889, 5060, 487, 2792, 29898, 11027, 29889, 1767, 877, 6330, 5907, 29914, 2792, 742, 1134, 29922, 29984, 12901, 2588, 876, 13, 4706, 1583, 29889, 22672, 29918, 5451, 357, 29889, 5060, 487, 2792, 29898, 13, 9651, 6055, 29889, 1767, 877, 6330, 5907, 29914, 24932, 18772, 357, 742, 1134, 29922, 29984, 12901, 2588, 876, 13, 4706, 1583, 29889, 18575, 29918, 5451, 357, 29889, 5060, 487, 2792, 29898, 13, 9651, 6055, 29889, 1767, 877, 6330, 5907, 29914, 29270, 18772, 357, 742, 1134, 29922, 29984, 12901, 2588, 876, 13, 13, 1678, 822, 2943, 29918, 2311, 29918, 15033, 29898, 1311, 29892, 474, 1125, 13, 4706, 11339, 29918, 2248, 353, 1583, 29889, 7168, 29918, 2248, 13, 4706, 1857, 29918, 667, 353, 1583, 29889, 8336, 29918, 8030, 29889, 3784, 2001, 580, 13, 4706, 565, 1857, 29918, 667, 29901, 13, 9651, 11339, 29918, 2248, 353, 938, 29898, 3784, 29918, 667, 29889, 726, 29898, 29896, 876, 13, 4706, 565, 11339, 29918, 2248, 1405, 29871, 29896, 29901, 13, 9651, 1583, 29889, 627, 943, 29961, 7168, 29918, 2248, 1822, 2577, 4854, 2141, 2697, 5228, 3505, 29898, 29875, 29897, 13, 9651, 1583, 29889, 9482, 29918, 7165, 29889, 10716, 580, 13, 13, 1678, 822, 1735, 29918, 2780, 29898, 1311, 29892, 11339, 29918, 2248, 1125, 13, 4706, 2927, 353, 1583, 29889, 15452, 2141, 29886, 26456, 2141, 7165, 2141, 2780, 2141, 978, 580, 13, 4706, 364, 29918, 20970, 353, 938, 29898, 2780, 29961, 29896, 29901, 29941, 1402, 29871, 29896, 29953, 29897, 13, 4706, 330, 29918, 20970, 353, 938, 29898, 2780, 29961, 29941, 29901, 29945, 1402, 29871, 29896, 29953, 29897, 13, 4706, 289, 29918, 20970, 353, 938, 29898, 2780, 29961, 29945, 29901, 29955, 1402, 29871, 29896, 29953, 29897, 13, 4706, 364, 29892, 330, 29892, 289, 353, 364, 29918, 20970, 29914, 29906, 29945, 29945, 29892, 330, 29918, 20970, 29914, 29906, 29945, 29945, 29892, 289, 29918, 20970, 29914, 29906, 29945, 29945, 13, 4706, 1583, 29889, 627, 943, 29961, 7168, 29918, 2248, 1822, 2577, 4854, 2141, 2697, 3306, 29898, 29878, 29892, 330, 29892, 289, 29897, 13, 4706, 1583, 29889, 9482, 29918, 7165, 29889, 10716, 580, 13, 13, 1678, 822, 1510, 29918, 11458, 29918, 7168, 29898, 1311, 29892, 2944, 29901, 660, 9643, 8801, 2001, 1125, 13, 4706, 565, 2944, 29889, 726, 29898, 29896, 1125, 13, 9651, 11339, 29918, 2248, 353, 938, 29898, 667, 29889, 726, 29898, 29896, 876, 13, 9651, 565, 2944, 29889, 3198, 2792, 29898, 29900, 29897, 1275, 14705, 29889, 17817, 29901, 13, 18884, 1583, 29889, 627, 943, 29961, 7168, 29918, 2248, 1822, 23318, 2951, 580, 13, 9651, 25342, 2944, 29889, 3198, 2792, 29898, 29900, 29897, 1275, 14705, 29889, 2525, 11238, 29901, 13, 18884, 1583, 29889, 627, 943, 29961, 7168, 29918, 2248, 1822, 23318, 6880, 580, 13, 9651, 1583, 29889, 9482, 29918, 7165, 29889, 10716, 580, 13, 13, 1678, 822, 788, 29918, 7168, 29898, 1311, 29892, 11339, 29892, 11339, 29918, 978, 29892, 11339, 29918, 2780, 29892, 3847, 29918, 978, 1125, 13, 4706, 1583, 29889, 7168, 29918, 2248, 4619, 29871, 29896, 13, 4706, 1583, 29889, 627, 943, 29961, 1311, 29889, 7168, 29918, 2248, 29962, 353, 11339, 13, 13, 4706, 1583, 29889, 9482, 261, 29889, 2528, 29909, 2801, 29898, 7168, 29897, 13, 4706, 1583, 29889, 9482, 261, 29889, 27175, 20717, 580, 13, 13, 4706, 1583, 29889, 9482, 29918, 7165, 29889, 10716, 580, 13, 13, 4706, 2944, 29918, 2248, 353, 1583, 29889, 8336, 29918, 8030, 29889, 3332, 29918, 5563, 29918, 7039, 29889, 2248, 29898, 3560, 29918, 978, 29897, 13, 4706, 2362, 3871, 353, 2897, 29889, 2084, 29889, 23579, 568, 486, 29898, 359, 29889, 2084, 29889, 6500, 3871, 29898, 7168, 29918, 978, 876, 29961, 29900, 29962, 13, 4706, 27716, 29918, 667, 353, 660, 9643, 8801, 2001, 29898, 1311, 29889, 8336, 29918, 8030, 29889, 3332, 10108, 2001, 29898, 667, 29918, 2248, 876, 13, 4706, 2927, 29918, 13908, 353, 9159, 13954, 8801, 29898, 2780, 29922, 7168, 29918, 2780, 29897, 13, 4706, 11339, 29918, 2248, 353, 1583, 29889, 7168, 29918, 2248, 13, 4706, 2927, 29918, 13908, 29889, 1643, 29889, 3808, 287, 29889, 6915, 29898, 2892, 29901, 1583, 29889, 3167, 29918, 2780, 29898, 7168, 29918, 2248, 876, 13, 4706, 27716, 29918, 667, 29889, 12038, 29898, 29900, 29892, 525, 8875, 4286, 4830, 29898, 6500, 3871, 876, 13, 4706, 27716, 29918, 667, 29889, 842, 5596, 2792, 29898, 29900, 29892, 14705, 29889, 17817, 29897, 13, 4706, 27716, 29918, 667, 29889, 12038, 29898, 29896, 29892, 525, 8875, 4286, 4830, 29898, 1311, 29889, 7168, 29918, 2248, 876, 13, 4706, 1583, 29889, 8336, 29918, 8030, 29889, 842, 2001, 8801, 29898, 4467, 29882, 29918, 667, 29892, 29871, 29906, 29892, 2927, 29918, 13908, 29897, 13, 13, 1678, 822, 1510, 29918, 4467, 29882, 29898, 1311, 29892, 8636, 1125, 13, 4706, 2943, 29918, 4841, 353, 8636, 29889, 3177, 29918, 4841, 13, 4706, 7573, 353, 8636, 29889, 18010, 13, 4706, 1543, 29918, 8768, 353, 8636, 29889, 5029, 29918, 8768, 13, 4706, 3161, 353, 8636, 29889, 17664, 13, 13, 4706, 3291, 353, 325, 11178, 20325, 580, 13, 4706, 363, 2380, 29892, 2943, 297, 26985, 29898, 18010, 1125, 13, 9651, 3291, 29889, 17491, 5228, 29898, 2248, 29892, 2943, 29897, 13, 13, 4706, 6856, 353, 325, 11178, 2525, 4984, 2955, 5756, 580, 13, 4706, 6856, 29889, 2697, 20325, 29898, 9748, 29897, 13, 13, 4706, 363, 2380, 29892, 1543, 297, 26985, 29898, 17664, 1125, 13, 9651, 3957, 353, 518, 3177, 29918, 4841, 29889, 2248, 29898, 29875, 29897, 363, 474, 297, 1543, 29962, 13, 9651, 6856, 29889, 17491, 9190, 4617, 29898, 29963, 29911, 29968, 29918, 29923, 1307, 13780, 29918, 11116, 29918, 21009, 29961, 5029, 29918, 8768, 29961, 2248, 20526, 7431, 29898, 5029, 511, 3957, 29897, 13, 13, 4706, 611, 2496, 353, 325, 11178, 28449, 19968, 580, 13, 4706, 611, 2496, 29889, 2697, 4290, 1469, 29898, 7720, 29897, 13, 13, 4706, 11339, 353, 325, 11178, 29909, 2801, 580, 13, 4706, 11339, 29889, 2697, 19968, 29898, 655, 2496, 29897, 13, 4706, 364, 29892, 330, 29892, 289, 353, 4036, 29889, 9502, 524, 29898, 29900, 29892, 29871, 29906, 29945, 29945, 511, 4036, 29889, 9502, 524, 29898, 29900, 29892, 29871, 29906, 29945, 29945, 511, 4036, 29889, 9502, 524, 29898, 29900, 29892, 29871, 29906, 29945, 29945, 29897, 13, 4706, 11339, 29889, 2577, 4854, 2141, 2697, 3306, 29898, 29878, 847, 29871, 29906, 29945, 29945, 29892, 330, 847, 29871, 29906, 29945, 29945, 29892, 289, 847, 29871, 29906, 29945, 29945, 29897, 13, 4706, 11339, 29889, 2577, 4854, 2141, 2697, 5228, 3505, 29898, 524, 29898, 1311, 29889, 15466, 29918, 3891, 29889, 3177, 29918, 2311, 29918, 1028, 262, 1884, 29889, 726, 22130, 13, 4706, 11339, 29889, 2577, 4854, 2141, 23894, 23318, 2951, 580, 13, 4706, 11339, 29889, 2577, 4854, 2141, 10716, 20325, 2887, 29903, 8096, 267, 2951, 580, 13, 13, 4706, 364, 29918, 20970, 353, 15090, 29898, 29878, 9601, 29906, 29901, 1822, 29878, 5143, 29898, 29906, 29892, 525, 29900, 1495, 13, 4706, 330, 29918, 20970, 353, 15090, 29898, 29887, 9601, 29906, 29901, 1822, 29878, 5143, 29898, 29906, 29892, 525, 29900, 1495, 13, 4706, 289, 29918, 20970, 353, 15090, 29898, 29890, 9601, 29906, 29901, 1822, 29878, 5143, 29898, 29906, 29892, 525, 29900, 1495, 13, 4706, 11339, 29918, 2780, 353, 16321, 29912, 1157, 1157, 29913, 4286, 4830, 29898, 29878, 29918, 20970, 29892, 330, 29918, 20970, 29892, 289, 29918, 20970, 29897, 13, 4706, 1583, 29889, 1202, 29918, 7168, 29898, 7168, 29892, 8636, 29889, 9507, 29892, 11339, 29918, 2780, 29892, 525, 31222, 31168, 1495, 13, 13, 1678, 822, 1510, 29918, 1557, 2620, 29898, 1311, 29892, 8636, 1125, 13, 4706, 7573, 353, 8636, 29889, 18010, 13, 4706, 3291, 353, 325, 11178, 20325, 580, 13, 4706, 363, 2380, 29892, 995, 297, 26985, 29898, 18010, 1125, 13, 9651, 3291, 29889, 17491, 5228, 29898, 2248, 29892, 995, 29897, 13, 13, 4706, 6856, 353, 325, 11178, 2525, 4984, 2955, 5756, 580, 13, 4706, 6856, 29889, 2697, 20325, 29898, 9748, 29897, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 18010, 22164, 13, 9651, 6856, 29889, 17491, 9190, 4617, 29898, 29963, 29911, 29968, 29918, 5348, 4330, 29990, 29892, 29871, 29896, 29892, 518, 29875, 2314, 13, 13, 4706, 611, 2496, 353, 325, 11178, 28449, 19968, 580, 13, 4706, 611, 2496, 29889, 2697, 4290, 1469, 29898, 7720, 29897, 13, 13, 4706, 11339, 353, 325, 11178, 29909, 2801, 580, 13, 4706, 11339, 29889, 2697, 19968, 29898, 655, 2496, 29897, 13, 4706, 364, 29892, 330, 29892, 289, 353, 4036, 29889, 9502, 524, 29898, 29900, 29892, 29871, 29906, 29945, 29945, 511, 4036, 29889, 9502, 524, 29898, 29900, 29892, 29871, 29906, 29945, 29945, 511, 4036, 29889, 9502, 524, 29898, 29900, 29892, 29871, 29906, 29945, 29945, 29897, 13, 4706, 11339, 29889, 2577, 4854, 2141, 2697, 3306, 29898, 29878, 29914, 29906, 29945, 29945, 29892, 330, 29914, 29906, 29945, 29945, 29892, 289, 29914, 29906, 29945, 29945, 29897, 13, 4706, 11339, 29889, 2577, 4854, 2141, 2697, 5228, 3505, 29898, 524, 29898, 1311, 29889, 15466, 29918, 3891, 29889, 3177, 29918, 2311, 29918, 1028, 262, 1884, 29889, 726, 22130, 13, 4706, 11339, 29889, 2577, 4854, 2141, 10716, 20325, 2887, 29903, 8096, 267, 2951, 580, 13, 13, 4706, 364, 29918, 20970, 353, 15090, 29898, 29878, 9601, 29906, 29901, 1822, 29878, 5143, 29898, 29906, 29892, 525, 29900, 1495, 13, 4706, 330, 29918, 20970, 353, 15090, 29898, 29887, 9601, 29906, 29901, 1822, 29878, 5143, 29898, 29906, 29892, 525, 29900, 1495, 13, 4706, 289, 29918, 20970, 353, 15090, 29898, 29890, 9601, 29906, 29901, 1822, 29878, 5143, 29898, 29906, 29892, 525, 29900, 1495, 13, 4706, 11339, 29918, 2780, 353, 16321, 29912, 1157, 1157, 29913, 4286, 4830, 29898, 29878, 29918, 20970, 29892, 330, 29918, 20970, 29892, 289, 29918, 20970, 29897, 13, 4706, 1583, 29889, 1202, 29918, 7168, 29898, 7168, 29892, 8636, 29889, 9507, 29892, 11339, 29918, 2780, 29892, 525, 31222, 31168, 1495, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 623, 353, 660, 4873, 29898, 9675, 29889, 19218, 29897, 13, 1678, 623, 29889, 842, 4873, 1170, 877, 8875, 4286, 4830, 22168, 932, 978, 1649, 876, 13, 1678, 623, 29889, 842, 27356, 2133, 1170, 877, 8875, 4286, 4830, 22168, 6388, 2133, 1649, 876, 13, 1678, 5401, 353, 4241, 5907, 580, 13, 1678, 5401, 29889, 4294, 580, 13, 1678, 623, 29889, 4258, 29918, 580, 13, 2 ]
scripts/raw.py
CadenaR/Clean-Transform-Pipeline
0
58613
<gh_stars>0 import csv from zipfile import ZipFile def save_raw_data(inbound_path, raw_path): # Unzipping file with ZipFile( inbound_path, "r", ) as zipfile: names_list = zipfile.namelist() csv_file_path = zipfile.extract(names_list[0], path=raw_path) # Open the CSV file in read mode with open(csv_file_path, mode="r", encoding="windows-1252") as csv_file: reader = csv.DictReader(csv_file) row = next(reader) # Get first row from reader print("[Raw] First row example:", row) if __name__ == "__main__": print("[Raw] Start") print("[Raw] Unzipping file") inbound_path = '../data/inbound/all_data.zip' raw_path = '../data/raw/' save_raw_data(inbound_path, raw_path) print("[Raw] End")
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 11799, 13, 3166, 14319, 1445, 1053, 796, 666, 2283, 13, 13, 13, 1753, 4078, 29918, 1610, 29918, 1272, 29898, 262, 9917, 29918, 2084, 29892, 10650, 29918, 2084, 1125, 13, 1678, 396, 29871, 853, 2526, 3262, 934, 13, 1678, 411, 796, 666, 2283, 29898, 13, 4706, 297, 9917, 29918, 2084, 29892, 13, 4706, 376, 29878, 613, 13, 1678, 1723, 408, 14319, 1445, 29901, 13, 4706, 2983, 29918, 1761, 353, 14319, 1445, 29889, 8588, 295, 391, 580, 13, 4706, 11799, 29918, 1445, 29918, 2084, 353, 14319, 1445, 29889, 21111, 29898, 7039, 29918, 1761, 29961, 29900, 1402, 2224, 29922, 1610, 29918, 2084, 29897, 13, 13, 4706, 396, 4673, 278, 16874, 934, 297, 1303, 4464, 13, 4706, 411, 1722, 29898, 7638, 29918, 1445, 29918, 2084, 29892, 4464, 543, 29878, 613, 8025, 543, 10499, 29899, 29896, 29906, 29945, 29906, 1159, 408, 11799, 29918, 1445, 29901, 13, 9651, 9591, 353, 11799, 29889, 21533, 6982, 29898, 7638, 29918, 1445, 29897, 13, 13, 9651, 1948, 353, 2446, 29898, 16950, 29897, 29871, 396, 3617, 937, 1948, 515, 9591, 13, 9651, 1596, 703, 29961, 22131, 29962, 3824, 1948, 1342, 29901, 613, 1948, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1596, 703, 29961, 22131, 29962, 7370, 1159, 13, 1678, 1596, 703, 29961, 22131, 29962, 853, 2526, 3262, 934, 1159, 13, 1678, 297, 9917, 29918, 2084, 353, 525, 6995, 1272, 29914, 262, 9917, 29914, 497, 29918, 1272, 29889, 7554, 29915, 13, 1678, 10650, 29918, 2084, 353, 525, 6995, 1272, 29914, 1610, 22208, 13, 1678, 4078, 29918, 1610, 29918, 1272, 29898, 262, 9917, 29918, 2084, 29892, 10650, 29918, 2084, 29897, 13, 1678, 1596, 703, 29961, 22131, 29962, 2796, 1159, 2 ]
jina/executors/indexers/keyvalue.py
winstonww/jina
0
198758
<reponame>winstonww/jina __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved." __license__ = "Apache-2.0" import mmap import os import random from typing import Iterable, Optional import numpy as np from . import BaseKVIndexer from ..compound import CompoundExecutor HEADER_NONE_ENTRY = (-1, -1, -1) class _WriteHandler: """ Write file handler. :param path: Path of the file. :param mode: Writing mode. (e.g. 'ab', 'wb') """ def __init__(self, path, mode): self.body = open(path, mode) self.header = open(path + '.head', mode) def close(self): """Close the file.""" if not self.body.closed: self.body.close() if not self.header.closed: self.header.close() def flush(self): """Clear the body and header.""" if not self.body.closed: self.body.flush() if not self.header.closed: self.header.flush() class _ReadHandler: """ Read file handler. :param path: Path of the file. :param key_length: Length of key. """ def __init__(self, path, key_length): with open(path + '.head', 'rb') as fp: tmp = np.frombuffer( fp.read(), dtype=[ ('', (np.str_, key_length)), ('', np.int64), ('', np.int64), ('', np.int64), ], ) self.header = { r[0]: None if np.array_equal((r[1], r[2], r[3]), HEADER_NONE_ENTRY) else (r[1], r[2], r[3]) for r in tmp } self._body = open(path, 'r+b') self.body = self._body.fileno() def close(self): """Close the file.""" if not self._body.closed: self._body.close() class BinaryPbWriterMixin: """Mixing for providing the binarypb writing and reading methods""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._start = 0 self._page_size = mmap.ALLOCATIONGRANULARITY def get_add_handler(self) -> '_WriteHandler': """ Get write file handler. :return: write handler """ # keep _start position as in pickle serialization return _WriteHandler(self.index_abspath, 'ab') def get_create_handler(self) -> '_WriteHandler': """ Get write file handler. :return: write handler. """ self._start = 0 # override _start position return _WriteHandler(self.index_abspath, 'wb') def get_query_handler(self) -> '_ReadHandler': """ Get read file handler. :return: read handler. """ return _ReadHandler(self.index_abspath, self.key_length) def _add( self, keys: Iterable[str], values: Iterable[bytes], writer: _WriteHandler = None ): if writer is None: if getattr(self, 'write_handler'): writer = self.write_handler else: raise Exception( 'No writer provided to add() and no self.write_handler available' ) for key, value in zip(keys, values): l = len(value) #: the length p = ( int(self._start / self._page_size) * self._page_size ) #: offset of the page r = ( self._start % self._page_size ) #: the remainder, i.e. the start position given the offset # noinspection PyTypeChecker writer.header.write( np.array( (key, p, r, r + l), dtype=[ ('', (np.str_, self.key_length)), ('', np.int64), ('', np.int64), ('', np.int64), ], ).tobytes() ) self._start += l writer.body.write(value) self._size += 1 writer.flush() def delete(self, keys: Iterable[str], *args, **kwargs) -> None: """Delete the serialized documents from the index via document ids. :param keys: a list of ``id``, i.e. ``doc.id`` in protobuf :param args: not used :param kwargs: not used """ keys = self._filter_nonexistent_keys(keys, self.query_handler.header.keys()) del self.query_handler self.handler_mutex = False if keys: self._delete(keys) def _delete(self, keys: Iterable[str]) -> None: for key in keys: self.write_handler.header.write( np.array( tuple(np.concatenate([[key], HEADER_NONE_ENTRY])), dtype=[ ('', (np.str_, self.key_length)), ('', np.int64), ('', np.int64), ('', np.int64), ], ).tobytes() ) self._size -= 1 def _query(self, key): pos_info = self.query_handler.header.get(key, None) if pos_info is not None: p, r, l = pos_info with mmap.mmap(self.query_handler.body, offset=p, length=l) as m: return m[r:] class BinaryPbIndexer(BinaryPbWriterMixin, BaseKVIndexer): """Simple Key-value indexer.""" def __getstate__(self): # called on pickle save if self.delete_on_dump: self._delete_invalid_indices() d = super().__getstate__() return d def _delete_invalid_indices(self): if self.query_handler: self.query_handler.close() if self.write_handler: self.write_handler.flush() self.write_handler.close() keys = [] vals = [] # we read the valid values and write them to the intermediary file read_handler = _ReadHandler(self.index_abspath, self.key_length) for key in read_handler.header.keys(): pos_info = read_handler.header.get(key, None) if pos_info: p, r, l = pos_info with mmap.mmap(read_handler.body, offset=p, length=l) as m: keys.append(key) vals.append(m[r:]) read_handler.close() if len(keys) == 0: return # intermediary file tmp_file = self.index_abspath + '-tmp' self._start = 0 filtered_data_writer = _WriteHandler(tmp_file, 'ab') # reset size self._size = 0 self._add(keys, vals, filtered_data_writer) filtered_data_writer.close() # replace orig. file # and .head file head_path = self.index_abspath + '.head' os.remove(self.index_abspath) os.remove(head_path) os.rename(tmp_file, self.index_abspath) os.rename(tmp_file + '.head', head_path) def __init__(self, delete_on_dump: bool = False, *args, **kwargs): super().__init__(*args, **kwargs) self.delete_on_dump = delete_on_dump def add( self, keys: Iterable[str], values: Iterable[bytes], *args, **kwargs ) -> None: """Add the serialized documents to the index via document ids. :param keys: a list of ``id``, i.e. ``doc.id`` in protobuf :param values: serialized documents :param args: extra arguments :param kwargs: keyword arguments """ if not any(keys): return self._add(keys, values) def sample(self) -> Optional[bytes]: """Return a random entry from the indexer for sanity check. :return: A random entry from the indexer. """ k = random.sample(self.query_handler.header.keys(), k=1)[0] return self[k] def __iter__(self): for k in self.query_handler.header.keys(): yield self[k] def query(self, key: str, *args, **kwargs) -> Optional[bytes]: """Find the serialized document to the index via document id. :param key: document id :param args: extra arguments :param kwargs: keyword arguments :return: serialized documents """ return self._query(key) def update( self, keys: Iterable[str], values: Iterable[bytes], *args, **kwargs ) -> None: """Update the serialized documents on the index via document ids. :param keys: a list of ``id``, i.e. ``doc.id`` in protobuf :param values: serialized documents :param args: extra arguments :param kwargs: keyword arguments """ keys, values = self._filter_nonexistent_keys_values( keys, values, self.query_handler.header.keys() ) del self.query_handler self.handler_mutex = False if keys: self._delete(keys) self.add(keys, values) def delete(self, keys: Iterable[str], *args, **kwargs) -> None: """Delete the serialized documents from the index via document ids. :param keys: a list of ``id``, i.e. ``doc.id`` in protobuf :param args: not used :param kwargs: not used""" super(BinaryPbIndexer, self).delete(keys) class KeyValueIndexer(BinaryPbIndexer): """Alias for :class:`BinaryPbIndexer` """ class DataURIPbIndexer(BinaryPbIndexer): """Alias for BinaryPbIndexer""" class UniquePbIndexer(CompoundExecutor): """A frequently used pattern for combining a :class:`BaseKVIndexer` and a :class:`DocCache` """
[ 1, 529, 276, 1112, 420, 29958, 29893, 2611, 265, 1615, 29914, 29926, 1099, 13, 1649, 8552, 1266, 1649, 353, 376, 11882, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29900, 435, 1099, 319, 29902, 28873, 29889, 2178, 10462, 21676, 1213, 13, 1649, 506, 1947, 1649, 353, 376, 17396, 1829, 29899, 29906, 29889, 29900, 29908, 13, 13, 5215, 286, 1958, 13, 5215, 2897, 13, 5215, 4036, 13, 3166, 19229, 1053, 20504, 519, 29892, 28379, 13, 13, 5215, 12655, 408, 7442, 13, 13, 3166, 869, 1053, 7399, 29968, 29963, 3220, 261, 13, 3166, 6317, 2388, 618, 1053, 3831, 618, 13366, 13, 13, 23252, 1001, 29918, 29940, 12413, 29918, 3919, 13207, 353, 8521, 29896, 29892, 448, 29896, 29892, 448, 29896, 29897, 13, 13, 13, 1990, 903, 6113, 4598, 29901, 13, 1678, 9995, 13, 1678, 14350, 934, 7834, 29889, 13, 13, 1678, 584, 3207, 2224, 29901, 10802, 310, 278, 934, 29889, 13, 1678, 584, 3207, 4464, 29901, 28676, 4464, 29889, 313, 29872, 29889, 29887, 29889, 525, 370, 742, 525, 29893, 29890, 1495, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2224, 29892, 4464, 1125, 13, 4706, 1583, 29889, 2587, 353, 1722, 29898, 2084, 29892, 4464, 29897, 13, 4706, 1583, 29889, 6672, 353, 1722, 29898, 2084, 718, 15300, 2813, 742, 4464, 29897, 13, 13, 1678, 822, 3802, 29898, 1311, 1125, 13, 4706, 9995, 11123, 278, 934, 1213, 15945, 13, 4706, 565, 451, 1583, 29889, 2587, 29889, 15603, 29901, 13, 9651, 1583, 29889, 2587, 29889, 5358, 580, 13, 4706, 565, 451, 1583, 29889, 6672, 29889, 15603, 29901, 13, 9651, 1583, 29889, 6672, 29889, 5358, 580, 13, 13, 1678, 822, 28371, 29898, 1311, 1125, 13, 4706, 9995, 18759, 278, 3573, 322, 4839, 1213, 15945, 13, 4706, 565, 451, 1583, 29889, 2587, 29889, 15603, 29901, 13, 9651, 1583, 29889, 2587, 29889, 23126, 580, 13, 4706, 565, 451, 1583, 29889, 6672, 29889, 15603, 29901, 13, 9651, 1583, 29889, 6672, 29889, 23126, 580, 13, 13, 13, 1990, 903, 6359, 4598, 29901, 13, 1678, 9995, 13, 1678, 7523, 934, 7834, 29889, 13, 13, 1678, 584, 3207, 2224, 29901, 10802, 310, 278, 934, 29889, 13, 1678, 584, 3207, 1820, 29918, 2848, 29901, 365, 1477, 310, 1820, 29889, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2224, 29892, 1820, 29918, 2848, 1125, 13, 4706, 411, 1722, 29898, 2084, 718, 15300, 2813, 742, 525, 6050, 1495, 408, 285, 29886, 29901, 13, 9651, 13128, 353, 7442, 29889, 3166, 9040, 29898, 13, 18884, 285, 29886, 29889, 949, 3285, 13, 18884, 26688, 11759, 13, 462, 1678, 6702, 742, 313, 9302, 29889, 710, 3383, 1820, 29918, 2848, 8243, 13, 462, 1678, 6702, 742, 7442, 29889, 524, 29953, 29946, 511, 13, 462, 1678, 6702, 742, 7442, 29889, 524, 29953, 29946, 511, 13, 462, 1678, 6702, 742, 7442, 29889, 524, 29953, 29946, 511, 13, 18884, 21251, 13, 9651, 1723, 13, 9651, 1583, 29889, 6672, 353, 426, 13, 18884, 364, 29961, 29900, 5387, 6213, 13, 18884, 565, 7442, 29889, 2378, 29918, 11745, 3552, 29878, 29961, 29896, 1402, 364, 29961, 29906, 1402, 364, 29961, 29941, 11724, 17714, 3035, 1001, 29918, 29940, 12413, 29918, 3919, 13207, 29897, 13, 18884, 1683, 313, 29878, 29961, 29896, 1402, 364, 29961, 29906, 1402, 364, 29961, 29941, 2314, 13, 18884, 363, 364, 297, 13128, 13, 9651, 500, 13, 4706, 1583, 3032, 2587, 353, 1722, 29898, 2084, 29892, 525, 29878, 29974, 29890, 1495, 13, 4706, 1583, 29889, 2587, 353, 1583, 3032, 2587, 29889, 1777, 8154, 580, 13, 13, 1678, 822, 3802, 29898, 1311, 1125, 13, 4706, 9995, 11123, 278, 934, 1213, 15945, 13, 4706, 565, 451, 1583, 3032, 2587, 29889, 15603, 29901, 13, 9651, 1583, 3032, 2587, 29889, 5358, 580, 13, 13, 13, 1990, 29479, 29925, 29890, 10507, 29924, 861, 262, 29901, 13, 1678, 9995, 29924, 861, 292, 363, 13138, 278, 7581, 24381, 5007, 322, 5183, 3519, 15945, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 2428, 2141, 1649, 2344, 1649, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 1583, 3032, 2962, 353, 29871, 29900, 13, 4706, 1583, 3032, 3488, 29918, 2311, 353, 286, 1958, 29889, 1964, 16652, 8098, 14345, 2190, 13309, 1718, 11937, 13, 13, 1678, 822, 679, 29918, 1202, 29918, 13789, 29898, 1311, 29897, 1599, 22868, 6113, 4598, 2396, 13, 4706, 9995, 13, 4706, 3617, 2436, 934, 7834, 29889, 13, 13, 4706, 584, 2457, 29901, 2436, 7834, 13, 4706, 9995, 13, 4706, 396, 3013, 903, 2962, 2602, 408, 297, 5839, 280, 7797, 2133, 13, 4706, 736, 903, 6113, 4598, 29898, 1311, 29889, 2248, 29918, 370, 1028, 493, 29892, 525, 370, 1495, 13, 13, 1678, 822, 679, 29918, 3258, 29918, 13789, 29898, 1311, 29897, 1599, 22868, 6113, 4598, 2396, 13, 4706, 9995, 13, 4706, 3617, 2436, 934, 7834, 29889, 13, 13, 4706, 584, 2457, 29901, 2436, 7834, 29889, 13, 4706, 9995, 13, 4706, 1583, 3032, 2962, 353, 29871, 29900, 29871, 396, 5712, 903, 2962, 2602, 13, 4706, 736, 903, 6113, 4598, 29898, 1311, 29889, 2248, 29918, 370, 1028, 493, 29892, 525, 29893, 29890, 1495, 13, 13, 1678, 822, 679, 29918, 1972, 29918, 13789, 29898, 1311, 29897, 1599, 22868, 6359, 4598, 2396, 13, 4706, 9995, 13, 4706, 3617, 1303, 934, 7834, 29889, 13, 13, 4706, 584, 2457, 29901, 1303, 7834, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6359, 4598, 29898, 1311, 29889, 2248, 29918, 370, 1028, 493, 29892, 1583, 29889, 1989, 29918, 2848, 29897, 13, 13, 1678, 822, 903, 1202, 29898, 13, 4706, 1583, 29892, 6611, 29901, 20504, 519, 29961, 710, 1402, 1819, 29901, 20504, 519, 29961, 13193, 1402, 9227, 29901, 903, 6113, 4598, 353, 6213, 13, 268, 1125, 13, 4706, 565, 9227, 338, 6213, 29901, 13, 9651, 565, 679, 5552, 29898, 1311, 29892, 525, 3539, 29918, 13789, 29374, 13, 18884, 9227, 353, 1583, 29889, 3539, 29918, 13789, 13, 9651, 1683, 29901, 13, 18884, 12020, 8960, 29898, 13, 462, 1678, 525, 3782, 9227, 4944, 304, 788, 580, 322, 694, 1583, 29889, 3539, 29918, 13789, 3625, 29915, 13, 18884, 1723, 13, 13, 4706, 363, 1820, 29892, 995, 297, 14319, 29898, 8149, 29892, 1819, 1125, 13, 9651, 301, 353, 7431, 29898, 1767, 29897, 29871, 396, 29901, 278, 3309, 13, 9651, 282, 353, 313, 13, 18884, 938, 29898, 1311, 3032, 2962, 847, 1583, 3032, 3488, 29918, 2311, 29897, 334, 1583, 3032, 3488, 29918, 2311, 13, 9651, 1723, 29871, 396, 29901, 9210, 310, 278, 1813, 13, 9651, 364, 353, 313, 13, 18884, 1583, 3032, 2962, 1273, 1583, 3032, 3488, 29918, 2311, 13, 9651, 1723, 29871, 396, 29901, 278, 21162, 29892, 474, 29889, 29872, 29889, 278, 1369, 2602, 2183, 278, 9210, 13, 9651, 396, 694, 1144, 27988, 10772, 1542, 5596, 261, 13, 9651, 9227, 29889, 6672, 29889, 3539, 29898, 13, 18884, 7442, 29889, 2378, 29898, 13, 462, 1678, 313, 1989, 29892, 282, 29892, 364, 29892, 364, 718, 301, 511, 13, 462, 1678, 26688, 11759, 13, 462, 4706, 6702, 742, 313, 9302, 29889, 710, 3383, 1583, 29889, 1989, 29918, 2848, 8243, 13, 462, 4706, 6702, 742, 7442, 29889, 524, 29953, 29946, 511, 13, 462, 4706, 6702, 742, 7442, 29889, 524, 29953, 29946, 511, 13, 462, 4706, 6702, 742, 7442, 29889, 524, 29953, 29946, 511, 13, 462, 1678, 21251, 13, 18884, 13742, 517, 13193, 580, 13, 9651, 1723, 13, 9651, 1583, 3032, 2962, 4619, 301, 13, 9651, 9227, 29889, 2587, 29889, 3539, 29898, 1767, 29897, 13, 9651, 1583, 3032, 2311, 4619, 29871, 29896, 13, 4706, 9227, 29889, 23126, 580, 13, 13, 1678, 822, 5217, 29898, 1311, 29892, 6611, 29901, 20504, 519, 29961, 710, 1402, 334, 5085, 29892, 3579, 19290, 29897, 1599, 6213, 29901, 13, 4706, 9995, 12498, 278, 7797, 1891, 10701, 515, 278, 2380, 3025, 1842, 18999, 29889, 13, 13, 4706, 584, 3207, 6611, 29901, 263, 1051, 310, 4954, 333, 29952, 1673, 474, 29889, 29872, 29889, 4954, 1514, 29889, 333, 16159, 297, 17814, 9721, 13, 4706, 584, 3207, 6389, 29901, 451, 1304, 13, 4706, 584, 3207, 9049, 5085, 29901, 451, 1304, 13, 4706, 9995, 13, 4706, 6611, 353, 1583, 3032, 4572, 29918, 9290, 29916, 9696, 29918, 8149, 29898, 8149, 29892, 1583, 29889, 1972, 29918, 13789, 29889, 6672, 29889, 8149, 3101, 13, 4706, 628, 1583, 29889, 1972, 29918, 13789, 13, 4706, 1583, 29889, 13789, 29918, 6149, 735, 353, 7700, 13, 4706, 565, 6611, 29901, 13, 9651, 1583, 3032, 8143, 29898, 8149, 29897, 13, 13, 1678, 822, 903, 8143, 29898, 1311, 29892, 6611, 29901, 20504, 519, 29961, 710, 2314, 1599, 6213, 29901, 13, 4706, 363, 1820, 297, 6611, 29901, 13, 9651, 1583, 29889, 3539, 29918, 13789, 29889, 6672, 29889, 3539, 29898, 13, 18884, 7442, 29889, 2378, 29898, 13, 462, 1678, 18761, 29898, 9302, 29889, 535, 29883, 2579, 403, 4197, 29961, 1989, 1402, 17714, 3035, 1001, 29918, 29940, 12413, 29918, 3919, 13207, 2314, 511, 13, 462, 1678, 26688, 11759, 13, 462, 4706, 6702, 742, 313, 9302, 29889, 710, 3383, 1583, 29889, 1989, 29918, 2848, 8243, 13, 462, 4706, 6702, 742, 7442, 29889, 524, 29953, 29946, 511, 13, 462, 4706, 6702, 742, 7442, 29889, 524, 29953, 29946, 511, 13, 462, 4706, 6702, 742, 7442, 29889, 524, 29953, 29946, 511, 13, 462, 1678, 21251, 13, 18884, 13742, 517, 13193, 580, 13, 9651, 1723, 13, 9651, 1583, 3032, 2311, 22361, 29871, 29896, 13, 13, 1678, 822, 903, 1972, 29898, 1311, 29892, 1820, 1125, 13, 4706, 926, 29918, 3888, 353, 1583, 29889, 1972, 29918, 13789, 29889, 6672, 29889, 657, 29898, 1989, 29892, 6213, 29897, 13, 4706, 565, 926, 29918, 3888, 338, 451, 6213, 29901, 13, 9651, 282, 29892, 364, 29892, 301, 353, 926, 29918, 3888, 13, 9651, 411, 286, 1958, 29889, 29885, 1958, 29898, 1311, 29889, 1972, 29918, 13789, 29889, 2587, 29892, 9210, 29922, 29886, 29892, 3309, 29922, 29880, 29897, 408, 286, 29901, 13, 18884, 736, 286, 29961, 29878, 17531, 13, 13, 13, 1990, 29479, 29925, 29890, 3220, 261, 29898, 25196, 29925, 29890, 10507, 29924, 861, 262, 29892, 7399, 29968, 29963, 3220, 261, 1125, 13, 1678, 9995, 15427, 7670, 29899, 1767, 2380, 261, 1213, 15945, 13, 13, 1678, 822, 4770, 657, 3859, 12035, 1311, 1125, 13, 4706, 396, 2000, 373, 5839, 280, 4078, 13, 4706, 565, 1583, 29889, 8143, 29918, 265, 29918, 15070, 29901, 13, 9651, 1583, 3032, 8143, 29918, 20965, 29918, 513, 1575, 580, 13, 4706, 270, 353, 2428, 2141, 1649, 657, 3859, 1649, 580, 13, 4706, 736, 270, 13, 13, 1678, 822, 903, 8143, 29918, 20965, 29918, 513, 1575, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 1972, 29918, 13789, 29901, 13, 9651, 1583, 29889, 1972, 29918, 13789, 29889, 5358, 580, 13, 4706, 565, 1583, 29889, 3539, 29918, 13789, 29901, 13, 9651, 1583, 29889, 3539, 29918, 13789, 29889, 23126, 580, 13, 9651, 1583, 29889, 3539, 29918, 13789, 29889, 5358, 580, 13, 13, 4706, 6611, 353, 5159, 13, 4706, 659, 29879, 353, 5159, 13, 4706, 396, 591, 1303, 278, 2854, 1819, 322, 2436, 963, 304, 278, 1006, 4210, 653, 934, 13, 4706, 1303, 29918, 13789, 353, 903, 6359, 4598, 29898, 1311, 29889, 2248, 29918, 370, 1028, 493, 29892, 1583, 29889, 1989, 29918, 2848, 29897, 13, 4706, 363, 1820, 297, 1303, 29918, 13789, 29889, 6672, 29889, 8149, 7295, 13, 9651, 926, 29918, 3888, 353, 1303, 29918, 13789, 29889, 6672, 29889, 657, 29898, 1989, 29892, 6213, 29897, 13, 9651, 565, 926, 29918, 3888, 29901, 13, 18884, 282, 29892, 364, 29892, 301, 353, 926, 29918, 3888, 13, 18884, 411, 286, 1958, 29889, 29885, 1958, 29898, 949, 29918, 13789, 29889, 2587, 29892, 9210, 29922, 29886, 29892, 3309, 29922, 29880, 29897, 408, 286, 29901, 13, 462, 1678, 6611, 29889, 4397, 29898, 1989, 29897, 13, 462, 1678, 659, 29879, 29889, 4397, 29898, 29885, 29961, 29878, 29901, 2314, 13, 4706, 1303, 29918, 13789, 29889, 5358, 580, 13, 4706, 565, 7431, 29898, 8149, 29897, 1275, 29871, 29900, 29901, 13, 9651, 736, 13, 13, 4706, 396, 1006, 4210, 653, 934, 13, 4706, 13128, 29918, 1445, 353, 1583, 29889, 2248, 29918, 370, 1028, 493, 718, 17411, 7050, 29915, 13, 4706, 1583, 3032, 2962, 353, 29871, 29900, 13, 4706, 22289, 29918, 1272, 29918, 13236, 353, 903, 6113, 4598, 29898, 7050, 29918, 1445, 29892, 525, 370, 1495, 13, 4706, 396, 10092, 2159, 13, 4706, 1583, 3032, 2311, 353, 29871, 29900, 13, 4706, 1583, 3032, 1202, 29898, 8149, 29892, 659, 29879, 29892, 22289, 29918, 1272, 29918, 13236, 29897, 13, 4706, 22289, 29918, 1272, 29918, 13236, 29889, 5358, 580, 13, 13, 4706, 396, 5191, 1677, 29889, 934, 13, 4706, 396, 322, 869, 2813, 934, 13, 4706, 2343, 29918, 2084, 353, 1583, 29889, 2248, 29918, 370, 1028, 493, 718, 15300, 2813, 29915, 13, 4706, 2897, 29889, 5992, 29898, 1311, 29889, 2248, 29918, 370, 1028, 493, 29897, 13, 4706, 2897, 29889, 5992, 29898, 2813, 29918, 2084, 29897, 13, 4706, 2897, 29889, 1267, 420, 29898, 7050, 29918, 1445, 29892, 1583, 29889, 2248, 29918, 370, 1028, 493, 29897, 13, 4706, 2897, 29889, 1267, 420, 29898, 7050, 29918, 1445, 718, 15300, 2813, 742, 2343, 29918, 2084, 29897, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5217, 29918, 265, 29918, 15070, 29901, 6120, 353, 7700, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 2428, 2141, 1649, 2344, 1649, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 1583, 29889, 8143, 29918, 265, 29918, 15070, 353, 5217, 29918, 265, 29918, 15070, 13, 13, 1678, 822, 788, 29898, 13, 4706, 1583, 29892, 6611, 29901, 20504, 519, 29961, 710, 1402, 1819, 29901, 20504, 519, 29961, 13193, 1402, 334, 5085, 29892, 3579, 19290, 13, 1678, 1723, 1599, 6213, 29901, 13, 4706, 9995, 2528, 278, 7797, 1891, 10701, 304, 278, 2380, 3025, 1842, 18999, 29889, 13, 13, 4706, 584, 3207, 6611, 29901, 263, 1051, 310, 4954, 333, 29952, 1673, 474, 29889, 29872, 29889, 4954, 1514, 29889, 333, 16159, 297, 17814, 9721, 13, 4706, 584, 3207, 1819, 29901, 7797, 1891, 10701, 13, 4706, 584, 3207, 6389, 29901, 4805, 6273, 13, 4706, 584, 3207, 9049, 5085, 29901, 13553, 6273, 13, 4706, 9995, 13, 4706, 565, 451, 738, 29898, 8149, 1125, 13, 9651, 736, 13, 13, 4706, 1583, 3032, 1202, 29898, 8149, 29892, 1819, 29897, 13, 13, 1678, 822, 4559, 29898, 1311, 29897, 1599, 28379, 29961, 13193, 5387, 13, 4706, 9995, 11609, 263, 4036, 6251, 515, 278, 2380, 261, 363, 9753, 537, 1423, 29889, 13, 13, 4706, 584, 2457, 29901, 319, 4036, 6251, 515, 278, 2380, 261, 29889, 13, 4706, 9995, 13, 4706, 413, 353, 4036, 29889, 11249, 29898, 1311, 29889, 1972, 29918, 13789, 29889, 6672, 29889, 8149, 3285, 413, 29922, 29896, 9601, 29900, 29962, 13, 4706, 736, 1583, 29961, 29895, 29962, 13, 13, 1678, 822, 4770, 1524, 12035, 1311, 1125, 13, 4706, 363, 413, 297, 1583, 29889, 1972, 29918, 13789, 29889, 6672, 29889, 8149, 7295, 13, 9651, 7709, 1583, 29961, 29895, 29962, 13, 13, 1678, 822, 2346, 29898, 1311, 29892, 1820, 29901, 851, 29892, 334, 5085, 29892, 3579, 19290, 29897, 1599, 28379, 29961, 13193, 5387, 13, 4706, 9995, 12542, 278, 7797, 1891, 1842, 304, 278, 2380, 3025, 1842, 1178, 29889, 13, 13, 4706, 584, 3207, 1820, 29901, 1842, 1178, 13, 4706, 584, 3207, 6389, 29901, 4805, 6273, 13, 4706, 584, 3207, 9049, 5085, 29901, 13553, 6273, 13, 4706, 584, 2457, 29901, 7797, 1891, 10701, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 1972, 29898, 1989, 29897, 13, 13, 1678, 822, 2767, 29898, 13, 4706, 1583, 29892, 6611, 29901, 20504, 519, 29961, 710, 1402, 1819, 29901, 20504, 519, 29961, 13193, 1402, 334, 5085, 29892, 3579, 19290, 13, 1678, 1723, 1599, 6213, 29901, 13, 4706, 9995, 6422, 278, 7797, 1891, 10701, 373, 278, 2380, 3025, 1842, 18999, 29889, 13, 13, 4706, 584, 3207, 6611, 29901, 263, 1051, 310, 4954, 333, 29952, 1673, 474, 29889, 29872, 29889, 4954, 1514, 29889, 333, 16159, 297, 17814, 9721, 13, 4706, 584, 3207, 1819, 29901, 7797, 1891, 10701, 13, 4706, 584, 3207, 6389, 29901, 4805, 6273, 13, 4706, 584, 3207, 9049, 5085, 29901, 13553, 6273, 13, 4706, 9995, 13, 4706, 6611, 29892, 1819, 353, 1583, 3032, 4572, 29918, 9290, 29916, 9696, 29918, 8149, 29918, 5975, 29898, 13, 9651, 6611, 29892, 1819, 29892, 1583, 29889, 1972, 29918, 13789, 29889, 6672, 29889, 8149, 580, 13, 4706, 1723, 13, 4706, 628, 1583, 29889, 1972, 29918, 13789, 13, 4706, 1583, 29889, 13789, 29918, 6149, 735, 353, 7700, 13, 4706, 565, 6611, 29901, 13, 9651, 1583, 3032, 8143, 29898, 8149, 29897, 13, 9651, 1583, 29889, 1202, 29898, 8149, 29892, 1819, 29897, 13, 13, 1678, 822, 5217, 29898, 1311, 29892, 6611, 29901, 20504, 519, 29961, 710, 1402, 334, 5085, 29892, 3579, 19290, 29897, 1599, 6213, 29901, 13, 4706, 9995, 12498, 278, 7797, 1891, 10701, 515, 278, 2380, 3025, 1842, 18999, 29889, 13, 13, 4706, 584, 3207, 6611, 29901, 263, 1051, 310, 4954, 333, 29952, 1673, 474, 29889, 29872, 29889, 4954, 1514, 29889, 333, 16159, 297, 17814, 9721, 13, 4706, 584, 3207, 6389, 29901, 451, 1304, 13, 4706, 584, 3207, 9049, 5085, 29901, 451, 1304, 15945, 29908, 13, 4706, 2428, 29898, 25196, 29925, 29890, 3220, 261, 29892, 1583, 467, 8143, 29898, 8149, 29897, 13, 13, 13, 1990, 7670, 1917, 3220, 261, 29898, 25196, 29925, 29890, 3220, 261, 1125, 13, 1678, 9995, 29909, 18849, 363, 584, 1990, 18078, 25196, 29925, 29890, 3220, 261, 29952, 9995, 13, 13, 13, 1990, 3630, 15551, 29925, 29890, 3220, 261, 29898, 25196, 29925, 29890, 3220, 261, 1125, 13, 1678, 9995, 29909, 18849, 363, 29479, 29925, 29890, 3220, 261, 15945, 29908, 13, 13, 13, 1990, 853, 1387, 29925, 29890, 3220, 261, 29898, 6843, 618, 13366, 1125, 13, 1678, 9995, 29909, 13672, 1304, 4766, 363, 29299, 263, 584, 1990, 18078, 5160, 29968, 29963, 3220, 261, 29952, 322, 263, 584, 1990, 18078, 14526, 10408, 29952, 9995, 13, 2 ]
BOJ/dp_boj/drop.py
mrbartrns/swacademy_structure
0
184361
# BOJ 14501 import sys si = sys.stdin.readline def solve(n): ans = 0 for i in range(n, 0, -1): if i + t[i] > n + 1: arr[i] = arr[i + 1] else: arr[i] = max(arr[i + 1], arr[i] + arr[i + t[i]]) ans = max(ans, arr[i]) return ans n = int(si()) t = [0] * 17 arr = [0] * 17 for i in range(1, n + 1): u, v = map(int, si().split()) t[i] = u arr[i] = v print(solve(n)) """ n = 7 t = [0, 3, 5, 1, 1, 2, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0] arr = [0, 10, 20, 10, 20, 15, 40, 200, 0, 0, 0, 0, 0, 0, 0, 0] ans = 0 for y in range(n, 0, -1): if y + t[y] > n + 1: arr[y] = arr[y + 1] else: arr[y] = max(arr[y + 1], arr[y] + arr[y + t[y]]) ans = max(ans, arr[y]) print(ans) # print(solve(n)) """
[ 1, 396, 16437, 29967, 29871, 29896, 29946, 29945, 29900, 29896, 13, 5215, 10876, 13, 13, 1039, 353, 10876, 29889, 4172, 262, 29889, 949, 1220, 13, 13, 13, 1753, 4505, 29898, 29876, 1125, 13, 1678, 6063, 353, 29871, 29900, 13, 13, 1678, 363, 474, 297, 3464, 29898, 29876, 29892, 29871, 29900, 29892, 448, 29896, 1125, 13, 4706, 565, 474, 718, 260, 29961, 29875, 29962, 1405, 302, 718, 29871, 29896, 29901, 13, 9651, 3948, 29961, 29875, 29962, 353, 3948, 29961, 29875, 718, 29871, 29896, 29962, 13, 4706, 1683, 29901, 13, 9651, 3948, 29961, 29875, 29962, 353, 4236, 29898, 2749, 29961, 29875, 718, 29871, 29896, 1402, 3948, 29961, 29875, 29962, 718, 3948, 29961, 29875, 718, 260, 29961, 29875, 24960, 13, 9651, 6063, 353, 4236, 29898, 550, 29892, 3948, 29961, 29875, 2314, 13, 1678, 736, 6063, 13, 13, 13, 29876, 353, 938, 29898, 1039, 3101, 13, 29873, 353, 518, 29900, 29962, 334, 29871, 29896, 29955, 13, 2749, 353, 518, 29900, 29962, 334, 29871, 29896, 29955, 13, 13, 1454, 474, 297, 3464, 29898, 29896, 29892, 302, 718, 29871, 29896, 1125, 13, 1678, 318, 29892, 325, 353, 2910, 29898, 524, 29892, 1354, 2141, 5451, 3101, 13, 1678, 260, 29961, 29875, 29962, 353, 318, 13, 1678, 3948, 29961, 29875, 29962, 353, 325, 13, 13, 2158, 29898, 2929, 345, 29898, 29876, 876, 13, 15945, 29908, 13, 13, 29876, 353, 29871, 29955, 13, 29873, 353, 518, 29900, 29892, 29871, 29941, 29892, 29871, 29945, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29906, 29892, 29871, 29946, 29892, 29871, 29906, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29962, 13, 2749, 353, 518, 29900, 29892, 29871, 29896, 29900, 29892, 29871, 29906, 29900, 29892, 29871, 29896, 29900, 29892, 29871, 29906, 29900, 29892, 29871, 29896, 29945, 29892, 29871, 29946, 29900, 29892, 29871, 29906, 29900, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29962, 13, 550, 353, 29871, 29900, 13, 1454, 343, 297, 3464, 29898, 29876, 29892, 29871, 29900, 29892, 448, 29896, 1125, 13, 1678, 565, 343, 718, 260, 29961, 29891, 29962, 1405, 302, 718, 29871, 29896, 29901, 13, 4706, 3948, 29961, 29891, 29962, 353, 3948, 29961, 29891, 718, 29871, 29896, 29962, 13, 1678, 1683, 29901, 13, 4706, 3948, 29961, 29891, 29962, 353, 4236, 29898, 2749, 29961, 29891, 718, 29871, 29896, 1402, 3948, 29961, 29891, 29962, 718, 3948, 29961, 29891, 718, 260, 29961, 29891, 24960, 13, 4706, 6063, 353, 4236, 29898, 550, 29892, 3948, 29961, 29891, 2314, 13, 2158, 29898, 550, 29897, 13, 29937, 1596, 29898, 2929, 345, 29898, 29876, 876, 13, 15945, 29908, 2 ]
main/schema/components/media_stats.py
kristianmk/tator
50
111511
<gh_stars>10-100 media_stats = { 'type': 'object', 'properties': { 'count': {'type': 'integer', 'minimum': 0}, 'download_size': {'type': 'integer', 'minimum': 0}, 'total_size': {'type': 'integer', 'minimum': 0}, 'duration': {'type': 'number', 'minimum': 0}, }, }
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 9799, 29918, 16202, 353, 426, 13, 1678, 525, 1853, 2396, 525, 3318, 742, 13, 1678, 525, 11330, 2396, 426, 13, 4706, 525, 2798, 2396, 11117, 1853, 2396, 525, 16031, 742, 525, 1195, 12539, 2396, 29871, 29900, 1118, 13, 4706, 525, 10382, 29918, 2311, 2396, 11117, 1853, 2396, 525, 16031, 742, 525, 1195, 12539, 2396, 29871, 29900, 1118, 13, 4706, 525, 7827, 29918, 2311, 2396, 11117, 1853, 2396, 525, 16031, 742, 525, 1195, 12539, 2396, 29871, 29900, 1118, 13, 4706, 525, 19708, 2396, 11117, 1853, 2396, 525, 4537, 742, 525, 1195, 12539, 2396, 29871, 29900, 1118, 13, 1678, 2981, 13, 29913, 13, 2 ]
python/vpc_flow_logs_enabled.py
jghaines/aws-config-rules
1
92626
# # This file made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode) # # Ensure VPC Flow Logs is enabled. # Description: Checks that VPC Flow Logs is enabled at specific VPC # # Trigger Type: Change Triggered # Scope of Changes: EC2:VPC # Required Resource Identifier: VPC ID # Example Value: vpc-xxxxxxxx import boto3 import json def evaluate_compliance(config_item, vpc_id): if (config_item['resourceType'] != 'AWS::EC2::VPC'): return 'NOT_APPLICABLE' elif is_flow_logs_enabled(vpc_id): return 'COMPLIANT' else: return 'NON_COMPLIANT' def is_flow_logs_enabled(vpc_id): ec2 = boto3.client('ec2') response = ec2.describe_flow_logs( Filter=[ { 'Name': 'resource-id', 'Values': [ vpc_id, ] }, ], ) if len(response[u'FlowLogs']) != 0: return True def lambda_handler(event, context): invoking_event = json.loads(event['invokingEvent']) compliance_value = 'NOT_APPLICABLE' vpc_id = invoking_event['configurationItem']['resourceId'] compliance_value = evaluate_compliance( invoking_event['configurationItem'], vpc_id) config = boto3.client('config') response = config.put_evaluations( Evaluations=[ { 'ComplianceResourceType': invoking_event['configurationItem']['resourceType'], 'ComplianceResourceId': vpc_id, 'ComplianceType': compliance_value, 'OrderingTimestamp': invoking_event['configurationItem']['configurationItemCaptureTime'] }, ], ResultToken=event['resultToken'])
[ 1, 396, 13, 29937, 910, 934, 1754, 3625, 1090, 19178, 29900, 29871, 29896, 29889, 29900, 21536, 313, 991, 597, 1037, 1230, 22382, 29889, 990, 29914, 3597, 7247, 29914, 9171, 29914, 29896, 29889, 29900, 29914, 12018, 401, 29897, 13, 29937, 13, 29937, 22521, 545, 478, 9026, 22787, 4522, 29879, 338, 9615, 29889, 13, 29937, 12953, 29901, 5399, 29879, 393, 478, 9026, 22787, 4522, 29879, 338, 9615, 472, 2702, 478, 9026, 13, 29937, 13, 29937, 1605, 3567, 5167, 29901, 10726, 1605, 3567, 287, 13, 29937, 317, 4338, 310, 678, 6916, 29901, 17522, 29906, 29901, 29963, 9026, 13, 29937, 830, 5958, 18981, 20286, 29901, 478, 9026, 3553, 13, 29937, 8741, 7865, 29901, 325, 6739, 29899, 14633, 14633, 13, 13, 5215, 289, 3747, 29941, 13, 5215, 4390, 13, 13, 1753, 14707, 29918, 2388, 13036, 29898, 2917, 29918, 667, 29892, 325, 6739, 29918, 333, 1125, 13, 1678, 565, 313, 2917, 29918, 667, 1839, 10314, 1542, 2033, 2804, 525, 29909, 7811, 1057, 11206, 29906, 1057, 29963, 9026, 29374, 13, 4706, 736, 525, 12256, 29918, 3301, 7390, 2965, 6181, 29915, 13, 13, 1678, 25342, 338, 29918, 1731, 29918, 20756, 29918, 17590, 29898, 29894, 6739, 29918, 333, 1125, 13, 4706, 736, 525, 21514, 5265, 13566, 29915, 13, 1678, 1683, 29901, 13, 4706, 736, 525, 29940, 1164, 29918, 21514, 5265, 13566, 29915, 13, 13, 1753, 338, 29918, 1731, 29918, 20756, 29918, 17590, 29898, 29894, 6739, 29918, 333, 1125, 13, 1678, 21226, 29906, 353, 289, 3747, 29941, 29889, 4645, 877, 687, 29906, 1495, 13, 1678, 2933, 353, 21226, 29906, 29889, 2783, 29581, 29918, 1731, 29918, 20756, 29898, 13, 4706, 19916, 11759, 13, 9651, 426, 13, 18884, 525, 1170, 2396, 525, 10314, 29899, 333, 742, 13, 18884, 525, 9065, 2396, 518, 13, 462, 1678, 325, 6739, 29918, 333, 29892, 13, 18884, 4514, 13, 9651, 2981, 13, 4706, 21251, 13, 1678, 1723, 13, 1678, 565, 7431, 29898, 5327, 29961, 29884, 29915, 17907, 3403, 29879, 11287, 2804, 29871, 29900, 29901, 736, 5852, 13, 13, 1753, 14013, 29918, 13789, 29898, 3696, 29892, 3030, 1125, 13, 1678, 2437, 17223, 29918, 3696, 353, 4390, 29889, 18132, 29898, 3696, 1839, 11569, 17223, 2624, 11287, 13, 13, 1678, 752, 13036, 29918, 1767, 353, 525, 12256, 29918, 3301, 7390, 2965, 6181, 29915, 13, 13, 1678, 325, 6739, 29918, 333, 353, 2437, 17223, 29918, 3696, 1839, 13305, 2001, 16215, 10314, 1204, 2033, 13, 1678, 752, 13036, 29918, 1767, 353, 14707, 29918, 2388, 13036, 29898, 13, 4706, 2437, 17223, 29918, 3696, 1839, 13305, 2001, 7464, 325, 6739, 29918, 333, 29897, 13, 13, 1678, 2295, 353, 289, 3747, 29941, 29889, 4645, 877, 2917, 1495, 13, 1678, 2933, 353, 2295, 29889, 649, 29918, 24219, 800, 29898, 13, 539, 382, 4387, 800, 11759, 13, 965, 426, 13, 1669, 525, 6843, 13036, 6848, 1542, 2396, 2437, 17223, 29918, 3696, 1839, 13305, 2001, 16215, 10314, 1542, 7464, 13, 1669, 525, 6843, 13036, 6848, 1204, 2396, 325, 6739, 29918, 333, 29892, 13, 1669, 525, 6843, 13036, 1542, 2396, 752, 13036, 29918, 1767, 29892, 13, 1669, 525, 7514, 292, 27939, 2396, 2437, 17223, 29918, 3696, 1839, 13305, 2001, 16215, 13305, 2001, 21133, 545, 2481, 2033, 13, 965, 2981, 13, 539, 21251, 13, 539, 7867, 6066, 29922, 3696, 1839, 2914, 6066, 11287, 13, 2 ]
peeringdb/migrations/0006_auto_20180213_0031.py
schiederme/peering-manager
173
186435
<filename>peeringdb/migrations/0006_auto_20180213_0031.py # -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-02-12 23:31 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("peeringdb", "0005_auto_20180122_1845")] operations = [ migrations.CreateModel( name="Prefix", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("protocol", models.CharField(max_length=8)), ("prefix", models.CharField(max_length=64)), ("ixlan_id", models.PositiveIntegerField()), ], options={ "verbose_name": "IX Prefix", "verbose_name_plural": "IX Prefixes", "ordering": ["prefix"], }, ), migrations.AddField( model_name="networkixlan", name="ixlan_id", field=models.PositiveIntegerField(default=0), preserve_default=False, ), ]
[ 1, 529, 9507, 29958, 412, 3241, 2585, 29914, 26983, 800, 29914, 29900, 29900, 29900, 29953, 29918, 6921, 29918, 29906, 29900, 29896, 29947, 29900, 29906, 29896, 29941, 29918, 29900, 29900, 29941, 29896, 29889, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 3251, 630, 491, 15337, 29871, 29896, 29889, 29896, 29896, 29889, 29896, 29900, 373, 29871, 29906, 29900, 29896, 29947, 29899, 29900, 29906, 29899, 29896, 29906, 29871, 29906, 29941, 29901, 29941, 29896, 13, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 29892, 4733, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 9962, 353, 518, 703, 412, 3241, 2585, 613, 376, 29900, 29900, 29900, 29945, 29918, 6921, 29918, 29906, 29900, 29896, 29947, 29900, 29896, 29906, 29906, 29918, 29896, 29947, 29946, 29945, 13531, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 543, 23095, 613, 13, 9651, 4235, 11759, 13, 18884, 313, 13, 462, 1678, 376, 333, 613, 13, 462, 1678, 4733, 29889, 12300, 3073, 29898, 13, 462, 4706, 4469, 29918, 11600, 29922, 5574, 29892, 13, 462, 4706, 7601, 29918, 1989, 29922, 5574, 29892, 13, 462, 4706, 28755, 29922, 8824, 29892, 13, 462, 4706, 26952, 29918, 978, 543, 1367, 613, 13, 462, 1678, 10353, 13, 18884, 10353, 13, 18884, 4852, 20464, 613, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29947, 8243, 13, 18884, 4852, 13506, 613, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29953, 29946, 8243, 13, 18884, 4852, 861, 6468, 29918, 333, 613, 4733, 29889, 9135, 3321, 7798, 3073, 25739, 13, 9651, 21251, 13, 9651, 3987, 3790, 13, 18884, 376, 369, 15828, 29918, 978, 1115, 376, 6415, 349, 9569, 613, 13, 18884, 376, 369, 15828, 29918, 978, 29918, 572, 3631, 1115, 376, 6415, 349, 9569, 267, 613, 13, 18884, 376, 2098, 292, 1115, 6796, 13506, 12436, 13, 9651, 2981, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2528, 3073, 29898, 13, 9651, 1904, 29918, 978, 543, 11618, 861, 6468, 613, 13, 9651, 1024, 543, 861, 6468, 29918, 333, 613, 13, 9651, 1746, 29922, 9794, 29889, 9135, 3321, 7798, 3073, 29898, 4381, 29922, 29900, 511, 13, 9651, 19905, 29918, 4381, 29922, 8824, 29892, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
tests/openwisp2/sample_network_topology/migrations/0004_default_groups.py
Aryamanz29/openwisp-network-topology
0
71234
from django.conf import settings from django.contrib.auth.management import create_permissions from django.contrib.auth.models import Permission from django.db import migrations from swapper import dependency, split def create_default_permissions(apps, schema_editor): for app_config in apps.get_app_configs(): app_config.models_module = True create_permissions(app_config, apps=apps, verbosity=0) app_config.models_module = None def assign_permissions_to_groups(apps, schema_editor): create_default_permissions(apps, schema_editor) operators_and_admin_can_change = ['link', 'node'] operators_read_only_admins_manage = ['topology'] manage_operations = ['add', 'change', 'delete'] Group = apps.get_model('openwisp_users', 'Group') try: admin = Group.objects.get(name='Administrator') operator = Group.objects.get(name='Operator') # consider failures custom cases # that do not have to be dealt with except Group.DoesNotExist: return for model_name in operators_and_admin_can_change: for operation in manage_operations: permission = Permission.objects.get( codename='{}_{}'.format(operation, model_name) ) admin.permissions.add(permission.pk) operator.permissions.add(permission.pk) for model_name in operators_read_only_admins_manage: try: permission = Permission.objects.get(codename="view_{}".format(model_name)) operator.permissions.add(permission.pk) except Permission.DoesNotExist: pass for operation in manage_operations: admin.permissions.add( Permission.objects.get( codename="{}_{}".format(operation, model_name) ).pk ) class Migration(migrations.Migration): dependencies = [ dependency(*split(settings.AUTH_USER_MODEL), version='0004_default_groups'), ('sample_network_topology', '0003_add_user_defined_properties_field'), ] operations = [ migrations.RunPython( assign_permissions_to_groups, reverse_code=migrations.RunPython.noop ) ]
[ 1, 515, 9557, 29889, 5527, 1053, 6055, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 21895, 1053, 1653, 29918, 17858, 6847, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9794, 1053, 20894, 2333, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 13, 3166, 2381, 23239, 1053, 10609, 29892, 6219, 13, 13, 13, 1753, 1653, 29918, 4381, 29918, 17858, 6847, 29898, 13371, 29892, 10938, 29918, 15204, 1125, 13, 1678, 363, 623, 29918, 2917, 297, 11446, 29889, 657, 29918, 932, 29918, 2917, 29879, 7295, 13, 4706, 623, 29918, 2917, 29889, 9794, 29918, 5453, 353, 5852, 13, 4706, 1653, 29918, 17858, 6847, 29898, 932, 29918, 2917, 29892, 11446, 29922, 13371, 29892, 9750, 359, 537, 29922, 29900, 29897, 13, 4706, 623, 29918, 2917, 29889, 9794, 29918, 5453, 353, 6213, 13, 13, 13, 1753, 3566, 29918, 17858, 6847, 29918, 517, 29918, 13155, 29898, 13371, 29892, 10938, 29918, 15204, 1125, 13, 1678, 1653, 29918, 4381, 29918, 17858, 6847, 29898, 13371, 29892, 10938, 29918, 15204, 29897, 13, 1678, 12768, 29918, 392, 29918, 6406, 29918, 3068, 29918, 3167, 353, 6024, 2324, 742, 525, 3177, 2033, 13, 1678, 12768, 29918, 949, 29918, 6194, 29918, 328, 29885, 1144, 29918, 1171, 482, 353, 6024, 3332, 3002, 2033, 13, 1678, 10933, 29918, 3372, 800, 353, 6024, 1202, 742, 525, 3167, 742, 525, 8143, 2033, 13, 1678, 6431, 353, 11446, 29889, 657, 29918, 4299, 877, 3150, 29893, 11936, 29918, 7193, 742, 525, 4782, 1495, 13, 13, 1678, 1018, 29901, 13, 4706, 4113, 353, 6431, 29889, 12650, 29889, 657, 29898, 978, 2433, 12754, 2132, 1061, 1495, 13, 4706, 5455, 353, 6431, 29889, 12650, 29889, 657, 29898, 978, 2433, 26486, 1495, 13, 1678, 396, 2050, 4418, 1973, 2888, 4251, 13, 1678, 396, 393, 437, 451, 505, 304, 367, 316, 1997, 411, 13, 1678, 5174, 6431, 29889, 25125, 3664, 1252, 391, 29901, 13, 4706, 736, 13, 13, 1678, 363, 1904, 29918, 978, 297, 12768, 29918, 392, 29918, 6406, 29918, 3068, 29918, 3167, 29901, 13, 4706, 363, 5858, 297, 10933, 29918, 3372, 800, 29901, 13, 9651, 10751, 353, 20894, 2333, 29889, 12650, 29889, 657, 29898, 13, 18884, 15234, 3871, 2433, 29912, 3227, 29913, 4286, 4830, 29898, 16453, 29892, 1904, 29918, 978, 29897, 13, 9651, 1723, 13, 9651, 4113, 29889, 17858, 6847, 29889, 1202, 29898, 16074, 29889, 20571, 29897, 13, 9651, 5455, 29889, 17858, 6847, 29889, 1202, 29898, 16074, 29889, 20571, 29897, 13, 1678, 363, 1904, 29918, 978, 297, 12768, 29918, 949, 29918, 6194, 29918, 328, 29885, 1144, 29918, 1171, 482, 29901, 13, 4706, 1018, 29901, 13, 9651, 10751, 353, 20894, 2333, 29889, 12650, 29889, 657, 29898, 19284, 3871, 543, 1493, 648, 29913, 1642, 4830, 29898, 4299, 29918, 978, 876, 13, 9651, 5455, 29889, 17858, 6847, 29889, 1202, 29898, 16074, 29889, 20571, 29897, 13, 4706, 5174, 20894, 2333, 29889, 25125, 3664, 1252, 391, 29901, 13, 9651, 1209, 13, 4706, 363, 5858, 297, 10933, 29918, 3372, 800, 29901, 13, 9651, 4113, 29889, 17858, 6847, 29889, 1202, 29898, 13, 18884, 20894, 2333, 29889, 12650, 29889, 657, 29898, 13, 462, 1678, 15234, 3871, 10724, 3227, 29913, 1642, 4830, 29898, 16453, 29892, 1904, 29918, 978, 29897, 13, 18884, 13742, 20571, 13, 9651, 1723, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 1678, 9962, 353, 518, 13, 4706, 10609, 10456, 5451, 29898, 11027, 29889, 20656, 29950, 29918, 11889, 29918, 20387, 29931, 511, 1873, 2433, 29900, 29900, 29900, 29946, 29918, 4381, 29918, 13155, 5477, 13, 4706, 6702, 11249, 29918, 11618, 29918, 3332, 3002, 742, 525, 29900, 29900, 29900, 29941, 29918, 1202, 29918, 1792, 29918, 12119, 29918, 11330, 29918, 2671, 5477, 13, 1678, 4514, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 6558, 11980, 29898, 13, 9651, 3566, 29918, 17858, 6847, 29918, 517, 29918, 13155, 29892, 11837, 29918, 401, 29922, 26983, 800, 29889, 6558, 11980, 29889, 1217, 459, 13, 4706, 1723, 13, 1678, 4514, 13, 2 ]
Scripts/ReverseSearch/social_media.py
balswyan/senior-capstone-fall-2018
1
31847
<filename>Scripts/ReverseSearch/social_media.py import urllib2 from cookielib import CookieJar import os import re import time import json cookies = CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies)) opener.addheaders = [('User-agent', 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 ' '(KHTML, like Gecko) Chrome/24.0.1312.27 Safari/537.17')] with open("missing_people.json") as f: people = json.load(f) for person in people['results']: facebook_profile = 'https://www.facebook.com/search/top/?q='+ person['firstname'] + '%20' + person['lastname'] facebook_post ='https://www.facebook.com/search/posts/?q='+ person['firstname'] + '%20' + person['lastname'] facebook_news = 'https://www.facebook.com/search/str/' + person['firstname'] + '%20' + person['lastname'] + '/links-keyword/stories-news-pivot' instagram_tags = 'https://www.instagram.com/explore/tags/'+ person['firstname'] + person['lastname'] twitter_search = 'https://twitter.com/search?q='+ person['firstname'] + '%20' + person['lastname'] + '&src=typd' twitter_hashtag = 'https://twitter.com/hashtag/' + person['firstname'] + person['lastname'] '?src=hash' print(What ever you want)
[ 1, 529, 9507, 29958, 4081, 29879, 29914, 1123, 3901, 7974, 29914, 24911, 29918, 9799, 29889, 2272, 13, 5215, 3142, 1982, 29906, 13, 3166, 7984, 709, 747, 1053, 17278, 347, 29967, 279, 13, 5215, 2897, 13, 5215, 337, 13, 5215, 931, 13, 5215, 4390, 13, 13, 13, 15108, 583, 353, 17278, 347, 29967, 279, 580, 13, 459, 759, 353, 3142, 1982, 29906, 29889, 4282, 29918, 459, 759, 29898, 2271, 1982, 29906, 29889, 10493, 24914, 18689, 29898, 15108, 583, 876, 13, 459, 759, 29889, 1202, 13662, 353, 518, 877, 2659, 29899, 14748, 742, 525, 29924, 2112, 2911, 29914, 29945, 29889, 29900, 313, 29990, 29896, 29896, 29936, 8074, 474, 29953, 29947, 29953, 29897, 12113, 3609, 13117, 29914, 29945, 29941, 29955, 29889, 29896, 29955, 525, 13, 462, 462, 1678, 525, 29898, 29968, 7020, 29892, 763, 1879, 27604, 29897, 10228, 29914, 29906, 29946, 29889, 29900, 29889, 29896, 29941, 29896, 29906, 29889, 29906, 29955, 24544, 29914, 29945, 29941, 29955, 29889, 29896, 29955, 1495, 29962, 13, 2541, 1722, 703, 27259, 29918, 25719, 29889, 3126, 1159, 408, 285, 29901, 13, 12, 25719, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 13, 1454, 2022, 297, 2305, 1839, 9902, 2033, 29901, 13, 12, 12, 15445, 29918, 10185, 353, 525, 991, 597, 1636, 29889, 15445, 29889, 510, 29914, 4478, 29914, 3332, 13401, 29939, 2433, 29974, 2022, 1839, 4102, 978, 2033, 718, 14210, 29906, 29900, 29915, 718, 2022, 1839, 4230, 978, 2033, 13, 12, 12, 15445, 29918, 2490, 353, 29915, 991, 597, 1636, 29889, 15445, 29889, 510, 29914, 4478, 29914, 14080, 13401, 29939, 2433, 29974, 2022, 1839, 4102, 978, 2033, 718, 14210, 29906, 29900, 29915, 718, 2022, 1839, 4230, 978, 2033, 13, 12, 12, 15445, 29918, 15753, 353, 525, 991, 597, 1636, 29889, 15445, 29889, 510, 29914, 4478, 29914, 710, 22208, 718, 2022, 1839, 4102, 978, 2033, 718, 14210, 29906, 29900, 29915, 718, 2022, 1839, 4230, 978, 2033, 718, 8207, 4965, 29899, 26766, 29914, 303, 3842, 29899, 15753, 29899, 29886, 11002, 29915, 13, 12, 12, 2611, 14442, 29918, 11338, 353, 525, 991, 597, 1636, 29889, 2611, 14442, 29889, 510, 29914, 24516, 487, 29914, 11338, 29914, 18717, 2022, 1839, 4102, 978, 2033, 718, 2022, 1839, 4230, 978, 2033, 13, 12, 12, 24946, 29918, 4478, 353, 525, 991, 597, 24946, 29889, 510, 29914, 4478, 29973, 29939, 2433, 29974, 2022, 1839, 4102, 978, 2033, 718, 14210, 29906, 29900, 29915, 718, 2022, 1839, 4230, 978, 2033, 718, 525, 29987, 4351, 29922, 1017, 15926, 29915, 13, 12, 12, 24946, 29918, 5349, 400, 351, 353, 525, 991, 597, 24946, 29889, 510, 29914, 5349, 400, 351, 22208, 718, 2022, 1839, 4102, 978, 2033, 718, 2022, 1839, 4230, 978, 2033, 525, 29973, 4351, 29922, 8568, 29915, 13, 12, 12, 2158, 29898, 5618, 3926, 366, 864, 29897, 13, 13, 2 ]
docs/test.py
jelitox/proxylist
0
119291
from proxylists import get_proxies proxies = get_proxies() print(proxies)
[ 1, 515, 10166, 21513, 1053, 679, 29918, 771, 29916, 583, 13, 13, 13, 771, 29916, 583, 353, 679, 29918, 771, 29916, 583, 580, 13, 2158, 29898, 771, 29916, 583, 29897, 13, 2 ]
flow/networks/i24_subnetwork.py
kumarms1/flow
0
196406
<reponame>kumarms1/flow from flow.networks.base import Network EDGES_DISTRIBUTION = [ # Main Highway "108162443", "108162396", "108162303", "634155184", "108162054", "108161914#0", "108161914#1", "108161914#2", "108161914#3", "108161914#4", "108161914#5", "635462234", "173720363#0", "173720363#1", "173720363#2", "173720363#3", "173720363#4", "173720351", "173720358#0", "173720358#1", "173720350", "173720361", "173720354", "173720360", ] class I24SubNetwork(Network): def specify_routes(self, net_params): return { "108162443": ["108162443", "108162396", "108162303", "634155184", "108162054", "108161914#0", "108161914#1", "108161914#2", "108161914#3", "108161914#4", "108161914#5", "635462234", "173720363#0", "173720363#1", "173720363#2", "173720363#3", "173720363#4", "173720351", "173720358#0", "173720358#1", "173720350", "173720361", "173720354", "173720360"] }
[ 1, 529, 276, 1112, 420, 29958, 29895, 24540, 1516, 29896, 29914, 1731, 13, 3166, 4972, 29889, 11618, 29879, 29889, 3188, 1053, 8527, 13, 13, 3352, 1692, 29903, 29918, 4571, 1254, 3960, 29933, 2692, 2725, 353, 518, 13, 1678, 396, 4241, 22080, 13, 1678, 376, 29896, 29900, 29947, 29896, 29953, 29906, 29946, 29946, 29941, 613, 13, 1678, 376, 29896, 29900, 29947, 29896, 29953, 29906, 29941, 29929, 29953, 613, 13, 1678, 376, 29896, 29900, 29947, 29896, 29953, 29906, 29941, 29900, 29941, 613, 13, 1678, 376, 29953, 29941, 29946, 29896, 29945, 29945, 29896, 29947, 29946, 613, 13, 1678, 376, 29896, 29900, 29947, 29896, 29953, 29906, 29900, 29945, 29946, 613, 13, 1678, 376, 29896, 29900, 29947, 29896, 29953, 29896, 29929, 29896, 29946, 29937, 29900, 613, 13, 1678, 376, 29896, 29900, 29947, 29896, 29953, 29896, 29929, 29896, 29946, 29937, 29896, 613, 13, 1678, 376, 29896, 29900, 29947, 29896, 29953, 29896, 29929, 29896, 29946, 29937, 29906, 613, 13, 1678, 376, 29896, 29900, 29947, 29896, 29953, 29896, 29929, 29896, 29946, 29937, 29941, 613, 13, 1678, 376, 29896, 29900, 29947, 29896, 29953, 29896, 29929, 29896, 29946, 29937, 29946, 613, 13, 1678, 376, 29896, 29900, 29947, 29896, 29953, 29896, 29929, 29896, 29946, 29937, 29945, 613, 13, 1678, 376, 29953, 29941, 29945, 29946, 29953, 29906, 29906, 29941, 29946, 613, 13, 1678, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29941, 29937, 29900, 613, 13, 1678, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29941, 29937, 29896, 613, 13, 1678, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29941, 29937, 29906, 613, 13, 1678, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29941, 29937, 29941, 613, 13, 1678, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29941, 29937, 29946, 613, 13, 1678, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29945, 29896, 613, 13, 1678, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29945, 29947, 29937, 29900, 613, 13, 1678, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29945, 29947, 29937, 29896, 613, 13, 1678, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29945, 29900, 613, 13, 1678, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29896, 613, 13, 1678, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29945, 29946, 613, 13, 1678, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29900, 613, 13, 29962, 13, 13, 1990, 306, 29906, 29946, 4035, 13724, 29898, 13724, 1125, 13, 13, 1678, 822, 6084, 29918, 27894, 29898, 1311, 29892, 7787, 29918, 7529, 1125, 13, 4706, 736, 426, 13, 9651, 376, 29896, 29900, 29947, 29896, 29953, 29906, 29946, 29946, 29941, 1115, 6796, 29896, 29900, 29947, 29896, 29953, 29906, 29946, 29946, 29941, 613, 13, 462, 4706, 376, 29896, 29900, 29947, 29896, 29953, 29906, 29941, 29929, 29953, 613, 13, 462, 4706, 376, 29896, 29900, 29947, 29896, 29953, 29906, 29941, 29900, 29941, 613, 13, 462, 4706, 376, 29953, 29941, 29946, 29896, 29945, 29945, 29896, 29947, 29946, 613, 13, 462, 4706, 376, 29896, 29900, 29947, 29896, 29953, 29906, 29900, 29945, 29946, 613, 13, 462, 4706, 376, 29896, 29900, 29947, 29896, 29953, 29896, 29929, 29896, 29946, 29937, 29900, 613, 13, 462, 4706, 376, 29896, 29900, 29947, 29896, 29953, 29896, 29929, 29896, 29946, 29937, 29896, 613, 13, 462, 4706, 376, 29896, 29900, 29947, 29896, 29953, 29896, 29929, 29896, 29946, 29937, 29906, 613, 13, 462, 4706, 376, 29896, 29900, 29947, 29896, 29953, 29896, 29929, 29896, 29946, 29937, 29941, 613, 13, 462, 4706, 376, 29896, 29900, 29947, 29896, 29953, 29896, 29929, 29896, 29946, 29937, 29946, 613, 13, 462, 4706, 376, 29896, 29900, 29947, 29896, 29953, 29896, 29929, 29896, 29946, 29937, 29945, 613, 13, 462, 4706, 376, 29953, 29941, 29945, 29946, 29953, 29906, 29906, 29941, 29946, 613, 13, 462, 4706, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29941, 29937, 29900, 613, 13, 462, 4706, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29941, 29937, 29896, 613, 13, 462, 4706, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29941, 29937, 29906, 613, 13, 462, 4706, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29941, 29937, 29941, 613, 13, 462, 4706, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29941, 29937, 29946, 613, 13, 462, 4706, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29945, 29896, 613, 13, 462, 4706, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29945, 29947, 29937, 29900, 613, 13, 462, 4706, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29945, 29947, 29937, 29896, 613, 13, 462, 4706, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29945, 29900, 613, 13, 462, 4706, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29896, 613, 13, 462, 4706, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29945, 29946, 613, 13, 462, 4706, 376, 29896, 29955, 29941, 29955, 29906, 29900, 29941, 29953, 29900, 3108, 13, 632, 13, 4706, 500, 2 ]
preprocess/python/h5py_utils.py
fredericsun/seq2seq-ChinesePoetryGenerater
0
23125
import numpy as np import h5py import os import sys from copy import deepcopy #handle .(period) and slash specially since it is part of path #replace with \period or \slash-forward when store, recover later #not using '\forward-slash' is because \f is a special character PERIOD='\period' SLASH='\slash-forward' ''' This function will save a python dictionary with format {'key':vector} to hdf5 format target_dict is the target dictionary f_name is the HDF5 file name including path to it mode is file open mode, 'a' for append is the default setting output file is a HDF5 file which the keys of HDF5 are keys of target dict dataset is corresponding array of each key in target dict ''' def dict2hdf5(target_dict, f_name, sub_group='/', mode='a'): print ('Saving In HDF5 Format...') index_count=0 bar_count=0 total=len(target_dict) if total<50: total=50 #open HDF5 file f = h5py.File(f_name, mode) for key in target_dict: ######### print progress ############# index_count +=1 if index_count % (total/50) ==0: sys.stdout.write('\r'), bar_count += 1 sys.stdout.write("[%-50s] %d%% %d/%d" % ('#'*bar_count, 2*bar_count, index_count, total)) sys.stdout.flush() ######### end print progress ######### #print os.path.join(sub_group,key) #sys.stdout.flush() #replace special handled chars, will not change string if / is not in it dataset_key=key.replace('.',PERIOD).replace('/',SLASH) f.create_dataset(os.path.join(sub_group,dataset_key), data=target_dict[key]) f.close() ''' This function will convert saved hdf5 file from previous function back to {'key':vector} dictionary f_name is the HDF5 file name including path to it ''' def hdf52dict(f_name, sub_group='/' ): rv=dict() #open HDF5 file f = h5py.File(f_name, 'r') group=f[sub_group] for key in group: #replace back special handled chars key=key.replace(PERIOD, '.').replace(SLASH,'/') rv[key]=np.array(group[key]) f.close() return rv def main(): d=dict() d['hello']=[1,0,0,0,0,0,0,0,0,0,0] d['world']=[0,1,0,0,0,0,0,0,0,0,0] dict2hdf5(target_dict=d, f_name='test') rv=hdf52dict('test') print (rv) if __name__ == '__main__': main()
[ 1, 1053, 12655, 408, 7442, 13, 5215, 298, 29945, 2272, 13, 5215, 2897, 13, 5215, 10876, 13, 3166, 3509, 1053, 6483, 8552, 13, 13, 13, 29937, 8411, 869, 29898, 19145, 29897, 322, 24765, 961, 5584, 1951, 372, 338, 760, 310, 2224, 13, 29937, 6506, 411, 320, 19145, 470, 320, 17057, 29899, 11333, 746, 3787, 29892, 9792, 2678, 13, 29937, 1333, 773, 11297, 11333, 29899, 17057, 29915, 29871, 338, 1363, 320, 29888, 338, 263, 4266, 2931, 13, 13171, 5971, 29928, 2433, 29905, 19145, 29915, 13, 12750, 24943, 2433, 29905, 17057, 29899, 11333, 29915, 13, 13, 12008, 13, 4013, 740, 674, 4078, 263, 3017, 8600, 411, 3402, 11117, 1989, 2396, 8111, 29913, 304, 298, 2176, 29945, 3402, 13, 13, 5182, 29918, 8977, 338, 278, 3646, 8600, 13, 29888, 29918, 978, 338, 278, 379, 4037, 29945, 934, 1024, 3704, 2224, 304, 372, 29871, 13, 8513, 338, 934, 1722, 4464, 29892, 525, 29874, 29915, 363, 9773, 338, 278, 2322, 4444, 13, 13, 4905, 934, 338, 263, 379, 4037, 29945, 934, 607, 278, 6611, 310, 379, 4037, 29945, 526, 6611, 310, 3646, 9657, 13, 24713, 338, 6590, 1409, 310, 1269, 1820, 297, 3646, 9657, 13, 12008, 13, 1753, 9657, 29906, 29882, 2176, 29945, 29898, 5182, 29918, 8977, 29892, 285, 29918, 978, 29892, 1014, 29918, 2972, 2433, 29914, 742, 4464, 2433, 29874, 29374, 13, 13, 12, 2158, 6702, 29903, 5555, 512, 379, 4037, 29945, 19191, 856, 1495, 13, 12, 2248, 29918, 2798, 29922, 29900, 13, 12, 1646, 29918, 2798, 29922, 29900, 13, 12, 7827, 29922, 2435, 29898, 5182, 29918, 8977, 29897, 13, 12, 361, 3001, 29966, 29945, 29900, 29901, 13, 12, 12, 7827, 29922, 29945, 29900, 13, 13, 12, 29937, 3150, 379, 4037, 29945, 934, 13, 12, 29888, 353, 298, 29945, 2272, 29889, 2283, 29898, 29888, 29918, 978, 29892, 4464, 29897, 13, 13, 12, 1454, 1820, 297, 3646, 29918, 8977, 29901, 13, 13, 12, 12, 7346, 29937, 1596, 6728, 835, 7346, 2277, 13, 12, 12, 2248, 29918, 2798, 4619, 29896, 13, 12, 12, 361, 2380, 29918, 2798, 1273, 313, 7827, 29914, 29945, 29900, 29897, 1275, 29900, 29901, 13, 12, 12, 12, 9675, 29889, 25393, 29889, 3539, 28909, 29878, 5477, 13, 12, 12, 12, 1646, 29918, 2798, 4619, 29871, 29896, 13, 12, 12, 12, 9675, 29889, 25393, 29889, 3539, 703, 29961, 29995, 29899, 29945, 29900, 29879, 29962, 1273, 29881, 7686, 1273, 29881, 22584, 29881, 29908, 1273, 6702, 29937, 29915, 29930, 1646, 29918, 2798, 29892, 29871, 29906, 29930, 1646, 29918, 2798, 29892, 2380, 29918, 2798, 29892, 3001, 876, 13, 12, 12, 12, 9675, 29889, 25393, 29889, 23126, 580, 13, 12, 12, 7346, 29937, 1095, 1596, 6728, 835, 4136, 2277, 13, 13, 13, 12, 12, 29937, 2158, 2897, 29889, 2084, 29889, 7122, 29898, 1491, 29918, 2972, 29892, 1989, 29897, 13, 12, 12, 29937, 9675, 29889, 25393, 29889, 23126, 580, 13, 13, 13, 12, 12, 29937, 6506, 4266, 16459, 22524, 29892, 674, 451, 1735, 1347, 565, 847, 338, 451, 297, 372, 13, 12, 12, 24713, 29918, 1989, 29922, 1989, 29889, 6506, 12839, 742, 13171, 5971, 29928, 467, 6506, 11219, 742, 12750, 24943, 29897, 13, 13, 12, 12, 29888, 29889, 3258, 29918, 24713, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1491, 29918, 2972, 29892, 24713, 29918, 1989, 511, 848, 29922, 5182, 29918, 8977, 29961, 1989, 2314, 13, 13, 12, 29888, 29889, 5358, 580, 13, 13, 12008, 13, 4013, 740, 674, 3588, 7160, 298, 2176, 29945, 934, 515, 3517, 740, 1250, 304, 11117, 1989, 2396, 8111, 29913, 8600, 13, 29888, 29918, 978, 338, 278, 379, 4037, 29945, 934, 1024, 3704, 2224, 304, 372, 29871, 13, 12008, 13, 1753, 298, 2176, 29945, 29906, 8977, 29898, 29888, 29918, 978, 29892, 1014, 29918, 2972, 2433, 22208, 29871, 1125, 13, 13, 12, 15291, 29922, 8977, 580, 13, 13, 12, 29937, 3150, 379, 4037, 29945, 934, 13, 12, 29888, 353, 298, 29945, 2272, 29889, 2283, 29898, 29888, 29918, 978, 29892, 525, 29878, 1495, 13, 13, 12, 2972, 29922, 29888, 29961, 1491, 29918, 2972, 29962, 13, 13, 12, 1454, 1820, 297, 2318, 29901, 13, 13, 12, 12, 29937, 6506, 1250, 4266, 16459, 22524, 13, 12, 12, 1989, 29922, 1989, 29889, 6506, 29898, 13171, 5971, 29928, 29892, 15300, 2824, 6506, 29898, 12750, 24943, 5501, 29914, 1495, 13, 13, 12, 12, 15291, 29961, 1989, 13192, 9302, 29889, 2378, 29898, 2972, 29961, 1989, 2314, 13, 13, 12, 29888, 29889, 5358, 580, 13, 13, 12, 2457, 364, 29894, 13, 13, 13, 1753, 1667, 7295, 13, 13, 12, 29881, 29922, 8977, 580, 13, 13, 12, 29881, 1839, 12199, 2033, 11759, 29896, 29892, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29962, 13, 12, 29881, 1839, 11526, 2033, 11759, 29900, 29892, 29896, 29892, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29962, 13, 13, 12, 8977, 29906, 29882, 2176, 29945, 29898, 5182, 29918, 8977, 29922, 29881, 29892, 285, 29918, 978, 2433, 1688, 1495, 13, 13, 12, 15291, 29922, 29882, 2176, 29945, 29906, 8977, 877, 1688, 1495, 13, 12, 2158, 313, 15291, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 12, 3396, 580, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 2 ]
src/server/oasisapi/analysis_models/tests/test_analysis_model.py
macabuag/OasisPlatform_GLP
36
127014
import json import string from backports.tempfile import TemporaryDirectory from django.test import override_settings from django.urls import reverse from django_webtest import WebTest, WebTestMixin from hypothesis import given, settings from hypothesis.extra.django import TestCase from hypothesis.strategies import text from rest_framework_simplejwt.tokens import AccessToken from ...auth.tests.fakes import fake_user from ..models import AnalysisModel from .fakes import fake_analysis_model # Override default deadline for all tests to 8s settings.register_profile("ci", deadline=800.0) settings.load_profile("ci") class AnalysisModelApi(WebTest, TestCase): @given( supplier_id=text(alphabet=string.ascii_letters, min_size=1, max_size=10), version_id=text(alphabet=string.whitespace, min_size=0, max_size=10), ) def test_version_id_is_missing___response_is_400(self, supplier_id, version_id): user = fake_user() response = self.app.post( reverse('analysis-model-list', kwargs={'version': 'v1'}), expect_errors=True, headers={ 'Authorization': 'Bearer {}'.format(AccessToken.for_user(user)) }, params=json.dumps({ 'supplier_id': supplier_id, 'version_id': version_id, }), content_type='application/json', ) self.assertEqual(400, response.status_code) self.assertFalse(AnalysisModel.objects.exists()) @given( supplier_id=text(alphabet=string.whitespace, min_size=0, max_size=10), version_id=text(alphabet=string.ascii_letters, min_size=1, max_size=10), ) def test_supplier_id_is_missing___response_is_400(self, supplier_id, version_id): user = fake_user() response = self.app.post( reverse('analysis-model-list', kwargs={'version': 'v1'}), expect_errors=True, headers={ 'Authorization': 'Bearer {}'.format(AccessToken.for_user(user)) }, params=json.dumps({ 'supplier_id': supplier_id, 'version_id': version_id, }), content_type='application/json', ) self.assertEqual(400, response.status_code) self.assertFalse(AnalysisModel.objects.exists()) @given( supplier_id=text(alphabet=string.ascii_letters, min_size=1, max_size=10), model_id=text(alphabet=string.ascii_letters, min_size=1, max_size=10), version_id=text(alphabet=string.ascii_letters, min_size=1, max_size=10), ) def test_data_is_valid___object_is_created(self, supplier_id, model_id, version_id): user = fake_user() response = self.app.post( reverse('analysis-model-list', kwargs={'version': 'v1'}), headers={ 'Authorization': 'Bearer {}'.format(AccessToken.for_user(user)) }, params=json.dumps({ 'supplier_id': supplier_id, 'model_id': model_id, 'version_id': version_id, }), content_type='application/json', ) model = AnalysisModel.objects.first() self.assertEqual(201, response.status_code) self.assertEqual(model.supplier_id, supplier_id) self.assertEqual(model.version_id, version_id) self.assertEqual(model.model_id, model_id) class ModelSettingsJson(WebTestMixin, TestCase): def test_user_is_not_authenticated___response_is_forbidden(self): models = fake_analysis_model() response = self.app.get(models.get_absolute_settings_url(), expect_errors=True) self.assertIn(response.status_code, [401,403]) """ Add these check back in once models auto-update their settings fields """ def test_settings_json_is_not_present___get_response_is_404(self): user = fake_user() models = fake_analysis_model() response = self.app.get( models.get_absolute_settings_url(), headers={ 'Authorization': 'Bearer {}'.format(AccessToken.for_user(user)) }, expect_errors=True, ) self.assertEqual(404, response.status_code) def test_settings_json_is_not_present___delete_response_is_404(self): user = fake_user() models = fake_analysis_model() response = self.app.delete( models.get_absolute_settings_url(), headers={ 'Authorization': 'Bearer {}'.format(AccessToken.for_user(user)) }, expect_errors=True, ) self.assertEqual(404, response.status_code) def test_settings_json_is_not_valid___response_is_400(self): with TemporaryDirectory() as d: with override_settings(MEDIA_ROOT=d): user = fake_user() models = fake_analysis_model() json_data = { "model_settings":{ "event_set":{ "name": "Event Set", "default": "P", "options":[ {"id":"P", "desc": "Proabilistic"}, {"id":"H", "desc": "Historic"} ] }, "event_occurrence_id":{ "name": "Occurrence Set", "desc": "PiWind Occurrence selection", "default": 1, "options":[ {"id":"1", "desc": "Long Term"} ] }, "boolean_parameters": [ {"name": "peril_wind", "desc":"Boolean option", "default": 1.1}, {"name": "peril_surge", "desc":"Boolean option", "default": True} ], "float_parameter": [ {"name": "float_1", "desc":"Some float value", "default": False, "max":1.0, "min":0.0}, {"name": "float_2", "desc":"Some float value", "default": 0.3, "max":1.0, "min":0.0} ] }, "lookup_settings":{ "supported_perils":[ {"i": "WSS", "desc": "Single Peril: Storm Surge"}, {"id": "WTC", "des": "Single Peril: Tropical Cyclone"}, {"id": "WW11", "desc": "Group Peril: Windstorm with storm surge"}, {"id": "WW2", "desc": "Group Peril: Windstorm w/o storm surge"} ] } } response = self.app.post( models.get_absolute_settings_url(), headers={ 'Authorization': 'Bearer {}'.format(AccessToken.for_user(user)) }, params=json.dumps(json_data), content_type='application/json', expect_errors=True, ) validation_error = { 'model_settings': ["Additional properties are not allowed ('float_parameter' was unexpected)"], 'model_settings-event_set': ["'desc' is a required property"], 'model_settings-event_occurrence_id-default': ["1 is not of type 'string'"], 'model_settings-boolean_parameters-0-default': ["1.1 is not of type 'boolean'"], 'lookup_settings-supported_perils-0': ["Additional properties are not allowed ('i' was unexpected)", "'id' is a required property"], 'lookup_settings-supported_perils-1': ["Additional properties are not allowed ('des' was unexpected)", "'desc' is a required property"], 'lookup_settings-supported_perils-2-id': ["'WW11' is too long"] } self.assertEqual(400, response.status_code) self.assertDictEqual.__self__.maxDiff = None self.assertDictEqual(json.loads(response.body), validation_error) def test_settings_json_is_uploaded___can_be_retrieved(self): with TemporaryDirectory() as d: with override_settings(MEDIA_ROOT=d): user = fake_user() models = fake_analysis_model() json_data = { "model_settings":{ "event_set":{ "name": "Event Set", "desc": "Either Probablistic or Historic", "default": "P", "options":[ {"id":"P", "desc": "Proabilistic"}, {"id":"H", "desc": "Historic"} ] }, "event_occurrence_id":{ "name": "Occurrence Set", "desc": "PiWind Occurrence selection", "default": "1", "options":[ {"id":"1", "desc": "Long Term"} ] }, "boolean_parameters": [ {"name": "peril_wind", "desc":"Boolean option", "default": False}, {"name": "peril_surge", "desc":"Boolean option", "default": True} ], "float_parameters": [ {"name": "float_1", "desc":"Some float value", "default": 0.5, "max":1.0, "min":0.0}, {"name": "float_2", "desc":"Some float value", "default": 0.3, "max":1.0, "min":0.0} ] }, "lookup_settings":{ "supported_perils":[ {"id": "WSS", "desc": "Single Peril: Storm Surge"}, {"id": "WTC", "desc": "Single Peril: Tropical Cyclone"}, {"id": "WW1", "desc": "Group Peril: Windstorm with storm surge"}, {"id": "WW2", "desc": "Group Peril: Windstorm w/o storm surge"} ] } } self.app.post( models.get_absolute_settings_url(), headers={ 'Authorization': 'Bearer {}'.format(AccessToken.for_user(user)) }, params=json.dumps(json_data), content_type='application/json' ) response = self.app.get( models.get_absolute_settings_url(), headers={ 'Authorization': 'Bearer {}'.format(AccessToken.for_user(user)) }, ) self.assertDictEqual.__self__.maxDiff = None self.assertDictEqual(json.loads(response.body), json_data) self.assertEqual(response.content_type, 'application/json')
[ 1, 1053, 4390, 13, 5215, 1347, 13, 13, 3166, 1250, 4011, 29889, 7382, 1445, 1053, 6789, 1971, 653, 9882, 13, 3166, 9557, 29889, 1688, 1053, 5712, 29918, 11027, 13, 3166, 9557, 29889, 26045, 1053, 11837, 13, 3166, 9557, 29918, 2676, 1688, 1053, 2563, 3057, 29892, 2563, 3057, 29924, 861, 262, 13, 3166, 20051, 1053, 2183, 29892, 6055, 13, 3166, 20051, 29889, 17833, 29889, 14095, 1053, 4321, 8259, 13, 3166, 20051, 29889, 710, 1845, 583, 1053, 1426, 13, 3166, 1791, 29918, 4468, 29918, 12857, 29926, 14554, 29889, 517, 12360, 1053, 11028, 6066, 13, 13, 3166, 2023, 5150, 29889, 21150, 29889, 29888, 6926, 1053, 25713, 29918, 1792, 13, 3166, 6317, 9794, 1053, 24352, 3195, 13, 13, 3166, 869, 29888, 6926, 1053, 25713, 29918, 15916, 29918, 4299, 13, 13, 29937, 6811, 2426, 2322, 7123, 1220, 363, 599, 6987, 304, 29871, 29947, 29879, 13, 11027, 29889, 9573, 29918, 10185, 703, 455, 613, 7123, 1220, 29922, 29947, 29900, 29900, 29889, 29900, 29897, 13, 11027, 29889, 1359, 29918, 10185, 703, 455, 1159, 13, 13, 13, 1990, 24352, 3195, 11713, 29898, 3609, 3057, 29892, 4321, 8259, 1125, 13, 1678, 732, 29887, 5428, 29898, 13, 4706, 1462, 4926, 29918, 333, 29922, 726, 29898, 284, 17416, 29922, 1807, 29889, 294, 18869, 29918, 1026, 2153, 29892, 1375, 29918, 2311, 29922, 29896, 29892, 4236, 29918, 2311, 29922, 29896, 29900, 511, 13, 4706, 1873, 29918, 333, 29922, 726, 29898, 284, 17416, 29922, 1807, 29889, 1332, 3246, 3535, 29892, 1375, 29918, 2311, 29922, 29900, 29892, 4236, 29918, 2311, 29922, 29896, 29900, 511, 13, 1678, 1723, 13, 1678, 822, 1243, 29918, 3259, 29918, 333, 29918, 275, 29918, 27259, 22359, 5327, 29918, 275, 29918, 29946, 29900, 29900, 29898, 1311, 29892, 1462, 4926, 29918, 333, 29892, 1873, 29918, 333, 1125, 13, 4706, 1404, 353, 25713, 29918, 1792, 580, 13, 13, 4706, 2933, 353, 1583, 29889, 932, 29889, 2490, 29898, 13, 9651, 11837, 877, 15916, 29899, 4299, 29899, 1761, 742, 9049, 5085, 3790, 29915, 3259, 2396, 525, 29894, 29896, 29915, 9594, 13, 9651, 2149, 29918, 12523, 29922, 5574, 29892, 13, 9651, 9066, 3790, 13, 18884, 525, 25471, 2396, 525, 29933, 799, 261, 6571, 4286, 4830, 29898, 6638, 6066, 29889, 1454, 29918, 1792, 29898, 1792, 876, 13, 9651, 2981, 13, 9651, 8636, 29922, 3126, 29889, 29881, 17204, 3319, 13, 18884, 525, 19303, 4926, 29918, 333, 2396, 1462, 4926, 29918, 333, 29892, 13, 18884, 525, 3259, 29918, 333, 2396, 1873, 29918, 333, 29892, 13, 9651, 500, 511, 13, 9651, 2793, 29918, 1853, 2433, 6214, 29914, 3126, 742, 13, 4706, 1723, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29946, 29900, 29900, 29892, 2933, 29889, 4882, 29918, 401, 29897, 13, 4706, 1583, 29889, 9294, 8824, 29898, 21067, 4848, 3195, 29889, 12650, 29889, 9933, 3101, 13, 13, 1678, 732, 29887, 5428, 29898, 13, 4706, 1462, 4926, 29918, 333, 29922, 726, 29898, 284, 17416, 29922, 1807, 29889, 1332, 3246, 3535, 29892, 1375, 29918, 2311, 29922, 29900, 29892, 4236, 29918, 2311, 29922, 29896, 29900, 511, 13, 4706, 1873, 29918, 333, 29922, 726, 29898, 284, 17416, 29922, 1807, 29889, 294, 18869, 29918, 1026, 2153, 29892, 1375, 29918, 2311, 29922, 29896, 29892, 4236, 29918, 2311, 29922, 29896, 29900, 511, 13, 1678, 1723, 13, 1678, 822, 1243, 29918, 19303, 4926, 29918, 333, 29918, 275, 29918, 27259, 22359, 5327, 29918, 275, 29918, 29946, 29900, 29900, 29898, 1311, 29892, 1462, 4926, 29918, 333, 29892, 1873, 29918, 333, 1125, 13, 4706, 1404, 353, 25713, 29918, 1792, 580, 13, 13, 4706, 2933, 353, 1583, 29889, 932, 29889, 2490, 29898, 13, 9651, 11837, 877, 15916, 29899, 4299, 29899, 1761, 742, 9049, 5085, 3790, 29915, 3259, 2396, 525, 29894, 29896, 29915, 9594, 13, 9651, 2149, 29918, 12523, 29922, 5574, 29892, 13, 9651, 9066, 3790, 13, 18884, 525, 25471, 2396, 525, 29933, 799, 261, 6571, 4286, 4830, 29898, 6638, 6066, 29889, 1454, 29918, 1792, 29898, 1792, 876, 13, 9651, 2981, 13, 9651, 8636, 29922, 3126, 29889, 29881, 17204, 3319, 13, 18884, 525, 19303, 4926, 29918, 333, 2396, 1462, 4926, 29918, 333, 29892, 13, 18884, 525, 3259, 29918, 333, 2396, 1873, 29918, 333, 29892, 13, 9651, 500, 511, 13, 9651, 2793, 29918, 1853, 2433, 6214, 29914, 3126, 742, 13, 4706, 1723, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29946, 29900, 29900, 29892, 2933, 29889, 4882, 29918, 401, 29897, 13, 4706, 1583, 29889, 9294, 8824, 29898, 21067, 4848, 3195, 29889, 12650, 29889, 9933, 3101, 13, 13, 1678, 732, 29887, 5428, 29898, 13, 4706, 1462, 4926, 29918, 333, 29922, 726, 29898, 284, 17416, 29922, 1807, 29889, 294, 18869, 29918, 1026, 2153, 29892, 1375, 29918, 2311, 29922, 29896, 29892, 4236, 29918, 2311, 29922, 29896, 29900, 511, 13, 4706, 1904, 29918, 333, 29922, 726, 29898, 284, 17416, 29922, 1807, 29889, 294, 18869, 29918, 1026, 2153, 29892, 1375, 29918, 2311, 29922, 29896, 29892, 4236, 29918, 2311, 29922, 29896, 29900, 511, 13, 4706, 1873, 29918, 333, 29922, 726, 29898, 284, 17416, 29922, 1807, 29889, 294, 18869, 29918, 1026, 2153, 29892, 1375, 29918, 2311, 29922, 29896, 29892, 4236, 29918, 2311, 29922, 29896, 29900, 511, 13, 1678, 1723, 13, 1678, 822, 1243, 29918, 1272, 29918, 275, 29918, 3084, 22359, 3318, 29918, 275, 29918, 11600, 29898, 1311, 29892, 1462, 4926, 29918, 333, 29892, 1904, 29918, 333, 29892, 1873, 29918, 333, 1125, 13, 4706, 1404, 353, 25713, 29918, 1792, 580, 13, 13, 4706, 2933, 353, 1583, 29889, 932, 29889, 2490, 29898, 13, 9651, 11837, 877, 15916, 29899, 4299, 29899, 1761, 742, 9049, 5085, 3790, 29915, 3259, 2396, 525, 29894, 29896, 29915, 9594, 13, 9651, 9066, 3790, 13, 18884, 525, 25471, 2396, 525, 29933, 799, 261, 6571, 4286, 4830, 29898, 6638, 6066, 29889, 1454, 29918, 1792, 29898, 1792, 876, 13, 9651, 2981, 13, 9651, 8636, 29922, 3126, 29889, 29881, 17204, 3319, 13, 18884, 525, 19303, 4926, 29918, 333, 2396, 1462, 4926, 29918, 333, 29892, 13, 18884, 525, 4299, 29918, 333, 2396, 1904, 29918, 333, 29892, 13, 18884, 525, 3259, 29918, 333, 2396, 1873, 29918, 333, 29892, 13, 9651, 500, 511, 13, 9651, 2793, 29918, 1853, 2433, 6214, 29914, 3126, 742, 13, 4706, 1723, 13, 13, 4706, 1904, 353, 24352, 3195, 29889, 12650, 29889, 4102, 580, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29906, 29900, 29896, 29892, 2933, 29889, 4882, 29918, 401, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 4299, 29889, 19303, 4926, 29918, 333, 29892, 1462, 4926, 29918, 333, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 4299, 29889, 3259, 29918, 333, 29892, 1873, 29918, 333, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 4299, 29889, 4299, 29918, 333, 29892, 1904, 29918, 333, 29897, 13, 13, 13, 13, 1990, 8125, 9585, 8148, 29898, 3609, 3057, 29924, 861, 262, 29892, 4321, 8259, 1125, 13, 1678, 822, 1243, 29918, 1792, 29918, 275, 29918, 1333, 29918, 27218, 630, 22359, 5327, 29918, 275, 29918, 1454, 29890, 4215, 29898, 1311, 1125, 13, 4706, 4733, 353, 25713, 29918, 15916, 29918, 4299, 580, 13, 13, 4706, 2933, 353, 1583, 29889, 932, 29889, 657, 29898, 9794, 29889, 657, 29918, 23552, 29918, 11027, 29918, 2271, 3285, 2149, 29918, 12523, 29922, 5574, 29897, 13, 4706, 1583, 29889, 9294, 797, 29898, 5327, 29889, 4882, 29918, 401, 29892, 518, 29946, 29900, 29896, 29892, 29946, 29900, 29941, 2314, 13, 13, 13, 1678, 9995, 3462, 1438, 1423, 1250, 297, 2748, 4733, 4469, 29899, 5504, 1009, 6055, 4235, 13, 1678, 9995, 13, 1678, 822, 1243, 29918, 11027, 29918, 3126, 29918, 275, 29918, 1333, 29918, 6338, 22359, 657, 29918, 5327, 29918, 275, 29918, 29946, 29900, 29946, 29898, 1311, 1125, 13, 4706, 1404, 353, 25713, 29918, 1792, 580, 13, 4706, 4733, 353, 25713, 29918, 15916, 29918, 4299, 580, 13, 13, 4706, 2933, 353, 1583, 29889, 932, 29889, 657, 29898, 13, 9651, 4733, 29889, 657, 29918, 23552, 29918, 11027, 29918, 2271, 3285, 13, 9651, 9066, 3790, 13, 18884, 525, 25471, 2396, 525, 29933, 799, 261, 6571, 4286, 4830, 29898, 6638, 6066, 29889, 1454, 29918, 1792, 29898, 1792, 876, 13, 9651, 2981, 13, 9651, 2149, 29918, 12523, 29922, 5574, 29892, 13, 4706, 1723, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29946, 29900, 29946, 29892, 2933, 29889, 4882, 29918, 401, 29897, 13, 13, 1678, 822, 1243, 29918, 11027, 29918, 3126, 29918, 275, 29918, 1333, 29918, 6338, 22359, 8143, 29918, 5327, 29918, 275, 29918, 29946, 29900, 29946, 29898, 1311, 1125, 13, 4706, 1404, 353, 25713, 29918, 1792, 580, 13, 4706, 4733, 353, 25713, 29918, 15916, 29918, 4299, 580, 13, 13, 4706, 2933, 353, 1583, 29889, 932, 29889, 8143, 29898, 13, 9651, 4733, 29889, 657, 29918, 23552, 29918, 11027, 29918, 2271, 3285, 13, 9651, 9066, 3790, 13, 18884, 525, 25471, 2396, 525, 29933, 799, 261, 6571, 4286, 4830, 29898, 6638, 6066, 29889, 1454, 29918, 1792, 29898, 1792, 876, 13, 9651, 2981, 13, 9651, 2149, 29918, 12523, 29922, 5574, 29892, 13, 4706, 1723, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29946, 29900, 29946, 29892, 2933, 29889, 4882, 29918, 401, 29897, 13, 13, 1678, 822, 1243, 29918, 11027, 29918, 3126, 29918, 275, 29918, 1333, 29918, 3084, 22359, 5327, 29918, 275, 29918, 29946, 29900, 29900, 29898, 1311, 1125, 13, 4706, 411, 6789, 1971, 653, 9882, 580, 408, 270, 29901, 13, 9651, 411, 5712, 29918, 11027, 29898, 2303, 4571, 29909, 29918, 21289, 29922, 29881, 1125, 13, 18884, 1404, 353, 25713, 29918, 1792, 580, 13, 18884, 4733, 353, 25713, 29918, 15916, 29918, 4299, 580, 13, 18884, 4390, 29918, 1272, 353, 426, 13, 462, 1678, 376, 4299, 29918, 11027, 1115, 29912, 13, 462, 4706, 376, 3696, 29918, 842, 1115, 29912, 13, 462, 9651, 376, 978, 1115, 376, 2624, 3789, 613, 13, 462, 9651, 376, 4381, 1115, 376, 29925, 613, 13, 462, 9651, 376, 6768, 1115, 29961, 13, 462, 18884, 8853, 333, 4710, 29925, 613, 376, 14273, 1115, 376, 1184, 4427, 4695, 10758, 13, 462, 18884, 8853, 333, 4710, 29950, 613, 376, 14273, 1115, 376, 29950, 2118, 293, 9092, 13, 462, 9651, 4514, 13, 462, 308, 2981, 13, 462, 4706, 376, 3696, 29918, 15693, 26841, 29918, 333, 1115, 29912, 13, 462, 9651, 376, 978, 1115, 376, 22034, 26841, 3789, 613, 13, 462, 9651, 376, 14273, 1115, 376, 12197, 29956, 513, 16117, 26841, 9262, 613, 13, 462, 9651, 376, 4381, 1115, 29871, 29896, 29892, 13, 462, 9651, 376, 6768, 1115, 29961, 13, 462, 18884, 8853, 333, 4710, 29896, 613, 376, 14273, 1115, 376, 8208, 11814, 9092, 13, 462, 9651, 4514, 13, 462, 4706, 2981, 13, 462, 4706, 376, 20054, 29918, 16744, 1115, 518, 13, 462, 9651, 8853, 978, 1115, 376, 546, 309, 29918, 14800, 613, 376, 14273, 4710, 18146, 2984, 613, 376, 4381, 1115, 29871, 29896, 29889, 29896, 1118, 13, 462, 9651, 8853, 978, 1115, 376, 546, 309, 29918, 7610, 479, 613, 376, 14273, 4710, 18146, 2984, 613, 376, 4381, 1115, 5852, 29913, 13, 462, 4706, 21251, 13, 462, 4706, 376, 7411, 29918, 15501, 1115, 518, 13, 462, 9651, 8853, 978, 1115, 376, 7411, 29918, 29896, 613, 376, 14273, 4710, 9526, 5785, 995, 613, 376, 4381, 1115, 7700, 29892, 376, 3317, 1115, 29896, 29889, 29900, 29892, 376, 1195, 1115, 29900, 29889, 29900, 1118, 13, 462, 9651, 8853, 978, 1115, 376, 7411, 29918, 29906, 613, 376, 14273, 4710, 9526, 5785, 995, 613, 376, 4381, 1115, 29871, 29900, 29889, 29941, 29892, 376, 3317, 1115, 29896, 29889, 29900, 29892, 376, 1195, 1115, 29900, 29889, 29900, 29913, 13, 462, 4706, 4514, 13, 462, 268, 2981, 13, 462, 1678, 376, 20401, 29918, 11027, 1115, 29912, 13, 462, 4706, 376, 23765, 29918, 546, 2719, 1115, 29961, 13, 462, 965, 8853, 29875, 1115, 376, 29956, 1799, 613, 376, 14273, 1115, 376, 15771, 2431, 309, 29901, 24444, 6298, 479, 10758, 13, 462, 965, 8853, 333, 1115, 376, 29956, 9472, 613, 376, 2783, 1115, 376, 15771, 2431, 309, 29901, 21601, 936, 8045, 16513, 10758, 13, 462, 965, 8853, 333, 1115, 376, 29956, 29956, 29896, 29896, 613, 376, 14273, 1115, 376, 4782, 2431, 309, 29901, 17311, 303, 555, 411, 14280, 1190, 479, 10758, 13, 462, 965, 8853, 333, 1115, 376, 29956, 29956, 29906, 613, 376, 14273, 1115, 376, 4782, 2431, 309, 29901, 17311, 303, 555, 281, 29914, 29877, 14280, 1190, 479, 9092, 13, 462, 4706, 4514, 13, 462, 1678, 500, 13, 18884, 500, 13, 13, 18884, 2933, 353, 1583, 29889, 932, 29889, 2490, 29898, 13, 462, 1678, 4733, 29889, 657, 29918, 23552, 29918, 11027, 29918, 2271, 3285, 13, 462, 1678, 9066, 3790, 13, 462, 4706, 525, 25471, 2396, 525, 29933, 799, 261, 6571, 4286, 4830, 29898, 6638, 6066, 29889, 1454, 29918, 1792, 29898, 1792, 876, 13, 462, 1678, 2981, 13, 462, 1678, 8636, 29922, 3126, 29889, 29881, 17204, 29898, 3126, 29918, 1272, 511, 13, 462, 1678, 2793, 29918, 1853, 2433, 6214, 29914, 3126, 742, 13, 462, 1678, 2149, 29918, 12523, 29922, 5574, 29892, 13, 18884, 1723, 13, 13, 18884, 8845, 29918, 2704, 353, 29871, 426, 13, 462, 1678, 525, 4299, 29918, 11027, 2396, 6796, 2528, 3245, 4426, 526, 451, 6068, 6702, 7411, 29918, 15501, 29915, 471, 15668, 5513, 1402, 29871, 13, 462, 1678, 525, 4299, 29918, 11027, 29899, 3696, 29918, 842, 2396, 6796, 29915, 14273, 29915, 338, 263, 3734, 2875, 12436, 13, 462, 1678, 525, 4299, 29918, 11027, 29899, 3696, 29918, 15693, 26841, 29918, 333, 29899, 4381, 2396, 6796, 29896, 338, 451, 310, 1134, 525, 1807, 11838, 1402, 13, 462, 1678, 525, 4299, 29918, 11027, 29899, 20054, 29918, 16744, 29899, 29900, 29899, 4381, 2396, 6796, 29896, 29889, 29896, 338, 451, 310, 1134, 525, 20054, 11838, 1402, 13, 462, 1678, 525, 20401, 29918, 11027, 29899, 23765, 29918, 546, 2719, 29899, 29900, 2396, 6796, 2528, 3245, 4426, 526, 451, 6068, 6702, 29875, 29915, 471, 15668, 19123, 13577, 333, 29915, 338, 263, 3734, 2875, 12436, 13, 462, 1678, 525, 20401, 29918, 11027, 29899, 23765, 29918, 546, 2719, 29899, 29896, 2396, 6796, 2528, 3245, 4426, 526, 451, 6068, 6702, 2783, 29915, 471, 15668, 19123, 13577, 14273, 29915, 338, 263, 3734, 2875, 12436, 13, 462, 1678, 525, 20401, 29918, 11027, 29899, 23765, 29918, 546, 2719, 29899, 29906, 29899, 333, 2396, 6796, 29915, 29956, 29956, 29896, 29896, 29915, 338, 2086, 1472, 3108, 13, 18884, 500, 13, 13, 18884, 1583, 29889, 9294, 9843, 29898, 29946, 29900, 29900, 29892, 2933, 29889, 4882, 29918, 401, 29897, 13, 18884, 1583, 29889, 9294, 21533, 9843, 17255, 1311, 26914, 3317, 26023, 353, 6213, 13, 18884, 1583, 29889, 9294, 21533, 9843, 29898, 3126, 29889, 18132, 29898, 5327, 29889, 2587, 511, 8845, 29918, 2704, 29897, 13, 13, 13, 1678, 822, 1243, 29918, 11027, 29918, 3126, 29918, 275, 29918, 9009, 287, 22359, 3068, 29918, 915, 29918, 276, 509, 6402, 29898, 1311, 1125, 13, 4706, 411, 6789, 1971, 653, 9882, 580, 408, 270, 29901, 13, 9651, 411, 5712, 29918, 11027, 29898, 2303, 4571, 29909, 29918, 21289, 29922, 29881, 1125, 13, 18884, 1404, 353, 25713, 29918, 1792, 580, 13, 18884, 4733, 353, 25713, 29918, 15916, 29918, 4299, 580, 13, 18884, 4390, 29918, 1272, 353, 426, 13, 462, 1678, 376, 4299, 29918, 11027, 1115, 29912, 13, 462, 4706, 376, 3696, 29918, 842, 1115, 29912, 13, 462, 9651, 376, 978, 1115, 376, 2624, 3789, 613, 13, 462, 9651, 376, 14273, 1115, 376, 29923, 2121, 1019, 29890, 370, 1761, 293, 470, 17939, 613, 13, 462, 9651, 376, 4381, 1115, 376, 29925, 613, 13, 462, 9651, 376, 6768, 1115, 29961, 13, 462, 18884, 8853, 333, 4710, 29925, 613, 376, 14273, 1115, 376, 1184, 4427, 4695, 10758, 13, 462, 18884, 8853, 333, 4710, 29950, 613, 376, 14273, 1115, 376, 29950, 2118, 293, 9092, 13, 462, 9651, 4514, 13, 462, 308, 2981, 13, 462, 4706, 376, 3696, 29918, 15693, 26841, 29918, 333, 1115, 29912, 13, 462, 9651, 376, 978, 1115, 376, 22034, 26841, 3789, 613, 13, 462, 9651, 376, 14273, 1115, 376, 12197, 29956, 513, 16117, 26841, 9262, 613, 13, 462, 9651, 376, 4381, 1115, 376, 29896, 613, 13, 462, 9651, 376, 6768, 1115, 29961, 13, 462, 18884, 8853, 333, 4710, 29896, 613, 376, 14273, 1115, 376, 8208, 11814, 9092, 13, 462, 9651, 4514, 13, 462, 4706, 2981, 13, 462, 4706, 376, 20054, 29918, 16744, 1115, 518, 13, 462, 9651, 8853, 978, 1115, 376, 546, 309, 29918, 14800, 613, 376, 14273, 4710, 18146, 2984, 613, 376, 4381, 1115, 7700, 1118, 13, 462, 9651, 8853, 978, 1115, 376, 546, 309, 29918, 7610, 479, 613, 376, 14273, 4710, 18146, 2984, 613, 376, 4381, 1115, 5852, 29913, 13, 462, 4706, 21251, 13, 462, 4706, 376, 7411, 29918, 16744, 1115, 518, 13, 462, 9651, 8853, 978, 1115, 376, 7411, 29918, 29896, 613, 376, 14273, 4710, 9526, 5785, 995, 613, 376, 4381, 1115, 29871, 29900, 29889, 29945, 29892, 376, 3317, 1115, 29896, 29889, 29900, 29892, 376, 1195, 1115, 29900, 29889, 29900, 1118, 13, 462, 9651, 8853, 978, 1115, 376, 7411, 29918, 29906, 613, 376, 14273, 4710, 9526, 5785, 995, 613, 376, 4381, 1115, 29871, 29900, 29889, 29941, 29892, 376, 3317, 1115, 29896, 29889, 29900, 29892, 376, 1195, 1115, 29900, 29889, 29900, 29913, 13, 462, 4706, 4514, 13, 462, 268, 2981, 13, 462, 1678, 376, 20401, 29918, 11027, 1115, 29912, 13, 462, 4706, 376, 23765, 29918, 546, 2719, 1115, 29961, 13, 462, 965, 8853, 333, 1115, 376, 29956, 1799, 613, 376, 14273, 1115, 376, 15771, 2431, 309, 29901, 24444, 6298, 479, 10758, 13, 462, 965, 8853, 333, 1115, 376, 29956, 9472, 613, 376, 14273, 1115, 376, 15771, 2431, 309, 29901, 21601, 936, 8045, 16513, 10758, 13, 462, 965, 8853, 333, 1115, 376, 29956, 29956, 29896, 613, 376, 14273, 1115, 376, 4782, 2431, 309, 29901, 17311, 303, 555, 411, 14280, 1190, 479, 10758, 13, 462, 965, 8853, 333, 1115, 376, 29956, 29956, 29906, 613, 376, 14273, 1115, 376, 4782, 2431, 309, 29901, 17311, 303, 555, 281, 29914, 29877, 14280, 1190, 479, 9092, 13, 462, 4706, 4514, 13, 462, 1678, 500, 13, 18884, 500, 13, 13, 18884, 1583, 29889, 932, 29889, 2490, 29898, 13, 462, 1678, 4733, 29889, 657, 29918, 23552, 29918, 11027, 29918, 2271, 3285, 13, 462, 1678, 9066, 3790, 13, 462, 4706, 525, 25471, 2396, 525, 29933, 799, 261, 6571, 4286, 4830, 29898, 6638, 6066, 29889, 1454, 29918, 1792, 29898, 1792, 876, 13, 462, 1678, 2981, 13, 462, 1678, 8636, 29922, 3126, 29889, 29881, 17204, 29898, 3126, 29918, 1272, 511, 13, 462, 1678, 2793, 29918, 1853, 2433, 6214, 29914, 3126, 29915, 13, 18884, 1723, 13, 13, 18884, 2933, 353, 1583, 29889, 932, 29889, 657, 29898, 13, 462, 1678, 4733, 29889, 657, 29918, 23552, 29918, 11027, 29918, 2271, 3285, 13, 462, 1678, 9066, 3790, 13, 462, 4706, 525, 25471, 2396, 525, 29933, 799, 261, 6571, 4286, 4830, 29898, 6638, 6066, 29889, 1454, 29918, 1792, 29898, 1792, 876, 13, 462, 1678, 2981, 13, 18884, 1723, 13, 18884, 1583, 29889, 9294, 21533, 9843, 17255, 1311, 26914, 3317, 26023, 353, 6213, 13, 18884, 1583, 29889, 9294, 21533, 9843, 29898, 3126, 29889, 18132, 29898, 5327, 29889, 2587, 511, 4390, 29918, 1272, 29897, 13, 18884, 1583, 29889, 9294, 9843, 29898, 5327, 29889, 3051, 29918, 1853, 29892, 525, 6214, 29914, 3126, 1495, 13, 2 ]
mmhoidet/core/hoi/samplers/__init__.py
noobying/mmhoidet
2
177090
from .base_sampler import BaseSampler from .sampling_result import SamplingResult from .pseudo_sampler import PseudoSampler __all__ = [ 'BaseSampler', 'SamplingResult', 'PseudoSampler' ]
[ 1, 515, 869, 3188, 29918, 13445, 20069, 1053, 7399, 22966, 20069, 13, 3166, 869, 13445, 10335, 29918, 2914, 1053, 3685, 10335, 3591, 13, 3166, 869, 27358, 5333, 29918, 13445, 20069, 1053, 17646, 5333, 22966, 20069, 13, 13, 1649, 497, 1649, 353, 518, 13, 1678, 525, 5160, 22966, 20069, 742, 525, 22966, 10335, 3591, 742, 525, 29925, 344, 5333, 22966, 20069, 29915, 13, 29962, 13, 2 ]
starcheat/assets/core.py
chrmoritz/starcheat
0
151009
""" Module for reading and indexing Starbound assets """ import os import json import re import sqlite3 import logging import starbound import starbound.btreedb4 from assets.blueprints import Blueprints from assets.items import Items from assets.species import Species from assets.player import Player from assets.monsters import Monsters from assets.techs import Techs from assets.images import Images from assets.frames import Frames from assets.common import asset_category # Regular expression for comments comment_re = re.compile( '("(\\[\s\S]|[^"])*")|((^)?[^\S\n]*/(?:\*(.*?)\*/[^\S\n]*|/[^\n]*)($)?)', re.DOTALL | re.MULTILINE ) ignore_assets = re.compile(".*\.(db|ds_store|ini|psd|patch)", re.IGNORECASE) def parse_json(content, key): decoder = json.JSONDecoder(strict=False) # Looking for comments # Allows for // inside of the " " JSON data content = comment_re.sub(lambda m: m.group(1) or '', content) # Return json file return decoder.decode(content) def load_asset_file(filename): with open(filename) as f: content = ''.join(f.readlines()) return parse_json(content, filename) class Assets(): def __init__(self, db_file, starbound_folder): self.starbound_folder = starbound_folder self.mods_folder = os.path.join(self.starbound_folder, "giraffe_storage", "mods") self.db = sqlite3.connect(db_file) self.vanilla_assets = os.path.join(self.starbound_folder, "assets", "packed.pak") self.image_cache = {} def init_db(self): c = self.db.cursor() c.execute("drop table if exists assets") c.execute("""create table assets (key text, path text, type text, category text, name text, desc text)""") self.db.commit() def total_indexed(self): c = self.db.cursor() try: c.execute("select count(*) from assets") except sqlite3.OperationalError: # database may be corrupt return 0 return c.fetchone()[0] def create_index(self, asset_files=False): logging.info("Creating new assets index...") if not asset_files: asset_files = self.find_assets() blueprints = Blueprints(self) items = Items(self) species = Species(self) monsters = Monsters(self) techs = Techs(self) frames = Frames(self) new_index_query = "insert into assets values (?, ?, ?, ?, ?, ?)" c = self.db.cursor() for asset in asset_files: yield (asset[0], asset[1]) tmp_data = None if asset_category(asset[0]) != '': if asset[0].endswith(".png"): tmp_data = (asset[0], asset[1], "image", "", "", "") elif blueprints.is_blueprint(asset[0]): tmp_data = blueprints.index_data(asset) elif species.is_species(asset[0]): tmp_data = species.index_data(asset) elif items.is_item(asset[0]): tmp_data = items.index_data(asset) elif monsters.is_monster(asset[0]): tmp_data = monsters.index_data(asset) elif techs.is_tech(asset[0]): tmp_data = techs.index_data(asset) elif frames.is_frames(asset[0]): tmp_data = frames.index_data(asset) else: logging.warning("Skipping invalid asset (no file extension) %s in %s" % (asset[0], asset[1])) if tmp_data is not None: c.execute(new_index_query, tmp_data) self.db.commit() logging.info("Finished creating index") def find_assets(self): """Scan all Starbound assets and return key/file list. Includes mod files, .pak files. """ index = [] vanilla_path = os.path.join(self.starbound_folder, "assets") logging.info("Scanning vanilla assets") vanilla_assets = self.scan_asset_folder(vanilla_path) [index.append(x) for x in vanilla_assets] mods_path = self.mods_folder if not os.path.isdir(mods_path): return index for mod in os.listdir(mods_path): mod_folder = os.path.join(mods_path, mod) if os.path.isdir(mod_folder): logging.info("Scanning mod folder: " + mod) mod_assets = self.scan_asset_folder(mod_folder) [index.append(x) for x in mod_assets] elif mod_folder.endswith(".modpak"): logging.info("Scanning modpak: " + mod) mod_assets = self.scan_modpak(mod_folder) [index.append(x) for x in mod_assets] return index def scan_modpak(self, modpak): # TODO: may need support for reading the mod folder from the pakinfo file db = starbound.open_file(modpak) index = [(x, modpak) for x in db.get_index()] return index def scan_asset_folder(self, folder): pak_path = os.path.join(folder, "packed.pak") if os.path.isfile(pak_path): db = starbound.open_file(pak_path) index = [(x, pak_path) for x in db.get_index()] return index else: # old style, probably a mod index = [] mod_assets = None files = os.listdir(folder) # TODO: will need more logic to handle .modpack with modinfo inside. found_mod_info = False for f in files: if f.endswith(".modinfo"): modinfo = os.path.join(folder, f) try: modinfo_data = load_asset_file(modinfo) path = "./" if "path" in modinfo_data.keys(): path = modinfo_data["path"] mod_assets = os.path.join(folder, path) found_mod_info = True except ValueError: # really old mods folder = os.path.join(folder, "assets") if os.path.isdir(folder): mod_assets = folder if mod_assets is None: return index elif found_mod_info and self.is_packed_file(mod_assets): # TODO: make a .pak scanner function that works for vanilla and mods pak_path = os.path.normpath(mod_assets) db = starbound.open_file(pak_path) for x in db.get_index(): # removes thumbs.db etc from user pak files if re.match(ignore_assets, x) is None: index.append((x, pak_path)) return index elif not os.path.isdir(mod_assets): return index # now we can scan! for root, dirs, files in os.walk(mod_assets): for f in files: if re.match(ignore_assets, f) is None: asset_folder = os.path.normpath(mod_assets) asset_file = os.path.normpath(os.path.join(root.replace(folder, ""), f)) index.append((asset_file, asset_folder)) return index def is_packed_file(self, path): """ Returns true if the asset path is a file (will be assuming from the index that it is a packed type) Returns false if the asset path is a folder (legacy/non-packed mods) """ return os.path.isfile(path) def read(self, key, path, image=False): if self.is_packed_file(path): key = key.lower() db = starbound.open_file(path) # try the cache first if image and key in self.image_cache: return self.image_cache[key] try: data = db.get(key) except KeyError: if image and path != self.vanilla_assets: img = self.read(key, self.vanilla_assets, image) self.image_cache[key] = img return img else: logging.exception("Unable to read db asset '%s' from '%s'" % (key, path)) return None if image: img = data self.image_cache[key] = img return img else: try: asset = parse_json(data.decode("utf-8"), key) return asset except ValueError: logging.exception("Unable to read db asset '%s' from '%s'" % (key, path)) return None else: asset_file = os.path.join(path, key[1:]) try: if image: img = open(asset_file, "rb").read() self.image_cache[key] = img return img else: asset = load_asset_file(asset_file) return asset except (FileNotFoundError, ValueError): if image and path != self.vanilla_assets: if self.is_packed_file(self.vanilla_assets): img = self.read(key.replace("\\", "/"), self.vanilla_assets, image) self.image_cache[key] = img return img else: img = self.read(key, self.vanilla_assets, image) self.image_cache[key] = img return img else: logging.exception("Unable to read asset file '%s' from '%s'" % (key, path)) return None def blueprints(self): return Blueprints(self) def items(self): return Items(self) def species(self): return Species(self) def player(self): return Player(self) def monsters(self): return Monsters(self) def techs(self): return Techs(self) def images(self): return Images(self) def frames(self): return Frames(self) def get_all(self, asset_type): c = self.assets.db.cursor() c.execute("select * from assets where type = ? order by name collate nocase", (asset_type,)) return c.fetchall() def get_categories(self, asset_type): c = self.assets.db.cursor() c.execute("select distinct category from assets where type = ? order by category", (asset_type,)) return [x[0] for x in c.fetchall()] def filter(self, asset_type, category, name): if category == "<all>": category = "%" name = "%" + name + "%" c = self.db.cursor() q = """select * from assets where type = ? and category like ? and (name like ? or desc like ?) order by desc, name collate nocase""" c.execute(q, (asset_type, category, name, name)) result = c.fetchall() return result def get_total(self, asset_type): c = self.assets.db.cursor() c.execute("select count(*) from assets where type = ?", (asset_type)) return c.fetchone()[0] def missing_icon(self): return self.read("/interface/inventory/x.png", self.vanilla_assets, image=True) def get_mods(self): """Return a list of all unique mod paths.""" c = self.db.cursor() c.execute("select distinct path from assets order by category") all_assets = [x[0].replace(self.starbound_folder, "") for x in c.fetchall()] return [x for x in all_assets if not x.endswith("packed.pak")] if __name__ == "__main__": logging.basicConfig(level=logging.DEBUG) assets = Assets("assets.db", "/opt/starbound") assets.init_db() logging.info("Started indexing...") count = 0 for i in assets.create_index(): count += 1 print(count) logging.info("Finished!")
[ 1, 9995, 13, 7355, 363, 5183, 322, 26190, 7828, 9917, 21608, 13, 15945, 29908, 13, 13, 5215, 2897, 13, 5215, 4390, 13, 5215, 337, 13, 5215, 21120, 29941, 13, 5215, 12183, 13, 13, 5215, 5810, 9917, 13, 5215, 5810, 9917, 29889, 29890, 2484, 287, 29890, 29946, 13, 13, 3166, 21608, 29889, 9539, 2158, 29879, 1053, 10924, 2158, 29879, 13, 3166, 21608, 29889, 7076, 1053, 25085, 13, 3166, 21608, 29889, 24091, 1053, 21807, 13, 3166, 21608, 29889, 9106, 1053, 14574, 13, 3166, 21608, 29889, 3712, 23080, 1053, 2598, 23080, 13, 3166, 21608, 29889, 11345, 29879, 1053, 1920, 12168, 13, 3166, 21608, 29889, 8346, 1053, 1954, 1179, 13, 3166, 21608, 29889, 19935, 1053, 4693, 1280, 13, 3166, 21608, 29889, 9435, 1053, 24342, 29918, 7320, 13, 13, 13, 29937, 2169, 1070, 4603, 363, 6589, 13, 9342, 29918, 276, 353, 337, 29889, 12198, 29898, 13, 1678, 525, 703, 1194, 29905, 7110, 29879, 29905, 29903, 29962, 29989, 22896, 20068, 29930, 1159, 29989, 3552, 29985, 6877, 29961, 3823, 29903, 29905, 29876, 29962, 3877, 10780, 3583, 16395, 5575, 29973, 2144, 3877, 29961, 3823, 29903, 29905, 29876, 14178, 29989, 29914, 29961, 3823, 29876, 29962, 7528, 1566, 6877, 29897, 742, 13, 1678, 337, 29889, 29928, 2891, 9818, 891, 337, 29889, 29924, 8647, 6227, 8895, 13, 29897, 13, 13, 17281, 29918, 16596, 353, 337, 29889, 12198, 703, 5575, 29905, 14030, 2585, 29989, 6289, 29918, 8899, 29989, 2172, 29989, 567, 29881, 29989, 5041, 19123, 337, 29889, 6259, 6632, 1525, 23487, 29897, 13, 13, 13, 1753, 6088, 29918, 3126, 29898, 3051, 29892, 1820, 1125, 13, 1678, 1602, 6119, 353, 4390, 29889, 7249, 6185, 6119, 29898, 710, 919, 29922, 8824, 29897, 13, 1678, 396, 21223, 363, 6589, 13, 1678, 396, 2178, 1242, 363, 849, 2768, 310, 278, 376, 376, 4663, 848, 13, 1678, 2793, 353, 3440, 29918, 276, 29889, 1491, 29898, 2892, 286, 29901, 286, 29889, 2972, 29898, 29896, 29897, 470, 15516, 2793, 29897, 13, 13, 1678, 396, 7106, 4390, 934, 13, 1678, 736, 1602, 6119, 29889, 13808, 29898, 3051, 29897, 13, 13, 13, 1753, 2254, 29918, 24129, 29918, 1445, 29898, 9507, 1125, 13, 1678, 411, 1722, 29898, 9507, 29897, 408, 285, 29901, 13, 4706, 2793, 353, 525, 4286, 7122, 29898, 29888, 29889, 949, 9012, 3101, 13, 4706, 736, 6088, 29918, 3126, 29898, 3051, 29892, 10422, 29897, 13, 13, 13, 1990, 1094, 7224, 7295, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 4833, 29918, 1445, 29892, 5810, 9917, 29918, 12083, 1125, 13, 4706, 1583, 29889, 8508, 9917, 29918, 12083, 353, 5810, 9917, 29918, 12083, 13, 4706, 1583, 29889, 1545, 29879, 29918, 12083, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 8508, 9917, 29918, 12083, 29892, 376, 29887, 3055, 17615, 29918, 12925, 613, 376, 1545, 29879, 1159, 13, 4706, 1583, 29889, 2585, 353, 21120, 29941, 29889, 6915, 29898, 2585, 29918, 1445, 29897, 13, 4706, 1583, 29889, 3703, 2911, 29918, 16596, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 8508, 9917, 29918, 12083, 29892, 376, 16596, 613, 376, 4058, 287, 29889, 29886, 557, 1159, 13, 4706, 1583, 29889, 3027, 29918, 8173, 353, 6571, 13, 13, 1678, 822, 2069, 29918, 2585, 29898, 1311, 1125, 13, 4706, 274, 353, 1583, 29889, 2585, 29889, 18127, 580, 13, 4706, 274, 29889, 7978, 703, 8865, 1591, 565, 4864, 21608, 1159, 13, 4706, 274, 29889, 7978, 703, 15945, 3258, 1591, 21608, 13, 4706, 313, 1989, 1426, 29892, 2224, 1426, 29892, 1134, 1426, 29892, 7663, 1426, 29892, 1024, 1426, 29892, 5153, 1426, 5513, 29908, 1159, 13, 4706, 1583, 29889, 2585, 29889, 15060, 580, 13, 13, 1678, 822, 3001, 29918, 2248, 287, 29898, 1311, 1125, 13, 4706, 274, 353, 1583, 29889, 2585, 29889, 18127, 580, 13, 4706, 1018, 29901, 13, 9651, 274, 29889, 7978, 703, 2622, 2302, 22798, 515, 21608, 1159, 13, 4706, 5174, 21120, 29941, 29889, 7094, 1288, 2392, 29901, 13, 9651, 396, 2566, 1122, 367, 1034, 6685, 13, 9651, 736, 29871, 29900, 13, 4706, 736, 274, 29889, 9155, 650, 580, 29961, 29900, 29962, 13, 13, 1678, 822, 1653, 29918, 2248, 29898, 1311, 29892, 24342, 29918, 5325, 29922, 8824, 1125, 13, 4706, 12183, 29889, 3888, 703, 9832, 1218, 716, 21608, 2380, 856, 1159, 13, 4706, 565, 451, 24342, 29918, 5325, 29901, 13, 9651, 24342, 29918, 5325, 353, 1583, 29889, 2886, 29918, 16596, 580, 13, 13, 4706, 7254, 2158, 29879, 353, 10924, 2158, 29879, 29898, 1311, 29897, 13, 4706, 4452, 353, 25085, 29898, 1311, 29897, 13, 4706, 6606, 353, 21807, 29898, 1311, 29897, 13, 4706, 1601, 23080, 353, 2598, 23080, 29898, 1311, 29897, 13, 4706, 734, 12168, 353, 1920, 12168, 29898, 1311, 29897, 13, 4706, 16608, 353, 4693, 1280, 29898, 1311, 29897, 13, 13, 4706, 716, 29918, 2248, 29918, 1972, 353, 376, 7851, 964, 21608, 1819, 313, 14579, 1577, 29892, 1577, 29892, 1577, 29892, 1577, 29892, 1577, 5513, 13, 4706, 274, 353, 1583, 29889, 2585, 29889, 18127, 580, 13, 13, 4706, 363, 24342, 297, 24342, 29918, 5325, 29901, 13, 9651, 7709, 313, 24129, 29961, 29900, 1402, 24342, 29961, 29896, 2314, 13, 13, 9651, 13128, 29918, 1272, 353, 6213, 13, 13, 9651, 565, 24342, 29918, 7320, 29898, 24129, 29961, 29900, 2314, 2804, 525, 2396, 13, 18884, 565, 24342, 29961, 29900, 1822, 1975, 2541, 17350, 2732, 29908, 1125, 13, 462, 1678, 13128, 29918, 1272, 353, 313, 24129, 29961, 29900, 1402, 24342, 29961, 29896, 1402, 376, 3027, 613, 12633, 12633, 20569, 13, 18884, 25342, 7254, 2158, 29879, 29889, 275, 29918, 9539, 2158, 29898, 24129, 29961, 29900, 29962, 1125, 13, 462, 1678, 13128, 29918, 1272, 353, 7254, 2158, 29879, 29889, 2248, 29918, 1272, 29898, 24129, 29897, 13, 18884, 25342, 6606, 29889, 275, 29918, 24091, 29898, 24129, 29961, 29900, 29962, 1125, 13, 462, 1678, 13128, 29918, 1272, 353, 6606, 29889, 2248, 29918, 1272, 29898, 24129, 29897, 13, 18884, 25342, 4452, 29889, 275, 29918, 667, 29898, 24129, 29961, 29900, 29962, 1125, 13, 462, 1678, 13128, 29918, 1272, 353, 4452, 29889, 2248, 29918, 1272, 29898, 24129, 29897, 13, 18884, 25342, 1601, 23080, 29889, 275, 29918, 3712, 2475, 29898, 24129, 29961, 29900, 29962, 1125, 13, 462, 1678, 13128, 29918, 1272, 353, 1601, 23080, 29889, 2248, 29918, 1272, 29898, 24129, 29897, 13, 18884, 25342, 734, 12168, 29889, 275, 29918, 11345, 29898, 24129, 29961, 29900, 29962, 1125, 13, 462, 1678, 13128, 29918, 1272, 353, 734, 12168, 29889, 2248, 29918, 1272, 29898, 24129, 29897, 13, 18884, 25342, 16608, 29889, 275, 29918, 19935, 29898, 24129, 29961, 29900, 29962, 1125, 13, 462, 1678, 13128, 29918, 1272, 353, 16608, 29889, 2248, 29918, 1272, 29898, 24129, 29897, 13, 9651, 1683, 29901, 13, 18884, 12183, 29889, 27392, 703, 29903, 1984, 3262, 8340, 24342, 313, 1217, 934, 6081, 29897, 1273, 29879, 297, 1273, 29879, 29908, 1273, 313, 24129, 29961, 29900, 1402, 24342, 29961, 29896, 12622, 13, 13, 9651, 565, 13128, 29918, 1272, 338, 451, 6213, 29901, 13, 18884, 274, 29889, 7978, 29898, 1482, 29918, 2248, 29918, 1972, 29892, 13128, 29918, 1272, 29897, 13, 13, 4706, 1583, 29889, 2585, 29889, 15060, 580, 13, 4706, 12183, 29889, 3888, 703, 12881, 3276, 4969, 2380, 1159, 13, 13, 1678, 822, 1284, 29918, 16596, 29898, 1311, 1125, 13, 4706, 9995, 29083, 599, 7828, 9917, 21608, 322, 736, 1820, 29914, 1445, 1051, 29889, 13, 13, 4706, 512, 27722, 878, 2066, 29892, 869, 29886, 557, 2066, 29889, 13, 13, 4706, 9995, 13, 4706, 2380, 353, 5159, 13, 4706, 1109, 2911, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 8508, 9917, 29918, 12083, 29892, 376, 16596, 1159, 13, 4706, 12183, 29889, 3888, 703, 4421, 9450, 1109, 2911, 21608, 1159, 13, 4706, 1109, 2911, 29918, 16596, 353, 1583, 29889, 16192, 29918, 24129, 29918, 12083, 29898, 3703, 2911, 29918, 2084, 29897, 13, 4706, 518, 2248, 29889, 4397, 29898, 29916, 29897, 363, 921, 297, 1109, 2911, 29918, 16596, 29962, 13, 13, 4706, 878, 29879, 29918, 2084, 353, 1583, 29889, 1545, 29879, 29918, 12083, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 275, 3972, 29898, 1545, 29879, 29918, 2084, 1125, 13, 9651, 736, 2380, 13, 13, 4706, 363, 878, 297, 2897, 29889, 1761, 3972, 29898, 1545, 29879, 29918, 2084, 1125, 13, 9651, 878, 29918, 12083, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1545, 29879, 29918, 2084, 29892, 878, 29897, 13, 9651, 565, 2897, 29889, 2084, 29889, 275, 3972, 29898, 1545, 29918, 12083, 1125, 13, 18884, 12183, 29889, 3888, 703, 4421, 9450, 878, 4138, 29901, 376, 718, 878, 29897, 13, 18884, 878, 29918, 16596, 353, 1583, 29889, 16192, 29918, 24129, 29918, 12083, 29898, 1545, 29918, 12083, 29897, 13, 18884, 518, 2248, 29889, 4397, 29898, 29916, 29897, 363, 921, 297, 878, 29918, 16596, 29962, 13, 9651, 25342, 878, 29918, 12083, 29889, 1975, 2541, 17350, 1545, 29886, 557, 29908, 1125, 13, 18884, 12183, 29889, 3888, 703, 4421, 9450, 878, 29886, 557, 29901, 376, 718, 878, 29897, 13, 18884, 878, 29918, 16596, 353, 1583, 29889, 16192, 29918, 1545, 29886, 557, 29898, 1545, 29918, 12083, 29897, 13, 18884, 518, 2248, 29889, 4397, 29898, 29916, 29897, 363, 921, 297, 878, 29918, 16596, 29962, 13, 4706, 736, 2380, 13, 13, 1678, 822, 12812, 29918, 1545, 29886, 557, 29898, 1311, 29892, 878, 29886, 557, 1125, 13, 4706, 396, 14402, 29901, 1122, 817, 2304, 363, 5183, 278, 878, 4138, 515, 278, 27068, 3888, 934, 13, 4706, 4833, 353, 5810, 9917, 29889, 3150, 29918, 1445, 29898, 1545, 29886, 557, 29897, 13, 4706, 2380, 353, 17288, 29916, 29892, 878, 29886, 557, 29897, 363, 921, 297, 4833, 29889, 657, 29918, 2248, 580, 29962, 13, 4706, 736, 2380, 13, 13, 1678, 822, 12812, 29918, 24129, 29918, 12083, 29898, 1311, 29892, 4138, 1125, 13, 4706, 27068, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 12083, 29892, 376, 4058, 287, 29889, 29886, 557, 1159, 13, 13, 4706, 565, 2897, 29889, 2084, 29889, 275, 1445, 29898, 29886, 557, 29918, 2084, 1125, 13, 9651, 4833, 353, 5810, 9917, 29889, 3150, 29918, 1445, 29898, 29886, 557, 29918, 2084, 29897, 13, 9651, 2380, 353, 17288, 29916, 29892, 27068, 29918, 2084, 29897, 363, 921, 297, 4833, 29889, 657, 29918, 2248, 580, 29962, 13, 9651, 736, 2380, 13, 4706, 1683, 29901, 13, 9651, 396, 2030, 3114, 29892, 3117, 263, 878, 13, 9651, 2380, 353, 5159, 13, 9651, 878, 29918, 16596, 353, 6213, 13, 9651, 2066, 353, 2897, 29889, 1761, 3972, 29898, 12083, 29897, 13, 13, 9651, 396, 14402, 29901, 674, 817, 901, 5900, 304, 4386, 869, 1545, 4058, 411, 878, 3888, 2768, 29889, 13, 9651, 1476, 29918, 1545, 29918, 3888, 353, 7700, 13, 13, 9651, 363, 285, 297, 2066, 29901, 13, 18884, 565, 285, 29889, 1975, 2541, 17350, 1545, 3888, 29908, 1125, 13, 462, 1678, 878, 3888, 353, 2897, 29889, 2084, 29889, 7122, 29898, 12083, 29892, 285, 29897, 13, 462, 1678, 1018, 29901, 13, 462, 4706, 878, 3888, 29918, 1272, 353, 2254, 29918, 24129, 29918, 1445, 29898, 1545, 3888, 29897, 13, 462, 4706, 2224, 353, 376, 6904, 29908, 13, 462, 4706, 565, 376, 2084, 29908, 297, 878, 3888, 29918, 1272, 29889, 8149, 7295, 13, 462, 9651, 2224, 353, 878, 3888, 29918, 1272, 3366, 2084, 3108, 13, 462, 4706, 878, 29918, 16596, 353, 2897, 29889, 2084, 29889, 7122, 29898, 12083, 29892, 2224, 29897, 13, 462, 4706, 1476, 29918, 1545, 29918, 3888, 353, 5852, 13, 462, 1678, 5174, 7865, 2392, 29901, 13, 462, 4706, 396, 2289, 2030, 878, 29879, 13, 462, 4706, 4138, 353, 2897, 29889, 2084, 29889, 7122, 29898, 12083, 29892, 376, 16596, 1159, 13, 462, 4706, 565, 2897, 29889, 2084, 29889, 275, 3972, 29898, 12083, 1125, 13, 462, 9651, 878, 29918, 16596, 353, 4138, 13, 13, 9651, 565, 878, 29918, 16596, 338, 6213, 29901, 13, 18884, 736, 2380, 13, 9651, 25342, 1476, 29918, 1545, 29918, 3888, 322, 1583, 29889, 275, 29918, 4058, 287, 29918, 1445, 29898, 1545, 29918, 16596, 1125, 13, 18884, 396, 14402, 29901, 1207, 263, 869, 29886, 557, 885, 7310, 740, 393, 1736, 363, 1109, 2911, 322, 878, 29879, 13, 18884, 27068, 29918, 2084, 353, 2897, 29889, 2084, 29889, 12324, 2084, 29898, 1545, 29918, 16596, 29897, 13, 18884, 4833, 353, 5810, 9917, 29889, 3150, 29918, 1445, 29898, 29886, 557, 29918, 2084, 29897, 13, 18884, 363, 921, 297, 4833, 29889, 657, 29918, 2248, 7295, 13, 462, 1678, 396, 25388, 28968, 29879, 29889, 2585, 2992, 515, 1404, 27068, 2066, 13, 462, 1678, 565, 337, 29889, 4352, 29898, 17281, 29918, 16596, 29892, 921, 29897, 338, 6213, 29901, 13, 462, 4706, 2380, 29889, 4397, 3552, 29916, 29892, 27068, 29918, 2084, 876, 13, 18884, 736, 2380, 13, 9651, 25342, 451, 2897, 29889, 2084, 29889, 275, 3972, 29898, 1545, 29918, 16596, 1125, 13, 18884, 736, 2380, 13, 13, 9651, 396, 1286, 591, 508, 12812, 29991, 13, 9651, 363, 3876, 29892, 4516, 29879, 29892, 2066, 297, 2897, 29889, 20919, 29898, 1545, 29918, 16596, 1125, 13, 18884, 363, 285, 297, 2066, 29901, 13, 462, 1678, 565, 337, 29889, 4352, 29898, 17281, 29918, 16596, 29892, 285, 29897, 338, 6213, 29901, 13, 462, 4706, 24342, 29918, 12083, 353, 2897, 29889, 2084, 29889, 12324, 2084, 29898, 1545, 29918, 16596, 29897, 13, 462, 4706, 24342, 29918, 1445, 353, 2897, 29889, 2084, 29889, 12324, 2084, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4632, 29889, 6506, 29898, 12083, 29892, 376, 4968, 285, 876, 13, 462, 4706, 2380, 29889, 4397, 3552, 24129, 29918, 1445, 29892, 24342, 29918, 12083, 876, 13, 9651, 736, 2380, 13, 13, 1678, 822, 338, 29918, 4058, 287, 29918, 1445, 29898, 1311, 29892, 2224, 1125, 13, 4706, 9995, 13, 9651, 16969, 1565, 565, 278, 24342, 2224, 338, 263, 934, 313, 14043, 367, 10241, 515, 278, 2380, 393, 372, 338, 263, 4870, 287, 1134, 29897, 13, 9651, 16969, 2089, 565, 278, 24342, 2224, 338, 263, 4138, 313, 1397, 4135, 29914, 5464, 29899, 4058, 287, 878, 29879, 29897, 13, 4706, 9995, 13, 4706, 736, 2897, 29889, 2084, 29889, 275, 1445, 29898, 2084, 29897, 13, 13, 1678, 822, 1303, 29898, 1311, 29892, 1820, 29892, 2224, 29892, 1967, 29922, 8824, 1125, 13, 4706, 565, 1583, 29889, 275, 29918, 4058, 287, 29918, 1445, 29898, 2084, 1125, 13, 9651, 1820, 353, 1820, 29889, 13609, 580, 13, 9651, 4833, 353, 5810, 9917, 29889, 3150, 29918, 1445, 29898, 2084, 29897, 13, 13, 9651, 396, 1018, 278, 7090, 937, 13, 9651, 565, 1967, 322, 1820, 297, 1583, 29889, 3027, 29918, 8173, 29901, 13, 18884, 736, 1583, 29889, 3027, 29918, 8173, 29961, 1989, 29962, 13, 13, 9651, 1018, 29901, 13, 18884, 848, 353, 4833, 29889, 657, 29898, 1989, 29897, 13, 9651, 5174, 7670, 2392, 29901, 13, 18884, 565, 1967, 322, 2224, 2804, 1583, 29889, 3703, 2911, 29918, 16596, 29901, 13, 462, 1678, 10153, 353, 1583, 29889, 949, 29898, 1989, 29892, 1583, 29889, 3703, 2911, 29918, 16596, 29892, 1967, 29897, 13, 462, 1678, 1583, 29889, 3027, 29918, 8173, 29961, 1989, 29962, 353, 10153, 13, 462, 1678, 736, 10153, 13, 18884, 1683, 29901, 13, 462, 1678, 12183, 29889, 11739, 703, 2525, 519, 304, 1303, 4833, 24342, 14210, 29879, 29915, 515, 14210, 29879, 11838, 1273, 313, 1989, 29892, 2224, 876, 13, 462, 1678, 736, 6213, 13, 9651, 565, 1967, 29901, 13, 18884, 10153, 353, 848, 13, 18884, 1583, 29889, 3027, 29918, 8173, 29961, 1989, 29962, 353, 10153, 13, 18884, 736, 10153, 13, 9651, 1683, 29901, 13, 18884, 1018, 29901, 13, 462, 1678, 24342, 353, 6088, 29918, 3126, 29898, 1272, 29889, 13808, 703, 9420, 29899, 29947, 4968, 1820, 29897, 13, 462, 1678, 736, 24342, 13, 18884, 5174, 7865, 2392, 29901, 13, 462, 1678, 12183, 29889, 11739, 703, 2525, 519, 304, 1303, 4833, 24342, 14210, 29879, 29915, 515, 14210, 29879, 11838, 1273, 313, 1989, 29892, 2224, 876, 13, 462, 1678, 736, 6213, 13, 4706, 1683, 29901, 13, 9651, 24342, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 29898, 2084, 29892, 1820, 29961, 29896, 29901, 2314, 13, 9651, 1018, 29901, 13, 18884, 565, 1967, 29901, 13, 462, 1678, 10153, 353, 1722, 29898, 24129, 29918, 1445, 29892, 376, 6050, 2564, 949, 580, 13, 462, 1678, 1583, 29889, 3027, 29918, 8173, 29961, 1989, 29962, 353, 10153, 13, 462, 1678, 736, 10153, 13, 18884, 1683, 29901, 13, 462, 1678, 24342, 353, 2254, 29918, 24129, 29918, 1445, 29898, 24129, 29918, 1445, 29897, 13, 462, 1678, 736, 24342, 13, 9651, 5174, 313, 2283, 17413, 2392, 29892, 7865, 2392, 1125, 13, 18884, 565, 1967, 322, 2224, 2804, 1583, 29889, 3703, 2911, 29918, 16596, 29901, 13, 462, 1678, 565, 1583, 29889, 275, 29918, 4058, 287, 29918, 1445, 29898, 1311, 29889, 3703, 2911, 29918, 16596, 1125, 13, 462, 4706, 10153, 353, 1583, 29889, 949, 29898, 1989, 29889, 6506, 703, 1966, 613, 5591, 4968, 1583, 29889, 3703, 2911, 29918, 16596, 29892, 1967, 29897, 13, 462, 4706, 1583, 29889, 3027, 29918, 8173, 29961, 1989, 29962, 353, 10153, 13, 462, 4706, 736, 10153, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 10153, 353, 1583, 29889, 949, 29898, 1989, 29892, 1583, 29889, 3703, 2911, 29918, 16596, 29892, 1967, 29897, 13, 462, 4706, 1583, 29889, 3027, 29918, 8173, 29961, 1989, 29962, 353, 10153, 13, 462, 4706, 736, 10153, 13, 18884, 1683, 29901, 13, 462, 1678, 12183, 29889, 11739, 703, 2525, 519, 304, 1303, 24342, 934, 14210, 29879, 29915, 515, 14210, 29879, 11838, 1273, 313, 1989, 29892, 2224, 876, 13, 462, 1678, 736, 6213, 13, 13, 1678, 822, 7254, 2158, 29879, 29898, 1311, 1125, 13, 4706, 736, 10924, 2158, 29879, 29898, 1311, 29897, 13, 13, 1678, 822, 4452, 29898, 1311, 1125, 13, 4706, 736, 25085, 29898, 1311, 29897, 13, 13, 1678, 822, 6606, 29898, 1311, 1125, 13, 4706, 736, 21807, 29898, 1311, 29897, 13, 13, 1678, 822, 4847, 29898, 1311, 1125, 13, 4706, 736, 14574, 29898, 1311, 29897, 13, 13, 1678, 822, 1601, 23080, 29898, 1311, 1125, 13, 4706, 736, 2598, 23080, 29898, 1311, 29897, 13, 13, 1678, 822, 734, 12168, 29898, 1311, 1125, 13, 4706, 736, 1920, 12168, 29898, 1311, 29897, 13, 13, 1678, 822, 4558, 29898, 1311, 1125, 13, 4706, 736, 1954, 1179, 29898, 1311, 29897, 13, 13, 1678, 822, 16608, 29898, 1311, 1125, 13, 4706, 736, 4693, 1280, 29898, 1311, 29897, 13, 13, 1678, 822, 679, 29918, 497, 29898, 1311, 29892, 24342, 29918, 1853, 1125, 13, 4706, 274, 353, 1583, 29889, 16596, 29889, 2585, 29889, 18127, 580, 13, 4706, 274, 29889, 7978, 703, 2622, 334, 515, 21608, 988, 1134, 353, 1577, 1797, 491, 1024, 5321, 403, 302, 542, 559, 613, 313, 24129, 29918, 1853, 29892, 876, 13, 4706, 736, 274, 29889, 9155, 497, 580, 13, 13, 1678, 822, 679, 29918, 20683, 29898, 1311, 29892, 24342, 29918, 1853, 1125, 13, 4706, 274, 353, 1583, 29889, 16596, 29889, 2585, 29889, 18127, 580, 13, 4706, 274, 29889, 7978, 703, 2622, 8359, 7663, 515, 21608, 988, 1134, 353, 1577, 1797, 491, 7663, 613, 313, 24129, 29918, 1853, 29892, 876, 13, 4706, 736, 518, 29916, 29961, 29900, 29962, 363, 921, 297, 274, 29889, 9155, 497, 580, 29962, 13, 13, 1678, 822, 4175, 29898, 1311, 29892, 24342, 29918, 1853, 29892, 7663, 29892, 1024, 1125, 13, 4706, 565, 7663, 1275, 9872, 497, 29958, 1115, 13, 9651, 7663, 353, 11860, 29908, 13, 4706, 1024, 353, 11860, 29908, 718, 1024, 718, 11860, 29908, 13, 4706, 274, 353, 1583, 29889, 2585, 29889, 18127, 580, 13, 4706, 3855, 353, 9995, 2622, 334, 515, 21608, 988, 1134, 353, 1577, 322, 7663, 763, 1577, 13, 4706, 322, 313, 978, 763, 1577, 470, 5153, 763, 1577, 29897, 1797, 491, 5153, 29892, 1024, 5321, 403, 302, 542, 559, 15945, 29908, 13, 4706, 274, 29889, 7978, 29898, 29939, 29892, 313, 24129, 29918, 1853, 29892, 7663, 29892, 1024, 29892, 1024, 876, 13, 4706, 1121, 353, 274, 29889, 9155, 497, 580, 13, 4706, 736, 1121, 13, 13, 1678, 822, 679, 29918, 7827, 29898, 1311, 29892, 24342, 29918, 1853, 1125, 13, 4706, 274, 353, 1583, 29889, 16596, 29889, 2585, 29889, 18127, 580, 13, 4706, 274, 29889, 7978, 703, 2622, 2302, 22798, 515, 21608, 988, 1134, 353, 1577, 613, 313, 24129, 29918, 1853, 876, 13, 4706, 736, 274, 29889, 9155, 650, 580, 29961, 29900, 29962, 13, 13, 1678, 822, 4567, 29918, 4144, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 949, 11974, 13248, 29914, 262, 23886, 29914, 29916, 29889, 2732, 613, 1583, 29889, 3703, 2911, 29918, 16596, 29892, 1967, 29922, 5574, 29897, 13, 13, 1678, 822, 679, 29918, 1545, 29879, 29898, 1311, 1125, 13, 4706, 9995, 11609, 263, 1051, 310, 599, 5412, 878, 10898, 1213, 15945, 13, 4706, 274, 353, 1583, 29889, 2585, 29889, 18127, 580, 13, 4706, 274, 29889, 7978, 703, 2622, 8359, 2224, 515, 21608, 1797, 491, 7663, 1159, 13, 4706, 599, 29918, 16596, 353, 518, 29916, 29961, 29900, 1822, 6506, 29898, 1311, 29889, 8508, 9917, 29918, 12083, 29892, 20569, 363, 921, 297, 274, 29889, 9155, 497, 580, 29962, 13, 4706, 736, 518, 29916, 363, 921, 297, 599, 29918, 16596, 565, 451, 921, 29889, 1975, 2541, 703, 4058, 287, 29889, 29886, 557, 13531, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 12183, 29889, 16121, 3991, 29898, 5563, 29922, 21027, 29889, 18525, 29897, 13, 1678, 21608, 353, 1094, 7224, 703, 16596, 29889, 2585, 613, 5591, 3670, 29914, 8508, 9917, 1159, 13, 1678, 21608, 29889, 2344, 29918, 2585, 580, 13, 1678, 12183, 29889, 3888, 703, 4763, 287, 26190, 856, 1159, 13, 1678, 2302, 353, 29871, 29900, 13, 1678, 363, 474, 297, 21608, 29889, 3258, 29918, 2248, 7295, 13, 4706, 2302, 4619, 29871, 29896, 13, 1678, 1596, 29898, 2798, 29897, 13, 1678, 12183, 29889, 3888, 703, 12881, 3276, 29991, 1159, 13, 2 ]
test.py
lipengyuan1994/Tensorflow-Developer
5
133166
<gh_stars>1-10 import tensorflow as tf print(tf.__version__)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 26110, 408, 15886, 13, 13, 2158, 29898, 13264, 17255, 3259, 1649, 29897, 13, 13, 13, 13, 2 ]
linux/functions_youtube_linux/check_version.py
Frxhb/youtubedl_script
0
117836
import os class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKCYAN = '\033[96m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' def check_ver_func(): test = os.popen('youtube-dl --version').read() print(" Your youtube-dl version is:\n" + bcolors.OKGREEN + " " + test + bcolors.ENDC)
[ 1, 1053, 2897, 13, 13, 1990, 289, 27703, 29901, 13, 1678, 17714, 3035, 1001, 353, 11297, 29900, 29941, 29941, 29961, 29929, 29945, 29885, 29915, 13, 1678, 9280, 13367, 4462, 353, 11297, 29900, 29941, 29941, 29961, 29929, 29946, 29885, 29915, 13, 1678, 9280, 29907, 29979, 2190, 353, 11297, 29900, 29941, 29941, 29961, 29929, 29953, 29885, 29915, 13, 1678, 9280, 29954, 1525, 1430, 353, 11297, 29900, 29941, 29941, 29961, 29929, 29906, 29885, 29915, 13, 1678, 399, 25614, 353, 11297, 29900, 29941, 29941, 29961, 29929, 29941, 29885, 29915, 13, 1678, 13515, 6227, 353, 11297, 29900, 29941, 29941, 29961, 29929, 29896, 29885, 29915, 13, 1678, 11056, 29907, 353, 11297, 29900, 29941, 29941, 29961, 29900, 29885, 29915, 13, 1678, 350, 5607, 29928, 353, 11297, 29900, 29941, 29941, 29961, 29896, 29885, 29915, 13, 1678, 501, 2797, 1001, 18521, 353, 11297, 29900, 29941, 29941, 29961, 29946, 29885, 29915, 13, 13, 1753, 1423, 29918, 369, 29918, 9891, 7295, 13, 1678, 1243, 353, 2897, 29889, 29886, 3150, 877, 19567, 29899, 11671, 1192, 3259, 2824, 949, 580, 13, 1678, 1596, 703, 418, 3575, 366, 29873, 4003, 29899, 11671, 1873, 338, 3583, 29876, 29908, 718, 289, 27703, 29889, 8949, 29954, 1525, 1430, 718, 376, 418, 376, 718, 1243, 718, 289, 27703, 29889, 11794, 29907, 29897, 2 ]
public-engines/spark-mllib-engine/spark_mllib_engine/data_handler/training_preparator.py
lucasnil/incubator-marvin
0
160656
#!/usr/bin/env python # coding=utf-8 """TrainingPreparator engine action. Use this module to add the project main code. """ from .._compatibility import six from .._logging import get_logger from ..spark_serializer import SparkSerializer from marvin_python_toolbox.engine_base import EngineBaseDataHandler __all__ = ['TrainingPreparator'] logger = get_logger('training_preparator') class TrainingPreparator(SparkSerializer,EngineBaseDataHandler): def __init__(self, **kwargs): super(TrainingPreparator, self).__init__(**kwargs) def execute(self, params, **kwargs): # Training Preparator from pyspark.sql.types import DoubleType from pyspark.ml.feature import StringIndexer from pyspark.ml.feature import VectorAssembler from pyspark.mllib.regression import LabeledPoint l_atributos = ["SepalLengthCm", "SepalWidthCm", "PetalLengthCm", "PetalWidthCm"] dataset = self.marvin_initial_dataset # Chaniging atribute types to double for coluna in l_atributos: dataset = dataset.withColumn(coluna, dataset[coluna].cast(DoubleType())) # Maping column "Species" to a numerical value in a new collumn named "label" label_indexer = StringIndexer().setInputCol("Species").setOutputCol("label") dataset = label_indexer.fit(dataset).transform(dataset) # Concatenating all features into a single vector and naming the resulting column as "features" assembler = VectorAssembler(inputCols=["SepalLengthCm", "SepalWidthCm", "PetalLengthCm", "PetalWidthCm"], outputCol="features") dataset = assembler.transform(dataset) (train, test) = dataset.randomSplit([0.7, 0.3]) self.marvin_dataset = {'train': train, 'test': test}
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 13, 15945, 29908, 5323, 2827, 6572, 17954, 6012, 3158, 29889, 13, 13, 11403, 445, 3883, 304, 788, 278, 2060, 1667, 775, 29889, 13, 15945, 29908, 13, 13, 3166, 6317, 29918, 12667, 4127, 1053, 4832, 13, 3166, 6317, 29918, 21027, 1053, 679, 29918, 21707, 13, 3166, 6317, 12597, 29918, 15550, 3950, 1053, 20814, 17679, 13, 13, 3166, 1766, 3845, 29918, 4691, 29918, 10154, 1884, 29889, 10599, 29918, 3188, 1053, 10863, 5160, 1469, 4598, 13, 13, 1649, 497, 1649, 353, 6024, 5323, 2827, 6572, 17954, 2033, 13, 13, 13, 21707, 353, 679, 29918, 21707, 877, 26495, 29918, 1457, 17954, 1495, 13, 13, 13, 1990, 26101, 6572, 17954, 29898, 29903, 6378, 17679, 29892, 12412, 5160, 1469, 4598, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3579, 19290, 1125, 13, 4706, 2428, 29898, 5323, 2827, 6572, 17954, 29892, 1583, 467, 1649, 2344, 12035, 1068, 19290, 29897, 13, 13, 1678, 822, 6222, 29898, 1311, 29892, 8636, 29892, 3579, 19290, 1125, 13, 4706, 396, 26101, 4721, 17954, 13, 13, 4706, 515, 282, 952, 6378, 29889, 2850, 29889, 8768, 1053, 11599, 1542, 13, 4706, 515, 282, 952, 6378, 29889, 828, 29889, 14394, 1053, 1714, 3220, 261, 13, 4706, 515, 282, 952, 6378, 29889, 828, 29889, 14394, 1053, 16510, 7900, 1590, 1358, 13, 4706, 515, 282, 952, 6378, 29889, 828, 1982, 29889, 276, 11476, 1053, 365, 24025, 5228, 13, 13, 4706, 301, 29918, 271, 1091, 20864, 353, 6796, 29903, 1022, 284, 6513, 29907, 29885, 613, 376, 29903, 1022, 284, 6110, 29907, 29885, 613, 376, 29925, 26310, 6513, 29907, 29885, 613, 376, 29925, 26310, 6110, 29907, 29885, 3108, 13, 13, 4706, 8783, 353, 1583, 29889, 3034, 3845, 29918, 11228, 29918, 24713, 13, 13, 13, 4706, 396, 22433, 335, 292, 472, 2666, 4072, 304, 3765, 13, 4706, 363, 784, 4347, 297, 301, 29918, 271, 1091, 20864, 29901, 13, 9651, 8783, 353, 8783, 29889, 2541, 4409, 29898, 1054, 4347, 29892, 8783, 29961, 1054, 4347, 1822, 4384, 29898, 11843, 1542, 22130, 13, 13, 13, 4706, 396, 7315, 292, 1897, 376, 10649, 2478, 29908, 304, 263, 16259, 995, 297, 263, 716, 5321, 1227, 4257, 376, 1643, 29908, 13, 4706, 3858, 29918, 2248, 261, 353, 1714, 3220, 261, 2141, 842, 4290, 1625, 703, 10649, 2478, 2564, 842, 6466, 1625, 703, 1643, 1159, 13, 13, 4706, 8783, 353, 3858, 29918, 2248, 261, 29889, 9202, 29898, 24713, 467, 9067, 29898, 24713, 29897, 13, 13, 13, 4706, 396, 23924, 2579, 1218, 599, 5680, 964, 263, 2323, 4608, 322, 22006, 278, 9819, 1897, 408, 376, 22100, 29908, 13, 4706, 24367, 1358, 353, 16510, 7900, 1590, 1358, 29898, 2080, 1625, 29879, 29922, 3366, 29903, 1022, 284, 6513, 29907, 29885, 613, 376, 29903, 1022, 284, 6110, 29907, 29885, 613, 376, 29925, 26310, 6513, 29907, 29885, 613, 376, 29925, 26310, 6110, 29907, 29885, 12436, 1962, 1625, 543, 22100, 1159, 13, 4706, 8783, 353, 24367, 1358, 29889, 9067, 29898, 24713, 29897, 13, 13, 13, 4706, 313, 14968, 29892, 1243, 29897, 353, 8783, 29889, 8172, 18772, 4197, 29900, 29889, 29955, 29892, 29871, 29900, 29889, 29941, 2314, 13, 13, 4706, 1583, 29889, 3034, 3845, 29918, 24713, 353, 11117, 14968, 2396, 7945, 29892, 525, 1688, 2396, 1243, 29913, 13, 13, 2 ]
Day 9/FLOW005.py
arpit1920/Python-Codechef-Problems
0
95216
''' Consider a currency system in which there are notes of six denominations, namely, Rs. 1, Rs. 2, Rs. 5, Rs. 10, Rs. 50, Rs. 100. If the sum of Rs. N is input, write a program to computer smallest number of notes that will combine to give Rs. N. Input The first line contains an integer T, total number of testcases. Then follow T lines, each line contains an integer N. Output For each test case, display the smallest number of notes that will combine to give N, in a new line. Constraints 1 ≤ T ≤ 1000 1 ≤ N ≤ 1000000 Example Input 3 1200 500 242 Output 12 5 7 ''' # cook your dish here t=int(input()) for i in range(t): n=int(input()) c=0 c+=(n//100) n=n%100 c+=(n//50) n=n%50 c+=(n//10) n=n%10 c+=(n//5) n=n%5 c+=(n//2) n=n%2 c+=(n//1) n=n%1 print(c)
[ 1, 14550, 30004, 13, 13696, 1241, 263, 27550, 1788, 297, 607, 727, 526, 11486, 310, 4832, 14267, 800, 11167, 13, 8588, 873, 29892, 390, 29879, 29889, 29871, 29896, 29892, 390, 29879, 29889, 29871, 29906, 29892, 390, 29879, 29889, 29871, 29945, 29892, 390, 29879, 29889, 29871, 29896, 29900, 29892, 390, 29879, 29889, 29871, 29945, 29900, 29892, 390, 29879, 29889, 29871, 29896, 29900, 29900, 22993, 13, 3644, 278, 2533, 310, 390, 29879, 29889, 405, 338, 1881, 11167, 13, 3539, 263, 1824, 304, 6601, 19087, 1353, 310, 11486, 393, 674, 14405, 304, 2367, 390, 29879, 29889, 405, 22993, 13, 30004, 13, 4290, 30004, 13, 1576, 937, 1196, 3743, 385, 6043, 323, 29892, 3001, 1353, 310, 1243, 11436, 22993, 13, 11760, 1101, 323, 3454, 29892, 1269, 1196, 3743, 385, 6043, 405, 22993, 13, 30004, 13, 6466, 30004, 13, 2831, 1269, 1243, 1206, 29892, 2479, 278, 19087, 1353, 310, 11486, 393, 674, 14405, 304, 2367, 405, 29892, 297, 263, 716, 1196, 22993, 13, 30004, 13, 27427, 30004, 13, 29896, 29871, 30248, 323, 29871, 30248, 29871, 29896, 29900, 29900, 29900, 30004, 13, 29896, 29871, 30248, 405, 29871, 30248, 29871, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 30004, 13, 30004, 13, 14023, 30004, 13, 4290, 30004, 13, 29941, 6756, 13, 29896, 29906, 29900, 29900, 30004, 13, 29945, 29900, 29900, 30004, 13, 29906, 29946, 29906, 30004, 13, 30004, 13, 6466, 30004, 13, 29896, 29906, 30004, 13, 29945, 30004, 13, 29955, 30004, 13, 12008, 30004, 13, 29937, 7984, 596, 270, 728, 1244, 30004, 13, 29873, 29922, 524, 29898, 2080, 3101, 30004, 13, 1454, 474, 297, 3464, 29898, 29873, 1125, 30004, 13, 1678, 302, 29922, 524, 29898, 2080, 3101, 30004, 13, 1678, 274, 29922, 29900, 30004, 13, 1678, 274, 29974, 7607, 29876, 458, 29896, 29900, 29900, 8443, 13, 1678, 302, 29922, 29876, 29995, 29896, 29900, 29900, 30004, 13, 1678, 274, 29974, 7607, 29876, 458, 29945, 29900, 8443, 13, 1678, 302, 29922, 29876, 29995, 29945, 29900, 30004, 13, 1678, 274, 29974, 7607, 29876, 458, 29896, 29900, 8443, 13, 1678, 302, 29922, 29876, 29995, 29896, 29900, 30004, 13, 1678, 274, 29974, 7607, 29876, 458, 29945, 8443, 13, 1678, 302, 29922, 29876, 29995, 29945, 30004, 13, 1678, 274, 29974, 7607, 29876, 458, 29906, 8443, 13, 1678, 302, 29922, 29876, 29995, 29906, 30004, 13, 1678, 274, 29974, 7607, 29876, 458, 29896, 8443, 13, 1678, 302, 29922, 29876, 29995, 29896, 30004, 13, 1678, 1596, 29898, 29883, 29897, 2 ]
Exercicios/Exercicio062.py
RicardoMart922/estudo_Python
0
111421
<reponame>RicardoMart922/estudo_Python<filename>Exercicios/Exercicio062.py # Faça um programa que leia um número qualquer e mostre seu fatorial. numero = int(input('Digite um número: ')) fatorial = 1 i = 1 while i <= numero: fatorial *= i i += 1 print('{}! = '.format(numero), end='') j = 1 k = 1 if numero == 0 or numero == 1: print('{}'.format(fatorial)) else: while numero >= j: if k == 1: print('{}'.format(numero), end='') k = 2 numero -= 1 print(' x {}'.format(numero), end='') numero -= 1 print(' = {}'.format(fatorial))
[ 1, 529, 276, 1112, 420, 29958, 29934, 293, 6491, 15838, 29929, 29906, 29906, 29914, 342, 5333, 29918, 11980, 29966, 9507, 29958, 1252, 6269, 19382, 29914, 1252, 6269, 11088, 29900, 29953, 29906, 29889, 2272, 13, 29937, 7748, 4277, 1922, 16914, 712, 454, 423, 1922, 13831, 4021, 7808, 321, 1556, 276, 5078, 285, 24737, 29889, 13, 1949, 1489, 353, 938, 29898, 2080, 877, 14991, 568, 1922, 13831, 29901, 525, 876, 13, 29888, 24737, 353, 29871, 29896, 13, 29875, 353, 29871, 29896, 13, 8000, 474, 5277, 17910, 29901, 13, 1678, 285, 24737, 334, 29922, 474, 13, 1678, 474, 4619, 29871, 29896, 29871, 13, 2158, 877, 8875, 29991, 353, 15300, 4830, 29898, 1949, 1489, 511, 1095, 2433, 1495, 13, 29926, 353, 29871, 29896, 13, 29895, 353, 29871, 29896, 13, 361, 17910, 1275, 29871, 29900, 470, 17910, 1275, 29871, 29896, 29901, 13, 1678, 1596, 877, 8875, 4286, 4830, 29898, 29888, 24737, 876, 13, 2870, 29901, 13, 1678, 1550, 17910, 6736, 432, 29901, 13, 4706, 565, 413, 1275, 29871, 29896, 29901, 13, 9651, 1596, 877, 8875, 4286, 4830, 29898, 1949, 1489, 511, 1095, 2433, 1495, 13, 9651, 413, 353, 29871, 29906, 13, 9651, 17910, 22361, 29871, 29896, 13, 4706, 1596, 877, 921, 6571, 4286, 4830, 29898, 1949, 1489, 511, 1095, 2433, 1495, 13, 4706, 17910, 22361, 29871, 29896, 13, 1678, 1596, 877, 353, 6571, 4286, 4830, 29898, 29888, 24737, 876, 13, 2 ]
tests/core/test_core_renderer.py
timvink/pheasant
24
12592
from pheasant.renderers.jupyter.jupyter import Jupyter jupyter = Jupyter() jupyter.findall("{{3}}3{{5}}") jupyter.page
[ 1, 515, 282, 354, 13186, 29889, 9482, 414, 29889, 29926, 786, 25547, 29889, 29926, 786, 25547, 1053, 27441, 25547, 13, 13, 29926, 786, 25547, 353, 27441, 25547, 580, 13, 29926, 786, 25547, 29889, 2886, 497, 703, 6224, 29941, 930, 29941, 6224, 29945, 930, 1159, 13, 29926, 786, 25547, 29889, 3488, 13, 2 ]
ap/apps/events/factories.py
shacker/ap
1
48841
import random from typing import Any import factory import pytz from django.utils.text import slugify from ap.apps.events.models import EVENT_TYPE_CHOICES, Event, Organization, Route from ap.apps.users.constants import COUNTRY_CHOICES from ap.apps.users.models import User from ap.apps.events.factory_data import RANDOM_EVENT_LIST, RANDOM_COORDS_LIST class RouteFactory(factory.django.DjangoModelFactory): """Fabricate a route with realistic data. MUST have an event passed in when called.""" class Meta: model = Route title = factory.Faker('text', max_nb_chars=60) url = factory.Faker('url') class EventFactory(factory.django.DjangoModelFactory): """Fabricate an event with realistic data""" class Meta: model = Event name = factory.LazyAttribute(lambda o: random.choice(RANDOM_EVENT_LIST)) event_type = factory.LazyAttribute(lambda o: random.choice(EVENT_TYPE_CHOICES)[0]) slug = factory.LazyAttribute(lambda o: slugify(o.name)) about = factory.Faker('paragraph', nb_sentences=9) start = factory.Faker('date_time_this_century', tzinfo=pytz.UTC) address = factory.Faker('street_address') place_name = factory.Faker('company') city = factory.Faker('city') state_province = factory.Faker('state') country = factory.LazyAttribute(lambda o: random.choice(COUNTRY_CHOICES)[0]) official_event_site_url = factory.Faker('url') official_event_site_title = factory.Faker('text', max_nb_chars=30) fee = factory.Faker('pydecimal', left_digits=4, right_digits=2, positive=True) fee_paid = factory.Faker('pybool') notes = factory.Faker('paragraph') published = True @factory.post_generation def maybe_add_orgs(obj, build: bool, extracted: Any, **kwargs: dict) -> None: # Maybe assign a random org to event. dice = random.choice(range(1, 5)) for _ in range(dice): org = Organization.objects.all().order_by('?').first() obj.organizations.add(org) @factory.post_generation def maybe_add_humans(obj, build: bool, extracted: Any, **kwargs: dict) -> None: # Maybe assign a random contact to event. dice = random.choice(range(1, 5)) for _ in range(dice): user = User.objects.all().order_by('?').first() obj.humans.add(user) @factory.post_generation def add_routes(obj, build: bool, extracted: Any, **kwargs: dict) -> None: numroutes = random.choice(range(0, 5)) RouteFactory.create_batch(numroutes, event=obj) @factory.post_generation def add_coords(obj, build: bool, extracted: Any, **kwargs: dict) -> None: # Select from actual city coordinates guaranteed to be on land coords = random.choice(RANDOM_COORDS_LIST) obj.latitude = coords[0] obj.longitude = coords[1] class OrgFactory(factory.django.DjangoModelFactory): """Fabricate an organization with realistic data""" class Meta: model = Organization name = factory.Faker('company') slug = factory.LazyAttribute(lambda o: slugify(o.name)) address = factory.Faker('address') phone = factory.Faker('phone_number') email = factory.Faker('email') human = factory.LazyAttribute(lambda o: User.objects.all().order_by('?').first())
[ 1, 1053, 4036, 13, 3166, 19229, 1053, 3139, 13, 13, 5215, 12529, 13, 5215, 282, 3637, 29920, 13, 3166, 9557, 29889, 13239, 29889, 726, 1053, 2243, 688, 1598, 13, 13, 3166, 3095, 29889, 13371, 29889, 13604, 29889, 9794, 1053, 382, 29963, 3919, 29918, 11116, 29918, 3210, 29949, 2965, 2890, 29892, 6864, 29892, 9205, 2133, 29892, 12034, 13, 3166, 3095, 29889, 13371, 29889, 7193, 29889, 3075, 1934, 1053, 4810, 3904, 5659, 29979, 29918, 3210, 29949, 2965, 2890, 13, 3166, 3095, 29889, 13371, 29889, 7193, 29889, 9794, 1053, 4911, 13, 3166, 3095, 29889, 13371, 29889, 13604, 29889, 14399, 29918, 1272, 1053, 390, 2190, 22141, 29918, 22240, 3919, 29918, 24360, 29892, 390, 2190, 22141, 29918, 3217, 1955, 8452, 29918, 24360, 13, 13, 13, 1990, 12034, 5126, 29898, 14399, 29889, 14095, 29889, 29928, 5364, 3195, 5126, 1125, 13, 1678, 9995, 29943, 370, 2200, 403, 263, 5782, 411, 1855, 4695, 848, 29889, 341, 17321, 505, 385, 1741, 4502, 297, 746, 2000, 1213, 15945, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 12034, 13, 13, 1678, 3611, 353, 12529, 29889, 29943, 5790, 877, 726, 742, 4236, 29918, 9877, 29918, 305, 1503, 29922, 29953, 29900, 29897, 13, 1678, 3142, 353, 12529, 29889, 29943, 5790, 877, 2271, 1495, 13, 13, 13, 1990, 6864, 5126, 29898, 14399, 29889, 14095, 29889, 29928, 5364, 3195, 5126, 1125, 13, 1678, 9995, 29943, 370, 2200, 403, 385, 1741, 411, 1855, 4695, 848, 15945, 29908, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 6864, 13, 13, 1678, 1024, 353, 12529, 29889, 29931, 24683, 6708, 29898, 2892, 288, 29901, 4036, 29889, 16957, 29898, 29934, 2190, 22141, 29918, 22240, 3919, 29918, 24360, 876, 13, 1678, 1741, 29918, 1853, 353, 12529, 29889, 29931, 24683, 6708, 29898, 2892, 288, 29901, 4036, 29889, 16957, 29898, 22240, 3919, 29918, 11116, 29918, 3210, 29949, 2965, 2890, 9601, 29900, 2314, 13, 1678, 2243, 688, 353, 12529, 29889, 29931, 24683, 6708, 29898, 2892, 288, 29901, 2243, 688, 1598, 29898, 29877, 29889, 978, 876, 13, 1678, 1048, 353, 12529, 29889, 29943, 5790, 877, 26956, 742, 302, 29890, 29918, 18616, 2063, 29922, 29929, 29897, 13, 1678, 1369, 353, 12529, 29889, 29943, 5790, 877, 1256, 29918, 2230, 29918, 1366, 29918, 27371, 742, 260, 29920, 3888, 29922, 2272, 17559, 29889, 26913, 29897, 13, 1678, 3211, 353, 12529, 29889, 29943, 5790, 877, 29352, 29918, 7328, 1495, 13, 1678, 2058, 29918, 978, 353, 12529, 29889, 29943, 5790, 877, 14518, 1495, 13, 1678, 4272, 353, 12529, 29889, 29943, 5790, 877, 12690, 1495, 13, 1678, 2106, 29918, 16123, 1239, 353, 12529, 29889, 29943, 5790, 877, 3859, 1495, 13, 1678, 4234, 353, 12529, 29889, 29931, 24683, 6708, 29898, 2892, 288, 29901, 4036, 29889, 16957, 29898, 3217, 3904, 5659, 29979, 29918, 3210, 29949, 2965, 2890, 9601, 29900, 2314, 13, 1678, 6221, 29918, 3696, 29918, 2746, 29918, 2271, 353, 12529, 29889, 29943, 5790, 877, 2271, 1495, 13, 1678, 6221, 29918, 3696, 29918, 2746, 29918, 3257, 353, 12529, 29889, 29943, 5790, 877, 726, 742, 4236, 29918, 9877, 29918, 305, 1503, 29922, 29941, 29900, 29897, 13, 1678, 27684, 353, 12529, 29889, 29943, 5790, 877, 2272, 7099, 3039, 742, 2175, 29918, 7501, 1169, 29922, 29946, 29892, 1492, 29918, 7501, 1169, 29922, 29906, 29892, 6374, 29922, 5574, 29897, 13, 1678, 27684, 29918, 3274, 333, 353, 12529, 29889, 29943, 5790, 877, 2272, 11227, 1495, 13, 1678, 11486, 353, 12529, 29889, 29943, 5790, 877, 26956, 1495, 13, 1678, 6369, 353, 5852, 13, 13, 1678, 732, 14399, 29889, 2490, 29918, 4738, 362, 13, 1678, 822, 5505, 29918, 1202, 29918, 990, 29879, 29898, 5415, 29892, 2048, 29901, 6120, 29892, 23892, 29901, 3139, 29892, 3579, 19290, 29901, 9657, 29897, 1599, 6213, 29901, 13, 4706, 396, 7198, 3566, 263, 4036, 1638, 304, 1741, 29889, 13, 4706, 17629, 353, 4036, 29889, 16957, 29898, 3881, 29898, 29896, 29892, 29871, 29945, 876, 13, 4706, 363, 903, 297, 3464, 29898, 29881, 625, 1125, 13, 9651, 1638, 353, 9205, 2133, 29889, 12650, 29889, 497, 2141, 2098, 29918, 1609, 877, 29973, 2824, 4102, 580, 13, 9651, 5446, 29889, 6388, 17063, 29889, 1202, 29898, 990, 29897, 13, 13, 1678, 732, 14399, 29889, 2490, 29918, 4738, 362, 13, 1678, 822, 5505, 29918, 1202, 29918, 16063, 550, 29898, 5415, 29892, 2048, 29901, 6120, 29892, 23892, 29901, 3139, 29892, 3579, 19290, 29901, 9657, 29897, 1599, 6213, 29901, 13, 4706, 396, 7198, 3566, 263, 4036, 6958, 304, 1741, 29889, 13, 4706, 17629, 353, 4036, 29889, 16957, 29898, 3881, 29898, 29896, 29892, 29871, 29945, 876, 13, 4706, 363, 903, 297, 3464, 29898, 29881, 625, 1125, 13, 9651, 1404, 353, 4911, 29889, 12650, 29889, 497, 2141, 2098, 29918, 1609, 877, 29973, 2824, 4102, 580, 13, 9651, 5446, 29889, 16063, 550, 29889, 1202, 29898, 1792, 29897, 13, 13, 1678, 732, 14399, 29889, 2490, 29918, 4738, 362, 13, 1678, 822, 788, 29918, 27894, 29898, 5415, 29892, 2048, 29901, 6120, 29892, 23892, 29901, 3139, 29892, 3579, 19290, 29901, 9657, 29897, 1599, 6213, 29901, 13, 4706, 954, 27894, 353, 4036, 29889, 16957, 29898, 3881, 29898, 29900, 29892, 29871, 29945, 876, 13, 4706, 12034, 5126, 29889, 3258, 29918, 16175, 29898, 1949, 27894, 29892, 1741, 29922, 5415, 29897, 13, 13, 13, 1678, 732, 14399, 29889, 2490, 29918, 4738, 362, 13, 1678, 822, 788, 29918, 1111, 4339, 29898, 5415, 29892, 2048, 29901, 6120, 29892, 23892, 29901, 3139, 29892, 3579, 19290, 29901, 9657, 29897, 1599, 6213, 29901, 13, 4706, 396, 7605, 515, 3935, 4272, 10350, 22688, 304, 367, 373, 2982, 13, 4706, 1302, 4339, 353, 4036, 29889, 16957, 29898, 29934, 2190, 22141, 29918, 3217, 1955, 8452, 29918, 24360, 29897, 13, 4706, 5446, 29889, 5066, 4279, 353, 1302, 4339, 29961, 29900, 29962, 13, 4706, 5446, 29889, 5426, 4279, 353, 1302, 4339, 29961, 29896, 29962, 13, 13, 13, 1990, 1394, 29887, 5126, 29898, 14399, 29889, 14095, 29889, 29928, 5364, 3195, 5126, 1125, 13, 1678, 9995, 29943, 370, 2200, 403, 385, 13013, 411, 1855, 4695, 848, 15945, 29908, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 9205, 2133, 13, 13, 1678, 1024, 353, 12529, 29889, 29943, 5790, 877, 14518, 1495, 13, 1678, 2243, 688, 353, 12529, 29889, 29931, 24683, 6708, 29898, 2892, 288, 29901, 2243, 688, 1598, 29898, 29877, 29889, 978, 876, 13, 1678, 3211, 353, 12529, 29889, 29943, 5790, 877, 7328, 1495, 13, 1678, 9008, 353, 12529, 29889, 29943, 5790, 877, 6710, 29918, 4537, 1495, 13, 1678, 4876, 353, 12529, 29889, 29943, 5790, 877, 5269, 1495, 13, 1678, 5199, 353, 12529, 29889, 29931, 24683, 6708, 29898, 2892, 288, 29901, 4911, 29889, 12650, 29889, 497, 2141, 2098, 29918, 1609, 877, 29973, 2824, 4102, 3101, 13, 2 ]
runpandas/types/summary.py
pnposch/runpandas
11
20854
<filename>runpandas/types/summary.py """ Helper module for evaluation and display of the summary of training sessions. """ import numpy as np import pandas as pd from runpandas._utils import convert_pace_secmeters2minkms def _build_summary_statistics(obj): """ Generate session statistics from a given DataFrame. Parameters ---------- obj: The DataFrame to generate basic commute statistics from. Returns: -------- A Dictionary containing the following statistics: - Total moving time - Average speed - Max speed - Average moving speed - Average cadence running - Average cadence running moving - Max cadence - Average heart rate - Average heart rate moving - Max heart rate - Average pace (per 1 km) - Average pace moving (per 1 km) - Max pace - Average temperature - Max temperature - Min temperature - Total distance - Total ellapsed time """ start = obj.start try: moving_time = obj.moving_time except AttributeError: moving_time = np.nan try: mean_speed = obj.mean_speed() max_speed = obj["speed"].max() mean_pace = convert_pace_secmeters2minkms(obj.mean_pace().total_seconds()) max_pace = convert_pace_secmeters2minkms( obj["speed"].to_pace().min().total_seconds() ) except AttributeError: mean_speed = np.nan max_speed = np.nan mean_pace = np.nan try: mean_moving_speed = obj.mean_speed(only_moving=True) mean_moving_pace = convert_pace_secmeters2minkms( obj.mean_pace(only_moving=True).total_seconds() ) except (AttributeError, KeyError): mean_moving_speed = np.nan mean_moving_pace = np.nan try: mean_cadence = obj.mean_cadence() max_cadence = obj["cad"].max() except AttributeError: mean_cadence = np.nan max_cadence = np.nan try: mean_moving_cadence = obj.mean_cadence(only_moving=True) except (AttributeError, KeyError): mean_moving_cadence = np.nan try: mean_heart_rate = obj.mean_heart_rate() max_heart_rate = obj["hr"].max() except AttributeError: mean_heart_rate = np.nan max_heart_rate = np.nan try: mean_moving_heart_rate = obj.mean_heart_rate(only_moving=True) except (AttributeError, KeyError): mean_moving_heart_rate = np.nan try: mean_temperature = obj["temp"].mean() min_temperature = obj["temp"].min() max_temperature = obj["temp"].max() except KeyError: mean_temperature = np.nan min_temperature = np.nan max_temperature = np.nan total_distance = obj.distance ellapsed_time = obj.ellapsed_time row = {k: v for k, v in locals().items() if not k.startswith("__") and k != "obj"} return row def _build_session_statistics(obj): """ Generate session statistics from a given DataFrame. Parameters ---------- obj: The DataFrame to generate basic commute statistics from. Returns: -------- A ``pandas.Dataframe`` containing the following statistics: - Total moving time - Average speed - Max speed - Average moving speed - Average cadence running - Average cadence running moving - Max cadence - Average heart rate - Average heart rate moving - Max heart rate - Average pace (per 1 km) - Average pace moving (per 1 km) - Max pace - Average temperature - Max temperature - Min temperature - Total distance - Total ellapsed time """ stats = {key: [value] for key, value in _build_summary_statistics(obj).items()} return pd.DataFrame(stats).set_index("start") def _build_activity_statistics(obj): """ Generate basic statistics from a given pandas Series. Parameters ---------- obj: The DataFrame to generate basic commute statistics from. Returns: -------- A Series containing the following statistics: - Session times - Total distance - Total ellapsed time - Total moving time - Total and average elevation gain - Average speed - Average moving speed - Average pace (per 1 km) - Average pace moving (per 1 km) - Average cadence running - Average cadence running moving - Average heart rate - Average heart rate moving - Average temperature """ # special conditions for methods that raise Exceptions stats = _build_summary_statistics(obj) rows = { "Session": "Running: %s" % stats["start"].strftime("%d-%m-%Y %H:%M:%S"), "Total distance (meters)": stats["total_distance"], "Total ellapsed time": stats["ellapsed_time"], "Total moving time": stats["moving_time"], "Average speed (km/h)": stats["mean_speed"] * 3.6, "Average moving speed (km/h)": stats["mean_moving_speed"] * 3.6, "Average pace (per 1 km)": stats["mean_pace"], "Average pace moving (per 1 km)": stats["mean_moving_pace"], "Average cadence": stats["mean_cadence"], "Average moving cadence": stats["mean_moving_cadence"], "Average heart rate": stats["mean_heart_rate"], "Average moving heart rate": stats["mean_moving_heart_rate"], "Average temperature": stats["mean_temperature"], } series = pd.Series( rows, index=[ "Session", "Total distance (meters)", "Total ellapsed time", "Total moving time", "Average speed (km/h)", "Average moving speed (km/h)", "Average pace (per 1 km)", "Average pace moving (per 1 km)", "Average cadence", "Average moving cadence", "Average heart rate", "Average moving heart rate", "Average temperature", ], ) return series def activity_summary(activity): """ Returns the pandas Dataframe with the common basic statistics for the given activity. Parameters ---------- activity: runpandas.types.Activity. Runpandas Activity to be computed the statistics Returns ------- pandas.Dataframe: A pandas DataFrame containing the summary statistics, which inclues estimates of the total distance covered, the total duration, the time spent moving, and many others. """ summary_statistics = _build_activity_statistics(activity) return summary_statistics.T def session_summary(session): """ Returns the a pandas Dataframe with the common basic statistics for the given activity. Parameters ---------- session: runpandas.types.Activity. Runpandas Activity with pandas.MultiIndex to be computed the statistics Returns ------- pandas.Dataframe: A pandas DataFrame containing the summary statistics across all th activities, which includes estimates of the total distance covered, the total duration, the time spent moving, and many others. """ frames = [] for index in session.index.unique(level="start"): df = session.xs(index, level=0) df.start = index frames.append(_build_session_statistics(df)) session_summary = pd.concat(frames, axis=0, verify_integrity=True) session_summary.sort_index(inplace=True) return session_summary
[ 1, 529, 9507, 29958, 3389, 15112, 29914, 8768, 29914, 7727, 29889, 2272, 13, 15945, 29908, 13, 1678, 6162, 546, 3883, 363, 17983, 322, 2479, 310, 278, 15837, 310, 6694, 21396, 29889, 13, 13, 9995, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 3166, 1065, 15112, 3032, 13239, 1053, 3588, 29918, 3535, 29918, 3471, 2527, 414, 29906, 29885, 682, 1516, 13, 13, 13, 1753, 903, 4282, 29918, 7727, 29918, 6112, 6765, 29898, 5415, 1125, 13, 1678, 9995, 13, 1678, 3251, 403, 4867, 13964, 515, 263, 2183, 3630, 4308, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 5446, 29901, 29871, 450, 3630, 4308, 304, 5706, 6996, 844, 1082, 13964, 515, 29889, 13, 13, 1678, 16969, 29901, 13, 1678, 448, 26589, 13, 1678, 319, 13343, 6943, 278, 1494, 13964, 29901, 13, 1678, 448, 14990, 8401, 931, 13, 1678, 448, 319, 19698, 6210, 13, 1678, 448, 5918, 6210, 13, 1678, 448, 319, 19698, 8401, 6210, 13, 1678, 448, 319, 19698, 13840, 663, 2734, 13, 1678, 448, 319, 19698, 13840, 663, 2734, 8401, 13, 1678, 448, 5918, 13840, 663, 13, 1678, 448, 319, 19698, 5192, 6554, 13, 1678, 448, 319, 19698, 5192, 6554, 8401, 13, 1678, 448, 5918, 5192, 6554, 13, 1678, 448, 319, 19698, 27725, 313, 546, 29871, 29896, 2383, 29897, 13, 1678, 448, 319, 19698, 27725, 8401, 313, 546, 29871, 29896, 2383, 29897, 13, 1678, 448, 5918, 27725, 13, 1678, 448, 319, 19698, 10430, 13, 1678, 448, 5918, 10430, 13, 1678, 448, 3080, 10430, 13, 1678, 448, 14990, 5418, 13, 1678, 448, 14990, 560, 23384, 931, 13, 1678, 9995, 13, 13, 1678, 1369, 353, 5446, 29889, 2962, 13, 13, 1678, 1018, 29901, 13, 4706, 8401, 29918, 2230, 353, 5446, 29889, 13529, 292, 29918, 2230, 13, 1678, 5174, 23833, 2392, 29901, 13, 4706, 8401, 29918, 2230, 353, 7442, 29889, 13707, 13, 13, 1678, 1018, 29901, 13, 4706, 2099, 29918, 19322, 353, 5446, 29889, 12676, 29918, 19322, 580, 13, 4706, 4236, 29918, 19322, 353, 5446, 3366, 19322, 16862, 3317, 580, 13, 4706, 2099, 29918, 3535, 353, 3588, 29918, 3535, 29918, 3471, 2527, 414, 29906, 29885, 682, 1516, 29898, 5415, 29889, 12676, 29918, 3535, 2141, 7827, 29918, 23128, 3101, 13, 4706, 4236, 29918, 3535, 353, 3588, 29918, 3535, 29918, 3471, 2527, 414, 29906, 29885, 682, 1516, 29898, 13, 9651, 5446, 3366, 19322, 16862, 517, 29918, 3535, 2141, 1195, 2141, 7827, 29918, 23128, 580, 13, 4706, 1723, 13, 1678, 5174, 23833, 2392, 29901, 13, 4706, 2099, 29918, 19322, 353, 7442, 29889, 13707, 13, 4706, 4236, 29918, 19322, 353, 7442, 29889, 13707, 13, 4706, 2099, 29918, 3535, 353, 7442, 29889, 13707, 13, 13, 1678, 1018, 29901, 13, 4706, 2099, 29918, 13529, 292, 29918, 19322, 353, 5446, 29889, 12676, 29918, 19322, 29898, 6194, 29918, 13529, 292, 29922, 5574, 29897, 13, 4706, 2099, 29918, 13529, 292, 29918, 3535, 353, 3588, 29918, 3535, 29918, 3471, 2527, 414, 29906, 29885, 682, 1516, 29898, 13, 9651, 5446, 29889, 12676, 29918, 3535, 29898, 6194, 29918, 13529, 292, 29922, 5574, 467, 7827, 29918, 23128, 580, 13, 4706, 1723, 13, 1678, 5174, 313, 6708, 2392, 29892, 7670, 2392, 1125, 13, 4706, 2099, 29918, 13529, 292, 29918, 19322, 353, 7442, 29889, 13707, 13, 4706, 2099, 29918, 13529, 292, 29918, 3535, 353, 7442, 29889, 13707, 13, 13, 1678, 1018, 29901, 13, 4706, 2099, 29918, 29883, 328, 663, 353, 5446, 29889, 12676, 29918, 29883, 328, 663, 580, 13, 4706, 4236, 29918, 29883, 328, 663, 353, 5446, 3366, 29883, 328, 16862, 3317, 580, 13, 1678, 5174, 23833, 2392, 29901, 13, 4706, 2099, 29918, 29883, 328, 663, 353, 7442, 29889, 13707, 13, 4706, 4236, 29918, 29883, 328, 663, 353, 7442, 29889, 13707, 13, 13, 1678, 1018, 29901, 13, 4706, 2099, 29918, 13529, 292, 29918, 29883, 328, 663, 353, 5446, 29889, 12676, 29918, 29883, 328, 663, 29898, 6194, 29918, 13529, 292, 29922, 5574, 29897, 13, 1678, 5174, 313, 6708, 2392, 29892, 7670, 2392, 1125, 13, 4706, 2099, 29918, 13529, 292, 29918, 29883, 328, 663, 353, 7442, 29889, 13707, 13, 13, 1678, 1018, 29901, 13, 4706, 2099, 29918, 23057, 29918, 10492, 353, 5446, 29889, 12676, 29918, 23057, 29918, 10492, 580, 13, 4706, 4236, 29918, 23057, 29918, 10492, 353, 5446, 3366, 1092, 16862, 3317, 580, 13, 1678, 5174, 23833, 2392, 29901, 13, 4706, 2099, 29918, 23057, 29918, 10492, 353, 7442, 29889, 13707, 13, 4706, 4236, 29918, 23057, 29918, 10492, 353, 7442, 29889, 13707, 13, 13, 1678, 1018, 29901, 13, 4706, 2099, 29918, 13529, 292, 29918, 23057, 29918, 10492, 353, 5446, 29889, 12676, 29918, 23057, 29918, 10492, 29898, 6194, 29918, 13529, 292, 29922, 5574, 29897, 13, 1678, 5174, 313, 6708, 2392, 29892, 7670, 2392, 1125, 13, 4706, 2099, 29918, 13529, 292, 29918, 23057, 29918, 10492, 353, 7442, 29889, 13707, 13, 13, 1678, 1018, 29901, 13, 4706, 2099, 29918, 12863, 1535, 353, 5446, 3366, 7382, 16862, 12676, 580, 13, 4706, 1375, 29918, 12863, 1535, 353, 5446, 3366, 7382, 16862, 1195, 580, 13, 4706, 4236, 29918, 12863, 1535, 353, 5446, 3366, 7382, 16862, 3317, 580, 13, 1678, 5174, 7670, 2392, 29901, 13, 4706, 2099, 29918, 12863, 1535, 353, 7442, 29889, 13707, 13, 4706, 1375, 29918, 12863, 1535, 353, 7442, 29889, 13707, 13, 4706, 4236, 29918, 12863, 1535, 353, 7442, 29889, 13707, 13, 13, 1678, 3001, 29918, 19244, 353, 5446, 29889, 19244, 13, 13, 1678, 560, 23384, 29918, 2230, 353, 5446, 29889, 3547, 567, 287, 29918, 2230, 13, 13, 1678, 1948, 353, 426, 29895, 29901, 325, 363, 413, 29892, 325, 297, 1180, 1338, 2141, 7076, 580, 565, 451, 413, 29889, 27382, 2541, 703, 1649, 1159, 322, 413, 2804, 376, 5415, 9092, 13, 13, 1678, 736, 1948, 13, 13, 13, 1753, 903, 4282, 29918, 7924, 29918, 6112, 6765, 29898, 5415, 1125, 13, 1678, 9995, 13, 1678, 3251, 403, 4867, 13964, 515, 263, 2183, 3630, 4308, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 5446, 29901, 29871, 450, 3630, 4308, 304, 5706, 6996, 844, 1082, 13964, 515, 29889, 13, 13, 1678, 16969, 29901, 13, 1678, 448, 26589, 13, 1678, 319, 4954, 15112, 29889, 1469, 2557, 16159, 6943, 278, 1494, 13964, 29901, 13, 1678, 448, 14990, 8401, 931, 13, 1678, 448, 319, 19698, 6210, 13, 1678, 448, 5918, 6210, 13, 1678, 448, 319, 19698, 8401, 6210, 13, 1678, 448, 319, 19698, 13840, 663, 2734, 13, 1678, 448, 319, 19698, 13840, 663, 2734, 8401, 13, 1678, 448, 5918, 13840, 663, 13, 1678, 448, 319, 19698, 5192, 6554, 13, 1678, 448, 319, 19698, 5192, 6554, 8401, 13, 1678, 448, 5918, 5192, 6554, 13, 1678, 448, 319, 19698, 27725, 313, 546, 29871, 29896, 2383, 29897, 13, 1678, 448, 319, 19698, 27725, 8401, 313, 546, 29871, 29896, 2383, 29897, 13, 1678, 448, 5918, 27725, 13, 1678, 448, 319, 19698, 10430, 13, 1678, 448, 5918, 10430, 13, 1678, 448, 3080, 10430, 13, 1678, 448, 14990, 5418, 13, 1678, 448, 14990, 560, 23384, 931, 13, 1678, 9995, 13, 1678, 22663, 353, 426, 1989, 29901, 518, 1767, 29962, 363, 1820, 29892, 995, 297, 903, 4282, 29918, 7727, 29918, 6112, 6765, 29898, 5415, 467, 7076, 28296, 13, 1678, 736, 10518, 29889, 17271, 29898, 16202, 467, 842, 29918, 2248, 703, 2962, 1159, 13, 13, 13, 1753, 903, 4282, 29918, 10072, 29918, 6112, 6765, 29898, 5415, 1125, 13, 1678, 9995, 13, 1678, 3251, 403, 6996, 13964, 515, 263, 2183, 11701, 10488, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 5446, 29901, 29871, 450, 3630, 4308, 304, 5706, 6996, 844, 1082, 13964, 515, 29889, 13, 13, 1678, 16969, 29901, 13, 1678, 448, 26589, 13, 13, 1678, 319, 10488, 6943, 278, 1494, 13964, 29901, 13, 1678, 448, 16441, 3064, 13, 1678, 448, 14990, 5418, 13, 1678, 448, 14990, 560, 23384, 931, 13, 1678, 448, 14990, 8401, 931, 13, 1678, 448, 14990, 322, 6588, 11858, 362, 11581, 13, 1678, 448, 319, 19698, 6210, 13, 1678, 448, 319, 19698, 8401, 6210, 13, 1678, 448, 319, 19698, 27725, 313, 546, 29871, 29896, 2383, 29897, 13, 1678, 448, 319, 19698, 27725, 8401, 313, 546, 29871, 29896, 2383, 29897, 13, 1678, 448, 319, 19698, 13840, 663, 2734, 13, 1678, 448, 319, 19698, 13840, 663, 2734, 8401, 13, 1678, 448, 319, 19698, 5192, 6554, 13, 1678, 448, 319, 19698, 5192, 6554, 8401, 13, 1678, 448, 319, 19698, 10430, 13, 1678, 9995, 13, 1678, 396, 4266, 5855, 363, 3519, 393, 12020, 8960, 29879, 13, 1678, 22663, 353, 903, 4282, 29918, 7727, 29918, 6112, 6765, 29898, 5415, 29897, 13, 13, 1678, 4206, 353, 426, 13, 4706, 376, 7317, 1115, 376, 27795, 29901, 1273, 29879, 29908, 1273, 22663, 3366, 2962, 16862, 710, 615, 603, 11702, 29881, 19222, 29885, 19222, 29979, 1273, 29950, 16664, 29924, 16664, 29903, 4968, 13, 4706, 376, 11536, 5418, 313, 2527, 414, 29897, 1115, 22663, 3366, 7827, 29918, 19244, 12436, 13, 4706, 376, 11536, 560, 23384, 931, 1115, 22663, 3366, 3547, 567, 287, 29918, 2230, 12436, 13, 4706, 376, 11536, 8401, 931, 1115, 22663, 3366, 13529, 292, 29918, 2230, 12436, 13, 4706, 376, 29909, 19698, 6210, 313, 8848, 29914, 29882, 29897, 1115, 22663, 3366, 12676, 29918, 19322, 3108, 334, 29871, 29941, 29889, 29953, 29892, 13, 4706, 376, 29909, 19698, 8401, 6210, 313, 8848, 29914, 29882, 29897, 1115, 22663, 3366, 12676, 29918, 13529, 292, 29918, 19322, 3108, 334, 29871, 29941, 29889, 29953, 29892, 13, 4706, 376, 29909, 19698, 27725, 313, 546, 29871, 29896, 2383, 29897, 1115, 22663, 3366, 12676, 29918, 3535, 12436, 13, 4706, 376, 29909, 19698, 27725, 8401, 313, 546, 29871, 29896, 2383, 29897, 1115, 22663, 3366, 12676, 29918, 13529, 292, 29918, 3535, 12436, 13, 4706, 376, 29909, 19698, 13840, 663, 1115, 22663, 3366, 12676, 29918, 29883, 328, 663, 12436, 13, 4706, 376, 29909, 19698, 8401, 13840, 663, 1115, 22663, 3366, 12676, 29918, 13529, 292, 29918, 29883, 328, 663, 12436, 13, 4706, 376, 29909, 19698, 5192, 6554, 1115, 22663, 3366, 12676, 29918, 23057, 29918, 10492, 12436, 13, 4706, 376, 29909, 19698, 8401, 5192, 6554, 1115, 22663, 3366, 12676, 29918, 13529, 292, 29918, 23057, 29918, 10492, 12436, 13, 4706, 376, 29909, 19698, 10430, 1115, 22663, 3366, 12676, 29918, 12863, 1535, 12436, 13, 1678, 500, 13, 13, 1678, 3652, 353, 10518, 29889, 19204, 29898, 13, 4706, 4206, 29892, 13, 4706, 2380, 11759, 13, 9651, 376, 7317, 613, 13, 9651, 376, 11536, 5418, 313, 2527, 414, 19123, 13, 9651, 376, 11536, 560, 23384, 931, 613, 13, 9651, 376, 11536, 8401, 931, 613, 13, 9651, 376, 29909, 19698, 6210, 313, 8848, 29914, 29882, 19123, 13, 9651, 376, 29909, 19698, 8401, 6210, 313, 8848, 29914, 29882, 19123, 13, 9651, 376, 29909, 19698, 27725, 313, 546, 29871, 29896, 2383, 19123, 13, 9651, 376, 29909, 19698, 27725, 8401, 313, 546, 29871, 29896, 2383, 19123, 13, 9651, 376, 29909, 19698, 13840, 663, 613, 13, 9651, 376, 29909, 19698, 8401, 13840, 663, 613, 13, 9651, 376, 29909, 19698, 5192, 6554, 613, 13, 9651, 376, 29909, 19698, 8401, 5192, 6554, 613, 13, 9651, 376, 29909, 19698, 10430, 613, 13, 4706, 21251, 13, 1678, 1723, 13, 13, 1678, 736, 3652, 13, 13, 13, 1753, 6354, 29918, 7727, 29898, 10072, 1125, 13, 1678, 9995, 13, 1678, 16969, 278, 11701, 3630, 2557, 411, 278, 3619, 6996, 13964, 363, 278, 13, 1678, 2183, 6354, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 6354, 29901, 29871, 1065, 15112, 29889, 8768, 29889, 3886, 29889, 7525, 15112, 13414, 304, 367, 15712, 278, 13964, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 4706, 11701, 29889, 1469, 2557, 29901, 29871, 319, 11701, 3630, 4308, 6943, 278, 15837, 13964, 29892, 607, 13, 4706, 1343, 1041, 21875, 310, 278, 3001, 5418, 10664, 29892, 278, 3001, 14385, 29892, 13, 4706, 278, 931, 10398, 8401, 29892, 322, 1784, 4045, 29889, 13, 13, 1678, 9995, 13, 1678, 15837, 29918, 6112, 6765, 353, 903, 4282, 29918, 10072, 29918, 6112, 6765, 29898, 10072, 29897, 13, 1678, 736, 15837, 29918, 6112, 6765, 29889, 29911, 13, 13, 13, 1753, 4867, 29918, 7727, 29898, 7924, 1125, 13, 1678, 9995, 13, 1678, 16969, 278, 263, 11701, 3630, 2557, 411, 278, 3619, 6996, 13964, 363, 278, 13, 1678, 2183, 6354, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 4867, 29901, 29871, 1065, 15112, 29889, 8768, 29889, 3886, 29889, 7525, 15112, 13414, 411, 11701, 29889, 15329, 3220, 13, 1678, 304, 367, 15712, 278, 13964, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 11701, 29889, 1469, 2557, 29901, 29871, 319, 11701, 3630, 4308, 6943, 278, 15837, 13964, 13, 1678, 4822, 599, 266, 14188, 29892, 607, 7805, 21875, 310, 278, 3001, 5418, 10664, 29892, 13, 1678, 278, 3001, 14385, 29892, 278, 931, 10398, 8401, 29892, 322, 1784, 4045, 29889, 13, 13, 1678, 9995, 13, 1678, 16608, 353, 5159, 13, 1678, 363, 2380, 297, 4867, 29889, 2248, 29889, 13092, 29898, 5563, 543, 2962, 29908, 1125, 13, 4706, 4489, 353, 4867, 29889, 10351, 29898, 2248, 29892, 3233, 29922, 29900, 29897, 13, 4706, 4489, 29889, 2962, 353, 2380, 13, 4706, 16608, 29889, 4397, 7373, 4282, 29918, 7924, 29918, 6112, 6765, 29898, 2176, 876, 13, 13, 1678, 4867, 29918, 7727, 353, 10518, 29889, 17685, 29898, 19935, 29892, 9685, 29922, 29900, 29892, 11539, 29918, 14146, 537, 29922, 5574, 29897, 13, 1678, 4867, 29918, 7727, 29889, 6605, 29918, 2248, 29898, 262, 6689, 29922, 5574, 29897, 13, 1678, 736, 4867, 29918, 7727, 13, 2 ]
src/plex_posters/__dev/__init__.py
dtomlinson91/plex_posters
0
40637
from __future__ import annotations from .__version__ import __version__ # noqa from .lib import export from typing import Type, TypeVar, List, Dict import praw # type: ignore import requests __all__ = [] # type: List __header__ = 'plex_posters' # __section__ = 'module' T_movie_poster_porn_scraper = TypeVar( 'T_movie_poster_porn_scraper', bound="movie_poster_porn_scraper" ) @export class movie_poster_porn_scraper(object): """Poster scraper Attributes ---------- reddit_instance : praw.Reddit A praw instance connected to Reddit """ def __init__(self, instance: praw.Reddit) -> None: """ Parameters ---------- instance : praw.Reddit A praw instance connected to Reddit """ super().__init__() self.reddit_instance = instance @classmethod def create_instance( cls: Type[T_movie_poster_porn_scraper], client_id: str, client_secret: str, user_agent: str, ) -> T_movie_poster_porn_scraper: """`classmethod` to connect to reddit using the api. Parameters ---------- client_id : str a valid client id client_secret : str the secret key for the client user_agent : str a user agent """ reddit_instance = praw.Reddit( client_id=client_id, client_secret=client_secret, user_agent=user_agent, ) return cls(reddit_instance) def get_hot_posters( self, ) -> T_movie_poster_porn_scraper: """ """ self._poster_urls: Dict = {} for post in self.reddit_instance.subreddit('MoviePosterPorn').hot( limit=10 ): print(post.title) print(post.url) # print(dir(post)) # self._poster_urls.append(post.url) self._poster_urls[post.title] = post.url print(self._poster_urls) return self def get_posters(self): """download the posters Returns ------- self """ for title, url in self._poster_urls.items(): r = requests.get(url) with open('posters/' + title + '.jpg', 'wb') as p: p.write(r.content) return self
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 25495, 13, 3166, 869, 1649, 3259, 1649, 1053, 4770, 3259, 1649, 29871, 396, 694, 25621, 13, 3166, 869, 1982, 1053, 5609, 13, 3166, 19229, 1053, 5167, 29892, 5167, 9037, 29892, 2391, 29892, 360, 919, 13, 5215, 20467, 29871, 396, 1134, 29901, 11455, 13, 5215, 7274, 13, 13, 1649, 497, 1649, 353, 5159, 29871, 396, 1134, 29901, 2391, 13, 13, 1649, 6672, 1649, 353, 525, 10709, 29918, 2490, 414, 29915, 13, 29937, 4770, 2042, 1649, 353, 525, 5453, 29915, 13, 13, 29911, 29918, 27362, 29918, 2490, 261, 29918, 29886, 1398, 29918, 1557, 336, 546, 353, 5167, 9037, 29898, 13, 1678, 525, 29911, 29918, 27362, 29918, 2490, 261, 29918, 29886, 1398, 29918, 1557, 336, 546, 742, 3216, 543, 27362, 29918, 2490, 261, 29918, 29886, 1398, 29918, 1557, 336, 546, 29908, 13, 29897, 13, 13, 13, 29992, 15843, 13, 1990, 14064, 29918, 2490, 261, 29918, 29886, 1398, 29918, 1557, 336, 546, 29898, 3318, 1125, 13, 13, 1678, 9995, 6747, 261, 24559, 546, 13, 13, 1678, 6212, 5026, 13, 1678, 448, 1378, 29899, 13, 1678, 337, 1289, 277, 29918, 8758, 584, 20467, 29889, 9039, 27423, 13, 4706, 319, 20467, 2777, 6631, 304, 4367, 27423, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2777, 29901, 20467, 29889, 9039, 27423, 29897, 1599, 6213, 29901, 13, 4706, 9995, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 2777, 584, 20467, 29889, 9039, 27423, 13, 9651, 319, 20467, 2777, 6631, 304, 4367, 27423, 13, 4706, 9995, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 1127, 27423, 29918, 8758, 353, 2777, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 1653, 29918, 8758, 29898, 13, 4706, 1067, 29879, 29901, 5167, 29961, 29911, 29918, 27362, 29918, 2490, 261, 29918, 29886, 1398, 29918, 1557, 336, 546, 1402, 13, 4706, 3132, 29918, 333, 29901, 851, 29892, 13, 4706, 3132, 29918, 19024, 29901, 851, 29892, 13, 4706, 1404, 29918, 14748, 29901, 851, 29892, 13, 1678, 1723, 1599, 323, 29918, 27362, 29918, 2490, 261, 29918, 29886, 1398, 29918, 1557, 336, 546, 29901, 13, 4706, 5124, 6937, 1990, 5696, 29952, 304, 4511, 304, 337, 1289, 277, 773, 278, 7882, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 3132, 29918, 333, 584, 851, 13, 9651, 263, 2854, 3132, 1178, 13, 4706, 3132, 29918, 19024, 584, 851, 13, 9651, 278, 7035, 1820, 363, 278, 3132, 13, 4706, 1404, 29918, 14748, 584, 851, 13, 9651, 263, 1404, 10823, 13, 4706, 9995, 13, 4706, 337, 1289, 277, 29918, 8758, 353, 20467, 29889, 9039, 27423, 29898, 13, 9651, 3132, 29918, 333, 29922, 4645, 29918, 333, 29892, 13, 9651, 3132, 29918, 19024, 29922, 4645, 29918, 19024, 29892, 13, 9651, 1404, 29918, 14748, 29922, 1792, 29918, 14748, 29892, 13, 4706, 1723, 13, 13, 4706, 736, 1067, 29879, 29898, 1127, 27423, 29918, 8758, 29897, 13, 13, 1678, 822, 679, 29918, 8711, 29918, 2490, 414, 29898, 13, 4706, 1583, 29892, 13, 1678, 1723, 1599, 323, 29918, 27362, 29918, 2490, 261, 29918, 29886, 1398, 29918, 1557, 336, 546, 29901, 13, 4706, 9995, 13, 4706, 9995, 13, 4706, 1583, 3032, 2490, 261, 29918, 26045, 29901, 360, 919, 353, 6571, 13, 4706, 363, 1400, 297, 1583, 29889, 1127, 27423, 29918, 8758, 29889, 1491, 1127, 27423, 877, 18749, 6747, 261, 29925, 1398, 2824, 8711, 29898, 13, 9651, 4046, 29922, 29896, 29900, 13, 308, 1125, 13, 9651, 1596, 29898, 2490, 29889, 3257, 29897, 13, 9651, 1596, 29898, 2490, 29889, 2271, 29897, 13, 9651, 396, 1596, 29898, 3972, 29898, 2490, 876, 13, 9651, 396, 1583, 3032, 2490, 261, 29918, 26045, 29889, 4397, 29898, 2490, 29889, 2271, 29897, 13, 9651, 1583, 3032, 2490, 261, 29918, 26045, 29961, 2490, 29889, 3257, 29962, 353, 1400, 29889, 2271, 13, 4706, 1596, 29898, 1311, 3032, 2490, 261, 29918, 26045, 29897, 13, 4706, 736, 1583, 13, 13, 1678, 822, 679, 29918, 2490, 414, 29898, 1311, 1125, 13, 4706, 9995, 10382, 278, 1400, 414, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 1583, 13, 4706, 9995, 13, 4706, 363, 3611, 29892, 3142, 297, 1583, 3032, 2490, 261, 29918, 26045, 29889, 7076, 7295, 13, 9651, 364, 353, 7274, 29889, 657, 29898, 2271, 29897, 13, 9651, 411, 1722, 877, 2490, 414, 22208, 718, 3611, 718, 15300, 6173, 742, 525, 29893, 29890, 1495, 408, 282, 29901, 13, 18884, 282, 29889, 3539, 29898, 29878, 29889, 3051, 29897, 13, 4706, 736, 1583, 13, 2 ]
pstraw/screws.py
pskelecton/straw
2
175944
#!/usr/local/bin/python3.6 # -*- coding:utf-8 -*- # ======================================== # Description : # 工具类 # 反射类、数据仓库类、路径加工、缓存 # Created : 2020.10.14 # Author : <NAME> # ======================================== from promise import Promise import os import inspect from dataclasses import dataclass # 字典反射对象使用案例 # ConfStore = Store({}) # ConfStore.a = {'xxx': Store({'yyy': 123})} # ConfStore.b = {'xxx': {'yyy': 123}} # 配置对象,控制对象只读 class ConfStore(): def __init__(self, **kwargs): self.__ConfStore__ = Store(kwargs) def __repr__(self): return str(self.__ConfStore__) def __str__(self): return str(self.__ConfStore__) def __getattr__(self, name): return self.__ConfStore__.get(name) def create(self, name, value): if self.__ConfStore__.get(name) == None: self.__ConfStore__[name] = value return True else: return False def modify(self, name, value): if self.__ConfStore__.get(name) != None: self.__ConfStore__[name] = value return True else: return False def remove(self, name): del self.__ConfStore__[name] # 路径加工类 class PathPlant(): def __init__(self, *args, **kwargs): super().__init__() # 接收一个model名的参数 self.MODEL_FOLDER_NAME = kwargs.get('MODEL_FOLDER_NAME') if not hasattr( self, "MODEL_FOLDER_NAME") else getattr(self, "MODEL_FOLDER_NAME") # 转换绝对路径,纯静态方法,外部直接访问 # 规则转换: @/xxx/ 则只取相对路径 , 没有@/则转换绝对路径 @staticmethod def transAbspath(path): if type(path) == str: if path[:2] == '@/': # 相对路径转换 # return os.path.normpath(path[2:]) # 绝对路径转换 return os.path.realpath(path[2:]) else: # 绝对路径转换 return os.path.abspath(path) else: return None # 获取模型绝对路径 @classmethod def getModelPath(cls, model_func): # 获取模型绝对路径 model_path = os.path.abspath(inspect.getfile(model_func)) return model_path # 初始化文件夹,静态+对象方法,可直接访问,可继承访问 @classmethod def splitFolder(cls, path, modelStr, includeModel=True): # 文件或目录检测,解决path最后带\\或/的情况 tempath = os.path.split(path) if tempath[1] == '': path = tempath[0] # modelStr前的路径 head = path # modelStr后的路径 tail = "" # skip = False while not skip: sp = os.path.split(head) # 匹配到或者都没有匹配到则跳出 if sp[1] == modelStr or sp[0] == "": skip = True # 初始赋值 if tail == "": tail = sp[1] else: if sp[1] == modelStr and includeModel == False: # 不组装modelStr pass else: # 每次循环都合并一下路径 tail = os.path.join(sp[1], tail) head = sp[0] return (head, tail) @classmethod def initFolder(cls, path): # 判断路径是否存在,不存在则创建文件夹 if not os.path.exists(path): # os.mkdir(path, mode=0o777) os.makedirs(path, mode=0o777, exist_ok=False) # 深度遍历文件,path一定要是绝对路径,静态+对象方法,可直接访问,可继承访问 @classmethod def deepenFolder(cls, path): _file_list = list() _dep_file_dict = dict() # 结构化文件夹 def traverseFile(dir_path): if os.path.exists(dir_path) and os.path.isdir(dir_path): file_list = os.listdir(dir_path) dep_file_dict = dict() for file_name in file_list: file_path = os.path.join(dir_path, file_name) if os.path.isdir(file_path): dep_file_dict[file_name] = traverseFile(file_path) else: _file_list.append(file_path) dep_file_dict[file_name] = file_path return dep_file_dict else: raise Exception # 生成文件结构化对象 _dep_file_dict = traverseFile(os.path.abspath(path)) return Store({'FILE_STRUCTURE': _dep_file_dict, 'PATH_LIST': _file_list}) # 字典反射成对象 class Store(dict): # 缓冲数据 __cache_dict = None def __init__(self, iterable=None): iterable = iterable or {} self.__cache_dict = dict(iterable) super().__init__(iterable) self.__reflect__(iterable) # 构建时反射值 def __reflect__(self, _dict): for key in _dict: if type(_dict[key]) == dict: self.__dict__[key] = Store(_dict[key]) else: self.__dict__[key] = _dict[key] # 更新时同步反射 def __updvalue__(self, key, value): # 判断旧值不等于新值的情况 if str(self.__cache_dict.get(key)) != str(value): # 更新缓冲数据 self.__cache_dict[key] = value # 引用赋值 if type(value) == dict: self.__dict__[key] = Store(value) else: self.__dict__[key] = value # 赋值 super().__setitem__(key, value) # 对象属性赋值拦截 def __setattr__(self, key, value): if self.__cache_dict != None: self.__updvalue__(key, value) else: self.__dict__[key] = value # 字典属性赋值拦截 def __setitem__(self, key, value): if self.__cache_dict != None: self.__updvalue__(key, value) # 字典取值拦截 def __getitem__(self, key): try: return self.__dict__[key] except Exception as exc: return None # 解除属性引用 def __delattr__(self, key): try: del self.__dict__[key] super().__delitem__(key) except Exception as exc: pass # 解除字典属性引用 def __delitem__(self, key): try: del self.__dict__[key] super().__delitem__(key) except Exception as exc: pass
[ 1, 18787, 4855, 29914, 2997, 29914, 2109, 29914, 4691, 29941, 29889, 29953, 13, 29937, 448, 29930, 29899, 14137, 29901, 9420, 29899, 29947, 448, 29930, 29899, 13, 29937, 1275, 9166, 9166, 2751, 1360, 13, 29937, 12953, 584, 13, 29937, 268, 31041, 232, 136, 186, 30832, 13, 29937, 268, 31908, 232, 179, 135, 30832, 30330, 30354, 30763, 231, 190, 150, 31700, 30832, 30330, 30874, 232, 193, 135, 30666, 31041, 30330, 234, 191, 150, 30946, 13, 29937, 6760, 630, 584, 29871, 29906, 29900, 29906, 29900, 29889, 29896, 29900, 29889, 29896, 29946, 13, 29937, 13361, 584, 529, 5813, 29958, 13, 29937, 1275, 9166, 9166, 2751, 1360, 13, 3166, 11640, 1053, 21501, 13, 5215, 2897, 13, 5215, 16096, 13, 3166, 848, 13203, 1053, 848, 1990, 13, 13, 29937, 29871, 30578, 31259, 31908, 232, 179, 135, 30783, 31133, 30785, 30406, 233, 164, 139, 31507, 13, 29937, 10811, 9044, 353, 14491, 3319, 1800, 13, 29937, 10811, 9044, 29889, 29874, 353, 11117, 12353, 2396, 14491, 3319, 29915, 8071, 29891, 2396, 29871, 29896, 29906, 29941, 1800, 29913, 13, 29937, 10811, 9044, 29889, 29890, 353, 11117, 12353, 2396, 11117, 8071, 29891, 2396, 29871, 29896, 29906, 29941, 930, 13, 13, 29937, 29871, 31361, 30669, 30783, 31133, 30214, 31617, 31072, 30783, 31133, 31557, 235, 178, 190, 13, 13, 13, 1990, 10811, 9044, 7295, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3579, 19290, 1125, 13, 4706, 1583, 17255, 16376, 9044, 1649, 353, 14491, 29898, 19290, 29897, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 736, 851, 29898, 1311, 17255, 16376, 9044, 1649, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 851, 29898, 1311, 17255, 16376, 9044, 1649, 29897, 13, 13, 1678, 822, 4770, 657, 5552, 12035, 1311, 29892, 1024, 1125, 13, 4706, 736, 1583, 17255, 16376, 9044, 26914, 657, 29898, 978, 29897, 13, 13, 1678, 822, 1653, 29898, 1311, 29892, 1024, 29892, 995, 1125, 13, 4706, 565, 1583, 17255, 16376, 9044, 26914, 657, 29898, 978, 29897, 1275, 6213, 29901, 13, 9651, 1583, 17255, 16376, 9044, 1649, 29961, 978, 29962, 353, 995, 13, 9651, 736, 5852, 13, 4706, 1683, 29901, 13, 9651, 736, 7700, 13, 13, 1678, 822, 6623, 29898, 1311, 29892, 1024, 29892, 995, 1125, 13, 4706, 565, 1583, 17255, 16376, 9044, 26914, 657, 29898, 978, 29897, 2804, 6213, 29901, 13, 9651, 1583, 17255, 16376, 9044, 1649, 29961, 978, 29962, 353, 995, 13, 9651, 736, 5852, 13, 4706, 1683, 29901, 13, 9651, 736, 7700, 13, 13, 1678, 822, 3349, 29898, 1311, 29892, 1024, 1125, 13, 4706, 628, 1583, 17255, 16376, 9044, 1649, 29961, 978, 29962, 13, 13, 13, 29937, 29871, 30874, 232, 193, 135, 30666, 31041, 30832, 13, 1990, 10802, 3247, 424, 7295, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 4706, 396, 29871, 31092, 31997, 30287, 30502, 4299, 30548, 30210, 31125, 30354, 13, 4706, 1583, 29889, 20387, 29931, 29918, 29943, 5607, 8032, 29918, 5813, 353, 9049, 5085, 29889, 657, 877, 20387, 29931, 29918, 29943, 5607, 8032, 29918, 5813, 1495, 565, 451, 756, 5552, 29898, 13, 9651, 1583, 29892, 376, 20387, 29931, 29918, 29943, 5607, 8032, 29918, 5813, 1159, 1683, 679, 5552, 29898, 1311, 29892, 376, 20387, 29931, 29918, 29943, 5607, 8032, 29918, 5813, 1159, 13, 13, 1678, 396, 29871, 31415, 31640, 234, 190, 160, 30783, 30874, 232, 193, 135, 30214, 234, 189, 178, 236, 160, 156, 31613, 30525, 30545, 30214, 31066, 30636, 31157, 31092, 235, 177, 194, 31658, 13, 1678, 396, 29871, 235, 170, 135, 31403, 31415, 31640, 29901, 732, 29914, 12353, 29914, 29871, 31403, 31557, 30683, 30990, 30783, 30874, 232, 193, 135, 1919, 29871, 31423, 30417, 29992, 29914, 31403, 31415, 31640, 234, 190, 160, 30783, 30874, 232, 193, 135, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1301, 4920, 1028, 493, 29898, 2084, 1125, 13, 4706, 565, 1134, 29898, 2084, 29897, 1275, 851, 29901, 13, 9651, 565, 2224, 7503, 29906, 29962, 1275, 18803, 29914, 2396, 13, 18884, 396, 29871, 30990, 30783, 30874, 232, 193, 135, 31415, 31640, 13, 18884, 396, 736, 2897, 29889, 2084, 29889, 12324, 2084, 29898, 2084, 29961, 29906, 29901, 2314, 13, 18884, 396, 29871, 234, 190, 160, 30783, 30874, 232, 193, 135, 31415, 31640, 13, 18884, 736, 2897, 29889, 2084, 29889, 6370, 2084, 29898, 2084, 29961, 29906, 29901, 2314, 13, 9651, 1683, 29901, 13, 18884, 396, 29871, 234, 190, 160, 30783, 30874, 232, 193, 135, 31415, 31640, 13, 18884, 736, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 2084, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 6213, 13, 13, 1678, 396, 29871, 31024, 30683, 31382, 30883, 234, 190, 160, 30783, 30874, 232, 193, 135, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 679, 3195, 2605, 29898, 25932, 29892, 1904, 29918, 9891, 1125, 13, 4706, 396, 29871, 31024, 30683, 31382, 30883, 234, 190, 160, 30783, 30874, 232, 193, 135, 13, 4706, 1904, 29918, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 1144, 1103, 29889, 657, 1445, 29898, 4299, 29918, 9891, 876, 13, 4706, 736, 1904, 29918, 2084, 13, 13, 1678, 396, 29871, 31120, 31020, 30705, 30333, 30631, 232, 167, 188, 30214, 236, 160, 156, 31613, 29974, 30783, 31133, 30525, 30545, 30214, 30682, 31157, 31092, 235, 177, 194, 31658, 30214, 30682, 234, 190, 170, 233, 140, 194, 235, 177, 194, 31658, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 6219, 12924, 29898, 25932, 29892, 2224, 29892, 1904, 5015, 29892, 3160, 3195, 29922, 5574, 1125, 13, 4706, 396, 29871, 30333, 30631, 31391, 30895, 31283, 233, 166, 131, 31851, 29892, 31201, 232, 137, 182, 2084, 30878, 30822, 232, 187, 169, 1966, 31391, 29914, 30210, 30993, 232, 137, 184, 13, 4706, 1350, 2084, 353, 2897, 29889, 2084, 29889, 5451, 29898, 2084, 29897, 13, 4706, 565, 1350, 2084, 29961, 29896, 29962, 1275, 525, 2396, 13, 9651, 2224, 353, 1350, 2084, 29961, 29900, 29962, 13, 4706, 396, 1904, 5015, 30658, 30210, 30874, 232, 193, 135, 13, 4706, 2343, 353, 2224, 13, 4706, 396, 1904, 5015, 30822, 30210, 30874, 232, 193, 135, 13, 4706, 12464, 353, 5124, 13, 4706, 396, 13, 4706, 14383, 353, 7700, 13, 4706, 1550, 451, 14383, 29901, 13, 9651, 805, 353, 2897, 29889, 2084, 29889, 5451, 29898, 2813, 29897, 13, 9651, 396, 29871, 232, 143, 188, 31361, 30780, 31391, 30767, 30769, 31423, 30417, 232, 143, 188, 31361, 30780, 31403, 235, 186, 182, 30544, 13, 9651, 565, 805, 29961, 29896, 29962, 1275, 1904, 5015, 470, 805, 29961, 29900, 29962, 1275, 376, 1115, 13, 18884, 14383, 353, 5852, 13, 9651, 396, 29871, 31120, 31020, 235, 184, 142, 30959, 13, 9651, 565, 12464, 1275, 376, 1115, 13, 18884, 12464, 353, 805, 29961, 29896, 29962, 13, 9651, 1683, 29901, 13, 18884, 565, 805, 29961, 29896, 29962, 1275, 1904, 5015, 322, 3160, 3195, 1275, 7700, 29901, 13, 462, 1678, 396, 29871, 30413, 31263, 31905, 4299, 5015, 13, 462, 1678, 1209, 13, 18884, 1683, 29901, 13, 462, 1678, 396, 29871, 31951, 30936, 232, 193, 173, 234, 145, 178, 30769, 30733, 31666, 30287, 30557, 30874, 232, 193, 135, 13, 462, 1678, 12464, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1028, 29961, 29896, 1402, 12464, 29897, 13, 9651, 2343, 353, 805, 29961, 29900, 29962, 13, 4706, 736, 313, 2813, 29892, 12464, 29897, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 2069, 12924, 29898, 25932, 29892, 2224, 1125, 13, 4706, 396, 29871, 31791, 31683, 30874, 232, 193, 135, 30392, 31191, 30946, 30505, 30214, 30413, 30946, 30505, 31403, 31441, 30886, 30333, 30631, 232, 167, 188, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 2084, 1125, 13, 9651, 396, 2897, 29889, 11256, 3972, 29898, 2084, 29892, 4464, 29922, 29900, 29877, 29955, 29955, 29955, 29897, 13, 9651, 2897, 29889, 29885, 12535, 12935, 29898, 2084, 29892, 4464, 29922, 29900, 29877, 29955, 29955, 29955, 29892, 1863, 29918, 554, 29922, 8824, 29897, 13, 13, 1678, 396, 29871, 31947, 30898, 236, 132, 144, 232, 145, 137, 30333, 30631, 30214, 2084, 30287, 30495, 30698, 30392, 234, 190, 160, 30783, 30874, 232, 193, 135, 30214, 236, 160, 156, 31613, 29974, 30783, 31133, 30525, 30545, 30214, 30682, 31157, 31092, 235, 177, 194, 31658, 30214, 30682, 234, 190, 170, 233, 140, 194, 235, 177, 194, 31658, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 6483, 264, 12924, 29898, 25932, 29892, 2224, 1125, 13, 4706, 903, 1445, 29918, 1761, 353, 1051, 580, 13, 4706, 903, 2716, 29918, 1445, 29918, 8977, 353, 9657, 580, 13, 13, 4706, 396, 29871, 31320, 31901, 30705, 30333, 30631, 232, 167, 188, 13, 4706, 822, 29370, 2283, 29898, 3972, 29918, 2084, 1125, 13, 9651, 565, 2897, 29889, 2084, 29889, 9933, 29898, 3972, 29918, 2084, 29897, 322, 2897, 29889, 2084, 29889, 275, 3972, 29898, 3972, 29918, 2084, 1125, 13, 18884, 934, 29918, 1761, 353, 2897, 29889, 1761, 3972, 29898, 3972, 29918, 2084, 29897, 13, 18884, 1401, 29918, 1445, 29918, 8977, 353, 9657, 580, 13, 18884, 363, 934, 29918, 978, 297, 934, 29918, 1761, 29901, 13, 462, 1678, 934, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 3972, 29918, 2084, 29892, 934, 29918, 978, 29897, 13, 462, 1678, 565, 2897, 29889, 2084, 29889, 275, 3972, 29898, 1445, 29918, 2084, 1125, 13, 462, 4706, 1401, 29918, 1445, 29918, 8977, 29961, 1445, 29918, 978, 29962, 353, 29370, 2283, 29898, 1445, 29918, 2084, 29897, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 903, 1445, 29918, 1761, 29889, 4397, 29898, 1445, 29918, 2084, 29897, 13, 462, 4706, 1401, 29918, 1445, 29918, 8977, 29961, 1445, 29918, 978, 29962, 353, 934, 29918, 2084, 13, 18884, 736, 1401, 29918, 1445, 29918, 8977, 13, 9651, 1683, 29901, 13, 18884, 12020, 8960, 13, 13, 4706, 396, 29871, 30486, 30494, 30333, 30631, 31320, 31901, 30705, 30783, 31133, 13, 4706, 903, 2716, 29918, 1445, 29918, 8977, 353, 29370, 2283, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 29898, 2084, 876, 13, 13, 4706, 736, 14491, 3319, 29915, 7724, 29918, 10810, 29965, 1783, 11499, 2396, 903, 2716, 29918, 1445, 29918, 8977, 29892, 525, 10145, 29918, 24360, 2396, 903, 1445, 29918, 1761, 1800, 13, 13, 13, 29937, 29871, 30578, 31259, 31908, 232, 179, 135, 30494, 30783, 31133, 13, 1990, 14491, 29898, 8977, 1125, 13, 1678, 396, 29871, 234, 191, 150, 232, 137, 181, 30354, 30763, 13, 1678, 4770, 8173, 29918, 8977, 353, 6213, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 4256, 519, 29922, 8516, 1125, 13, 4706, 4256, 519, 353, 4256, 519, 470, 6571, 13, 4706, 1583, 17255, 8173, 29918, 8977, 353, 9657, 29898, 1524, 519, 29897, 13, 4706, 2428, 2141, 1649, 2344, 12035, 1524, 519, 29897, 13, 4706, 1583, 17255, 13191, 12035, 1524, 519, 29897, 13, 13, 1678, 396, 29871, 31901, 30886, 30594, 31908, 232, 179, 135, 30959, 13, 1678, 822, 4770, 13191, 12035, 1311, 29892, 903, 8977, 1125, 13, 4706, 363, 1820, 297, 903, 8977, 29901, 13, 9651, 565, 1134, 7373, 8977, 29961, 1989, 2314, 1275, 9657, 29901, 13, 18884, 1583, 17255, 8977, 1649, 29961, 1989, 29962, 353, 14491, 7373, 8977, 29961, 1989, 2314, 13, 9651, 1683, 29901, 13, 18884, 1583, 17255, 8977, 1649, 29961, 1989, 29962, 353, 903, 8977, 29961, 1989, 29962, 13, 13, 1678, 396, 29871, 31100, 30374, 30594, 30980, 233, 176, 168, 31908, 232, 179, 135, 13, 1678, 822, 4770, 786, 29881, 1767, 12035, 1311, 29892, 1820, 29892, 995, 1125, 13, 4706, 396, 29871, 31791, 31683, 233, 154, 170, 30959, 30413, 31184, 30909, 30374, 30959, 30210, 30993, 232, 137, 184, 13, 4706, 565, 851, 29898, 1311, 17255, 8173, 29918, 8977, 29889, 657, 29898, 1989, 876, 2804, 851, 29898, 1767, 1125, 13, 9651, 396, 29871, 31100, 30374, 234, 191, 150, 232, 137, 181, 30354, 30763, 13, 9651, 1583, 17255, 8173, 29918, 8977, 29961, 1989, 29962, 353, 995, 13, 9651, 396, 29871, 31674, 30406, 235, 184, 142, 30959, 13, 9651, 565, 1134, 29898, 1767, 29897, 1275, 9657, 29901, 13, 18884, 1583, 17255, 8977, 1649, 29961, 1989, 29962, 353, 14491, 29898, 1767, 29897, 13, 9651, 1683, 29901, 13, 18884, 1583, 17255, 8977, 1649, 29961, 1989, 29962, 353, 995, 13, 9651, 396, 29871, 235, 184, 142, 30959, 13, 9651, 2428, 2141, 1649, 842, 667, 12035, 1989, 29892, 995, 29897, 13, 13, 1678, 396, 29871, 30783, 31133, 31360, 30952, 235, 184, 142, 30959, 233, 142, 169, 233, 139, 173, 13, 1678, 822, 4770, 842, 5552, 12035, 1311, 29892, 1820, 29892, 995, 1125, 13, 4706, 565, 1583, 17255, 8173, 29918, 8977, 2804, 6213, 29901, 13, 9651, 1583, 17255, 786, 29881, 1767, 12035, 1989, 29892, 995, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 17255, 8977, 1649, 29961, 1989, 29962, 353, 995, 13, 13, 1678, 396, 29871, 30578, 31259, 31360, 30952, 235, 184, 142, 30959, 233, 142, 169, 233, 139, 173, 13, 1678, 822, 4770, 842, 667, 12035, 1311, 29892, 1820, 29892, 995, 1125, 13, 4706, 565, 1583, 17255, 8173, 29918, 8977, 2804, 6213, 29901, 13, 9651, 1583, 17255, 786, 29881, 1767, 12035, 1989, 29892, 995, 29897, 13, 13, 1678, 396, 29871, 30578, 31259, 30683, 30959, 233, 142, 169, 233, 139, 173, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 1820, 1125, 13, 4706, 1018, 29901, 13, 9651, 736, 1583, 17255, 8977, 1649, 29961, 1989, 29962, 13, 4706, 5174, 8960, 408, 5566, 29901, 13, 9651, 736, 6213, 13, 13, 1678, 396, 29871, 31201, 31152, 31360, 30952, 31674, 30406, 13, 1678, 822, 4770, 6144, 5552, 12035, 1311, 29892, 1820, 1125, 13, 4706, 1018, 29901, 13, 9651, 628, 1583, 17255, 8977, 1649, 29961, 1989, 29962, 13, 9651, 2428, 2141, 1649, 6144, 667, 12035, 1989, 29897, 13, 4706, 5174, 8960, 408, 5566, 29901, 13, 9651, 1209, 13, 13, 1678, 396, 29871, 31201, 31152, 30578, 31259, 31360, 30952, 31674, 30406, 13, 1678, 822, 4770, 6144, 667, 12035, 1311, 29892, 1820, 1125, 13, 4706, 1018, 29901, 13, 9651, 628, 1583, 17255, 8977, 1649, 29961, 1989, 29962, 13, 9651, 2428, 2141, 1649, 6144, 667, 12035, 1989, 29897, 13, 4706, 5174, 8960, 408, 5566, 29901, 13, 9651, 1209, 13, 2 ]
tests/test_fixtures.py
adammichaelwood/omk_core
0
74204
<gh_stars>0 import pytest import omk_core as omk @pytest.fixture def tonal_tuples(): MS = [ (0, 0), (1, 2), (2, 4), (3, 5), (4, 7), (5, 9), (6,11) ] return [(x[0],(x[1]+m)%12) for m in [0,1,2,-1,-2] for x in MS] @pytest.fixture def tonal_vectors(tonal_tuples): return [omk.TonalVector(x) for x in tonal_tuples] @pytest.fixture def tonal_oct_tuples(tonal_tuples): return [(x[0], x[1], y) for y in [0,1,2,-1,-2] for x in tonal_tuples] @pytest.fixture def tonal_oct_vectors(tonal_oct_tuples): return [omk.TonalVector(x) for x in tonal_oct_tuples]
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 11451, 1688, 13, 13, 5215, 2703, 29895, 29918, 3221, 408, 2703, 29895, 29871, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 260, 7177, 29918, 9161, 2701, 7295, 13, 1678, 10888, 353, 518, 13, 4706, 313, 29900, 29892, 29871, 29900, 511, 13, 4706, 313, 29896, 29892, 29871, 29906, 511, 13, 4706, 313, 29906, 29892, 29871, 29946, 511, 13, 4706, 313, 29941, 29892, 29871, 29945, 511, 29871, 13, 4706, 313, 29946, 29892, 29871, 29955, 511, 29871, 13, 4706, 313, 29945, 29892, 29871, 29929, 511, 13, 4706, 313, 29953, 29892, 29896, 29896, 29897, 13, 1678, 4514, 13, 13, 1678, 736, 17288, 29916, 29961, 29900, 1402, 29898, 29916, 29961, 29896, 10062, 29885, 29897, 29995, 29896, 29906, 29897, 363, 286, 297, 518, 29900, 29892, 29896, 29892, 29906, 6653, 29896, 6653, 29906, 29962, 363, 921, 297, 10888, 29962, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 260, 7177, 29918, 345, 14359, 29898, 880, 284, 29918, 9161, 2701, 1125, 13, 1678, 736, 518, 290, 29895, 29889, 29911, 7177, 12877, 29898, 29916, 29897, 363, 921, 297, 260, 7177, 29918, 9161, 2701, 29962, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 260, 7177, 29918, 20082, 29918, 9161, 2701, 29898, 880, 284, 29918, 9161, 2701, 1125, 13, 1678, 736, 17288, 29916, 29961, 29900, 1402, 921, 29961, 29896, 1402, 343, 29897, 363, 343, 297, 518, 29900, 29892, 29896, 29892, 29906, 6653, 29896, 6653, 29906, 29962, 363, 921, 297, 260, 7177, 29918, 9161, 2701, 29962, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 260, 7177, 29918, 20082, 29918, 345, 14359, 29898, 880, 284, 29918, 20082, 29918, 9161, 2701, 1125, 13, 1678, 736, 518, 290, 29895, 29889, 29911, 7177, 12877, 29898, 29916, 29897, 363, 921, 297, 260, 7177, 29918, 20082, 29918, 9161, 2701, 29962, 13, 13, 2 ]
azure-mgmt/tests/test_mgmt_network.py
SUSE/azure-sdk-for-python
2
1024
# coding: utf-8 #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #-------------------------------------------------------------------------- import unittest import azure.mgmt.network.models from testutils.common_recordingtestcase import record from tests.mgmt_testcase import HttpStatusCode, AzureMgmtTestCase class MgmtNetworkTest(AzureMgmtTestCase): def setUp(self): super(MgmtNetworkTest, self).setUp() self.network_client = self.create_mgmt_client( azure.mgmt.network.NetworkManagementClient ) if not self.is_playback(): self.create_resource_group() @record def test_network_interface_card(self): vnet_name = self.get_resource_name('pyvnet') subnet_name = self.get_resource_name('pysubnet') nic_name = self.get_resource_name('pynic') # Create VNet async_vnet_creation = self.network_client.virtual_networks.create_or_update( self.group_name, vnet_name, { 'location': self.region, 'address_space': { 'address_prefixes': ['10.0.0.0/16'] } } ) async_vnet_creation.wait() # Create Subnet async_subnet_creation = self.network_client.subnets.create_or_update( self.group_name, vnet_name, subnet_name, {'address_prefix': '10.0.0.0/24'} ) subnet_info = async_subnet_creation.result() # Create NIC async_nic_creation = self.network_client.network_interfaces.create_or_update( self.group_name, nic_name, { 'location': self.region, 'ip_configurations': [{ 'name': 'MyIpConfig', 'subnet': { 'id': subnet_info.id } }] } ) nic_info = async_nic_creation.result() nic_info = self.network_client.network_interfaces.get( self.group_name, nic_info.name ) nics = list(self.network_client.network_interfaces.list( self.group_name )) self.assertEqual(len(nics), 1) nics = list(self.network_client.network_interfaces.list_all()) self.assertGreater(len(nics), 0) async_delete = self.network_client.network_interfaces.delete( self.group_name, nic_info.name ) async_delete.wait() @record def test_load_balancers(self): public_ip_name = self.get_resource_name('pyipname') frontend_ip_name = self.get_resource_name('pyfipname') addr_pool_name = self.get_resource_name('pyapname') probe_name = self.get_resource_name('pyprobename') lb_name = self.get_resource_name('pylbname') front_end_id = ('/subscriptions/{}' '/resourceGroups/{}' '/providers/Microsoft.Network' '/loadBalancers/{}' '/frontendIPConfigurations/{}').format( self.settings.SUBSCRIPTION_ID, self.group_name, lb_name, frontend_ip_name ) back_end_id = ('/subscriptions/{}' '/resourceGroups/{}' '/providers/Microsoft.Network' '/loadBalancers/{}' '/backendAddressPools/{}').format( self.settings.SUBSCRIPTION_ID, self.group_name, lb_name, addr_pool_name ) probe_id = ('/subscriptions/{}' '/resourceGroups/{}' '/providers/Microsoft.Network' '/loadBalancers/{}' '/probes/{}').format( self.settings.SUBSCRIPTION_ID, self.group_name, lb_name, probe_name ) # Create PublicIP public_ip_parameters = { 'location': self.region, 'public_ip_allocation_method': 'static', 'idle_timeout_in_minutes': 4 } async_publicip_creation = self.network_client.public_ip_addresses.create_or_update( self.group_name, public_ip_name, public_ip_parameters ) public_ip_info = async_publicip_creation.result() # Building a FrontEndIpPool frontend_ip_configurations = [{ 'name': frontend_ip_name, 'private_ip_allocation_method': 'Dynamic', 'public_ip_address': { 'id': public_ip_info.id } }] # Building a BackEnd adress pool backend_address_pools = [{ 'name': addr_pool_name }] # Building a HealthProbe probes = [{ 'name': probe_name, 'protocol': 'Http', 'port': 80, 'interval_in_seconds': 15, 'number_of_probes': 4, 'request_path': 'healthprobe.aspx' }] # Building a LoadBalancer rule load_balancing_rules = [{ 'name': 'azure-sample-lb-rule', 'protocol': 'tcp', 'frontend_port': 80, 'backend_port': 80, 'idle_timeout_in_minutes': 4, 'enable_floating_ip': False, 'load_distribution': 'Default', 'frontend_ip_configuration': { 'id': front_end_id }, 'backend_address_pool': { 'id': back_end_id }, 'probe': { 'id': probe_id } }] # Building InboundNATRule1 inbound_nat_rules = [{ 'name': 'azure-sample-netrule1', 'protocol': 'tcp', 'frontend_port': 21, 'backend_port': 22, 'enable_floating_ip': False, 'idle_timeout_in_minutes': 4, 'frontend_ip_configuration': { 'id': front_end_id } }] # Building InboundNATRule2 inbound_nat_rules.append({ 'name': 'azure-sample-netrule2', 'protocol': 'tcp', 'frontend_port': 23, 'backend_port': 22, 'enable_floating_ip': False, 'idle_timeout_in_minutes': 4, 'frontend_ip_configuration': { 'id': front_end_id } }) # Creating Load Balancer lb_async_creation = self.network_client.load_balancers.create_or_update( self.group_name, lb_name, { 'location': self.region, 'frontend_ip_configurations': frontend_ip_configurations, 'backend_address_pools': backend_address_pools, 'probes': probes, 'load_balancing_rules': load_balancing_rules, 'inbound_nat_rules' :inbound_nat_rules } ) lb_info = lb_async_creation.result() # Get it lb_info = self.network_client.load_balancers.get( self.group_name, lb_name ) # List all lbs = self.network_client.load_balancers.list_all() lbs = list(lbs) self.assertGreater(len(lbs), 0) # List RG lbs = self.network_client.load_balancers.list(self.group_name) lbs = list(lbs) self.assertGreater(len(lbs), 0) # Delete async_lb_delete = self.network_client.load_balancers.delete( self.group_name, lb_name ) async_lb_delete.wait() @record def test_public_ip_addresses(self): public_ip_name = self.get_resource_name('pyipname') params_create = azure.mgmt.network.models.PublicIPAddress( location=self.region, public_ip_allocation_method=azure.mgmt.network.models.IPAllocationMethod.dynamic, tags={ 'key': 'value', }, ) result_create = self.network_client.public_ip_addresses.create_or_update( self.group_name, public_ip_name, params_create, ) result_create.wait() # AzureOperationPoller #self.assertEqual(result_create.status_code, HttpStatusCode.OK) result_get = self.network_client.public_ip_addresses.get( self.group_name, public_ip_name, ) #self.assertEqual(result_get.status_code, HttpStatusCode.OK) self.assertEqual(result_get.location, self.region) self.assertEqual(result_get.tags['key'], 'value') result_list = self.network_client.public_ip_addresses.list(self.group_name) #self.assertEqual(result_list.status_code, HttpStatusCode.OK) result_list = list(result_list) self.assertEqual(len(result_list), 1) result_list_all = self.network_client.public_ip_addresses.list_all() #self.assertEqual(result_list_all.status_code, HttpStatusCode.OK) result_list_all = list(result_list_all) self.assertGreater(len(result_list_all), 0) result_delete = self.network_client.public_ip_addresses.delete( self.group_name, public_ip_name, ) result_delete.wait() # AzureOperationPoller #self.assertEqual(result_delete.status_code, HttpStatusCode.OK) result_list = self.network_client.public_ip_addresses.list(self.group_name) #self.assertEqual(result_list.status_code, HttpStatusCode.OK) result_list = list(result_list) self.assertEqual(len(result_list), 0) @record def test_virtual_networks(self): network_name = self.get_resource_name('pyvnet') subnet1_name = self.get_resource_name('pyvnetsubnetone') subnet2_name = self.get_resource_name('pyvnetsubnettwo') params_create = azure.mgmt.network.models.VirtualNetwork( location=self.region, address_space=azure.mgmt.network.models.AddressSpace( address_prefixes=[ '10.0.0.0/16', ], ), dhcp_options=azure.mgmt.network.models.DhcpOptions( dns_servers=[ '10.1.1.1', '10.1.2.4', ], ), subnets=[ azure.mgmt.network.models.Subnet( name=subnet1_name, address_prefix='10.0.1.0/24', ), azure.mgmt.network.models.Subnet( name=subnet2_name, address_prefix='10.0.2.0/24', ), ], ) result_create = self.network_client.virtual_networks.create_or_update( self.group_name, network_name, params_create, ) vnet = result_create.result() vnet = self.network_client.virtual_networks.get( self.group_name, vnet.name, ) ip_availability = self.network_client.virtual_networks.check_ip_address_availability( self.group_name, vnet.name, '10.0.1.35' # Should be available since new VNet sor Subnet 1 ) self.assertTrue(ip_availability.available) result_list = list(self.network_client.virtual_networks.list( self.group_name, )) self.assertEqual(len(result_list), 1) result_list_all = list(self.network_client.virtual_networks.list_all()) async_delete = self.network_client.virtual_networks.delete( self.group_name, network_name, ) async_delete.wait() @record def test_dns_availability(self): result_check = self.network_client.check_dns_name_availability( self.region, 'pydomain', ) #self.assertEqual(result_check.status_code, HttpStatusCode.OK) self.assertTrue(result_check) @record def test_subnets(self): network_name = self.get_resource_name('pysubnet') subnet1_name = self.get_resource_name('pysubnetone') subnet2_name = self.get_resource_name('pysubnettwo') params_create = azure.mgmt.network.models.VirtualNetwork( location=self.region, address_space=azure.mgmt.network.models.AddressSpace( address_prefixes=[ '10.0.0.0/16', ], ), dhcp_options=azure.mgmt.network.models.DhcpOptions( dns_servers=[ '10.1.1.1', '10.1.2.4', ], ), subnets=[ azure.mgmt.network.models.Subnet( name=subnet1_name, address_prefix='10.0.1.0/24', ), ], ) result_create = self.network_client.virtual_networks.create_or_update( self.group_name, network_name, params_create, ) result_create.wait() # AzureOperationPoller params_create = azure.mgmt.network.models.Subnet( name=subnet2_name, address_prefix='10.0.2.0/24', ) result_create = self.network_client.subnets.create_or_update( self.group_name, network_name, subnet2_name, params_create, ) result_create.wait() # AzureOperationPoller result_get = self.network_client.virtual_networks.get( self.group_name, network_name, ) self.assertEqual(len(result_get.subnets), 2) result_get = self.network_client.subnets.get( self.group_name, network_name, subnet2_name, ) result_list = self.network_client.subnets.list( self.group_name, network_name, ) subnets = list(result_list) result_delete = self.network_client.subnets.delete( self.group_name, network_name, subnet2_name, ) result_delete.wait() @record def test_network_security_groups(self): security_group_name = self.get_resource_name('pysecgroup') security_rule_name = self.get_resource_name('pysecgrouprule') params_create = azure.mgmt.network.models.NetworkSecurityGroup( location=self.region, security_rules=[ azure.mgmt.network.models.SecurityRule( name=security_rule_name, access=azure.mgmt.network.models.SecurityRuleAccess.allow, description='Test security rule', destination_address_prefix='*', destination_port_range='123-3500', direction=azure.mgmt.network.models.SecurityRuleDirection.inbound, priority=500, protocol=azure.mgmt.network.models.SecurityRuleProtocol.tcp, source_address_prefix='*', source_port_range='655', ), ], ) result_create = self.network_client.network_security_groups.create_or_update( self.group_name, security_group_name, params_create, ) result_create.wait() # AzureOperationPoller result_get = self.network_client.network_security_groups.get( self.group_name, security_group_name, ) result_list = list(self.network_client.network_security_groups.list( self.group_name, )) self.assertEqual(len(result_list), 1) result_list_all = list(self.network_client.network_security_groups.list_all()) # Security Rules new_security_rule_name = self.get_resource_name('pynewrule') async_security_rule = self.network_client.security_rules.create_or_update( self.group_name, security_group_name, new_security_rule_name, { 'access':azure.mgmt.network.models.SecurityRuleAccess.allow, 'description':'New Test security rule', 'destination_address_prefix':'*', 'destination_port_range':'123-3500', 'direction':azure.mgmt.network.models.SecurityRuleDirection.outbound, 'priority':400, 'protocol':azure.mgmt.network.models.SecurityRuleProtocol.tcp, 'source_address_prefix':'*', 'source_port_range':'655', } ) security_rule = async_security_rule.result() security_rule = self.network_client.security_rules.get( self.group_name, security_group_name, security_rule.name ) self.assertEqual(security_rule.name, new_security_rule_name) new_security_rules = list(self.network_client.security_rules.list( self.group_name, security_group_name )) self.assertEqual(len(new_security_rules), 2) result_delete = self.network_client.security_rules.delete( self.group_name, security_group_name, new_security_rule_name ) result_delete.wait() # Delete NSG result_delete = self.network_client.network_security_groups.delete( self.group_name, security_group_name, ) result_delete.wait() @record def test_routes(self): route_table_name = self.get_resource_name('pyroutetable') route_name = self.get_resource_name('pyroute') async_route_table = self.network_client.route_tables.create_or_update( self.group_name, route_table_name, {'location': self.region} ) route_table = async_route_table.result() route_table = self.network_client.route_tables.get( self.group_name, route_table.name ) self.assertEqual(route_table.name, route_table_name) route_tables = list(self.network_client.route_tables.list( self.group_name )) self.assertEqual(len(route_tables), 1) route_tables = list(self.network_client.route_tables.list_all()) self.assertGreater(len(route_tables), 0) async_route = self.network_client.routes.create_or_update( self.group_name, route_table.name, route_name, { 'address_prefix': '10.1.0.0/16', 'next_hop_type': 'None' } ) route = async_route.result() route = self.network_client.routes.get( self.group_name, route_table.name, route.name ) self.assertEqual(route.name, route_name) routes = list(self.network_client.routes.list( self.group_name, route_table.name )) self.assertEqual(len(routes), 1) async_route_delete = self.network_client.routes.delete( self.group_name, route_table.name, route.name ) async_route_delete.wait() async_route_table_delete = self.network_client.route_tables.delete( self.group_name, route_table_name ) async_route_table_delete.wait() @record def test_usages(self): usages = list(self.network_client.usages.list(self.region)) self.assertGreater(len(usages), 1) self.assertTrue(all(hasattr(u, 'name') for u in usages)) @record def test_express_route_service_providers(self): ersp = list(self.network_client.express_route_service_providers.list()) self.assertGreater(len(ersp), 0) self.assertTrue(all(hasattr(u, 'bandwidths_offered') for u in ersp)) @record def test_express_route_circuit(self): express_route_name = self.get_resource_name('pyexpressroute') async_express_route = self.network_client.express_route_circuits.create_or_update( self.group_name, express_route_name, { "location": self.region, "sku": { "name": "Standard_MeteredData", "tier": "Standard", "family": "MeteredData" }, "service_provider_properties": { "service_provider_name": "Comcast", "peering_location": "Chicago", "bandwidth_in_mbps": 100 } } ) express_route = async_express_route.result() express_route = self.network_client.express_route_circuits.get( self.group_name, express_route_name ) routes = list(self.network_client.express_route_circuits.list( self.group_name )) self.assertEqual(len(routes), 1) routes = list(self.network_client.express_route_circuits.list_all()) self.assertGreater(len(routes), 0) stats = self.network_client.express_route_circuits.get_stats( self.group_name, express_route_name ) self.assertIsNotNone(stats) async_peering = self.network_client.express_route_circuit_peerings.create_or_update( self.group_name, express_route_name, 'AzurePublicPeering', { "peering_type": "AzurePublicPeering", "peer_asn": 100, "primary_peer_address_prefix": "192.168.1.0/30", "secondary_peer_address_prefix": "192.168.2.0/30", "vlan_id": 200, } ) peering = async_peering.result() peering = self.network_client.express_route_circuit_peerings.get( self.group_name, express_route_name, 'AzurePublicPeering' ) peerings = list(self.network_client.express_route_circuit_peerings.list( self.group_name, express_route_name )) self.assertEqual(len(peerings), 1) stats = self.network_client.express_route_circuits.get_peering_stats( self.group_name, express_route_name, 'AzurePublicPeering' ) self.assertIsNotNone(stats) auth_name = self.get_resource_name('pyauth') async_auth = self.network_client.express_route_circuit_authorizations.create_or_update( self.group_name, express_route_name, auth_name, {} ) auth = async_auth.result() auth = self.network_client.express_route_circuit_authorizations.get( self.group_name, express_route_name, auth_name ) auths = list(self.network_client.express_route_circuit_authorizations.list( self.group_name, express_route_name )) self.assertEqual(len(auths), 1) async_auth = self.network_client.express_route_circuit_authorizations.delete( self.group_name, express_route_name, auth_name ) async_auth.wait() async_peering = self.network_client.express_route_circuit_peerings.delete( self.group_name, express_route_name, 'AzurePublicPeering' ) async_peering.wait() async_express_route = self.network_client.express_route_circuits.delete( self.group_name, express_route_name ) async_express_route.wait() @record def test_virtual_network_gateway_operations(self): # https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-portal vnet_name = self.get_resource_name('pyvirtnet') fe_name = self.get_resource_name('pysubnetfe') be_name = self.get_resource_name('pysubnetbe') gateway_name = self.get_resource_name('pysubnetga') # Create VNet async_vnet_creation = self.network_client.virtual_networks.create_or_update( self.group_name, vnet_name, { 'location': self.region, 'address_space': { 'address_prefixes': [ '10.11.0.0/16', '10.12.0.0/16' ] } } ) async_vnet_creation.wait() # Create Front End Subnet async_subnet_creation = self.network_client.subnets.create_or_update( self.group_name, vnet_name, fe_name, {'address_prefix': '10.11.0.0/24'} ) fe_subnet_info = async_subnet_creation.result() # Create Back End Subnet async_subnet_creation = self.network_client.subnets.create_or_update( self.group_name, vnet_name, be_name, {'address_prefix': '10.12.0.0/24'} ) be_subnet_info = async_subnet_creation.result() # Create Gateway Subnet async_subnet_creation = self.network_client.subnets.create_or_update( self.group_name, vnet_name, 'GatewaySubnet', {'address_prefix': '10.12.255.0/27'} ) gateway_subnet_info = async_subnet_creation.result() # Public IP Address public_ip_name = self.get_resource_name('pyipname') params_create = azure.mgmt.network.models.PublicIPAddress( location=self.region, public_ip_allocation_method=azure.mgmt.network.models.IPAllocationMethod.dynamic, tags={ 'key': 'value', }, ) result_create = self.network_client.public_ip_addresses.create_or_update( self.group_name, public_ip_name, params_create, ) public_ip_address = result_create.result() # Gateway itself vng_name = self.get_resource_name('pyvng') gw_params = { 'location': self.region, 'gateway_type': 'VPN', 'vpn_type': 'RouteBased', 'enable_bgp': False, 'sku': { 'tier': 'Standard', 'capacity': 2, 'name': 'Standard'}, 'ip_configurations':[{ 'name': 'default', 'private_ip_allocation_method': 'Dynamic', 'subnet': { 'id': gateway_subnet_info.id }, 'public_ip_address': { 'id': public_ip_address.id } }], } async_create = self.network_client.virtual_network_gateways.create_or_update( self.group_name, vng_name, gw_params ) vng = async_create.result() self.assertEquals(vng.name, vng_name) #------------------------------------------------------------------------------ if __name__ == '__main__': unittest.main()
[ 1, 29871, 30143, 29937, 14137, 29901, 23616, 29899, 29947, 13, 13, 29937, 2683, 2683, 2683, 2683, 1378, 29899, 13, 29937, 14187, 1266, 313, 29883, 29897, 7783, 15025, 29889, 2178, 10462, 21676, 29889, 13, 29937, 10413, 21144, 1090, 278, 341, 1806, 19245, 29889, 2823, 19245, 29889, 3945, 297, 278, 2060, 3876, 363, 13, 29937, 19405, 2472, 29889, 13, 29937, 2683, 2683, 2683, 2683, 28400, 13, 5215, 443, 27958, 13, 13, 5215, 15699, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 13, 3166, 1243, 13239, 29889, 9435, 29918, 3757, 3278, 1688, 4878, 1053, 2407, 13, 3166, 6987, 29889, 29885, 29887, 4378, 29918, 1688, 4878, 1053, 9056, 5709, 3399, 29892, 12634, 29924, 29887, 4378, 3057, 8259, 13, 13, 1990, 341, 29887, 4378, 13724, 3057, 29898, 28413, 29924, 29887, 4378, 3057, 8259, 1125, 13, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 2428, 29898, 29924, 29887, 4378, 13724, 3057, 29892, 1583, 467, 842, 3373, 580, 13, 4706, 1583, 29889, 11618, 29918, 4645, 353, 1583, 29889, 3258, 29918, 29885, 29887, 4378, 29918, 4645, 29898, 13, 9651, 15699, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 13724, 27107, 4032, 13, 4706, 1723, 13, 4706, 565, 451, 1583, 29889, 275, 29918, 1456, 1627, 7295, 13, 9651, 1583, 29889, 3258, 29918, 10314, 29918, 2972, 580, 13, 13, 1678, 732, 11651, 13, 1678, 822, 1243, 29918, 11618, 29918, 13248, 29918, 7543, 29898, 1311, 1125, 13, 4706, 325, 1212, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 29894, 1212, 1495, 13, 4706, 1014, 1212, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 29886, 952, 431, 1212, 1495, 13, 4706, 16588, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 29886, 948, 293, 1495, 13, 13, 4706, 396, 6204, 478, 6779, 13, 4706, 7465, 29918, 29894, 1212, 29918, 1037, 362, 353, 1583, 29889, 11618, 29918, 4645, 29889, 18714, 29918, 11618, 29879, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 325, 1212, 29918, 978, 29892, 13, 9651, 426, 13, 18884, 525, 5479, 2396, 1583, 29889, 12803, 29892, 13, 18884, 525, 7328, 29918, 3493, 2396, 426, 13, 462, 1678, 525, 7328, 29918, 13506, 267, 2396, 6024, 29896, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 29914, 29896, 29953, 2033, 13, 18884, 500, 13, 9651, 500, 13, 4706, 1723, 13, 4706, 7465, 29918, 29894, 1212, 29918, 1037, 362, 29889, 10685, 580, 13, 13, 4706, 396, 6204, 3323, 1212, 13, 4706, 7465, 29918, 1491, 1212, 29918, 1037, 362, 353, 1583, 29889, 11618, 29918, 4645, 29889, 1491, 1212, 29879, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 325, 1212, 29918, 978, 29892, 13, 9651, 1014, 1212, 29918, 978, 29892, 13, 9651, 11117, 7328, 29918, 13506, 2396, 525, 29896, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 29914, 29906, 29946, 10827, 13, 4706, 1723, 13, 4706, 1014, 1212, 29918, 3888, 353, 7465, 29918, 1491, 1212, 29918, 1037, 362, 29889, 2914, 580, 13, 13, 4706, 396, 6204, 405, 2965, 13, 4706, 7465, 29918, 7823, 29918, 1037, 362, 353, 1583, 29889, 11618, 29918, 4645, 29889, 11618, 29918, 1639, 8726, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 16588, 29918, 978, 29892, 13, 9651, 426, 13, 18884, 525, 5479, 2396, 1583, 29889, 12803, 29892, 13, 18884, 525, 666, 29918, 2917, 332, 800, 2396, 15974, 13, 462, 1678, 525, 978, 2396, 525, 3421, 29902, 29886, 3991, 742, 13, 462, 1678, 525, 1491, 1212, 2396, 426, 13, 462, 4706, 525, 333, 2396, 1014, 1212, 29918, 3888, 29889, 333, 13, 462, 1678, 500, 13, 18884, 500, 29962, 13, 9651, 500, 13, 4706, 1723, 13, 4706, 16588, 29918, 3888, 353, 7465, 29918, 7823, 29918, 1037, 362, 29889, 2914, 580, 13, 13, 4706, 16588, 29918, 3888, 353, 1583, 29889, 11618, 29918, 4645, 29889, 11618, 29918, 1639, 8726, 29889, 657, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 16588, 29918, 3888, 29889, 978, 13, 4706, 1723, 13, 3986, 13, 4706, 302, 1199, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 11618, 29918, 1639, 8726, 29889, 1761, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 13, 308, 876, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 29876, 1199, 511, 29871, 29896, 29897, 13, 13, 4706, 302, 1199, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 11618, 29918, 1639, 8726, 29889, 1761, 29918, 497, 3101, 13, 4706, 1583, 29889, 9294, 25120, 1008, 29898, 2435, 29898, 29876, 1199, 511, 29871, 29900, 29897, 13, 13, 4706, 7465, 29918, 8143, 353, 1583, 29889, 11618, 29918, 4645, 29889, 11618, 29918, 1639, 8726, 29889, 8143, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 16588, 29918, 3888, 29889, 978, 13, 4706, 1723, 13, 4706, 7465, 29918, 8143, 29889, 10685, 580, 13, 13, 1678, 732, 11651, 13, 1678, 822, 1243, 29918, 1359, 29918, 5521, 4564, 414, 29898, 1311, 1125, 13, 4706, 970, 29918, 666, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 666, 978, 1495, 13, 4706, 4565, 355, 29918, 666, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 29888, 666, 978, 1495, 13, 4706, 28915, 29918, 10109, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 481, 978, 1495, 13, 4706, 410, 915, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 771, 1785, 420, 1495, 13, 4706, 27981, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 27728, 978, 1495, 13, 13, 4706, 4565, 29918, 355, 29918, 333, 353, 6702, 29914, 1491, 7588, 1980, 29914, 8875, 29915, 13, 9651, 8207, 10314, 24020, 29914, 8875, 29915, 13, 9651, 8207, 771, 29454, 29914, 11277, 29889, 13724, 29915, 13, 9651, 8207, 1359, 22031, 4564, 414, 29914, 8875, 29915, 13, 9651, 8207, 8862, 355, 5690, 3991, 332, 800, 29914, 8875, 2824, 4830, 29898, 13, 18884, 1583, 29889, 11027, 29889, 20633, 7187, 24290, 2725, 29918, 1367, 29892, 13, 18884, 1583, 29889, 2972, 29918, 978, 29892, 13, 18884, 27981, 29918, 978, 29892, 13, 18884, 4565, 355, 29918, 666, 29918, 978, 13, 9651, 1723, 13, 4706, 1250, 29918, 355, 29918, 333, 353, 6702, 29914, 1491, 7588, 1980, 29914, 8875, 29915, 13, 9651, 8207, 10314, 24020, 29914, 8875, 29915, 13, 9651, 8207, 771, 29454, 29914, 11277, 29889, 13724, 29915, 13, 9651, 8207, 1359, 22031, 4564, 414, 29914, 8875, 29915, 13, 9651, 8207, 27852, 7061, 29925, 8789, 29914, 8875, 2824, 4830, 29898, 13, 18884, 1583, 29889, 11027, 29889, 20633, 7187, 24290, 2725, 29918, 1367, 29892, 13, 18884, 1583, 29889, 2972, 29918, 978, 29892, 13, 18884, 27981, 29918, 978, 29892, 13, 18884, 28915, 29918, 10109, 29918, 978, 13, 9651, 1723, 13, 13, 4706, 410, 915, 29918, 333, 353, 6702, 29914, 1491, 7588, 1980, 29914, 8875, 29915, 13, 9651, 8207, 10314, 24020, 29914, 8875, 29915, 13, 9651, 8207, 771, 29454, 29914, 11277, 29889, 13724, 29915, 13, 9651, 8207, 1359, 22031, 4564, 414, 29914, 8875, 29915, 13, 9651, 8207, 771, 5707, 29914, 8875, 2824, 4830, 29898, 13, 18884, 1583, 29889, 11027, 29889, 20633, 7187, 24290, 2725, 29918, 1367, 29892, 13, 18884, 1583, 29889, 2972, 29918, 978, 29892, 13, 18884, 27981, 29918, 978, 29892, 13, 18884, 410, 915, 29918, 978, 13, 9651, 1723, 13, 13, 4706, 396, 6204, 5236, 5690, 13, 4706, 970, 29918, 666, 29918, 16744, 353, 426, 13, 9651, 525, 5479, 2396, 1583, 29889, 12803, 29892, 13, 9651, 525, 3597, 29918, 666, 29918, 284, 5479, 29918, 5696, 2396, 525, 7959, 742, 13, 9651, 525, 333, 280, 29918, 15619, 29918, 262, 29918, 1195, 2667, 2396, 29871, 29946, 13, 4706, 500, 13, 4706, 7465, 29918, 3597, 666, 29918, 1037, 362, 353, 1583, 29889, 11618, 29918, 4645, 29889, 3597, 29918, 666, 29918, 7328, 267, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 970, 29918, 666, 29918, 978, 29892, 13, 9651, 970, 29918, 666, 29918, 16744, 13, 4706, 1723, 13, 4706, 970, 29918, 666, 29918, 3888, 353, 7465, 29918, 3597, 666, 29918, 1037, 362, 29889, 2914, 580, 13, 13, 4706, 396, 17166, 263, 13960, 5044, 29902, 29886, 11426, 13, 4706, 4565, 355, 29918, 666, 29918, 2917, 332, 800, 353, 15974, 13, 9651, 525, 978, 2396, 4565, 355, 29918, 666, 29918, 978, 29892, 13, 9651, 525, 9053, 29918, 666, 29918, 284, 5479, 29918, 5696, 2396, 525, 24001, 742, 13, 9651, 525, 3597, 29918, 666, 29918, 7328, 2396, 426, 13, 18884, 525, 333, 2396, 970, 29918, 666, 29918, 3888, 29889, 333, 13, 9651, 500, 13, 4706, 500, 29962, 13, 13, 4706, 396, 17166, 263, 7437, 5044, 594, 1253, 11565, 13, 4706, 14998, 29918, 7328, 29918, 1129, 3775, 353, 15974, 13, 9651, 525, 978, 2396, 28915, 29918, 10109, 29918, 978, 13, 4706, 500, 29962, 13, 13, 4706, 396, 17166, 263, 15202, 1184, 915, 13, 4706, 2070, 267, 353, 15974, 13, 9651, 525, 978, 2396, 410, 915, 29918, 978, 29892, 13, 9651, 525, 20464, 2396, 525, 5506, 742, 13, 9651, 525, 637, 2396, 29871, 29947, 29900, 29892, 13, 9651, 525, 19207, 29918, 262, 29918, 23128, 2396, 29871, 29896, 29945, 29892, 13, 9651, 525, 4537, 29918, 974, 29918, 771, 5707, 2396, 29871, 29946, 29892, 13, 9651, 525, 3827, 29918, 2084, 2396, 525, 354, 4298, 771, 915, 29889, 6307, 29915, 13, 4706, 500, 29962, 13, 13, 4706, 396, 17166, 263, 16012, 22031, 25856, 5751, 13, 4706, 2254, 29918, 5521, 19985, 29918, 19238, 353, 15974, 13, 9651, 525, 978, 2396, 525, 17688, 29899, 11249, 29899, 27728, 29899, 7491, 742, 13, 9651, 525, 20464, 2396, 525, 23981, 742, 13, 9651, 525, 8862, 355, 29918, 637, 2396, 29871, 29947, 29900, 29892, 13, 9651, 525, 27852, 29918, 637, 2396, 29871, 29947, 29900, 29892, 13, 9651, 525, 333, 280, 29918, 15619, 29918, 262, 29918, 1195, 2667, 2396, 29871, 29946, 29892, 13, 9651, 525, 12007, 29918, 29888, 417, 1218, 29918, 666, 2396, 7700, 29892, 13, 9651, 525, 1359, 29918, 27691, 2396, 525, 4592, 742, 13, 9651, 525, 8862, 355, 29918, 666, 29918, 13305, 2396, 426, 13, 18884, 525, 333, 2396, 4565, 29918, 355, 29918, 333, 13, 9651, 2981, 13, 9651, 525, 27852, 29918, 7328, 29918, 10109, 2396, 426, 13, 18884, 525, 333, 2396, 1250, 29918, 355, 29918, 333, 13, 9651, 2981, 13, 9651, 525, 771, 915, 2396, 426, 13, 18884, 525, 333, 2396, 410, 915, 29918, 333, 13, 9651, 500, 13, 4706, 500, 29962, 13, 13, 4706, 396, 17166, 512, 9917, 29940, 1299, 10740, 29896, 13, 4706, 297, 9917, 29918, 8924, 29918, 19238, 353, 15974, 13, 9651, 525, 978, 2396, 525, 17688, 29899, 11249, 29899, 1212, 7491, 29896, 742, 13, 9651, 525, 20464, 2396, 525, 23981, 742, 13, 9651, 525, 8862, 355, 29918, 637, 2396, 29871, 29906, 29896, 29892, 13, 9651, 525, 27852, 29918, 637, 2396, 29871, 29906, 29906, 29892, 13, 9651, 525, 12007, 29918, 29888, 417, 1218, 29918, 666, 2396, 7700, 29892, 13, 9651, 525, 333, 280, 29918, 15619, 29918, 262, 29918, 1195, 2667, 2396, 29871, 29946, 29892, 13, 9651, 525, 8862, 355, 29918, 666, 29918, 13305, 2396, 426, 13, 18884, 525, 333, 2396, 4565, 29918, 355, 29918, 333, 13, 9651, 500, 13, 4706, 500, 29962, 13, 13, 4706, 396, 17166, 512, 9917, 29940, 1299, 10740, 29906, 13, 4706, 297, 9917, 29918, 8924, 29918, 19238, 29889, 4397, 3319, 13, 9651, 525, 978, 2396, 525, 17688, 29899, 11249, 29899, 1212, 7491, 29906, 742, 13, 9651, 525, 20464, 2396, 525, 23981, 742, 13, 9651, 525, 8862, 355, 29918, 637, 2396, 29871, 29906, 29941, 29892, 13, 9651, 525, 27852, 29918, 637, 2396, 29871, 29906, 29906, 29892, 13, 9651, 525, 12007, 29918, 29888, 417, 1218, 29918, 666, 2396, 7700, 29892, 13, 9651, 525, 333, 280, 29918, 15619, 29918, 262, 29918, 1195, 2667, 2396, 29871, 29946, 29892, 13, 9651, 525, 8862, 355, 29918, 666, 29918, 13305, 2396, 426, 13, 18884, 525, 333, 2396, 4565, 29918, 355, 29918, 333, 13, 9651, 500, 13, 4706, 5615, 13, 13, 4706, 396, 26221, 16012, 7392, 25856, 13, 4706, 27981, 29918, 12674, 29918, 1037, 362, 353, 1583, 29889, 11618, 29918, 4645, 29889, 1359, 29918, 5521, 4564, 414, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 27981, 29918, 978, 29892, 13, 9651, 426, 13, 18884, 525, 5479, 2396, 1583, 29889, 12803, 29892, 13, 18884, 525, 8862, 355, 29918, 666, 29918, 2917, 332, 800, 2396, 4565, 355, 29918, 666, 29918, 2917, 332, 800, 29892, 13, 18884, 525, 27852, 29918, 7328, 29918, 1129, 3775, 2396, 14998, 29918, 7328, 29918, 1129, 3775, 29892, 13, 18884, 525, 771, 5707, 2396, 2070, 267, 29892, 13, 18884, 525, 1359, 29918, 5521, 19985, 29918, 19238, 2396, 2254, 29918, 5521, 19985, 29918, 19238, 29892, 13, 18884, 525, 262, 9917, 29918, 8924, 29918, 19238, 29915, 584, 262, 9917, 29918, 8924, 29918, 19238, 13, 9651, 500, 13, 4706, 1723, 13, 4706, 27981, 29918, 3888, 353, 27981, 29918, 12674, 29918, 1037, 362, 29889, 2914, 580, 13, 13, 4706, 396, 3617, 372, 13, 4706, 27981, 29918, 3888, 353, 1583, 29889, 11618, 29918, 4645, 29889, 1359, 29918, 5521, 4564, 414, 29889, 657, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 27981, 29918, 978, 13, 4706, 1723, 13, 13, 4706, 396, 2391, 599, 13, 4706, 301, 5824, 353, 1583, 29889, 11618, 29918, 4645, 29889, 1359, 29918, 5521, 4564, 414, 29889, 1761, 29918, 497, 580, 13, 4706, 301, 5824, 353, 1051, 29898, 29880, 5824, 29897, 13, 4706, 1583, 29889, 9294, 25120, 1008, 29898, 2435, 29898, 29880, 5824, 511, 29871, 29900, 29897, 13, 13, 4706, 396, 2391, 390, 29954, 13, 4706, 301, 5824, 353, 1583, 29889, 11618, 29918, 4645, 29889, 1359, 29918, 5521, 4564, 414, 29889, 1761, 29898, 1311, 29889, 2972, 29918, 978, 29897, 13, 4706, 301, 5824, 353, 1051, 29898, 29880, 5824, 29897, 13, 4706, 1583, 29889, 9294, 25120, 1008, 29898, 2435, 29898, 29880, 5824, 511, 29871, 29900, 29897, 13, 13, 4706, 396, 21267, 13, 4706, 7465, 29918, 27728, 29918, 8143, 353, 1583, 29889, 11618, 29918, 4645, 29889, 1359, 29918, 5521, 4564, 414, 29889, 8143, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 27981, 29918, 978, 13, 4706, 1723, 13, 4706, 7465, 29918, 27728, 29918, 8143, 29889, 10685, 580, 13, 13, 1678, 732, 11651, 13, 1678, 822, 1243, 29918, 3597, 29918, 666, 29918, 7328, 267, 29898, 1311, 1125, 13, 4706, 970, 29918, 666, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 666, 978, 1495, 13, 13, 4706, 8636, 29918, 3258, 353, 15699, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 19858, 5690, 7061, 29898, 13, 9651, 4423, 29922, 1311, 29889, 12803, 29892, 13, 9651, 970, 29918, 666, 29918, 284, 5479, 29918, 5696, 29922, 17688, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 5690, 2499, 5479, 4062, 29889, 16626, 29892, 13, 9651, 8282, 3790, 13, 18884, 525, 1989, 2396, 525, 1767, 742, 13, 9651, 2981, 13, 4706, 1723, 13, 4706, 1121, 29918, 3258, 353, 1583, 29889, 11618, 29918, 4645, 29889, 3597, 29918, 666, 29918, 7328, 267, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 970, 29918, 666, 29918, 978, 29892, 13, 9651, 8636, 29918, 3258, 29892, 13, 4706, 1723, 13, 4706, 1121, 29918, 3258, 29889, 10685, 580, 396, 12634, 10925, 7713, 1358, 13, 4706, 396, 1311, 29889, 9294, 9843, 29898, 2914, 29918, 3258, 29889, 4882, 29918, 401, 29892, 9056, 5709, 3399, 29889, 8949, 29897, 13, 13, 4706, 1121, 29918, 657, 353, 1583, 29889, 11618, 29918, 4645, 29889, 3597, 29918, 666, 29918, 7328, 267, 29889, 657, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 970, 29918, 666, 29918, 978, 29892, 13, 4706, 1723, 13, 4706, 396, 1311, 29889, 9294, 9843, 29898, 2914, 29918, 657, 29889, 4882, 29918, 401, 29892, 9056, 5709, 3399, 29889, 8949, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2914, 29918, 657, 29889, 5479, 29892, 1583, 29889, 12803, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2914, 29918, 657, 29889, 11338, 1839, 1989, 7464, 525, 1767, 1495, 13, 13, 4706, 1121, 29918, 1761, 353, 1583, 29889, 11618, 29918, 4645, 29889, 3597, 29918, 666, 29918, 7328, 267, 29889, 1761, 29898, 1311, 29889, 2972, 29918, 978, 29897, 13, 4706, 396, 1311, 29889, 9294, 9843, 29898, 2914, 29918, 1761, 29889, 4882, 29918, 401, 29892, 9056, 5709, 3399, 29889, 8949, 29897, 13, 4706, 1121, 29918, 1761, 353, 1051, 29898, 2914, 29918, 1761, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 2914, 29918, 1761, 511, 29871, 29896, 29897, 13, 13, 4706, 1121, 29918, 1761, 29918, 497, 353, 1583, 29889, 11618, 29918, 4645, 29889, 3597, 29918, 666, 29918, 7328, 267, 29889, 1761, 29918, 497, 580, 13, 4706, 396, 1311, 29889, 9294, 9843, 29898, 2914, 29918, 1761, 29918, 497, 29889, 4882, 29918, 401, 29892, 9056, 5709, 3399, 29889, 8949, 29897, 13, 4706, 1121, 29918, 1761, 29918, 497, 353, 1051, 29898, 2914, 29918, 1761, 29918, 497, 29897, 13, 4706, 1583, 29889, 9294, 25120, 1008, 29898, 2435, 29898, 2914, 29918, 1761, 29918, 497, 511, 29871, 29900, 29897, 13, 13, 4706, 1121, 29918, 8143, 353, 1583, 29889, 11618, 29918, 4645, 29889, 3597, 29918, 666, 29918, 7328, 267, 29889, 8143, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 970, 29918, 666, 29918, 978, 29892, 13, 4706, 1723, 13, 4706, 1121, 29918, 8143, 29889, 10685, 580, 396, 12634, 10925, 7713, 1358, 13, 4706, 396, 1311, 29889, 9294, 9843, 29898, 2914, 29918, 8143, 29889, 4882, 29918, 401, 29892, 9056, 5709, 3399, 29889, 8949, 29897, 13, 13, 4706, 1121, 29918, 1761, 353, 1583, 29889, 11618, 29918, 4645, 29889, 3597, 29918, 666, 29918, 7328, 267, 29889, 1761, 29898, 1311, 29889, 2972, 29918, 978, 29897, 13, 4706, 396, 1311, 29889, 9294, 9843, 29898, 2914, 29918, 1761, 29889, 4882, 29918, 401, 29892, 9056, 5709, 3399, 29889, 8949, 29897, 13, 4706, 1121, 29918, 1761, 353, 1051, 29898, 2914, 29918, 1761, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 2914, 29918, 1761, 511, 29871, 29900, 29897, 13, 13, 1678, 732, 11651, 13, 1678, 822, 1243, 29918, 18714, 29918, 11618, 29879, 29898, 1311, 1125, 13, 4706, 3564, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 29894, 1212, 1495, 13, 4706, 1014, 1212, 29896, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 29894, 1212, 1491, 1212, 650, 1495, 13, 4706, 1014, 1212, 29906, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 29894, 1212, 1491, 1212, 10184, 1495, 13, 13, 4706, 8636, 29918, 3258, 353, 15699, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 21287, 13724, 29898, 13, 9651, 4423, 29922, 1311, 29889, 12803, 29892, 13, 9651, 3211, 29918, 3493, 29922, 17688, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 7061, 14936, 29898, 13, 18884, 3211, 29918, 13506, 267, 11759, 13, 462, 1678, 525, 29896, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 29914, 29896, 29953, 742, 13, 18884, 21251, 13, 9651, 10353, 13, 9651, 270, 29882, 6814, 29918, 6768, 29922, 17688, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 29928, 29882, 6814, 5856, 29898, 13, 18884, 270, 1983, 29918, 643, 874, 11759, 13, 462, 1678, 525, 29896, 29900, 29889, 29896, 29889, 29896, 29889, 29896, 742, 13, 462, 1678, 525, 29896, 29900, 29889, 29896, 29889, 29906, 29889, 29946, 742, 13, 18884, 21251, 13, 9651, 10353, 13, 9651, 1014, 1212, 29879, 11759, 13, 18884, 15699, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 4035, 1212, 29898, 13, 462, 1678, 1024, 29922, 1491, 1212, 29896, 29918, 978, 29892, 13, 462, 1678, 3211, 29918, 13506, 2433, 29896, 29900, 29889, 29900, 29889, 29896, 29889, 29900, 29914, 29906, 29946, 742, 13, 18884, 10353, 13, 18884, 15699, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 4035, 1212, 29898, 13, 462, 1678, 1024, 29922, 1491, 1212, 29906, 29918, 978, 29892, 13, 462, 1678, 3211, 29918, 13506, 2433, 29896, 29900, 29889, 29900, 29889, 29906, 29889, 29900, 29914, 29906, 29946, 742, 13, 18884, 10353, 13, 9651, 21251, 13, 4706, 1723, 13, 13, 4706, 1121, 29918, 3258, 353, 1583, 29889, 11618, 29918, 4645, 29889, 18714, 29918, 11618, 29879, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 3564, 29918, 978, 29892, 13, 9651, 8636, 29918, 3258, 29892, 13, 4706, 1723, 13, 4706, 325, 1212, 353, 1121, 29918, 3258, 29889, 2914, 580, 13, 13, 4706, 325, 1212, 353, 1583, 29889, 11618, 29918, 4645, 29889, 18714, 29918, 11618, 29879, 29889, 657, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 325, 1212, 29889, 978, 29892, 13, 4706, 1723, 13, 13, 4706, 10377, 29918, 485, 737, 3097, 353, 1583, 29889, 11618, 29918, 4645, 29889, 18714, 29918, 11618, 29879, 29889, 3198, 29918, 666, 29918, 7328, 29918, 485, 737, 3097, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 325, 1212, 29889, 978, 29892, 13, 9651, 525, 29896, 29900, 29889, 29900, 29889, 29896, 29889, 29941, 29945, 29915, 396, 10575, 367, 3625, 1951, 716, 478, 6779, 7319, 3323, 1212, 29871, 29896, 13, 4706, 1723, 13, 4706, 1583, 29889, 9294, 5574, 29898, 666, 29918, 485, 737, 3097, 29889, 16515, 29897, 13, 13, 4706, 1121, 29918, 1761, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 18714, 29918, 11618, 29879, 29889, 1761, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 308, 876, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 2914, 29918, 1761, 511, 29871, 29896, 29897, 13, 13, 4706, 1121, 29918, 1761, 29918, 497, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 18714, 29918, 11618, 29879, 29889, 1761, 29918, 497, 3101, 13, 13, 4706, 7465, 29918, 8143, 353, 1583, 29889, 11618, 29918, 4645, 29889, 18714, 29918, 11618, 29879, 29889, 8143, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 3564, 29918, 978, 29892, 13, 4706, 1723, 13, 4706, 7465, 29918, 8143, 29889, 10685, 580, 13, 13, 1678, 732, 11651, 13, 1678, 822, 1243, 29918, 29881, 1983, 29918, 485, 737, 3097, 29898, 1311, 1125, 13, 4706, 1121, 29918, 3198, 353, 1583, 29889, 11618, 29918, 4645, 29889, 3198, 29918, 29881, 1983, 29918, 978, 29918, 485, 737, 3097, 29898, 13, 9651, 1583, 29889, 12803, 29892, 13, 9651, 525, 2272, 7247, 742, 13, 4706, 1723, 13, 4706, 396, 1311, 29889, 9294, 9843, 29898, 2914, 29918, 3198, 29889, 4882, 29918, 401, 29892, 9056, 5709, 3399, 29889, 8949, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 2914, 29918, 3198, 29897, 13, 13, 1678, 732, 11651, 13, 1678, 822, 1243, 29918, 1491, 1212, 29879, 29898, 1311, 1125, 13, 4706, 3564, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 29886, 952, 431, 1212, 1495, 13, 4706, 1014, 1212, 29896, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 29886, 952, 431, 1212, 650, 1495, 13, 4706, 1014, 1212, 29906, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 29886, 952, 431, 1212, 10184, 1495, 13, 13, 4706, 8636, 29918, 3258, 353, 15699, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 21287, 13724, 29898, 13, 9651, 4423, 29922, 1311, 29889, 12803, 29892, 13, 9651, 3211, 29918, 3493, 29922, 17688, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 7061, 14936, 29898, 13, 18884, 3211, 29918, 13506, 267, 11759, 13, 462, 1678, 525, 29896, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 29914, 29896, 29953, 742, 13, 18884, 21251, 13, 9651, 10353, 13, 9651, 270, 29882, 6814, 29918, 6768, 29922, 17688, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 29928, 29882, 6814, 5856, 29898, 13, 18884, 270, 1983, 29918, 643, 874, 11759, 13, 462, 1678, 525, 29896, 29900, 29889, 29896, 29889, 29896, 29889, 29896, 742, 13, 462, 1678, 525, 29896, 29900, 29889, 29896, 29889, 29906, 29889, 29946, 742, 13, 18884, 21251, 13, 9651, 10353, 13, 9651, 1014, 1212, 29879, 11759, 13, 18884, 15699, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 4035, 1212, 29898, 13, 462, 1678, 1024, 29922, 1491, 1212, 29896, 29918, 978, 29892, 13, 462, 1678, 3211, 29918, 13506, 2433, 29896, 29900, 29889, 29900, 29889, 29896, 29889, 29900, 29914, 29906, 29946, 742, 13, 18884, 10353, 13, 9651, 21251, 13, 4706, 1723, 13, 4706, 1121, 29918, 3258, 353, 1583, 29889, 11618, 29918, 4645, 29889, 18714, 29918, 11618, 29879, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 3564, 29918, 978, 29892, 13, 9651, 8636, 29918, 3258, 29892, 13, 4706, 1723, 13, 4706, 1121, 29918, 3258, 29889, 10685, 580, 396, 12634, 10925, 7713, 1358, 13, 13, 4706, 8636, 29918, 3258, 353, 15699, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 4035, 1212, 29898, 13, 9651, 1024, 29922, 1491, 1212, 29906, 29918, 978, 29892, 13, 9651, 3211, 29918, 13506, 2433, 29896, 29900, 29889, 29900, 29889, 29906, 29889, 29900, 29914, 29906, 29946, 742, 13, 4706, 1723, 13, 4706, 1121, 29918, 3258, 353, 1583, 29889, 11618, 29918, 4645, 29889, 1491, 1212, 29879, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 3564, 29918, 978, 29892, 13, 9651, 1014, 1212, 29906, 29918, 978, 29892, 13, 9651, 8636, 29918, 3258, 29892, 13, 4706, 1723, 13, 4706, 1121, 29918, 3258, 29889, 10685, 580, 396, 12634, 10925, 7713, 1358, 13, 13, 4706, 1121, 29918, 657, 353, 1583, 29889, 11618, 29918, 4645, 29889, 18714, 29918, 11618, 29879, 29889, 657, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 3564, 29918, 978, 29892, 13, 4706, 1723, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 2914, 29918, 657, 29889, 1491, 1212, 29879, 511, 29871, 29906, 29897, 13, 13, 4706, 1121, 29918, 657, 353, 1583, 29889, 11618, 29918, 4645, 29889, 1491, 1212, 29879, 29889, 657, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 3564, 29918, 978, 29892, 13, 9651, 1014, 1212, 29906, 29918, 978, 29892, 13, 4706, 1723, 13, 13, 4706, 1121, 29918, 1761, 353, 1583, 29889, 11618, 29918, 4645, 29889, 1491, 1212, 29879, 29889, 1761, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 3564, 29918, 978, 29892, 13, 4706, 1723, 13, 4706, 1014, 1212, 29879, 353, 1051, 29898, 2914, 29918, 1761, 29897, 13, 13, 4706, 1121, 29918, 8143, 353, 1583, 29889, 11618, 29918, 4645, 29889, 1491, 1212, 29879, 29889, 8143, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 3564, 29918, 978, 29892, 13, 9651, 1014, 1212, 29906, 29918, 978, 29892, 13, 4706, 1723, 13, 4706, 1121, 29918, 8143, 29889, 10685, 580, 13, 13, 1678, 732, 11651, 13, 1678, 822, 1243, 29918, 11618, 29918, 8926, 29918, 13155, 29898, 1311, 1125, 13, 4706, 6993, 29918, 2972, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 3471, 2972, 1495, 13, 4706, 6993, 29918, 7491, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 3471, 629, 283, 558, 1297, 1495, 13, 13, 4706, 8636, 29918, 3258, 353, 15699, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 13724, 13228, 4782, 29898, 13, 9651, 4423, 29922, 1311, 29889, 12803, 29892, 13, 9651, 6993, 29918, 19238, 11759, 13, 18884, 15699, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 13228, 10740, 29898, 13, 462, 1678, 1024, 29922, 8926, 29918, 7491, 29918, 978, 29892, 13, 462, 1678, 2130, 29922, 17688, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 13228, 10740, 6638, 29889, 9536, 29892, 13, 462, 1678, 6139, 2433, 3057, 6993, 5751, 742, 13, 462, 1678, 12551, 29918, 7328, 29918, 13506, 2433, 29930, 742, 13, 462, 1678, 12551, 29918, 637, 29918, 3881, 2433, 29896, 29906, 29941, 29899, 29941, 29945, 29900, 29900, 742, 13, 462, 1678, 5305, 29922, 17688, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 13228, 10740, 21602, 29889, 262, 9917, 29892, 13, 462, 1678, 20136, 29922, 29945, 29900, 29900, 29892, 13, 462, 1678, 9608, 29922, 17688, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 13228, 10740, 17830, 29889, 23981, 29892, 13, 462, 1678, 2752, 29918, 7328, 29918, 13506, 2433, 29930, 742, 13, 462, 1678, 2752, 29918, 637, 29918, 3881, 2433, 29953, 29945, 29945, 742, 13, 18884, 10353, 13, 9651, 21251, 13, 4706, 1723, 13, 4706, 1121, 29918, 3258, 353, 1583, 29889, 11618, 29918, 4645, 29889, 11618, 29918, 8926, 29918, 13155, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 6993, 29918, 2972, 29918, 978, 29892, 13, 9651, 8636, 29918, 3258, 29892, 13, 4706, 1723, 13, 4706, 1121, 29918, 3258, 29889, 10685, 580, 396, 12634, 10925, 7713, 1358, 13, 13, 4706, 1121, 29918, 657, 353, 1583, 29889, 11618, 29918, 4645, 29889, 11618, 29918, 8926, 29918, 13155, 29889, 657, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 6993, 29918, 2972, 29918, 978, 29892, 13, 4706, 1723, 13, 13, 4706, 1121, 29918, 1761, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 11618, 29918, 8926, 29918, 13155, 29889, 1761, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 308, 876, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 2914, 29918, 1761, 511, 29871, 29896, 29897, 13, 13, 4706, 1121, 29918, 1761, 29918, 497, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 11618, 29918, 8926, 29918, 13155, 29889, 1761, 29918, 497, 3101, 13, 13, 4706, 396, 14223, 390, 2540, 13, 4706, 716, 29918, 8926, 29918, 7491, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 1482, 7491, 1495, 13, 4706, 7465, 29918, 8926, 29918, 7491, 353, 1583, 29889, 11618, 29918, 4645, 29889, 8926, 29918, 19238, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 6993, 29918, 2972, 29918, 978, 29892, 13, 9651, 716, 29918, 8926, 29918, 7491, 29918, 978, 29892, 13, 9651, 426, 13, 462, 1678, 525, 5943, 2396, 17688, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 13228, 10740, 6638, 29889, 9536, 29892, 13, 462, 1678, 525, 8216, 22099, 4373, 4321, 6993, 5751, 742, 13, 462, 1678, 525, 23848, 29918, 7328, 29918, 13506, 22099, 29930, 742, 13, 462, 1678, 525, 23848, 29918, 637, 29918, 3881, 22099, 29896, 29906, 29941, 29899, 29941, 29945, 29900, 29900, 742, 13, 462, 1678, 525, 20845, 2396, 17688, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 13228, 10740, 21602, 29889, 449, 9917, 29892, 13, 462, 1678, 525, 29886, 21766, 2396, 29946, 29900, 29900, 29892, 13, 462, 1678, 525, 20464, 2396, 17688, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 13228, 10740, 17830, 29889, 23981, 29892, 13, 462, 1678, 525, 4993, 29918, 7328, 29918, 13506, 22099, 29930, 742, 13, 462, 1678, 525, 4993, 29918, 637, 29918, 3881, 22099, 29953, 29945, 29945, 742, 13, 9651, 500, 13, 4706, 1723, 13, 4706, 6993, 29918, 7491, 353, 7465, 29918, 8926, 29918, 7491, 29889, 2914, 580, 13, 13, 4706, 6993, 29918, 7491, 353, 1583, 29889, 11618, 29918, 4645, 29889, 8926, 29918, 19238, 29889, 657, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 6993, 29918, 2972, 29918, 978, 29892, 13, 9651, 6993, 29918, 7491, 29889, 978, 13, 4706, 1723, 13, 4706, 1583, 29889, 9294, 9843, 29898, 8926, 29918, 7491, 29889, 978, 29892, 716, 29918, 8926, 29918, 7491, 29918, 978, 29897, 13, 13, 4706, 716, 29918, 8926, 29918, 19238, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 8926, 29918, 19238, 29889, 1761, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 6993, 29918, 2972, 29918, 978, 13, 308, 876, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 1482, 29918, 8926, 29918, 19238, 511, 29871, 29906, 29897, 13, 13, 4706, 1121, 29918, 8143, 353, 1583, 29889, 11618, 29918, 4645, 29889, 8926, 29918, 19238, 29889, 8143, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 6993, 29918, 2972, 29918, 978, 29892, 13, 9651, 716, 29918, 8926, 29918, 7491, 29918, 978, 13, 4706, 1723, 13, 4706, 1121, 29918, 8143, 29889, 10685, 580, 13, 13, 4706, 396, 21267, 3865, 29954, 13, 4706, 1121, 29918, 8143, 353, 1583, 29889, 11618, 29918, 4645, 29889, 11618, 29918, 8926, 29918, 13155, 29889, 8143, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 6993, 29918, 2972, 29918, 978, 29892, 13, 4706, 1723, 13, 4706, 1121, 29918, 8143, 29889, 10685, 580, 13, 13, 1678, 732, 11651, 13, 1678, 822, 1243, 29918, 27894, 29898, 1311, 1125, 13, 4706, 5782, 29918, 2371, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 14608, 300, 519, 1495, 13, 4706, 5782, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 13134, 1495, 13, 13, 4706, 7465, 29918, 13134, 29918, 2371, 353, 1583, 29889, 11618, 29918, 4645, 29889, 13134, 29918, 24051, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 5782, 29918, 2371, 29918, 978, 29892, 13, 9651, 11117, 5479, 2396, 1583, 29889, 12803, 29913, 13, 4706, 1723, 13, 4706, 5782, 29918, 2371, 353, 7465, 29918, 13134, 29918, 2371, 29889, 2914, 580, 13, 13, 4706, 5782, 29918, 2371, 353, 1583, 29889, 11618, 29918, 4645, 29889, 13134, 29918, 24051, 29889, 657, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 5782, 29918, 2371, 29889, 978, 13, 4706, 1723, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13134, 29918, 2371, 29889, 978, 29892, 5782, 29918, 2371, 29918, 978, 29897, 13, 13, 4706, 5782, 29918, 24051, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 13134, 29918, 24051, 29889, 1761, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 13, 308, 876, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 13134, 29918, 24051, 511, 29871, 29896, 29897, 13, 13, 4706, 5782, 29918, 24051, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 13134, 29918, 24051, 29889, 1761, 29918, 497, 3101, 13, 4706, 1583, 29889, 9294, 25120, 1008, 29898, 2435, 29898, 13134, 29918, 24051, 511, 29871, 29900, 29897, 13, 13, 4706, 7465, 29918, 13134, 353, 1583, 29889, 11618, 29918, 4645, 29889, 27894, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 5782, 29918, 2371, 29889, 978, 29892, 13, 9651, 5782, 29918, 978, 29892, 13, 9651, 426, 13, 18884, 525, 7328, 29918, 13506, 2396, 525, 29896, 29900, 29889, 29896, 29889, 29900, 29889, 29900, 29914, 29896, 29953, 742, 13, 18884, 525, 4622, 29918, 29882, 459, 29918, 1853, 2396, 525, 8516, 29915, 13, 9651, 500, 13, 4706, 1723, 13, 4706, 5782, 353, 7465, 29918, 13134, 29889, 2914, 580, 13, 13, 4706, 5782, 353, 1583, 29889, 11618, 29918, 4645, 29889, 27894, 29889, 657, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 5782, 29918, 2371, 29889, 978, 29892, 13, 9651, 5782, 29889, 978, 13, 4706, 1723, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13134, 29889, 978, 29892, 5782, 29918, 978, 29897, 13, 13, 4706, 12049, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 27894, 29889, 1761, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 5782, 29918, 2371, 29889, 978, 13, 308, 876, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 27894, 511, 29871, 29896, 29897, 13, 13, 4706, 7465, 29918, 13134, 29918, 8143, 353, 1583, 29889, 11618, 29918, 4645, 29889, 27894, 29889, 8143, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 5782, 29918, 2371, 29889, 978, 29892, 13, 9651, 5782, 29889, 978, 13, 4706, 1723, 13, 4706, 7465, 29918, 13134, 29918, 8143, 29889, 10685, 580, 13, 13, 4706, 7465, 29918, 13134, 29918, 2371, 29918, 8143, 353, 1583, 29889, 11618, 29918, 4645, 29889, 13134, 29918, 24051, 29889, 8143, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 5782, 29918, 2371, 29918, 978, 13, 4706, 1723, 13, 4706, 7465, 29918, 13134, 29918, 2371, 29918, 8143, 29889, 10685, 580, 13, 13, 1678, 732, 11651, 13, 1678, 822, 1243, 29918, 375, 1179, 29898, 1311, 1125, 13, 4706, 502, 1179, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 375, 1179, 29889, 1761, 29898, 1311, 29889, 12803, 876, 13, 4706, 1583, 29889, 9294, 25120, 1008, 29898, 2435, 29898, 375, 1179, 511, 29871, 29896, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 497, 29898, 5349, 5552, 29898, 29884, 29892, 525, 978, 1495, 363, 318, 297, 502, 1179, 876, 13, 13, 1678, 732, 11651, 13, 1678, 822, 1243, 29918, 17073, 29918, 13134, 29918, 5509, 29918, 771, 29454, 29898, 1311, 1125, 13, 4706, 17730, 29886, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 5509, 29918, 771, 29454, 29889, 1761, 3101, 13, 4706, 1583, 29889, 9294, 25120, 1008, 29898, 2435, 29898, 414, 29886, 511, 29871, 29900, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 497, 29898, 5349, 5552, 29898, 29884, 29892, 525, 4980, 2103, 29879, 29918, 974, 571, 287, 1495, 363, 318, 297, 17730, 29886, 876, 13, 13, 1678, 732, 11651, 13, 1678, 822, 1243, 29918, 17073, 29918, 13134, 29918, 6034, 3121, 29898, 1311, 1125, 13, 4706, 4653, 29918, 13134, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 17073, 13134, 1495, 13, 4706, 7465, 29918, 17073, 29918, 13134, 353, 1583, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 19544, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 4653, 29918, 13134, 29918, 978, 29892, 13, 9651, 426, 13, 18884, 376, 5479, 1115, 1583, 29889, 12803, 29892, 13, 18884, 376, 18181, 1115, 426, 13, 462, 1678, 376, 978, 1115, 376, 15449, 29918, 29924, 1308, 287, 1469, 613, 13, 462, 1678, 376, 29873, 631, 1115, 376, 15449, 613, 13, 462, 1678, 376, 11922, 1115, 376, 29924, 1308, 287, 1469, 29908, 13, 18884, 2981, 13, 18884, 376, 5509, 29918, 18121, 29918, 11330, 1115, 426, 13, 462, 1678, 376, 5509, 29918, 18121, 29918, 978, 1115, 376, 1523, 4384, 613, 13, 462, 1678, 376, 412, 3241, 29918, 5479, 1115, 376, 1451, 9384, 613, 13, 462, 1678, 376, 4980, 2103, 29918, 262, 29918, 8337, 567, 1115, 29871, 29896, 29900, 29900, 13, 18884, 500, 13, 9651, 500, 13, 4706, 1723, 13, 4706, 4653, 29918, 13134, 353, 7465, 29918, 17073, 29918, 13134, 29889, 2914, 580, 13, 13, 4706, 4653, 29918, 13134, 353, 1583, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 19544, 29889, 657, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 4653, 29918, 13134, 29918, 978, 13, 4706, 1723, 13, 13, 4706, 12049, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 19544, 29889, 1761, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 13, 308, 876, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 27894, 511, 29871, 29896, 29897, 13, 13, 4706, 12049, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 19544, 29889, 1761, 29918, 497, 3101, 13, 4706, 1583, 29889, 9294, 25120, 1008, 29898, 2435, 29898, 27894, 511, 29871, 29900, 29897, 13, 13, 4706, 22663, 353, 1583, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 19544, 29889, 657, 29918, 16202, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 4653, 29918, 13134, 29918, 978, 13, 4706, 1723, 13, 4706, 1583, 29889, 9294, 3624, 3664, 8516, 29898, 16202, 29897, 13, 13, 4706, 7465, 29918, 412, 3241, 353, 1583, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 3121, 29918, 412, 261, 886, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 4653, 29918, 13134, 29918, 978, 29892, 13, 9651, 525, 28413, 19858, 15666, 3241, 742, 13, 9651, 426, 13, 18884, 376, 412, 3241, 29918, 1853, 1115, 376, 28413, 19858, 15666, 3241, 613, 13, 18884, 376, 412, 261, 29918, 294, 29876, 1115, 29871, 29896, 29900, 29900, 29892, 29871, 13, 18884, 376, 16072, 29918, 412, 261, 29918, 7328, 29918, 13506, 1115, 376, 29896, 29929, 29906, 29889, 29896, 29953, 29947, 29889, 29896, 29889, 29900, 29914, 29941, 29900, 613, 13, 18884, 376, 7496, 653, 29918, 412, 261, 29918, 7328, 29918, 13506, 1115, 376, 29896, 29929, 29906, 29889, 29896, 29953, 29947, 29889, 29906, 29889, 29900, 29914, 29941, 29900, 613, 13, 18884, 376, 29894, 6468, 29918, 333, 1115, 29871, 29906, 29900, 29900, 29892, 13, 9651, 500, 13, 4706, 1723, 13, 4706, 1236, 3241, 353, 7465, 29918, 412, 3241, 29889, 2914, 580, 13, 13, 4706, 1236, 3241, 353, 1583, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 3121, 29918, 412, 261, 886, 29889, 657, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 4653, 29918, 13134, 29918, 978, 29892, 13, 9651, 525, 28413, 19858, 15666, 3241, 29915, 13, 4706, 1723, 13, 13, 4706, 23533, 886, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 3121, 29918, 412, 261, 886, 29889, 1761, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 4653, 29918, 13134, 29918, 978, 13, 308, 876, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 412, 261, 886, 511, 29871, 29896, 29897, 13, 13, 4706, 22663, 353, 1583, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 19544, 29889, 657, 29918, 412, 3241, 29918, 16202, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 4653, 29918, 13134, 29918, 978, 29892, 13, 9651, 525, 28413, 19858, 15666, 3241, 29915, 13, 4706, 1723, 13, 4706, 1583, 29889, 9294, 3624, 3664, 8516, 29898, 16202, 29897, 13, 13, 4706, 4817, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 5150, 1495, 13, 4706, 7465, 29918, 5150, 353, 1583, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 3121, 29918, 8921, 17063, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 4653, 29918, 13134, 29918, 978, 29892, 13, 9651, 4817, 29918, 978, 29892, 13, 9651, 6571, 13, 4706, 1723, 13, 4706, 4817, 353, 7465, 29918, 5150, 29889, 2914, 580, 13, 13, 4706, 4817, 353, 1583, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 3121, 29918, 8921, 17063, 29889, 657, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 4653, 29918, 13134, 29918, 978, 29892, 13, 9651, 4817, 29918, 978, 13, 4706, 1723, 13, 13, 4706, 4817, 29879, 353, 1051, 29898, 1311, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 3121, 29918, 8921, 17063, 29889, 1761, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 4653, 29918, 13134, 29918, 978, 13, 308, 876, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 5150, 29879, 511, 29871, 29896, 29897, 13, 13, 4706, 7465, 29918, 5150, 353, 1583, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 3121, 29918, 8921, 17063, 29889, 8143, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 4653, 29918, 13134, 29918, 978, 29892, 13, 9651, 4817, 29918, 978, 13, 4706, 1723, 13, 4706, 7465, 29918, 5150, 29889, 10685, 580, 13, 13, 4706, 7465, 29918, 412, 3241, 353, 1583, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 3121, 29918, 412, 261, 886, 29889, 8143, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 4653, 29918, 13134, 29918, 978, 29892, 13, 9651, 525, 28413, 19858, 15666, 3241, 29915, 13, 4706, 1723, 13, 4706, 7465, 29918, 412, 3241, 29889, 10685, 580, 13, 13, 4706, 7465, 29918, 17073, 29918, 13134, 353, 1583, 29889, 11618, 29918, 4645, 29889, 17073, 29918, 13134, 29918, 6034, 19544, 29889, 8143, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 4653, 29918, 13134, 29918, 978, 13, 4706, 1723, 13, 4706, 7465, 29918, 17073, 29918, 13134, 29889, 10685, 580, 13, 13, 1678, 732, 11651, 13, 1678, 822, 1243, 29918, 18714, 29918, 11618, 29918, 17062, 1582, 29918, 3372, 800, 29898, 1311, 1125, 13, 4706, 396, 2045, 597, 2640, 29889, 4994, 29889, 510, 29914, 264, 29899, 375, 29914, 17688, 29914, 29894, 21257, 29899, 17062, 1582, 29914, 29894, 21257, 29899, 17062, 1582, 29899, 3525, 517, 29899, 2746, 29899, 517, 29899, 2746, 29899, 10314, 29899, 12847, 29899, 25089, 13, 13, 4706, 325, 1212, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 15389, 1212, 1495, 13, 4706, 1238, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 29886, 952, 431, 1212, 1725, 1495, 13, 4706, 367, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 29886, 952, 431, 1212, 915, 1495, 13, 4706, 28646, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 29886, 952, 431, 1212, 3249, 1495, 13, 13, 4706, 396, 6204, 478, 6779, 13, 4706, 7465, 29918, 29894, 1212, 29918, 1037, 362, 353, 1583, 29889, 11618, 29918, 4645, 29889, 18714, 29918, 11618, 29879, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 325, 1212, 29918, 978, 29892, 13, 9651, 426, 13, 18884, 525, 5479, 2396, 1583, 29889, 12803, 29892, 13, 18884, 525, 7328, 29918, 3493, 2396, 426, 13, 462, 1678, 525, 7328, 29918, 13506, 267, 2396, 518, 13, 462, 4706, 525, 29896, 29900, 29889, 29896, 29896, 29889, 29900, 29889, 29900, 29914, 29896, 29953, 742, 13, 462, 4706, 525, 29896, 29900, 29889, 29896, 29906, 29889, 29900, 29889, 29900, 29914, 29896, 29953, 29915, 13, 462, 1678, 4514, 13, 18884, 500, 13, 9651, 500, 13, 4706, 1723, 13, 4706, 7465, 29918, 29894, 1212, 29918, 1037, 362, 29889, 10685, 580, 13, 13, 4706, 396, 6204, 13960, 2796, 3323, 1212, 13, 4706, 7465, 29918, 1491, 1212, 29918, 1037, 362, 353, 1583, 29889, 11618, 29918, 4645, 29889, 1491, 1212, 29879, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 325, 1212, 29918, 978, 29892, 13, 9651, 1238, 29918, 978, 29892, 13, 9651, 11117, 7328, 29918, 13506, 2396, 525, 29896, 29900, 29889, 29896, 29896, 29889, 29900, 29889, 29900, 29914, 29906, 29946, 10827, 13, 4706, 1723, 13, 4706, 1238, 29918, 1491, 1212, 29918, 3888, 353, 7465, 29918, 1491, 1212, 29918, 1037, 362, 29889, 2914, 580, 13, 13, 4706, 396, 6204, 7437, 2796, 3323, 1212, 13, 4706, 7465, 29918, 1491, 1212, 29918, 1037, 362, 353, 1583, 29889, 11618, 29918, 4645, 29889, 1491, 1212, 29879, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 325, 1212, 29918, 978, 29892, 13, 9651, 367, 29918, 978, 29892, 13, 9651, 11117, 7328, 29918, 13506, 2396, 525, 29896, 29900, 29889, 29896, 29906, 29889, 29900, 29889, 29900, 29914, 29906, 29946, 10827, 13, 4706, 1723, 13, 4706, 367, 29918, 1491, 1212, 29918, 3888, 353, 7465, 29918, 1491, 1212, 29918, 1037, 362, 29889, 2914, 580, 13, 13, 4706, 396, 6204, 22510, 1582, 3323, 1212, 13, 4706, 7465, 29918, 1491, 1212, 29918, 1037, 362, 353, 1583, 29889, 11618, 29918, 4645, 29889, 1491, 1212, 29879, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 325, 1212, 29918, 978, 29892, 13, 9651, 525, 29954, 403, 1582, 4035, 1212, 742, 13, 9651, 11117, 7328, 29918, 13506, 2396, 525, 29896, 29900, 29889, 29896, 29906, 29889, 29906, 29945, 29945, 29889, 29900, 29914, 29906, 29955, 10827, 13, 4706, 1723, 13, 4706, 28646, 29918, 1491, 1212, 29918, 3888, 353, 7465, 29918, 1491, 1212, 29918, 1037, 362, 29889, 2914, 580, 13, 13, 4706, 396, 5236, 5641, 16428, 13, 4706, 970, 29918, 666, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 666, 978, 1495, 13, 4706, 8636, 29918, 3258, 353, 15699, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 19858, 5690, 7061, 29898, 13, 9651, 4423, 29922, 1311, 29889, 12803, 29892, 13, 9651, 970, 29918, 666, 29918, 284, 5479, 29918, 5696, 29922, 17688, 29889, 29885, 29887, 4378, 29889, 11618, 29889, 9794, 29889, 5690, 2499, 5479, 4062, 29889, 16626, 29892, 13, 9651, 8282, 3790, 13, 18884, 525, 1989, 2396, 525, 1767, 742, 13, 9651, 2981, 13, 4706, 1723, 13, 4706, 1121, 29918, 3258, 353, 1583, 29889, 11618, 29918, 4645, 29889, 3597, 29918, 666, 29918, 7328, 267, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 970, 29918, 666, 29918, 978, 29892, 13, 9651, 8636, 29918, 3258, 29892, 13, 4706, 1723, 13, 4706, 970, 29918, 666, 29918, 7328, 353, 1121, 29918, 3258, 29889, 2914, 580, 13, 13, 4706, 396, 22510, 1582, 3528, 13, 4706, 325, 865, 29918, 978, 353, 1583, 29889, 657, 29918, 10314, 29918, 978, 877, 2272, 29894, 865, 1495, 13, 4706, 330, 29893, 29918, 7529, 353, 426, 13, 9651, 525, 5479, 2396, 1583, 29889, 12803, 29892, 13, 9651, 525, 17062, 1582, 29918, 1853, 2396, 525, 29963, 15695, 742, 13, 9651, 525, 29894, 21257, 29918, 1853, 2396, 525, 12085, 29933, 1463, 742, 13, 9651, 525, 12007, 29918, 16264, 29886, 2396, 7700, 29892, 13, 9651, 525, 18181, 2396, 426, 13, 18884, 525, 29873, 631, 2396, 525, 15449, 742, 13, 18884, 525, 5030, 5946, 2396, 29871, 29906, 29892, 13, 18884, 525, 978, 2396, 525, 15449, 16675, 13, 9651, 525, 666, 29918, 2917, 332, 800, 2396, 19660, 13, 18884, 525, 978, 2396, 525, 4381, 742, 13, 18884, 525, 9053, 29918, 666, 29918, 284, 5479, 29918, 5696, 2396, 525, 24001, 742, 13, 18884, 525, 1491, 1212, 2396, 426, 13, 462, 1678, 525, 333, 2396, 28646, 29918, 1491, 1212, 29918, 3888, 29889, 333, 13, 18884, 2981, 13, 18884, 525, 3597, 29918, 666, 29918, 7328, 2396, 426, 13, 462, 1678, 525, 333, 2396, 970, 29918, 666, 29918, 7328, 29889, 333, 13, 18884, 500, 13, 9651, 500, 1402, 13, 4706, 500, 13, 4706, 7465, 29918, 3258, 353, 1583, 29889, 11618, 29918, 4645, 29889, 18714, 29918, 11618, 29918, 17062, 1994, 29889, 3258, 29918, 272, 29918, 5504, 29898, 13, 9651, 1583, 29889, 2972, 29918, 978, 29892, 13, 9651, 325, 865, 29918, 978, 29892, 13, 9651, 330, 29893, 29918, 7529, 13, 4706, 1723, 13, 4706, 325, 865, 353, 7465, 29918, 3258, 29889, 2914, 580, 13, 4706, 1583, 29889, 9294, 14776, 29898, 29894, 865, 29889, 978, 29892, 325, 865, 29918, 978, 29897, 13, 13, 13, 29937, 2683, 2683, 2683, 2683, 9072, 489, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 2 ]