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
ultracart/models/item_identifiers.py
UltraCart/rest_api_v2_sdk_python
1
1617189
<filename>ultracart/models/item_identifiers.py # coding: utf-8 """ UltraCart Rest API V2 UltraCart REST API Version 2 # noqa: E501 OpenAPI spec version: 2.0.0 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class ItemIdentifiers(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ """ Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ swagger_types = { 'barcode': 'str', 'manufacturer_name': 'str', 'manufacturer_sku': 'str', 'unspsc': 'str' } attribute_map = { 'barcode': 'barcode', 'manufacturer_name': 'manufacturer_name', 'manufacturer_sku': 'manufacturer_sku', 'unspsc': 'unspsc' } def __init__(self, barcode=None, manufacturer_name=None, manufacturer_sku=None, unspsc=None): # noqa: E501 """ItemIdentifiers - a model defined in Swagger""" # noqa: E501 self._barcode = None self._manufacturer_name = None self._manufacturer_sku = None self._unspsc = None self.discriminator = None if barcode is not None: self.barcode = barcode if manufacturer_name is not None: self.manufacturer_name = manufacturer_name if manufacturer_sku is not None: self.manufacturer_sku = manufacturer_sku if unspsc is not None: self.unspsc = unspsc @property def barcode(self): """Gets the barcode of this ItemIdentifiers. # noqa: E501 Barcode # noqa: E501 :return: The barcode of this ItemIdentifiers. # noqa: E501 :rtype: str """ return self._barcode @barcode.setter def barcode(self, barcode): """Sets the barcode of this ItemIdentifiers. Barcode # noqa: E501 :param barcode: The barcode of this ItemIdentifiers. # noqa: E501 :type: str """ if barcode is not None and len(barcode) > 30: raise ValueError("Invalid value for `barcode`, length must be less than or equal to `30`") # noqa: E501 self._barcode = barcode @property def manufacturer_name(self): """Gets the manufacturer_name of this ItemIdentifiers. # noqa: E501 Manufacturer Name # noqa: E501 :return: The manufacturer_name of this ItemIdentifiers. # noqa: E501 :rtype: str """ return self._manufacturer_name @manufacturer_name.setter def manufacturer_name(self, manufacturer_name): """Sets the manufacturer_name of this ItemIdentifiers. Manufacturer Name # noqa: E501 :param manufacturer_name: The manufacturer_name of this ItemIdentifiers. # noqa: E501 :type: str """ if manufacturer_name is not None and len(manufacturer_name) > 50: raise ValueError("Invalid value for `manufacturer_name`, length must be less than or equal to `50`") # noqa: E501 self._manufacturer_name = manufacturer_name @property def manufacturer_sku(self): """Gets the manufacturer_sku of this ItemIdentifiers. # noqa: E501 Manufacturer SKU # noqa: E501 :return: The manufacturer_sku of this ItemIdentifiers. # noqa: E501 :rtype: str """ return self._manufacturer_sku @manufacturer_sku.setter def manufacturer_sku(self, manufacturer_sku): """Sets the manufacturer_sku of this ItemIdentifiers. Manufacturer SKU # noqa: E501 :param manufacturer_sku: The manufacturer_sku of this ItemIdentifiers. # noqa: E501 :type: str """ if manufacturer_sku is not None and len(manufacturer_sku) > 25: raise ValueError("Invalid value for `manufacturer_sku`, length must be less than or equal to `25`") # noqa: E501 self._manufacturer_sku = manufacturer_sku @property def unspsc(self): """Gets the unspsc of this ItemIdentifiers. # noqa: E501 UNSPSC # noqa: E501 :return: The unspsc of this ItemIdentifiers. # noqa: E501 :rtype: str """ return self._unspsc @unspsc.setter def unspsc(self, unspsc): """Sets the unspsc of this ItemIdentifiers. UNSPSC # noqa: E501 :param unspsc: The unspsc of this ItemIdentifiers. # noqa: E501 :type: str """ if unspsc is not None and len(unspsc) > 20: raise ValueError("Invalid value for `unspsc`, length must be less than or equal to `20`") # noqa: E501 self._unspsc = unspsc def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: result[attr] = value if issubclass(ItemIdentifiers, dict): for key, value in self.items(): result[key] = value return result def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict()) def __repr__(self): """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, ItemIdentifiers): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other
[ 1, 529, 9507, 29958, 499, 945, 442, 29914, 9794, 29914, 667, 29918, 1693, 14903, 29889, 2272, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 13, 15945, 29908, 13, 1678, 18514, 336, 25233, 11654, 3450, 478, 29906, 13, 13, 1678, 18514, 336, 25233, 16759, 3450, 10079, 29871, 29906, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 1678, 4673, 8787, 1580, 1873, 29901, 29871, 29906, 29889, 29900, 29889, 29900, 13, 1678, 22387, 29901, 529, 26862, 6227, 29958, 13, 1678, 3251, 630, 491, 29901, 2045, 597, 3292, 29889, 510, 29914, 2774, 9921, 29899, 2754, 29914, 2774, 9921, 29899, 401, 1885, 29889, 5559, 13, 15945, 29908, 13, 13, 13, 5215, 282, 2158, 13, 5215, 337, 29871, 396, 694, 25621, 29901, 383, 29946, 29900, 29896, 13, 13, 5215, 4832, 13, 13, 13, 1990, 10976, 7648, 14903, 29898, 3318, 1125, 13, 1678, 9995, 12256, 29923, 29901, 910, 770, 338, 4469, 5759, 491, 278, 2381, 9921, 775, 15299, 1824, 29889, 13, 13, 1678, 1938, 451, 3863, 278, 770, 7522, 29889, 13, 1678, 9995, 13, 13, 1678, 9995, 13, 1678, 6212, 5026, 29901, 13, 418, 2381, 9921, 29918, 8768, 313, 8977, 1125, 450, 1820, 338, 5352, 1024, 13, 462, 9651, 322, 278, 995, 338, 5352, 1134, 29889, 13, 418, 5352, 29918, 1958, 313, 8977, 1125, 450, 1820, 338, 5352, 1024, 13, 462, 9651, 322, 278, 995, 338, 4390, 1820, 297, 5023, 29889, 13, 1678, 9995, 13, 1678, 2381, 9921, 29918, 8768, 353, 426, 13, 4706, 525, 1646, 401, 2396, 525, 710, 742, 13, 4706, 525, 1171, 9765, 9945, 29918, 978, 2396, 525, 710, 742, 13, 4706, 525, 1171, 9765, 9945, 29918, 18181, 2396, 525, 710, 742, 13, 4706, 525, 6948, 567, 29883, 2396, 525, 710, 29915, 13, 1678, 500, 13, 13, 1678, 5352, 29918, 1958, 353, 426, 13, 4706, 525, 1646, 401, 2396, 525, 1646, 401, 742, 13, 4706, 525, 1171, 9765, 9945, 29918, 978, 2396, 525, 1171, 9765, 9945, 29918, 978, 742, 13, 4706, 525, 1171, 9765, 9945, 29918, 18181, 2396, 525, 1171, 9765, 9945, 29918, 18181, 742, 13, 4706, 525, 6948, 567, 29883, 2396, 525, 6948, 567, 29883, 29915, 13, 1678, 500, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2594, 401, 29922, 8516, 29892, 12012, 9945, 29918, 978, 29922, 8516, 29892, 12012, 9945, 29918, 18181, 29922, 8516, 29892, 9644, 567, 29883, 29922, 8516, 1125, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 4706, 9995, 2001, 7648, 14903, 448, 263, 1904, 3342, 297, 3925, 9921, 15945, 29908, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 1583, 3032, 1646, 401, 353, 6213, 13, 4706, 1583, 3032, 1171, 9765, 9945, 29918, 978, 353, 6213, 13, 4706, 1583, 3032, 1171, 9765, 9945, 29918, 18181, 353, 6213, 13, 4706, 1583, 3032, 6948, 567, 29883, 353, 6213, 13, 4706, 1583, 29889, 2218, 29883, 20386, 1061, 353, 6213, 13, 13, 4706, 565, 2594, 401, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 1646, 401, 353, 2594, 401, 13, 4706, 565, 12012, 9945, 29918, 978, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 1171, 9765, 9945, 29918, 978, 353, 12012, 9945, 29918, 978, 13, 4706, 565, 12012, 9945, 29918, 18181, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 1171, 9765, 9945, 29918, 18181, 353, 12012, 9945, 29918, 18181, 13, 4706, 565, 9644, 567, 29883, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 6948, 567, 29883, 353, 9644, 567, 29883, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2594, 401, 29898, 1311, 1125, 13, 4706, 9995, 29954, 1691, 278, 2594, 401, 310, 445, 10976, 7648, 14903, 29889, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 2261, 401, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 584, 2457, 29901, 450, 2594, 401, 310, 445, 10976, 7648, 14903, 29889, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 4706, 584, 29878, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 1646, 401, 13, 13, 1678, 732, 1646, 401, 29889, 842, 357, 13, 1678, 822, 2594, 401, 29898, 1311, 29892, 2594, 401, 1125, 13, 4706, 9995, 29903, 1691, 278, 2594, 401, 310, 445, 10976, 7648, 14903, 29889, 13, 13, 4706, 2261, 401, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 584, 3207, 2594, 401, 29901, 450, 2594, 401, 310, 445, 10976, 7648, 14903, 29889, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 4706, 584, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 565, 2594, 401, 338, 451, 6213, 322, 7431, 29898, 1646, 401, 29897, 1405, 29871, 29941, 29900, 29901, 13, 9651, 12020, 7865, 2392, 703, 13919, 995, 363, 421, 1646, 401, 1673, 3309, 1818, 367, 3109, 1135, 470, 5186, 304, 421, 29941, 29900, 29952, 1159, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 1583, 3032, 1646, 401, 353, 2594, 401, 13, 13, 1678, 732, 6799, 13, 1678, 822, 12012, 9945, 29918, 978, 29898, 1311, 1125, 13, 4706, 9995, 29954, 1691, 278, 12012, 9945, 29918, 978, 310, 445, 10976, 7648, 14903, 29889, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 2315, 9765, 9945, 4408, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 584, 2457, 29901, 450, 12012, 9945, 29918, 978, 310, 445, 10976, 7648, 14903, 29889, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 4706, 584, 29878, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 1171, 9765, 9945, 29918, 978, 13, 13, 1678, 732, 1171, 9765, 9945, 29918, 978, 29889, 842, 357, 13, 1678, 822, 12012, 9945, 29918, 978, 29898, 1311, 29892, 12012, 9945, 29918, 978, 1125, 13, 4706, 9995, 29903, 1691, 278, 12012, 9945, 29918, 978, 310, 445, 10976, 7648, 14903, 29889, 13, 13, 4706, 2315, 9765, 9945, 4408, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 584, 3207, 12012, 9945, 29918, 978, 29901, 450, 12012, 9945, 29918, 978, 310, 445, 10976, 7648, 14903, 29889, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 4706, 584, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 565, 12012, 9945, 29918, 978, 338, 451, 6213, 322, 7431, 29898, 1171, 9765, 9945, 29918, 978, 29897, 1405, 29871, 29945, 29900, 29901, 13, 9651, 12020, 7865, 2392, 703, 13919, 995, 363, 421, 1171, 9765, 9945, 29918, 978, 1673, 3309, 1818, 367, 3109, 1135, 470, 5186, 304, 421, 29945, 29900, 29952, 1159, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 1583, 3032, 1171, 9765, 9945, 29918, 978, 353, 12012, 9945, 29918, 978, 13, 13, 1678, 732, 6799, 13, 1678, 822, 12012, 9945, 29918, 18181, 29898, 1311, 1125, 13, 4706, 9995, 29954, 1691, 278, 12012, 9945, 29918, 18181, 310, 445, 10976, 7648, 14903, 29889, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 2315, 9765, 9945, 18581, 29965, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 584, 2457, 29901, 450, 12012, 9945, 29918, 18181, 310, 445, 10976, 7648, 14903, 29889, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 4706, 584, 29878, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 1171, 9765, 9945, 29918, 18181, 13, 13, 1678, 732, 1171, 9765, 9945, 29918, 18181, 29889, 842, 357, 13, 1678, 822, 12012, 9945, 29918, 18181, 29898, 1311, 29892, 12012, 9945, 29918, 18181, 1125, 13, 4706, 9995, 29903, 1691, 278, 12012, 9945, 29918, 18181, 310, 445, 10976, 7648, 14903, 29889, 13, 13, 4706, 2315, 9765, 9945, 18581, 29965, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 584, 3207, 12012, 9945, 29918, 18181, 29901, 450, 12012, 9945, 29918, 18181, 310, 445, 10976, 7648, 14903, 29889, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 4706, 584, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 565, 12012, 9945, 29918, 18181, 338, 451, 6213, 322, 7431, 29898, 1171, 9765, 9945, 29918, 18181, 29897, 1405, 29871, 29906, 29945, 29901, 13, 9651, 12020, 7865, 2392, 703, 13919, 995, 363, 421, 1171, 9765, 9945, 29918, 18181, 1673, 3309, 1818, 367, 3109, 1135, 470, 5186, 304, 421, 29906, 29945, 29952, 1159, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 1583, 3032, 1171, 9765, 9945, 29918, 18181, 353, 12012, 9945, 29918, 18181, 13, 13, 1678, 732, 6799, 13, 1678, 822, 9644, 567, 29883, 29898, 1311, 1125, 13, 4706, 9995, 29954, 1691, 278, 9644, 567, 29883, 310, 445, 10976, 7648, 14903, 29889, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 501, 3059, 7024, 29907, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 584, 2457, 29901, 450, 9644, 567, 29883, 310, 445, 10976, 7648, 14903, 29889, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 4706, 584, 29878, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 6948, 567, 29883, 13, 13, 1678, 732, 6948, 567, 29883, 29889, 842, 357, 13, 1678, 822, 9644, 567, 29883, 29898, 1311, 29892, 9644, 567, 29883, 1125, 13, 4706, 9995, 29903, 1691, 278, 9644, 567, 29883, 310, 445, 10976, 7648, 14903, 29889, 13, 13, 4706, 501, 3059, 7024, 29907, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 584, 3207, 9644, 567, 29883, 29901, 450, 9644, 567, 29883, 310, 445, 10976, 7648, 14903, 29889, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 4706, 584, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 565, 9644, 567, 29883, 338, 451, 6213, 322, 7431, 29898, 6948, 567, 29883, 29897, 1405, 29871, 29906, 29900, 29901, 13, 9651, 12020, 7865, 2392, 703, 13919, 995, 363, 421, 6948, 567, 29883, 1673, 3309, 1818, 367, 3109, 1135, 470, 5186, 304, 421, 29906, 29900, 29952, 1159, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 13, 4706, 1583, 3032, 6948, 567, 29883, 353, 9644, 567, 29883, 13, 13, 1678, 822, 304, 29918, 8977, 29898, 1311, 1125, 13, 4706, 9995, 11609, 29879, 278, 1904, 4426, 408, 263, 9657, 15945, 29908, 13, 4706, 1121, 353, 6571, 13, 13, 4706, 363, 12421, 29892, 903, 297, 4832, 29889, 1524, 7076, 29898, 1311, 29889, 2774, 9921, 29918, 8768, 1125, 13, 9651, 995, 353, 679, 5552, 29898, 1311, 29892, 12421, 29897, 13, 9651, 565, 338, 8758, 29898, 1767, 29892, 1051, 1125, 13, 18884, 1121, 29961, 5552, 29962, 353, 1051, 29898, 1958, 29898, 13, 462, 1678, 14013, 921, 29901, 921, 29889, 517, 29918, 8977, 580, 565, 756, 5552, 29898, 29916, 29892, 376, 517, 29918, 8977, 1159, 1683, 921, 29892, 13, 462, 1678, 995, 13, 462, 876, 13, 9651, 25342, 756, 5552, 29898, 1767, 29892, 376, 517, 29918, 8977, 29908, 1125, 13, 18884, 1121, 29961, 5552, 29962, 353, 995, 29889, 517, 29918, 8977, 580, 13, 9651, 25342, 338, 8758, 29898, 1767, 29892, 9657, 1125, 13, 18884, 1121, 29961, 5552, 29962, 353, 9657, 29898, 1958, 29898, 13, 462, 1678, 14013, 2944, 29901, 313, 667, 29961, 29900, 1402, 2944, 29961, 29896, 1822, 517, 29918, 8977, 3101, 13, 462, 1678, 565, 756, 5552, 29898, 667, 29961, 29896, 1402, 376, 517, 29918, 8977, 1159, 1683, 2944, 29892, 13, 462, 1678, 995, 29889, 7076, 580, 13, 462, 876, 13, 9651, 1683, 29901, 13, 18884, 1121, 29961, 5552, 29962, 353, 995, 13, 4706, 565, 338, 1491, 1990, 29898, 2001, 7648, 14903, 29892, 9657, 1125, 13, 9651, 363, 1820, 29892, 995, 297, 1583, 29889, 7076, 7295, 13, 18884, 1121, 29961, 1989, 29962, 353, 995, 13, 13, 4706, 736, 1121, 13, 13, 1678, 822, 304, 29918, 710, 29898, 1311, 1125, 13, 4706, 9995, 11609, 29879, 278, 1347, 8954, 310, 278, 1904, 15945, 29908, 13, 4706, 736, 282, 2158, 29889, 29886, 4830, 29898, 1311, 29889, 517, 29918, 8977, 3101, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 9995, 2831, 421, 2158, 29952, 322, 421, 407, 29878, 524, 29952, 15945, 29908, 13, 4706, 736, 1583, 29889, 517, 29918, 710, 580, 13, 13, 1678, 822, 4770, 1837, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 11609, 29879, 1565, 565, 1716, 3618, 526, 5186, 15945, 29908, 13, 4706, 565, 451, 338, 8758, 29898, 1228, 29892, 10976, 7648, 14903, 1125, 13, 9651, 736, 7700, 13, 13, 4706, 736, 1583, 17255, 8977, 1649, 1275, 916, 17255, 8977, 1649, 13, 13, 1678, 822, 4770, 484, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 11609, 29879, 1565, 565, 1716, 3618, 526, 451, 5186, 15945, 29908, 13, 4706, 736, 451, 1583, 1275, 916, 13, 2 ]
nuclear/types/time.py
igrek51/glue
6
166087
from datetime import datetime, date, time from typing import Callable from nuclear.parser.error import CliSyntaxError def datetime_format(*formats: str) -> Callable[[str], datetime]: """format: %Y-%m-%d %H:%M:%S""" def parser(arg: str): return _parse_date_formats(arg, *formats) return parser def today_format(*formats: str) -> Callable[[str], datetime]: """format: %Y-%m-%d %H:%M:%S""" def parser(arg: str): today: date = datetime.now().date() parsed_time: time = _parse_date_formats(arg, *formats).time() return datetime.combine(today, parsed_time) return parser iso_date: Callable[[str], datetime] = datetime_format('%Y-%m-%d') iso_time: Callable[[str], datetime] = datetime_format('%H:%M:%S') iso_datetime: Callable[[str], datetime] = datetime_format('%Y-%m-%d %H:%M:%S') def _parse_date_formats(s: str, *formats: str) -> datetime: for time_format in formats: try: return _parse_date(s, time_format) except ValueError: pass raise CliSyntaxError('invalid datetime format: ' + s) def _parse_date(s: str, time_format: str): return datetime.strptime(s, time_format)
[ 1, 515, 12865, 1053, 12865, 29892, 2635, 29892, 931, 13, 3166, 19229, 1053, 8251, 519, 13, 13, 3166, 20346, 29889, 16680, 29889, 2704, 1053, 315, 492, 16676, 2392, 13, 13, 13, 1753, 12865, 29918, 4830, 10456, 689, 1446, 29901, 851, 29897, 1599, 8251, 519, 8999, 710, 1402, 12865, 5387, 13, 1678, 9995, 4830, 29901, 1273, 29979, 19222, 29885, 19222, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 15945, 29908, 13, 13, 1678, 822, 13812, 29898, 1191, 29901, 851, 1125, 13, 4706, 736, 903, 5510, 29918, 1256, 29918, 689, 1446, 29898, 1191, 29892, 334, 689, 1446, 29897, 13, 13, 1678, 736, 13812, 13, 13, 13, 1753, 9826, 29918, 4830, 10456, 689, 1446, 29901, 851, 29897, 1599, 8251, 519, 8999, 710, 1402, 12865, 5387, 13, 1678, 9995, 4830, 29901, 1273, 29979, 19222, 29885, 19222, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 15945, 29908, 13, 13, 1678, 822, 13812, 29898, 1191, 29901, 851, 1125, 13, 4706, 9826, 29901, 2635, 353, 12865, 29889, 3707, 2141, 1256, 580, 13, 4706, 21213, 29918, 2230, 29901, 931, 353, 903, 5510, 29918, 1256, 29918, 689, 1446, 29898, 1191, 29892, 334, 689, 1446, 467, 2230, 580, 13, 4706, 736, 12865, 29889, 17743, 457, 29898, 27765, 29892, 21213, 29918, 2230, 29897, 13, 13, 1678, 736, 13812, 13, 13, 13, 10718, 29918, 1256, 29901, 8251, 519, 8999, 710, 1402, 12865, 29962, 353, 12865, 29918, 4830, 877, 29995, 29979, 19222, 29885, 19222, 29881, 1495, 13, 10718, 29918, 2230, 29901, 8251, 519, 8999, 710, 1402, 12865, 29962, 353, 12865, 29918, 4830, 877, 29995, 29950, 16664, 29924, 16664, 29903, 1495, 13, 10718, 29918, 12673, 29901, 8251, 519, 8999, 710, 1402, 12865, 29962, 353, 12865, 29918, 4830, 877, 29995, 29979, 19222, 29885, 19222, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 1495, 13, 13, 13, 1753, 903, 5510, 29918, 1256, 29918, 689, 1446, 29898, 29879, 29901, 851, 29892, 334, 689, 1446, 29901, 851, 29897, 1599, 12865, 29901, 13, 1678, 363, 931, 29918, 4830, 297, 21971, 29901, 13, 4706, 1018, 29901, 13, 9651, 736, 903, 5510, 29918, 1256, 29898, 29879, 29892, 931, 29918, 4830, 29897, 13, 4706, 5174, 7865, 2392, 29901, 13, 9651, 1209, 13, 1678, 12020, 315, 492, 16676, 2392, 877, 20965, 12865, 3402, 29901, 525, 718, 269, 29897, 13, 13, 13, 1753, 903, 5510, 29918, 1256, 29898, 29879, 29901, 851, 29892, 931, 29918, 4830, 29901, 851, 1125, 13, 1678, 736, 12865, 29889, 710, 415, 603, 29898, 29879, 29892, 931, 29918, 4830, 29897, 13, 2 ]
databricks/koalas/strings.py
mercileesb/koalas
1
15512
# # Copyright (C) 2019 Databricks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # """ String functions on Koalas Series """ from typing import TYPE_CHECKING import numpy as np from pyspark.sql.types import StringType, BinaryType, BooleanType from databricks.koalas.base import _wrap_accessor_pandas if TYPE_CHECKING: import databricks.koalas as ks class StringMethods(object): """String methods for Koalas Series""" def __init__(self, series: 'ks.Series'): if not isinstance(series.spark_type, (StringType, BinaryType)): raise ValueError( "Cannot call StringMethods on type {}" .format(series.spark_type)) self._data = series self.name = self._data.name # Methods def capitalize(self) -> 'ks.Series': """ Convert Strings in the series to be capitalized. """ return _wrap_accessor_pandas( self, lambda x: x.str.capitalize(), StringType() ).alias(self.name) def lower(self) -> 'ks.Series': """ Convert strings in the Series/Index to all lowercase. """ return _wrap_accessor_pandas( self, lambda x: x.str.lower(), StringType() ).alias(self.name) def upper(self) -> 'ks.Series': """ Convert strings in the Series/Index to all uppercase. """ return _wrap_accessor_pandas( self, lambda x: x.str.upper(), StringType() ).alias(self.name) def swapcase(self) -> 'ks.Series': """ Convert strings in the Series/Index to be swapcased. """ return _wrap_accessor_pandas( self, lambda x: x.str.swapcase(), StringType() ).alias(self.name) def startswith(self, pattern, na=np.NaN) -> 'ks.Series': """ Test if the start of each string element matches a pattern. Equivalent to :func:`str.startswith`. Parameters ---------- pattern : str Character sequence. Regular expressions are not accepted. na : object, defulat NaN Object shown if element is not a string. Returns ------- Series of bool Koalas Series of booleans indicating whether the given pattern matches the start of each string element. """ return _wrap_accessor_pandas( self, lambda x: x.str.startswith(pattern, na), BooleanType() ).alias(self.name) def endswith(self, pattern, na=np.NaN) -> 'ks.Series': """ Test if the end of each string element matches a pattern. Equivalent to :func:`str.endswith`. Parameters ---------- pattern : str Character sequence. Regular expressions are not accepted. na : object, defulat NaN Object shown if element is not a string. Returns ------- Series of bool Koalas Series of booleans indicating whether the given pattern matches the end of each string element. """ return _wrap_accessor_pandas( self, lambda x: x.str.endswith(pattern, na), BooleanType() ).alias(self.name) def strip(self, to_strip=None) -> 'ks.Series': """ Remove leading and trailing characters. Strip whitespaces (including newlines) or a set of specified characters from each string in the Series/Index from left and right sides. Equivalent to :func:`str.strip`. Parameters ---------- to_strip : str Specifying the set of characters to be removed. All combinations of this set of characters will be stripped. If None then whitespaces are removed. Returns ------- Series of str """ return _wrap_accessor_pandas( self, lambda x: x.str.strip(to_strip), StringType() ).alias(self.name) def lstrip(self, to_strip=None) -> 'ks.Series': """ Remove leading characters. Strip whitespaces (including newlines) or a set of specified characters from each string in the Series/Index from left side. Equivalent to :func:`str.lstrip`. Parameters ---------- to_strip : str Specifying the set of characters to be removed. All combinations of this set of characters will be stripped. If None then whitespaces are removed. Returns ------- Series of str """ return _wrap_accessor_pandas( self, lambda x: x.str.lstrip(to_strip), StringType() ).alias(self.name) def rstrip(self, to_strip=None) -> 'ks.Series': """ Remove trailing characters. Strip whitespaces (including newlines) or a set of specified characters from each string in the Series/Index from right side. Equivalent to :func:`str.rstrip`. Parameters ---------- to_strip : str Specifying the set of characters to be removed. All combinations of this set of characters will be stripped. If None then whitespaces are removed. Returns ------- Series of str """ return _wrap_accessor_pandas( self, lambda x: x.str.rstrip(to_strip), StringType() ).alias(self.name) def get(self, i) -> 'ks.Series': """ Extract element from each string in the Series/Index at the specified position. Parameters ---------- i : int Position of element to extract. Returns ------- Series of objects """ return _wrap_accessor_pandas( self, lambda x: x.str.get(i), StringType() ).alias(self.name) def isalnum(self) -> 'ks.Series': """ Check whether all characters in each string are alphanumeric. This is equivalent to running the Python string method :func:`str.isalnum` for each element of the Series/Index. If a string has zero characters, False is returned for that check. """ return _wrap_accessor_pandas( self, lambda x: x.str.isalnum(), BooleanType() ).alias(self.name) def isalpha(self) -> 'ks.Series': """ Check whether all characters in each string are alphabetic. This is equivalent to running the Python string method :func:`str.isalpha` for each element of the Series/Index. If a string has zero characters, False is returned for that check. """ return _wrap_accessor_pandas( self, lambda x: x.str.isalpha(), BooleanType() ).alias(self.name) def isdigit(self) -> 'ks.Series': """ Check whether all characters in each string are digits. This is equivalent to running the Python string method :func:`str.isdigit` for each element of the Series/Index. If a string has zero characters, False is returned for that check. """ return _wrap_accessor_pandas( self, lambda x: x.str.isdigit(), BooleanType() ).alias(self.name) def isspace(self) -> 'ks.Series': """ Check whether all characters in each string are whitespaces. This is equivalent to running the Python string method :func:`str.isspace` for each element of the Series/Index. If a string has zero characters, False is returned for that check. """ return _wrap_accessor_pandas( self, lambda x: x.str.isspace(), BooleanType() ).alias(self.name) def islower(self) -> 'ks.Series': """ Check whether all characters in each string are lowercase. This is equivalent to running the Python string method :func:`str.islower` for each element of the Series/Index. If a string has zero characters, False is returned for that check. """ return _wrap_accessor_pandas( self, lambda x: x.str.islower(), BooleanType() ).alias(self.name) def isupper(self) -> 'ks.Series': """ Check whether all characters in each string are uppercase. This is equivalent to running the Python string method :func:`str.isupper` for each element of the Series/Index. If a string has zero characters, False is returned for that check. """ return _wrap_accessor_pandas( self, lambda x: x.str.isupper(), BooleanType() ).alias(self.name) def istitle(self) -> 'ks.Series': """ Check whether all characters in each string are titlecase. This is equivalent to running the Python string method :func:`str.istitle` for each element of the Series/Index. If a string has zero characters, False is returned for that check. """ return _wrap_accessor_pandas( self, lambda x: x.str.istitle(), BooleanType() ).alias(self.name) def isnumeric(self) -> 'ks.Series': """ Check whether all characters in each string are numeric. This is equivalent to running the Python string method :func:`str.isnumeric` for each element of the Series/Index. If a string has zero characters, False is returned for that check. """ return _wrap_accessor_pandas( self, lambda x: x.str.isnumeric(), BooleanType() ).alias(self.name) def isdecimal(self) -> 'ks.Series': """ Check whether all characters in each string are decimals. This is equivalent to running the Python string method :func:`str.isdecimal` for each element of the Series/Index. If a string has zero characters, False is returned for that check. """ return _wrap_accessor_pandas( self, lambda x: x.str.isdecimal(), BooleanType() ).alias(self.name)
[ 1, 396, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29929, 13373, 370, 29878, 7358, 29892, 9266, 29889, 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, 268, 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, 29937, 13, 13, 15945, 29908, 13, 1231, 3168, 373, 8224, 284, 294, 10488, 13, 15945, 29908, 13, 3166, 19229, 1053, 323, 6959, 29918, 3210, 16658, 4214, 13, 13, 5215, 12655, 408, 7442, 13, 13, 3166, 282, 952, 6378, 29889, 2850, 29889, 8768, 1053, 1714, 1542, 29892, 29479, 1542, 29892, 11185, 1542, 13, 13, 3166, 16236, 29878, 7358, 29889, 2901, 284, 294, 29889, 3188, 1053, 903, 6312, 29918, 5943, 272, 29918, 15112, 13, 13, 361, 323, 6959, 29918, 3210, 16658, 4214, 29901, 13, 1678, 1053, 16236, 29878, 7358, 29889, 2901, 284, 294, 408, 413, 29879, 13, 13, 13, 1990, 1714, 26112, 29898, 3318, 1125, 13, 1678, 9995, 1231, 3519, 363, 8224, 284, 294, 10488, 15945, 29908, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3652, 29901, 525, 2039, 29889, 19204, 29374, 13, 4706, 565, 451, 338, 8758, 29898, 13757, 29889, 12597, 29918, 1853, 29892, 313, 1231, 1542, 29892, 29479, 1542, 22164, 13, 9651, 12020, 7865, 2392, 29898, 13, 18884, 376, 29089, 1246, 1714, 26112, 373, 1134, 426, 5038, 13, 18884, 869, 4830, 29898, 13757, 29889, 12597, 29918, 1853, 876, 13, 4706, 1583, 3032, 1272, 353, 3652, 13, 4706, 1583, 29889, 978, 353, 1583, 3032, 1272, 29889, 978, 13, 13, 1678, 396, 8108, 29879, 13, 1678, 822, 7483, 675, 29898, 1311, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 14806, 3767, 886, 297, 278, 3652, 304, 367, 7483, 1891, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 5030, 2410, 675, 3285, 13, 9651, 1714, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 5224, 29898, 1311, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 14806, 6031, 297, 278, 10488, 29914, 3220, 304, 599, 5224, 4878, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 13609, 3285, 13, 9651, 1714, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 7568, 29898, 1311, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 14806, 6031, 297, 278, 10488, 29914, 3220, 304, 599, 7568, 4878, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 21064, 3285, 13, 9651, 1714, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 17945, 4878, 29898, 1311, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 14806, 6031, 297, 278, 10488, 29914, 3220, 304, 367, 17945, 29883, 1463, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 26276, 4878, 3285, 13, 9651, 1714, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 8665, 2541, 29898, 1311, 29892, 4766, 29892, 1055, 29922, 9302, 29889, 19377, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 4321, 565, 278, 1369, 310, 1269, 1347, 1543, 7087, 263, 4766, 29889, 13, 13, 4706, 11243, 27445, 304, 584, 9891, 18078, 710, 29889, 27382, 2541, 1412, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 4766, 584, 851, 13, 9651, 26804, 5665, 29889, 2169, 1070, 12241, 526, 451, 9259, 29889, 13, 4706, 1055, 584, 1203, 29892, 822, 352, 271, 18780, 13, 9651, 4669, 4318, 565, 1543, 338, 451, 263, 1347, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 10488, 310, 6120, 13, 9651, 8224, 284, 294, 10488, 310, 1045, 1772, 550, 23941, 3692, 278, 2183, 4766, 13, 9651, 7087, 278, 1369, 310, 1269, 1347, 1543, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 27382, 2541, 29898, 11037, 29892, 1055, 511, 13, 9651, 11185, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 10614, 2541, 29898, 1311, 29892, 4766, 29892, 1055, 29922, 9302, 29889, 19377, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 4321, 565, 278, 1095, 310, 1269, 1347, 1543, 7087, 263, 4766, 29889, 13, 13, 4706, 11243, 27445, 304, 584, 9891, 18078, 710, 29889, 1975, 2541, 1412, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 4766, 584, 851, 13, 9651, 26804, 5665, 29889, 2169, 1070, 12241, 526, 451, 9259, 29889, 13, 4706, 1055, 584, 1203, 29892, 822, 352, 271, 18780, 13, 9651, 4669, 4318, 565, 1543, 338, 451, 263, 1347, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 10488, 310, 6120, 13, 9651, 8224, 284, 294, 10488, 310, 1045, 1772, 550, 23941, 3692, 278, 2183, 4766, 13, 9651, 7087, 278, 1095, 310, 1269, 1347, 1543, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 1975, 2541, 29898, 11037, 29892, 1055, 511, 13, 9651, 11185, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 17820, 29898, 1311, 29892, 304, 29918, 17010, 29922, 8516, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 15154, 8236, 322, 25053, 4890, 29889, 13, 13, 4706, 624, 6472, 18960, 22459, 313, 18271, 716, 9012, 29897, 470, 263, 731, 310, 6790, 13, 4706, 4890, 515, 1269, 1347, 297, 278, 10488, 29914, 3220, 515, 2175, 322, 13, 4706, 1492, 11192, 29889, 11243, 27445, 304, 584, 9891, 18078, 710, 29889, 17010, 1412, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 304, 29918, 17010, 584, 851, 13, 9651, 12048, 9215, 278, 731, 310, 4890, 304, 367, 6206, 29889, 2178, 18240, 13, 9651, 310, 445, 731, 310, 4890, 674, 367, 10076, 2986, 29889, 960, 6213, 769, 13, 9651, 18960, 22459, 526, 6206, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 10488, 310, 851, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 17010, 29898, 517, 29918, 17010, 511, 13, 9651, 1714, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 301, 17010, 29898, 1311, 29892, 304, 29918, 17010, 29922, 8516, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 15154, 8236, 4890, 29889, 13, 13, 4706, 624, 6472, 18960, 22459, 313, 18271, 716, 9012, 29897, 470, 263, 731, 310, 6790, 13, 4706, 4890, 515, 1269, 1347, 297, 278, 10488, 29914, 3220, 515, 2175, 2625, 29889, 13, 4706, 11243, 27445, 304, 584, 9891, 18078, 710, 29889, 29880, 17010, 1412, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 304, 29918, 17010, 584, 851, 13, 9651, 12048, 9215, 278, 731, 310, 4890, 304, 367, 6206, 29889, 2178, 18240, 13, 9651, 310, 445, 731, 310, 4890, 674, 367, 10076, 2986, 29889, 960, 6213, 769, 13, 9651, 18960, 22459, 526, 6206, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 10488, 310, 851, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 29880, 17010, 29898, 517, 29918, 17010, 511, 13, 9651, 1714, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 364, 17010, 29898, 1311, 29892, 304, 29918, 17010, 29922, 8516, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 15154, 25053, 4890, 29889, 13, 13, 4706, 624, 6472, 18960, 22459, 313, 18271, 716, 9012, 29897, 470, 263, 731, 310, 6790, 13, 4706, 4890, 515, 1269, 1347, 297, 278, 10488, 29914, 3220, 515, 1492, 2625, 29889, 13, 4706, 11243, 27445, 304, 584, 9891, 18078, 710, 29889, 29878, 17010, 1412, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 304, 29918, 17010, 584, 851, 13, 9651, 12048, 9215, 278, 731, 310, 4890, 304, 367, 6206, 29889, 2178, 18240, 13, 9651, 310, 445, 731, 310, 4890, 674, 367, 10076, 2986, 29889, 960, 6213, 769, 13, 9651, 18960, 22459, 526, 6206, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 10488, 310, 851, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 29878, 17010, 29898, 517, 29918, 17010, 511, 13, 9651, 1714, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 679, 29898, 1311, 29892, 474, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 7338, 1461, 1543, 515, 1269, 1347, 297, 278, 10488, 29914, 3220, 472, 278, 13, 4706, 6790, 2602, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 474, 584, 938, 13, 9651, 20627, 310, 1543, 304, 6597, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 10488, 310, 3618, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 657, 29898, 29875, 511, 13, 9651, 1714, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 338, 284, 1949, 29898, 1311, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 5399, 3692, 599, 4890, 297, 1269, 1347, 526, 394, 16711, 25099, 29889, 13, 13, 4706, 910, 338, 7126, 304, 2734, 278, 5132, 1347, 1158, 13, 4706, 584, 9891, 18078, 710, 29889, 275, 284, 1949, 29952, 363, 1269, 1543, 310, 278, 10488, 29914, 3220, 29889, 13, 4706, 960, 263, 1347, 756, 5225, 4890, 29892, 7700, 338, 4133, 363, 393, 1423, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 275, 284, 1949, 3285, 13, 9651, 11185, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 338, 2312, 29898, 1311, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 5399, 3692, 599, 4890, 297, 1269, 1347, 526, 394, 561, 370, 7492, 29889, 13, 13, 4706, 910, 338, 7126, 304, 2734, 278, 5132, 1347, 1158, 13, 4706, 584, 9891, 18078, 710, 29889, 275, 2312, 29952, 363, 1269, 1543, 310, 278, 10488, 29914, 3220, 29889, 13, 4706, 960, 263, 1347, 756, 5225, 4890, 29892, 7700, 338, 4133, 363, 393, 1423, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 275, 2312, 3285, 13, 9651, 11185, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 338, 26204, 29898, 1311, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 5399, 3692, 599, 4890, 297, 1269, 1347, 526, 13340, 29889, 13, 13, 4706, 910, 338, 7126, 304, 2734, 278, 5132, 1347, 1158, 13, 4706, 584, 9891, 18078, 710, 29889, 275, 26204, 29952, 363, 1269, 1543, 310, 278, 10488, 29914, 3220, 29889, 13, 4706, 960, 263, 1347, 756, 5225, 4890, 29892, 7700, 338, 4133, 363, 393, 1423, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 275, 26204, 3285, 13, 9651, 11185, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 338, 3493, 29898, 1311, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 5399, 3692, 599, 4890, 297, 1269, 1347, 526, 18960, 22459, 29889, 13, 13, 4706, 910, 338, 7126, 304, 2734, 278, 5132, 1347, 1158, 13, 4706, 584, 9891, 18078, 710, 29889, 790, 3535, 29952, 363, 1269, 1543, 310, 278, 10488, 29914, 3220, 29889, 13, 4706, 960, 263, 1347, 756, 5225, 4890, 29892, 7700, 338, 4133, 363, 393, 1423, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 790, 3535, 3285, 13, 9651, 11185, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 338, 13609, 29898, 1311, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 5399, 3692, 599, 4890, 297, 1269, 1347, 526, 5224, 4878, 29889, 13, 13, 4706, 910, 338, 7126, 304, 2734, 278, 5132, 1347, 1158, 13, 4706, 584, 9891, 18078, 710, 29889, 275, 13609, 29952, 363, 1269, 1543, 310, 278, 10488, 29914, 3220, 29889, 13, 4706, 960, 263, 1347, 756, 5225, 4890, 29892, 7700, 338, 4133, 363, 393, 1423, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 275, 13609, 3285, 13, 9651, 11185, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 338, 21064, 29898, 1311, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 5399, 3692, 599, 4890, 297, 1269, 1347, 526, 7568, 4878, 29889, 13, 13, 4706, 910, 338, 7126, 304, 2734, 278, 5132, 1347, 1158, 13, 4706, 584, 9891, 18078, 710, 29889, 275, 21064, 29952, 363, 1269, 1543, 310, 278, 10488, 29914, 3220, 29889, 13, 4706, 960, 263, 1347, 756, 5225, 4890, 29892, 7700, 338, 4133, 363, 393, 1423, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 275, 21064, 3285, 13, 9651, 11185, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 1752, 1740, 29898, 1311, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 5399, 3692, 599, 4890, 297, 1269, 1347, 526, 3611, 4878, 29889, 13, 13, 4706, 910, 338, 7126, 304, 2734, 278, 5132, 1347, 1158, 13, 4706, 584, 9891, 18078, 710, 29889, 391, 1740, 29952, 363, 1269, 1543, 310, 278, 10488, 29914, 3220, 29889, 13, 4706, 960, 263, 1347, 756, 5225, 4890, 29892, 7700, 338, 4133, 363, 393, 1423, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 391, 1740, 3285, 13, 9651, 11185, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 338, 21574, 29898, 1311, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 5399, 3692, 599, 4890, 297, 1269, 1347, 526, 16985, 29889, 13, 13, 4706, 910, 338, 7126, 304, 2734, 278, 5132, 1347, 1158, 13, 4706, 584, 9891, 18078, 710, 29889, 275, 21574, 29952, 363, 1269, 1543, 310, 278, 10488, 29914, 3220, 29889, 13, 4706, 960, 263, 1347, 756, 5225, 4890, 29892, 7700, 338, 4133, 363, 393, 1423, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 275, 21574, 3285, 13, 9651, 11185, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 13, 1678, 822, 338, 7099, 3039, 29898, 1311, 29897, 1599, 525, 2039, 29889, 19204, 2396, 13, 4706, 9995, 13, 4706, 5399, 3692, 599, 4890, 297, 1269, 1347, 526, 1602, 326, 1338, 29889, 13, 13, 4706, 910, 338, 7126, 304, 2734, 278, 5132, 1347, 1158, 13, 4706, 584, 9891, 18078, 710, 29889, 275, 7099, 3039, 29952, 363, 1269, 1543, 310, 278, 10488, 29914, 3220, 29889, 13, 4706, 960, 263, 1347, 756, 5225, 4890, 29892, 7700, 338, 4133, 363, 393, 1423, 29889, 13, 4706, 9995, 13, 4706, 736, 903, 6312, 29918, 5943, 272, 29918, 15112, 29898, 13, 9651, 1583, 29892, 13, 9651, 14013, 921, 29901, 921, 29889, 710, 29889, 275, 7099, 3039, 3285, 13, 9651, 11185, 1542, 580, 13, 4706, 13742, 19973, 29898, 1311, 29889, 978, 29897, 13, 2 ]
Binaryclassifier/slacked.py
Hritikbansal/RNNs_SVA_OOD
4
79980
<gh_stars>1-10 import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable import numpy as np import math from numpy.random import binomial import sys _VF = torch._C._VariableFunctions device = torch.device("cuda" if torch.cuda.is_available() else "cpu") def rectify(x): relu = nn.ReLU() return relu(x) class DecayModule(nn.Module): def __init__(self, input_size , hidden_size, bias = True, num_chunks = 1, activation='relu', nodiag=False): super(DecayModule, self).__init__() self.sigmoid = nn.Sigmoid() self.tanh = nn.Tanh() self.relu = nn.ReLU() self.input_size = input_size self.hidden_size = hidden_size self.nodiag=nodiag self.bias = bias self.num_chunks = num_chunks self.rgate = nn.Parameter(torch.tensor(0.8),requires_grad=True) self.weight_ih = nn.Parameter(torch.Tensor(num_chunks*hidden_size,input_size)) self.weight_hh = nn.Parameter(torch.Tensor(num_chunks * hidden_size, hidden_size)) self.d_rec = nn.Parameter(torch.zeros(num_chunks * hidden_size, hidden_size),requires_grad=False) self.activation=activation if bias: self.bias_ih = nn.Parameter(torch.Tensor(num_chunks * hidden_size)) self.bias_hh = nn.Parameter(torch.Tensor(num_chunks * hidden_size)) else: self.register_parameter('bias_ih', None) self.register_parameter('bias_hh', None) self.reset_parameters() if self.nodiag: for i in range(hidden_size): self.weight_hh.data[i, i]=0 def reset_parameters(self): stdv = 1.0 / math.sqrt(self.hidden_size) for weight in self.parameters(): nn.init.uniform_(weight, -stdv, stdv) for name,param in self.named_parameters(): if name=="rgate": param.data = torch.tensor(0.8) for i in range(self.num_chunks) : x = i * self.hidden_size for j in range(self.hidden_size) : if (j < 0.8*self.hidden_size) : self.d_rec[x + j][j] = 1.0 else : self.d_rec[x + j][j] = -1.0 def forward(self, input_, hx = None): if hx is None: hx = input_.new_zeros(self.num_chunks*self.hidden_size, requires_grad=False) # dale_hh = torch.mm(self.relu(self.weight_hh), self.d_rec) if (self.bias) : w_x = self.bias_ih + torch.matmul(self.weight_ih,input_).t() # w_h = self.bias_hh + torch.matmul(dale_hh,hx.t()).t() w_h = self.bias_hh + torch.matmul(self.weight_hh,hx.t()).t() else : w_x = torch.matmul(self.weight_ih,input_).t() # w_h = torch.matmul(dale_hh,hx.t()).t() w_h = torch.matmul(self.weight_hh,hx.t()).t() w_w = ((self.rgate) * hx) + ((1-(self.rgate)) * (w_x + w_h)) if self.activation=='tanh': h = self.tanh(w_w) else: h = self.relu(w_w) return h # shape is (M, H) where M is the batch size and H is the embedded dimension. class SDRNN(nn.Module): def __init__(self, input_size, hidden_size, num_layers = 1, dropout=0.2, activation='relu', nodiag=False): super(SDRNN, self).__init__() self.input_size = input_size self.hidden_size = hidden_size self.num_layers = num_layers self.nodiag=nodiag self.dropout = dropout self.dropout_layer = nn.Dropout(dropout) self.activation=activation for layer in range(num_layers): layer_input_size = self.input_size if layer == 0 else self.hidden_size cell = DecayModule(input_size = layer_input_size, hidden_size = self.hidden_size,activation=self.activation, nodiag=self.nodiag) setattr(self, 'cell_{}'.format(layer), cell) self.reset_parameters() def get_cell(self, layer): return getattr(self, 'cell_{}'.format(layer)) def reset_parameters(self): for layer in range(self.num_layers): cell = self.get_cell(layer) cell.reset_parameters() def forward_single_layer(self, input_, layer, h_0=None, max_time=50): # assumed input shape : (time_stamps, batch_size, input_emb_dim) # assumed output shape: (time_stamps, batch_size, hidden_dim) , h_n shape = (num_layers, batch_size, hidden_dim) --> corresponding to the last time stamp all_hidden = [] cell = self.get_cell(layer) max_time, M = input_.shape[0], input_.shape[1] state = h_0 assert (h_0.shape[0],h_0.shape[1]) == (M, self.hidden_size) for time in range(max_time): state = cell(input_ = input_[time, :, :].t(), hx = state) if layer==self.num_layers-1: all_hidden.append(state) else: all_hidden.append(self.dropout_layer(state)) h_n = state #last time stamp state (M, H) all_hidden = torch.stack(all_hidden) assert (h_n.shape[0], h_n.shape[1]) ==(M, self.hidden_size) return all_hidden, h_n def forward(self, input_, h_0=None, max_time=50): # we assume that the input shape is (time_stamps, batch_size, input_sizes) # for every example the h_init will serve as none. H_init will be none in each layer and for all examples. # the inputs that will be passed to layer_0 will be the input_, for the subsequent layers, we will pass the processed # hidden layer outputs. # h_0 is the inital state to be used for the dynamics. max_time, M = input_.shape[0], input_.shape[1] if not torch.is_tensor(h_0): h_0 = torch.zeros((self.num_layers, M, self.hidden_size)).to(device) h_n = [] for layer in range(self.num_layers): if layer == 0: all_hidden, h_n_layer = self.forward_single_layer(input_, layer, h_0[layer, :, :]) else: all_hidden, h_n_layer = self.forward_single_layer(all_hidden, layer, h_0[layer,:,:]) h_n.append(h_n_layer) h_n = torch.stack(h_n) assert (h_n.shape[0],h_n.shape[1],h_n.shape[2]) ==( self.num_layers, M , self.hidden_size ) assert (all_hidden.shape[0],all_hidden.shape[1],all_hidden.shape[2])==(max_time, M, self.hidden_size) return all_hidden, h_n
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 4842, 305, 30004, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 30004, 13, 5215, 4842, 305, 29889, 20640, 408, 5994, 30004, 13, 3166, 4842, 305, 29889, 1300, 468, 3665, 1053, 28736, 30004, 13, 5215, 12655, 408, 7442, 30004, 13, 5215, 5844, 30004, 13, 3166, 12655, 29889, 8172, 1053, 9016, 7615, 30004, 13, 5215, 10876, 30004, 13, 30004, 13, 29918, 24460, 353, 4842, 305, 3032, 29907, 3032, 16174, 6678, 29879, 30004, 13, 30004, 13, 10141, 353, 4842, 305, 29889, 10141, 703, 29883, 6191, 29908, 565, 4842, 305, 29889, 29883, 6191, 29889, 275, 29918, 16515, 580, 1683, 376, 21970, 1159, 30004, 13, 30004, 13, 1753, 7705, 1598, 29898, 29916, 1125, 30004, 13, 12, 2674, 29884, 353, 302, 29876, 29889, 1123, 29931, 29965, 26471, 13, 12, 2457, 1104, 29884, 29898, 29916, 8443, 13, 30004, 13, 1990, 3826, 388, 7355, 29898, 15755, 29889, 7355, 1125, 30004, 13, 30004, 13, 30004, 13, 12, 1753, 4770, 2344, 12035, 1311, 29892, 1881, 29918, 2311, 1919, 7934, 29918, 2311, 29892, 24003, 353, 5852, 29892, 954, 29918, 305, 18801, 353, 29871, 29896, 29892, 26229, 2433, 2674, 29884, 742, 302, 12143, 351, 29922, 8824, 1125, 30004, 13, 12, 12, 9136, 29898, 6185, 388, 7355, 29892, 1583, 467, 1649, 2344, 1649, 26471, 13, 12, 12, 1311, 29889, 18816, 29885, 3398, 353, 302, 29876, 29889, 29903, 335, 29885, 3398, 26471, 13, 12, 12, 1311, 29889, 13161, 29882, 353, 302, 29876, 29889, 29911, 27731, 26471, 13, 12, 12, 1311, 29889, 2674, 29884, 353, 302, 29876, 29889, 1123, 29931, 29965, 26471, 13, 12, 12, 1311, 29889, 2080, 29918, 2311, 353, 1881, 29918, 2311, 30004, 13, 12, 12, 1311, 29889, 10892, 29918, 2311, 353, 7934, 29918, 2311, 30004, 13, 12, 12, 1311, 29889, 29876, 12143, 351, 29922, 29876, 12143, 351, 30004, 13, 12, 12, 1311, 29889, 29890, 3173, 353, 24003, 30004, 13, 12, 12, 1311, 29889, 1949, 29918, 305, 18801, 353, 954, 29918, 305, 18801, 30004, 13, 12, 12, 1311, 29889, 11007, 403, 353, 302, 29876, 29889, 9329, 29898, 7345, 305, 29889, 20158, 29898, 29900, 29889, 29947, 511, 276, 339, 2658, 29918, 5105, 29922, 5574, 8443, 13, 12, 12, 1311, 29889, 7915, 29918, 4861, 353, 302, 29876, 29889, 9329, 29898, 7345, 305, 29889, 29911, 6073, 29898, 1949, 29918, 305, 18801, 29930, 10892, 29918, 2311, 29892, 2080, 29918, 2311, 876, 30004, 13, 12, 12, 1311, 29889, 7915, 29918, 25446, 353, 302, 29876, 29889, 9329, 29898, 7345, 305, 29889, 29911, 6073, 29898, 1949, 29918, 305, 18801, 334, 7934, 29918, 2311, 29892, 7934, 29918, 2311, 876, 30004, 13, 12, 12, 1311, 29889, 29881, 29918, 3757, 353, 302, 29876, 29889, 9329, 29898, 7345, 305, 29889, 3298, 359, 29898, 1949, 29918, 305, 18801, 334, 7934, 29918, 2311, 29892, 7934, 29918, 2311, 511, 276, 339, 2658, 29918, 5105, 29922, 8824, 8443, 13, 12, 12, 1311, 29889, 11236, 362, 29922, 11236, 362, 30004, 13, 30004, 13, 12, 12, 361, 24003, 29901, 30004, 13, 12, 12, 12, 1311, 29889, 29890, 3173, 29918, 4861, 353, 302, 29876, 29889, 9329, 29898, 7345, 305, 29889, 29911, 6073, 29898, 1949, 29918, 305, 18801, 334, 7934, 29918, 2311, 876, 30004, 13, 12, 12, 12, 1311, 29889, 29890, 3173, 29918, 25446, 353, 302, 29876, 29889, 9329, 29898, 7345, 305, 29889, 29911, 6073, 29898, 1949, 29918, 305, 18801, 334, 7934, 29918, 2311, 876, 30004, 13, 12, 12, 2870, 29901, 30004, 13, 12, 12, 12, 1311, 29889, 9573, 29918, 15501, 877, 29890, 3173, 29918, 4861, 742, 6213, 8443, 13, 12, 12, 12, 1311, 29889, 9573, 29918, 15501, 877, 29890, 3173, 29918, 25446, 742, 6213, 8443, 13, 12, 12, 30004, 13, 12, 12, 1311, 29889, 12071, 29918, 16744, 26471, 13, 12, 12, 361, 1583, 29889, 29876, 12143, 351, 29901, 30004, 13, 12, 12, 12, 1454, 474, 297, 3464, 29898, 10892, 29918, 2311, 1125, 30004, 13, 12, 12, 12, 12, 1311, 29889, 7915, 29918, 25446, 29889, 1272, 29961, 29875, 29892, 474, 13192, 29900, 30004, 13, 30004, 13, 12, 1753, 10092, 29918, 16744, 29898, 1311, 1125, 30004, 13, 12, 12, 4172, 29894, 353, 29871, 29896, 29889, 29900, 847, 5844, 29889, 3676, 29898, 1311, 29889, 10892, 29918, 2311, 8443, 13, 12, 12, 1454, 7688, 297, 1583, 29889, 16744, 7295, 30004, 13, 12, 12, 12, 15755, 29889, 2344, 29889, 29590, 23538, 7915, 29892, 448, 4172, 29894, 29892, 3659, 29894, 8443, 13, 12, 12, 30004, 13, 12, 12, 1454, 1024, 29892, 3207, 297, 1583, 29889, 17514, 29918, 16744, 7295, 30004, 13, 12, 12, 12, 361, 1024, 26359, 11007, 403, 1115, 30004, 13, 12, 12, 12, 12, 3207, 29889, 1272, 29871, 353, 4842, 305, 29889, 20158, 29898, 29900, 29889, 29947, 8443, 13, 30004, 13, 12, 12, 1454, 474, 297, 3464, 29898, 1311, 29889, 1949, 29918, 305, 18801, 29897, 584, 30004, 13, 12, 12, 12, 29916, 353, 474, 334, 1583, 29889, 10892, 29918, 2311, 30004, 13, 12, 12, 12, 1454, 432, 297, 3464, 29898, 1311, 29889, 10892, 29918, 2311, 29897, 584, 30004, 13, 12, 12, 12, 12, 361, 313, 29926, 529, 29871, 29900, 29889, 29947, 29930, 1311, 29889, 10892, 29918, 2311, 29897, 584, 30004, 13, 12, 12, 12, 12, 12, 1311, 29889, 29881, 29918, 3757, 29961, 29916, 718, 432, 3816, 29926, 29962, 353, 29871, 29896, 29889, 29900, 30004, 13, 12, 12, 12, 12, 2870, 584, 30004, 13, 12, 12, 12, 12, 12, 1311, 29889, 29881, 29918, 3757, 29961, 29916, 718, 432, 3816, 29926, 29962, 353, 448, 29896, 29889, 29900, 30004, 13, 30004, 13, 12, 1753, 6375, 29898, 1311, 29892, 1881, 3383, 298, 29916, 353, 6213, 1125, 30004, 13, 12, 12, 361, 298, 29916, 338, 6213, 29901, 30004, 13, 12, 12, 12, 29882, 29916, 353, 1881, 5396, 1482, 29918, 3298, 359, 29898, 1311, 29889, 1949, 29918, 305, 18801, 29930, 1311, 29889, 10892, 29918, 2311, 29892, 6858, 29918, 5105, 29922, 8824, 8443, 13, 30004, 13, 12, 12, 29937, 270, 744, 29918, 25446, 353, 4842, 305, 29889, 4317, 29898, 1311, 29889, 2674, 29884, 29898, 1311, 29889, 7915, 29918, 25446, 511, 1583, 29889, 29881, 29918, 3757, 8443, 13, 30004, 13, 12, 12, 361, 313, 1311, 29889, 29890, 3173, 29897, 584, 30004, 13, 12, 12, 12, 29893, 29918, 29916, 353, 1583, 29889, 29890, 3173, 29918, 4861, 718, 4842, 305, 29889, 2922, 16109, 29898, 1311, 29889, 7915, 29918, 4861, 29892, 2080, 29918, 467, 29873, 26471, 13, 12, 12, 12, 29937, 281, 29918, 29882, 353, 1583, 29889, 29890, 3173, 29918, 25446, 718, 4842, 305, 29889, 2922, 16109, 29898, 23276, 29918, 25446, 29892, 29882, 29916, 29889, 29873, 16655, 29873, 26471, 13, 12, 12, 12, 29893, 29918, 29882, 353, 1583, 29889, 29890, 3173, 29918, 25446, 718, 4842, 305, 29889, 2922, 16109, 29898, 1311, 29889, 7915, 29918, 25446, 29892, 29882, 29916, 29889, 29873, 16655, 29873, 580, 29871, 6756, 13, 12, 12, 2870, 584, 30004, 13, 12, 12, 12, 29893, 29918, 29916, 353, 4842, 305, 29889, 2922, 16109, 29898, 1311, 29889, 7915, 29918, 4861, 29892, 2080, 29918, 467, 29873, 26471, 13, 12, 12, 12, 29937, 281, 29918, 29882, 353, 4842, 305, 29889, 2922, 16109, 29898, 23276, 29918, 25446, 29892, 29882, 29916, 29889, 29873, 16655, 29873, 26471, 13, 12, 12, 12, 29893, 29918, 29882, 353, 4842, 305, 29889, 2922, 16109, 29898, 1311, 29889, 7915, 29918, 25446, 29892, 29882, 29916, 29889, 29873, 16655, 29873, 580, 29871, 6756, 13, 12, 12, 29893, 29918, 29893, 353, 5135, 1311, 29889, 11007, 403, 29897, 334, 298, 29916, 29897, 718, 5135, 29896, 17722, 1311, 29889, 11007, 403, 876, 334, 313, 29893, 29918, 29916, 718, 281, 29918, 29882, 876, 30004, 13, 12, 12, 361, 1583, 29889, 11236, 362, 1360, 29915, 13161, 29882, 2396, 30004, 13, 12, 12, 12, 29882, 353, 1583, 29889, 13161, 29882, 29898, 29893, 29918, 29893, 8443, 13, 12, 12, 2870, 29901, 30004, 13, 12, 12, 12, 29882, 353, 1583, 29889, 2674, 29884, 29898, 29893, 29918, 29893, 8443, 13, 12, 12, 2457, 298, 29871, 396, 8267, 338, 313, 29924, 29892, 379, 29897, 988, 341, 338, 278, 9853, 2159, 322, 379, 338, 278, 15685, 9927, 29889, 6756, 13, 30004, 13, 1990, 8073, 29934, 10262, 29898, 15755, 29889, 7355, 1125, 30004, 13, 30004, 13, 30004, 13, 12, 1753, 4770, 2344, 12035, 1311, 29892, 1881, 29918, 2311, 29892, 7934, 29918, 2311, 29892, 954, 29918, 29277, 353, 29871, 29896, 29892, 5768, 449, 29922, 29900, 29889, 29906, 29892, 26229, 2433, 2674, 29884, 742, 302, 12143, 351, 29922, 8824, 1125, 30004, 13, 12, 12, 9136, 29898, 7230, 29934, 10262, 29892, 1583, 467, 1649, 2344, 1649, 26471, 13, 30004, 13, 12, 12, 1311, 29889, 2080, 29918, 2311, 29871, 353, 1881, 29918, 2311, 6756, 13, 12, 12, 1311, 29889, 10892, 29918, 2311, 353, 7934, 29918, 2311, 30004, 13, 12, 12, 1311, 29889, 1949, 29918, 29277, 353, 954, 29918, 29277, 30004, 13, 12, 12, 1311, 29889, 29876, 12143, 351, 29922, 29876, 12143, 351, 30004, 13, 12, 12, 1311, 29889, 8865, 449, 353, 5768, 449, 30004, 13, 12, 12, 1311, 29889, 8865, 449, 29918, 13148, 353, 302, 29876, 29889, 15063, 449, 29898, 8865, 449, 8443, 13, 12, 12, 1311, 29889, 11236, 362, 29922, 11236, 362, 30004, 13, 30004, 13, 12, 12, 1454, 7546, 297, 3464, 29898, 1949, 29918, 29277, 1125, 30004, 13, 12, 12, 12, 13148, 29918, 2080, 29918, 2311, 29871, 353, 1583, 29889, 2080, 29918, 2311, 565, 7546, 1275, 29871, 29900, 1683, 1583, 29889, 10892, 29918, 2311, 30004, 13, 12, 12, 12, 3729, 353, 3826, 388, 7355, 29898, 2080, 29918, 2311, 29871, 353, 7546, 29918, 2080, 29918, 2311, 29892, 7934, 29918, 2311, 353, 1583, 29889, 10892, 29918, 2311, 29892, 11236, 362, 29922, 1311, 29889, 11236, 362, 29892, 302, 12143, 351, 29922, 1311, 29889, 29876, 12143, 351, 8443, 13, 12, 12, 12, 842, 5552, 29898, 1311, 29892, 525, 3729, 648, 29913, 4286, 4830, 29898, 13148, 511, 3038, 8443, 13, 30004, 13, 12, 12, 1311, 29889, 12071, 29918, 16744, 26471, 13, 30004, 13, 12, 1753, 679, 29918, 3729, 29898, 1311, 29892, 7546, 1125, 30004, 13, 12, 12, 2457, 679, 5552, 29898, 1311, 29892, 525, 3729, 648, 29913, 4286, 4830, 29898, 13148, 876, 30004, 13, 30004, 13, 12, 1753, 10092, 29918, 16744, 29898, 1311, 1125, 30004, 13, 12, 12, 1454, 7546, 297, 3464, 29898, 1311, 29889, 1949, 29918, 29277, 1125, 30004, 13, 12, 12, 12, 3729, 353, 1583, 29889, 657, 29918, 3729, 29898, 13148, 8443, 13, 12, 12, 12, 3729, 29889, 12071, 29918, 16744, 26471, 13, 30004, 13, 12, 1753, 6375, 29918, 14369, 29918, 13148, 29898, 1311, 29892, 1881, 3383, 7546, 29892, 298, 29918, 29900, 29922, 8516, 29892, 4236, 29918, 2230, 29922, 29945, 29900, 1125, 30004, 13, 12, 12, 29937, 12023, 1881, 8267, 584, 313, 2230, 29918, 303, 15092, 29892, 9853, 29918, 2311, 29892, 1881, 29918, 1590, 29918, 6229, 8443, 13, 12, 12, 29937, 12023, 1962, 8267, 29901, 313, 2230, 29918, 303, 15092, 29892, 9853, 29918, 2311, 29892, 7934, 29918, 6229, 29897, 1919, 298, 29918, 29876, 8267, 353, 313, 1949, 29918, 29277, 29892, 9853, 29918, 2311, 29892, 7934, 29918, 6229, 29897, 6660, 6590, 304, 278, 1833, 931, 25214, 6756, 13, 12, 12, 497, 29918, 10892, 353, 5159, 30004, 13, 12, 12, 3729, 353, 1583, 29889, 657, 29918, 3729, 29898, 13148, 8443, 13, 12, 12, 3317, 29918, 2230, 29892, 341, 353, 1881, 5396, 12181, 29961, 29900, 1402, 1881, 5396, 12181, 29961, 29896, 29962, 30004, 13, 12, 12, 3859, 353, 298, 29918, 29900, 30004, 13, 30004, 13, 12, 12, 9294, 313, 29882, 29918, 29900, 29889, 12181, 29961, 29900, 1402, 29882, 29918, 29900, 29889, 12181, 29961, 29896, 2314, 1275, 313, 29924, 29892, 1583, 29889, 10892, 29918, 2311, 8443, 13, 30004, 13, 12, 12, 1454, 931, 297, 3464, 29898, 3317, 29918, 2230, 1125, 30004, 13, 12, 12, 12, 3859, 353, 3038, 29898, 2080, 29918, 353, 1881, 29918, 29961, 2230, 29892, 584, 29892, 584, 1822, 29873, 3285, 298, 29916, 353, 2106, 8443, 13, 12, 12, 12, 361, 7546, 1360, 1311, 29889, 1949, 29918, 29277, 29899, 29896, 29901, 30004, 13, 12, 12, 12, 12, 497, 29918, 10892, 29889, 4397, 29898, 3859, 8443, 13, 12, 12, 12, 2870, 29901, 30004, 13, 12, 12, 12, 12, 497, 29918, 10892, 29889, 4397, 29898, 1311, 29889, 8865, 449, 29918, 13148, 29898, 3859, 876, 30004, 13, 30004, 13, 12, 12, 29882, 29918, 29876, 353, 2106, 396, 4230, 931, 25214, 2106, 313, 29924, 29892, 379, 8443, 13, 12, 12, 497, 29918, 10892, 353, 4842, 305, 29889, 1429, 29898, 497, 29918, 10892, 8443, 13, 12, 12, 9294, 313, 29882, 29918, 29876, 29889, 12181, 29961, 29900, 1402, 298, 29918, 29876, 29889, 12181, 29961, 29896, 2314, 1275, 29898, 29924, 29892, 1583, 29889, 10892, 29918, 2311, 8443, 13, 12, 12, 2457, 599, 29918, 10892, 29892, 298, 29918, 29876, 30004, 13, 30004, 13, 12, 1753, 6375, 29898, 1311, 29892, 1881, 3383, 298, 29918, 29900, 29922, 8516, 29892, 4236, 29918, 2230, 29922, 29945, 29900, 1125, 30004, 13, 12, 12, 29937, 591, 5251, 393, 278, 1881, 8267, 338, 313, 2230, 29918, 303, 15092, 29892, 9853, 29918, 2311, 29892, 1881, 29918, 29879, 7093, 8443, 13, 12, 12, 29937, 363, 1432, 1342, 278, 298, 29918, 2344, 674, 9080, 408, 5642, 29889, 379, 29918, 2344, 674, 367, 5642, 297, 1269, 7546, 322, 363, 599, 6455, 29889, 6756, 13, 12, 12, 29937, 278, 10970, 393, 674, 367, 4502, 304, 7546, 29918, 29900, 674, 367, 278, 1881, 3383, 363, 278, 15352, 15359, 29892, 591, 674, 1209, 278, 19356, 6756, 13, 12, 12, 29937, 7934, 7546, 14391, 29889, 6756, 13, 12, 12, 29937, 298, 29918, 29900, 338, 278, 2069, 284, 2106, 304, 367, 1304, 363, 278, 19753, 29889, 6756, 13, 30004, 13, 12, 12, 3317, 29918, 2230, 29892, 341, 353, 1881, 5396, 12181, 29961, 29900, 1402, 1881, 5396, 12181, 29961, 29896, 29962, 30004, 13, 30004, 13, 12, 12, 361, 451, 4842, 305, 29889, 275, 29918, 20158, 29898, 29882, 29918, 29900, 1125, 30004, 13, 12, 12, 12, 29882, 29918, 29900, 353, 4842, 305, 29889, 3298, 359, 3552, 1311, 29889, 1949, 29918, 29277, 29892, 341, 29892, 1583, 29889, 10892, 29918, 2311, 8106, 517, 29898, 10141, 8443, 13, 30004, 13, 12, 12, 29882, 29918, 29876, 353, 5159, 30004, 13, 259, 6756, 13, 12, 12, 1454, 7546, 297, 3464, 29898, 1311, 29889, 1949, 29918, 29277, 1125, 30004, 13, 12, 12, 12, 361, 7546, 1275, 29871, 29900, 29901, 6756, 13, 12, 12, 12, 12, 497, 29918, 10892, 29892, 298, 29918, 29876, 29918, 13148, 353, 1583, 29889, 11333, 29918, 14369, 29918, 13148, 29898, 2080, 3383, 7546, 29892, 298, 29918, 29900, 29961, 13148, 29892, 584, 29892, 584, 2314, 30004, 13, 12, 12, 12, 2870, 29901, 30004, 13, 12, 12, 12, 12, 497, 29918, 10892, 29892, 298, 29918, 29876, 29918, 13148, 353, 1583, 29889, 11333, 29918, 14369, 29918, 13148, 29898, 497, 29918, 10892, 29892, 7546, 29892, 298, 29918, 29900, 29961, 13148, 29892, 29901, 29892, 29901, 2314, 30004, 13, 30004, 13, 12, 12, 12, 29882, 29918, 29876, 29889, 4397, 29898, 29882, 29918, 29876, 29918, 13148, 8443, 13, 30004, 13, 12, 12, 29882, 29918, 29876, 353, 4842, 305, 29889, 1429, 29898, 29882, 29918, 29876, 8443, 13, 30004, 13, 12, 12, 9294, 313, 29882, 29918, 29876, 29889, 12181, 29961, 29900, 1402, 29882, 29918, 29876, 29889, 12181, 29961, 29896, 1402, 29882, 29918, 29876, 29889, 12181, 29961, 29906, 2314, 1275, 29898, 1583, 29889, 1949, 29918, 29277, 29892, 341, 1919, 1583, 29889, 10892, 29918, 2311, 1723, 30004, 13, 12, 12, 9294, 313, 497, 29918, 10892, 29889, 12181, 29961, 29900, 1402, 497, 29918, 10892, 29889, 12181, 29961, 29896, 1402, 497, 29918, 10892, 29889, 12181, 29961, 29906, 2314, 1360, 29898, 3317, 29918, 2230, 29892, 341, 29892, 1583, 29889, 10892, 29918, 2311, 8443, 13, 30004, 13, 12, 12, 2457, 599, 29918, 10892, 29892, 298, 29918, 29876, 2 ]
app/__init__.py
clhayes/NEU-Senior-Thesis
0
131334
import os, sys, configparser, warnings from flask import (Flask, redirect, render_template, request, session, url_for) from app import consent, alert, experiment, complete, error from .io import write_metadata from .utils import gen_code __version__ = '1.0' ## Define root directory. ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) ## Load and parse configuration file. cfg = configparser.ConfigParser() cfg.read(os.path.join(ROOT_DIR, 'app.ini')) ## Ensure output directories exist. data_dir = os.path.join(ROOT_DIR, cfg['IO']['DATA']) if not os.path.isdir(data_dir): os.makedirs(data_dir) meta_dir = os.path.join(ROOT_DIR, cfg['IO']['METADATA']) if not os.path.isdir(meta_dir): os.makedirs(meta_dir) reject_dir = os.path.join(ROOT_DIR, cfg['IO']['REJECT']) if not os.path.isdir(reject_dir): os.makedirs(reject_dir) ## Check Flask mode; if debug mode, clear session variable. debug = cfg['FLASK'].getboolean('DEBUG') if debug: warnings.warn("WARNING: Flask currently in debug mode. This should be changed prior to production.") ## Check Flask password. secret_key = cfg['FLASK']['SECRET_KEY'] if secret_key == "PLEASE_CHANGE_THIS": warnings.warn("WARNING: Flask password is currently default. This should be changed prior to production.") ## Initialize Flask application. app = Flask(__name__) app.secret_key = secret_key ## Apply blueprints to the application. app.register_blueprint(consent.bp) app.register_blueprint(alert.bp) app.register_blueprint(experiment.bp) app.register_blueprint(complete.bp) app.register_blueprint(error.bp) ## Define root node. @app.route('/') def index(): ## Debug mode: clear session. if debug: session.clear() ## Store directories in session object. session['data'] = data_dir session['metadata'] = meta_dir session['reject'] = reject_dir ## Record incoming metadata. info = dict( workerId = request.args.get('workerId'), # MTurk metadata assignmentId = request.args.get('assignmentId'), # MTurk metadata hitId = request.args.get('hitId'), # MTurk metadata subId = gen_code(24), # NivTurk metadata a = request.args.get('a'), # TurkPrime metadata tp_a = request.args.get('tp_a'), # TurkPrime metadata b = request.args.get('b'), # TurkPrime metadata tp_b = request.args.get('tp_b'), # TurkPrime metadata c = request.args.get('c'), # TurkPrime metadata tp_c = request.args.get('tp_c'), # TurkPrime metadata address = request.remote_addr, # NivTurk metadata browser = request.user_agent.browser, # User metadata platform = request.user_agent.platform, # User metadata version = request.user_agent.version, # User metadata ) ## Case 1: workerId absent. if info['workerId'] is None: ## Redirect participant to error (missing workerId). return redirect(url_for('error.error', errornum=1000)) ## Case 2: mobile user. elif info['platform'] in ['android','iphone','ipad','wii']: ## Redirect participant to error (platform error). return redirect(url_for('error.error', errornum=1001)) ## Case 3: repeat visit, previous success. elif f"{info['subId']}.json" in os.listdir(data_dir): ## Update metadata. session['workerId'] = info['workerId'] session['complete'] = 'success' ## Redirect participant to complete page. return redirect(url_for('complete.complete')) ## Case 4: repeat visit, previous reject. elif f"{info['subId']}.json" in os.listdir(reject_dir): ## Update metadata. session['workerId'] = info['workerId'] session['complete'] = 'reject' ## Redirect participant to complete page. return redirect(url_for('complete.complete')) ## Case 5: repeat visit, preexisting log but no session data. elif not 'workerId' in session and info['workerId'] in os.listdir(meta_dir): ## Update metadata. for k, v in info.items(): session[k] = v session['WARNING'] = "Incognito user." write_metadata(session, ['subId','WARNING'], 'a') ## Redirect participant to consent form. return redirect(url_for('consent.consent')) ## Case 6: repeat visit, preexisting activity. elif 'workerId' in session: ## Update metadata. session['WARNING'] = "Revisited home." write_metadata(session, ['WARNING'], 'a') ## Redirect participant to consent form. return redirect(url_for('consent.consent')) ## Case 7: first visit, workerId present. else: ## Update metadata. for k, v in info.items(): session[k] = v write_metadata(session, ['workerId','hitId','assignmentId','subId','address','browser','platform','version'], 'w') ## Redirect participant to consent form. return redirect(url_for('consent.consent'))
[ 1, 1053, 2897, 29892, 10876, 29892, 2295, 16680, 29892, 18116, 13, 3166, 29784, 1053, 313, 8754, 1278, 29892, 6684, 29892, 4050, 29918, 6886, 29892, 2009, 29892, 4867, 29892, 3142, 29918, 1454, 29897, 13, 3166, 623, 1053, 20218, 29892, 6655, 29892, 7639, 29892, 4866, 29892, 1059, 13, 3166, 869, 601, 1053, 2436, 29918, 19635, 13, 3166, 869, 13239, 1053, 2531, 29918, 401, 13, 1649, 3259, 1649, 353, 525, 29896, 29889, 29900, 29915, 13, 13, 2277, 22402, 3876, 3884, 29889, 13, 21289, 29918, 9464, 353, 2897, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 6370, 2084, 22168, 1445, 1649, 876, 13, 13, 2277, 16012, 322, 6088, 5285, 934, 29889, 13, 16859, 353, 2295, 16680, 29889, 3991, 11726, 580, 13, 16859, 29889, 949, 29898, 359, 29889, 2084, 29889, 7122, 29898, 21289, 29918, 9464, 29892, 525, 932, 29889, 2172, 8785, 13, 13, 2277, 22521, 545, 1962, 17525, 1863, 29889, 13, 1272, 29918, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898, 21289, 29918, 9464, 29892, 274, 16434, 1839, 5971, 16215, 14573, 11287, 13, 361, 451, 2897, 29889, 2084, 29889, 275, 3972, 29898, 1272, 29918, 3972, 1125, 2897, 29889, 29885, 12535, 12935, 29898, 1272, 29918, 3972, 29897, 13, 7299, 29918, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898, 21289, 29918, 9464, 29892, 274, 16434, 1839, 5971, 16215, 2303, 29911, 3035, 8254, 11287, 13, 361, 451, 2897, 29889, 2084, 29889, 275, 3972, 29898, 7299, 29918, 3972, 1125, 2897, 29889, 29885, 12535, 12935, 29898, 7299, 29918, 3972, 29897, 13, 276, 622, 29918, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898, 21289, 29918, 9464, 29892, 274, 16434, 1839, 5971, 16215, 1525, 17637, 11287, 13, 361, 451, 2897, 29889, 2084, 29889, 275, 3972, 29898, 276, 622, 29918, 3972, 1125, 2897, 29889, 29885, 12535, 12935, 29898, 276, 622, 29918, 3972, 29897, 13, 13, 2277, 5399, 2379, 1278, 4464, 29936, 565, 4744, 4464, 29892, 2821, 4867, 2286, 29889, 13, 8382, 353, 274, 16434, 1839, 10536, 3289, 29968, 13359, 657, 20054, 877, 18525, 1495, 13, 361, 4744, 29901, 13, 1678, 18116, 29889, 25442, 703, 29956, 25614, 29901, 2379, 1278, 5279, 297, 4744, 4464, 29889, 910, 881, 367, 3939, 7536, 304, 5802, 23157, 13, 13, 2277, 5399, 2379, 1278, 4800, 29889, 13, 19024, 29918, 1989, 353, 274, 16434, 1839, 10536, 3289, 29968, 16215, 1660, 22245, 29911, 29918, 10818, 2033, 13, 361, 7035, 29918, 1989, 1275, 376, 29925, 14063, 29918, 3210, 24336, 29918, 4690, 3235, 1115, 13, 1678, 18116, 29889, 25442, 703, 29956, 25614, 29901, 2379, 1278, 4800, 338, 5279, 2322, 29889, 910, 881, 367, 3939, 7536, 304, 5802, 23157, 13, 13, 2277, 25455, 2379, 1278, 2280, 29889, 13, 932, 353, 2379, 1278, 22168, 978, 1649, 29897, 13, 932, 29889, 19024, 29918, 1989, 353, 7035, 29918, 1989, 13, 13, 2277, 2401, 368, 7254, 2158, 29879, 304, 278, 2280, 29889, 13, 932, 29889, 9573, 29918, 9539, 2158, 29898, 3200, 296, 29889, 25288, 29897, 13, 932, 29889, 9573, 29918, 9539, 2158, 29898, 12888, 29889, 25288, 29897, 13, 932, 29889, 9573, 29918, 9539, 2158, 29898, 735, 15362, 29889, 25288, 29897, 13, 932, 29889, 9573, 29918, 9539, 2158, 29898, 8835, 29889, 25288, 29897, 13, 932, 29889, 9573, 29918, 9539, 2158, 29898, 2704, 29889, 25288, 29897, 13, 13, 2277, 22402, 3876, 2943, 29889, 13, 29992, 932, 29889, 13134, 11219, 1495, 13, 1753, 2380, 7295, 13, 13, 1678, 444, 16171, 4464, 29901, 2821, 4867, 29889, 13, 1678, 565, 4744, 29901, 13, 4706, 4867, 29889, 8551, 580, 13, 13, 1678, 444, 14491, 17525, 297, 4867, 1203, 29889, 13, 1678, 4867, 1839, 1272, 2033, 353, 848, 29918, 3972, 13, 1678, 4867, 1839, 19635, 2033, 353, 12700, 29918, 3972, 13, 1678, 4867, 1839, 276, 622, 2033, 353, 12560, 29918, 3972, 13, 13, 1678, 444, 14164, 23235, 15562, 29889, 13, 1678, 5235, 353, 9657, 29898, 13, 4706, 15645, 1204, 268, 353, 2009, 29889, 5085, 29889, 657, 877, 24602, 1204, 5477, 4706, 396, 341, 29911, 29641, 15562, 13, 4706, 12827, 1204, 353, 2009, 29889, 5085, 29889, 657, 877, 465, 10194, 1204, 5477, 1678, 396, 341, 29911, 29641, 15562, 13, 4706, 7124, 1204, 4706, 353, 2009, 29889, 5085, 29889, 657, 877, 27342, 1204, 5477, 965, 396, 341, 29911, 29641, 15562, 13, 4706, 1014, 1204, 4706, 353, 2531, 29918, 401, 29898, 29906, 29946, 511, 462, 4706, 396, 405, 440, 29911, 29641, 15562, 13, 4706, 263, 9651, 353, 2009, 29889, 5085, 29889, 657, 877, 29874, 5477, 1669, 396, 16559, 4040, 603, 15562, 13, 4706, 260, 29886, 29918, 29874, 308, 353, 2009, 29889, 5085, 29889, 657, 877, 9392, 29918, 29874, 5477, 9651, 396, 16559, 4040, 603, 15562, 13, 4706, 289, 9651, 353, 2009, 29889, 5085, 29889, 657, 877, 29890, 5477, 1669, 396, 16559, 4040, 603, 15562, 13, 4706, 260, 29886, 29918, 29890, 308, 353, 2009, 29889, 5085, 29889, 657, 877, 9392, 29918, 29890, 5477, 9651, 396, 16559, 4040, 603, 15562, 13, 4706, 274, 9651, 353, 2009, 29889, 5085, 29889, 657, 877, 29883, 5477, 1669, 396, 16559, 4040, 603, 15562, 13, 4706, 260, 29886, 29918, 29883, 308, 353, 2009, 29889, 5085, 29889, 657, 877, 9392, 29918, 29883, 5477, 9651, 396, 16559, 4040, 603, 15562, 13, 4706, 3211, 418, 353, 2009, 29889, 16674, 29918, 10030, 29892, 462, 396, 405, 440, 29911, 29641, 15562, 13, 4706, 4714, 418, 353, 2009, 29889, 1792, 29918, 14748, 29889, 15965, 29892, 3986, 396, 4911, 15562, 13, 4706, 7481, 268, 353, 2009, 29889, 1792, 29918, 14748, 29889, 12120, 29892, 308, 396, 4911, 15562, 13, 4706, 1873, 418, 353, 2009, 29889, 1792, 29918, 14748, 29889, 3259, 29892, 3986, 396, 4911, 15562, 13, 1678, 1723, 13, 13, 1678, 444, 11733, 29871, 29896, 29901, 15645, 1204, 29207, 29889, 13, 1678, 565, 5235, 1839, 24602, 1204, 2033, 338, 6213, 29901, 13, 13, 4706, 444, 4367, 1088, 5221, 424, 304, 1059, 313, 27259, 15645, 1204, 467, 13, 4706, 736, 6684, 29898, 2271, 29918, 1454, 877, 2704, 29889, 2704, 742, 1059, 1949, 29922, 29896, 29900, 29900, 29900, 876, 13, 13, 1678, 444, 11733, 29871, 29906, 29901, 10426, 1404, 29889, 13, 1678, 25342, 5235, 1839, 12120, 2033, 297, 6024, 2843, 3788, 29875, 6710, 3788, 666, 328, 3788, 29893, 2236, 2033, 29901, 13, 13, 4706, 444, 4367, 1088, 5221, 424, 304, 1059, 313, 12120, 1059, 467, 13, 4706, 736, 6684, 29898, 2271, 29918, 1454, 877, 2704, 29889, 2704, 742, 1059, 1949, 29922, 29896, 29900, 29900, 29896, 876, 13, 13, 1678, 444, 11733, 29871, 29941, 29901, 12312, 6493, 29892, 3517, 2551, 29889, 13, 1678, 25342, 285, 29908, 29912, 3888, 1839, 1491, 1204, 2033, 1836, 3126, 29908, 297, 2897, 29889, 1761, 3972, 29898, 1272, 29918, 3972, 1125, 13, 13, 4706, 444, 10318, 15562, 29889, 13, 4706, 4867, 1839, 24602, 1204, 2033, 353, 5235, 1839, 24602, 1204, 2033, 13, 4706, 4867, 1839, 8835, 2033, 353, 525, 8698, 29915, 13, 13, 4706, 444, 4367, 1088, 5221, 424, 304, 4866, 1813, 29889, 13, 4706, 736, 6684, 29898, 2271, 29918, 1454, 877, 8835, 29889, 8835, 8785, 13, 13, 1678, 444, 11733, 29871, 29946, 29901, 12312, 6493, 29892, 3517, 12560, 29889, 13, 1678, 25342, 285, 29908, 29912, 3888, 1839, 1491, 1204, 2033, 1836, 3126, 29908, 297, 2897, 29889, 1761, 3972, 29898, 276, 622, 29918, 3972, 1125, 13, 13, 4706, 444, 10318, 15562, 29889, 13, 4706, 4867, 1839, 24602, 1204, 2033, 353, 5235, 1839, 24602, 1204, 2033, 13, 4706, 4867, 1839, 8835, 2033, 353, 525, 276, 622, 29915, 13, 13, 4706, 444, 4367, 1088, 5221, 424, 304, 4866, 1813, 29889, 13, 4706, 736, 6684, 29898, 2271, 29918, 1454, 877, 8835, 29889, 8835, 8785, 13, 13, 1678, 444, 11733, 29871, 29945, 29901, 12312, 6493, 29892, 758, 735, 15423, 1480, 541, 694, 4867, 848, 29889, 13, 1678, 25342, 451, 525, 24602, 1204, 29915, 297, 4867, 322, 5235, 1839, 24602, 1204, 2033, 297, 2897, 29889, 1761, 3972, 29898, 7299, 29918, 3972, 1125, 13, 13, 4706, 444, 10318, 15562, 29889, 13, 4706, 363, 413, 29892, 325, 297, 5235, 29889, 7076, 7295, 4867, 29961, 29895, 29962, 353, 325, 13, 4706, 4867, 1839, 29956, 25614, 2033, 353, 376, 797, 29883, 3811, 2049, 1404, 1213, 13, 4706, 2436, 29918, 19635, 29898, 7924, 29892, 6024, 1491, 1204, 3788, 29956, 25614, 7464, 525, 29874, 1495, 13, 13, 4706, 444, 4367, 1088, 5221, 424, 304, 20218, 883, 29889, 13, 4706, 736, 6684, 29898, 2271, 29918, 1454, 877, 3200, 296, 29889, 3200, 296, 8785, 13, 13, 1678, 444, 11733, 29871, 29953, 29901, 12312, 6493, 29892, 758, 735, 15423, 6354, 29889, 13, 1678, 25342, 525, 24602, 1204, 29915, 297, 4867, 29901, 13, 13, 4706, 444, 10318, 15562, 29889, 13, 4706, 4867, 1839, 29956, 25614, 2033, 353, 376, 1123, 1730, 1573, 3271, 1213, 13, 4706, 2436, 29918, 19635, 29898, 7924, 29892, 6024, 29956, 25614, 7464, 525, 29874, 1495, 13, 13, 4706, 444, 4367, 1088, 5221, 424, 304, 20218, 883, 29889, 13, 4706, 736, 6684, 29898, 2271, 29918, 1454, 877, 3200, 296, 29889, 3200, 296, 8785, 13, 13, 1678, 444, 11733, 29871, 29955, 29901, 937, 6493, 29892, 15645, 1204, 2198, 29889, 13, 1678, 1683, 29901, 13, 13, 4706, 444, 10318, 15562, 29889, 13, 4706, 363, 413, 29892, 325, 297, 5235, 29889, 7076, 7295, 4867, 29961, 29895, 29962, 353, 325, 13, 4706, 2436, 29918, 19635, 29898, 7924, 29892, 6024, 24602, 1204, 3788, 27342, 1204, 3788, 465, 10194, 1204, 3788, 1491, 1204, 3788, 7328, 3788, 15965, 3788, 12120, 3788, 3259, 7464, 525, 29893, 1495, 13, 13, 4706, 444, 4367, 1088, 5221, 424, 304, 20218, 883, 29889, 13, 4706, 736, 6684, 29898, 2271, 29918, 1454, 877, 3200, 296, 29889, 3200, 296, 8785, 13, 2 ]
Hackerrank/Python/triangle-quest-2.py
PROxZIMA/Competitive-Coding
1
82162
num = int(input()) for i in range(1, num+1): s = '' for j in range(1, i): s += str(j) for j in range(i, 0, -1): s += str(j) print(s)
[ 1, 954, 353, 938, 29898, 2080, 3101, 13, 13, 1454, 474, 297, 3464, 29898, 29896, 29892, 954, 29974, 29896, 1125, 13, 1678, 269, 353, 6629, 13, 1678, 363, 432, 297, 3464, 29898, 29896, 29892, 474, 1125, 13, 4706, 269, 4619, 851, 29898, 29926, 29897, 13, 1678, 363, 432, 297, 3464, 29898, 29875, 29892, 29871, 29900, 29892, 448, 29896, 1125, 13, 4706, 269, 4619, 851, 29898, 29926, 29897, 13, 1678, 1596, 29898, 29879, 29897, 2 ]
jacket/drivers/openstack/compute_driver.py
bopopescu/jacket
0
52971
<gh_stars>0 # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ Driver base-classes: (Beginning of) the contract that compute drivers must follow, and shared types that support that contract """ import copy import socket import traceback import uuid from oslo_log import log as logging from oslo_serialization import jsonutils from oslo_utils import excutils from oslo_utils import strutils from jacket.compute.cloud import power_state from jacket.compute.cloud import task_states from jacket.compute.cloud import vm_states from jacket.compute.virt import driver from jacket.compute.virt import hardware from jacket import conf from jacket import context as req_context from jacket.compute import image from jacket.db.extend import api as caa_db_api from jacket.drivers.openstack import base from jacket.drivers.openstack import exception_ex from jacket import exception from jacket.i18n import _LE from jacket import utils from jacket.objects import compute as objects LOG = logging.getLogger(__name__) CONF = conf.CONF FS_DOMAIN_NOSTATE = 0 FS_DOMAIN_RUNNING = 1 FS_DOMAIN_BLOCKED = 2 FS_DOMAIN_PAUSED = 3 FS_DOMAIN_SHUTDOWN = 4 FS_DOMAIN_SHUTOFF = 5 FS_DOMAIN_CRASHED = 6 FS_DOMAIN_PMSUSPENDED = 7 FS_POWER_STATE = { FS_DOMAIN_NOSTATE: power_state.NOSTATE, FS_DOMAIN_RUNNING: power_state.RUNNING, FS_DOMAIN_BLOCKED: power_state.RUNNING, FS_DOMAIN_PAUSED: power_state.PAUSED, FS_DOMAIN_SHUTDOWN: power_state.SHUTDOWN, FS_DOMAIN_SHUTOFF: power_state.SHUTDOWN, FS_DOMAIN_CRASHED: power_state.CRASHED, FS_DOMAIN_PMSUSPENDED: power_state.SUSPENDED, } class OsComputeDriver(driver.ComputeDriver, base.OsDriver): def __init__(self, virtapi): self._os_novaclient = None self._os_cinderclient = None self._os_glanceclient = None self.caa_db_api = caa_db_api self._image_api = image.API() super(OsComputeDriver, self).__init__(virtapi) def after_detach_volume_fail(self, job_detail_info, **kwargs): pass def after_detach_volume_success(self, job_detail_info, **kwargs): pass def _add_tag_to_metadata(self, metadata, caa_instance_id): if not metadata: metadata = {} metadata['tag:caa_instance_id'] = caa_instance_id return metadata def _is_booted_from_volume(self, instance, disk_mapping=None): """Determines whether the VM is booting from volume Determines whether the disk mapping indicates that the VM is booting from a volume. """ return (not bool(instance.get('image_ref'))) def _transfer_to_sub_block_device_mapping_v2(self, context, instance, block_device_mapping): """ :param block_device_mapping: { 'block_device_mapping': [{ 'guest_format': None, 'boot_index': 0, 'mount_device': u'/dev/sda', 'connection_info': { u'driver_volume_type': u'fs_clouds_volume', 'serial': u'817492df-3e7f-439a-bfb3-6c2f6488a6e5', u'data': { u'access_mode': u'rw', u'qos_specs': None, u'display_name': u'image-v-02', u'volume_id': u'817492df-3e7f-439a-bfb3-6c2f6488a6e5', u'backend': u'fsclouds' } }, 'disk_bus': None, 'device_type': None, 'delete_on_termination': False }], 'root_device_name': u'/dev/sda', 'ephemerals': [], 'swap': None } :return: type list, [{ "boot_index": 0, "uuid": "5e9ba941-7fad-4515-872a-0b2f1a05d577", "volume_size": "1", "device_name": "/dev/sda", "source_type": "volume", "volume_id": "5e9ba941-7fad-4515-872a-0b2f1a05d577", "delete_on_termination": "False"}] """ sub_bdms = [] bdm_list = block_device_mapping.get('block_device_mapping', []) for bdm in bdm_list: bdm_info_dict = {} # bdm_info_dict['delete_on_termination'] = bdm.get( # 'delete_on_termination', False) bdm_info_dict['boot_index'] = bdm.get('boot_index') bdm_info_dict['destination_type'] = 'volume' source_type = bdm.get('source_type', None) # NOTE(laoyi) Now, only support image and blank if source_type == 'image': image_id = bdm.get('image_id', None) if image_id: provider_image_id = self._get_provider_image_id(context, image_id) else: provider_image_id = self._get_provider_base_image_id( context) if provider_image_id: bdm_info_dict['source_type'] = 'image' bdm_info_dict['uuid'] = provider_image_id else: bdm_info_dict['source_type'] = 'blank' bdm_info_dict['volume_size'] = str(bdm.get('size')) bdm_info_dict['delete_on_termination'] = bdm.get( 'delete_on_termination', False) elif source_type == 'blank': bdm_info_dict['source_type'] = source_type bdm_info_dict['volume_size'] = str(bdm.get('size')) bdm_info_dict['delete_on_termination'] = bdm.get( 'delete_on_termination', False) else: volume_id = bdm.get('connection_info').get('data').get( 'volume_id') if volume_id: provider_volume = self._get_provider_volume(context, volume_id) bdm_info_dict['uuid'] = provider_volume.id bdm_info_dict['volume_size'] = str(provider_volume.size) # bdm_info_dict['device_name'] = device_name bdm_info_dict['source_type'] = 'volume' bdm_info_dict['delete_on_termination'] = bdm.get( 'delete_on_termination', False) else: # TODO: need to support snapshot id continue sub_bdms.append(bdm_info_dict) if not sub_bdms: sub_bdms = None return sub_bdms def _get_provider_security_groups_list(self, context, project_mapper=None): if project_mapper is None: project_mapper = self._get_project_mapper(context, context.project_id) provider_sg = project_mapper.get('security_groups', None) if provider_sg: security_groups = provider_sg.split(',') else: security_groups = None return security_groups def _get_provider_nics(self, context, project_mapper=None): if project_mapper is None: project_mapper = self._get_project_mapper(context, context.project_id) provider_net_data = project_mapper.get('net_data', None) provider_net_api = project_mapper.get('net_api', None) provider_net_external = project_mapper.get('net_external', None) nics = [] if provider_net_external: nics.append({'net-id': provider_net_external}) nics.append({'net-id': provider_net_data}) nics.append({'net-id': provider_net_api}) return nics def _get_agent_inject_file(self, instance, driver_param_inject_files): return dict(driver_param_inject_files) def _generate_provider_instance_name(self, instance_name, instance_id): """ :param instance_name: type string :param instance_id: type string :return: type string, e.g. 'my_vm@97988012-4f48-4463-a150-d7e6b0a321d9' """ if not instance_name: instance_name = 'server' return '@'.join([instance_name, instance_id]) def _get_provider_flavor_id(self, context, flavor_id): # get dest flavor id flavor_mapper = self.caa_db_api.flavor_mapper_get(context, flavor_id, context.project_id) dest_flavor_id = flavor_mapper.get("dest_flavor_id", flavor_id) return dest_flavor_id def _create_snapshot_metadata(self, image_meta, instance, img_fmt, snp_name): metadata = {'is_public': False, 'status': 'active', 'name': snp_name, 'properties': { 'kernel_id': instance.kernel_id, 'image_location': 'snapshot', 'image_state': 'available', 'owner_id': instance.project_id, 'ramdisk_id': instance.ramdisk_id, } } if instance.os_type: metadata['properties']['os_type'] = instance.os_type if img_fmt: metadata['disk_format'] = img_fmt else: metadata['disk_format'] = image_meta.disk_format if image_meta.obj_attr_is_set("container_format"): metadata['container_format'] = image_meta.container_format else: metadata['container_format'] = "bare" return metadata def list_instance_uuids(self): uuids = [] context = req_context.RequestContext(is_admin=True, project_id='default') servers = self.os_novaclient(context).list() for server in servers: server_id = server.id uuids.append(server_id) LOG.debug('list_instance_uuids: %s' % uuids) return uuids def list_instances(self): """List VM instances from all nodes. :return: list of instance id. e.g.['id_001', 'id_002', ...] """ instances = [] context = req_context.RequestContext(is_admin=True, project_id='default') servers = self.os_novaclient(context).list() for server in servers: server_name = server.name instances.append(server_name) LOG.debug('list_instance: %s' % instances) return instances def list_instances_stats(self): """List VM instances from all nodes. :return: list of instance id. e.g.['id_001', 'id_002', ...] """ stats = {} context = req_context.RequestContext(is_admin=True, project_id='default') servers = self.os_novaclient(context).list() for server in servers: server_id = server.id instance_power_state = getattr(server, 'OS-EXT-STS:power_state') stats[server_id] = FS_POWER_STATE[instance_power_state] return stats def get_console_output(self, context, instance): provider_uuid = self._get_provider_instance_id(context, instance.uuid) return self.os_novaclient(context).get_console_output(provider_uuid) def volume_create(self, context, instance, image_id=None, size=None): if image_id and image_id == "base": provider_image_id = self._get_provider_base_image_id(context) elif image_id: provider_image_id = self._get_provider_image_id(context, image_id) else: provider_image_id = None volume_id = str(uuid.uuid4()) kwargs = {} if not size: size = instance.get_flavor().get('root_gb') volume_name = instance.uuid kwargs['display_name'] = volume_name if provider_image_id: kwargs['imageRef'] = provider_image_id provider_volume = self.os_cinderclient(context).create_volume(size, **kwargs) try: self.os_cinderclient(context).check_create_volume_complete( provider_volume) except Exception as ex: LOG.exception(_LE("provider volume(%s), " "check_create_volume_complete " "failed! ex = %s"), provider_volume.id, ex) with excutils.save_and_reraise_exception(): provider_volume.delete() try: # create volume mapper values = {"provider_volume_id": provider_volume.id} self.caa_db_api.volume_mapper_create(context, volume_id, context.project_id, values) except Exception as ex: LOG.exception(_LE("volume_mapper_create failed! ex = %s"), ex) with excutils.save_and_reraise_exception(): provider_volume.delete() return volume_id def volume_delete(self, context, instance, volume_id): try: provider_volume = self._get_provider_volume(context, volume_id) except exception.EntityNotFound: LOG.debug('no sub-volume exist, ' 'no need to delete provider volume') return LOG.debug('submit delete-volume task') provider_volume.delete() LOG.debug('wait for volume delete') self.os_cinderclient(context).check_delete_volume_complete( provider_volume) try: # delelte volume mapper self.caa_db_api.volume_mapper_delete(context, volume_id, context.project_id) except Exception as ex: LOG.error(_LE("volume_mapper_delete failed! ex = %s"), ex) def _attach_volume(self, context, instance, provider_volume, mountpoint): provider_server = self._get_provider_instance(context, instance) if not provider_server: LOG.error('Can not find server in provider os, ' 'server: %s' % instance.uuid) raise exception_ex.ServerNotExistException( server_name=instance.display_name) if provider_volume.status == "in-use": attach_id, server_id = self._get_attachment_id_for_volume( provider_volume) if server_id != provider_server.id: LOG.error(_LE("provider volume(%s) has been attached to " "provider instance(%s)"), provider_volume.id, server_id) raise exception_ex.VolumeAttachFailed( volume_id=provider_volume.id) else: return if provider_volume.status == 'available': self.os_novaclient(context).attach_volume(provider_server.id, provider_volume.id, mountpoint) self.os_cinderclient(context).check_attach_volume_complete( provider_volume) else: raise Exception('provider volume %s is not available, ' 'status is %s' % (provider_volume.id, provider_volume.status)) def attach_volume(self, context, connection_info, instance, mountpoint=None, disk_bus=None, device_type=None, encryption=None): """ :param context: ['auth_token', 'elevated', 'from_dict', 'instance_lock_checked', 'is_admin', 'project_id', 'project_name', 'quota_class', 'read_deleted', 'remote_address', 'request_id', 'roles', 'service_catalog', 'tenant', 'timestamp', 'to_dict', 'update_store', 'user', 'user_id', 'user_name'] :param connection_info: { u'driver_volume_type': u'vcloud_volume', 'serial': u'824d397e-4138-48e4-b00b-064cf9ef4ed8', u'data': { u'access_mode': u'rw', u'qos_specs': None, u'display_name': u'volume_02', u'volume_id': u'824d397e-4138-48e4-b00b-064cf9ef4ed8', u'backend': u'vcloud' } } :param instance: Instance( access_ip_v4=None, access_ip_v6=None, architecture=None, auto_disk_config=False, availability_zone='az01.hws--fusionsphere', cell_name=None, cleaned=False, config_drive='', created_at=2016-01-14T07: 17: 40Z, default_ephemeral_device=None, default_swap_device=None, deleted=False, deleted_at=None, disable_terminate=False, display_description='volume_backend_01', display_name='volume_backend_01', ephemeral_gb=0, ephemeral_key_uuid=None, fault=<?>, host='420824B8-AC4B-7A64-6B8D-D5ACB90E136A', hostname='volume-backend-01', id=57, image_ref='', info_cache=InstanceInfoCache, instance_type_id=2, kernel_id='', key_data=None, key_name=None, launch_index=0, launched_at=2016-01-14T07: 17: 43Z, launched_on='420824B8-AC4B-7A64-6B8D-D5ACB90E136A', locked=False, locked_by=None, memory_mb=512, metadata={ }, node='420824B8-AC4B-7A64-6B8D-D5ACB90E136A', numa_topology=<?>, os_type=None, pci_devices=<?>, power_state=0, progress=0, project_id='e178f1b9539b4a02a9c849dd7ea3ea9e', ramdisk_id='', reservation_id='r-marvoq8g', root_device_name='/dev/sda', root_gb=1, scheduled_at=None, security_groups=SecurityGroupList, shutdown_terminate=False, system_metadata={ image_base_image_ref='', image_checksum='d972013792949d0d3ba628fbe8685bce', image_container_format='bare', image_disk_format='qcow2', image_image_id='617e72df-41ba-4e0d-ac88-cfff935a7dc3', image_image_name='cirros', image_min_disk='0', image_min_ram='0', image_size='13147648', instance_type_ephemeral_gb='0', instance_type_flavorid='1', instance_type_id='2', instance_type_memory_mb='512', instance_type_name='m1.tiny', instance_type_root_gb='1', instance_type_rxtx_factor='1.0', instance_type_swap='0', instance_type_vcpu_weight=None, instance_type_vcpus='1' }, task_state=None, terminated_at=None, updated_at=2016-01-14T07: 17: 43Z, user_data=u'<SANITIZED>, user_id='d38732b0a8ff451eb044015e80bbaa65', uuid=9eef20f0-5ebf-4793-b4a2-5a667b0acad0, vcpus=1, vm_mode=None, vm_state='active') Volume object: { 'status': u'attaching', 'volume_type_id': u'type01', 'volume_image_metadata': { u'container_format': u'bare', u'min_ram': u'0', u'disk_format': u'qcow2', u'image_name': u'cirros', u'image_id': u'617e72df-41ba-4e0d-ac88-cfff935a7dc3', u'checksum': u'd972013792949d0d3ba628fbe8685bce', u'min_disk': u'0', u'size': u'13147648' }, 'display_name': u'volume_02', 'attachments': [], 'attach_time': '', 'availability_zone': u'az01.hws--fusionsphere', 'bootable': True, 'created_at': u'2016-01-18T07: 03: 57.822386', 'attach_status': 'detached', 'display_description': None, 'volume_metadata': { u'readonly': u'False' }, 'shareable': u'false', 'snapshot_id': None, 'mountpoint': '', 'id': u'824d397e-4138-48e4-b00b-064cf9ef4ed8', 'size': 120 } :param mountpoint: string. e.g. "/dev/sdb" :param disk_bus: :param device_type: :param encryption: :return: """ LOG.debug('start to attach volume.') cascading_volume_id = connection_info['data']['volume_id'] provider_volume = self._get_provider_volume(context, cascading_volume_id) self._attach_volume(context, instance, provider_volume, mountpoint) LOG.debug('attach volume : %s success.' % cascading_volume_id) def destroy(self, context, instance, network_info, block_device_info=None, destroy_disks=True, migrate_data=None): """ :param instance: :param network_info: :param block_device_info: :param destroy_disks: :param migrate_data: :return: """ try: provider_server = self._get_provider_instance(context, instance) except exception.EntityNotFound: LOG.debug("instance is not exist, no need to delete!", instance=instance) return if provider_server: try: self.os_novaclient(context).delete(provider_server) self.os_novaclient(context).check_delete_server_complete( provider_server) except exception.ResourceInError: import time; time.sleep(30) self.os_novaclient(context).check_delete_server_complete( provider_server) else: LOG.error('Can not found server to delete.') # raise exception_ex.ServerNotExistException(server_name=instance.display_name) try: # delete instance mapper self.caa_db_api.instance_mapper_delete(context, instance.uuid, instance.project_id) except Exception as ex: LOG.error(_LE("instance_mapper_delete failed! ex = %s"), ex) LOG.debug('success to delete instance: %s' % instance.uuid) def _detach_volume(self, context, provider_volume): if provider_volume.status == "available": LOG.debug("provider volume(%s) has been detach", provider_volume.id) return attachment_id, server_id = self._get_attachment_id_for_volume( provider_volume) LOG.debug('server_id: %s' % server_id) LOG.debug('submit detach task') self.os_novaclient(context).detach_volume(server_id, provider_volume.id) LOG.debug('wait for volume in available status.') self.os_cinderclient(context).check_detach_volume_complete( provider_volume) def detach_volume(self, connection_info, instance, mountpoint, encryption=None): LOG.debug('start to detach volume.') LOG.debug('instance: %s' % instance) LOG.debug('connection_info: %s' % connection_info) context = req_context.RequestContext(is_admin=True, project_id=instance.project_id) cascading_volume_id = connection_info['data']['volume_id'] provider_volume = self._get_provider_volume(context, cascading_volume_id) self._detach_volume(context, provider_volume) LOG.debug("detach volume success!", instance=instance) def get_available_nodes(self, refresh=False): """Returns nodenames of all nodes managed by the compute service. This method is for multi compute-nodes support. If a driver supports multi compute-nodes, this method returns a list of nodenames managed by the service. Otherwise, this method should return [hypervisor_hostname]. """ hostname = socket.gethostname() return [hostname] def _get_host_stats(self, hostname): return {'vcpus': 999999, 'vcpus_used': 0, 'memory_mb': 999999, 'memory_mb_used': 0, 'local_gb': 99999999, 'local_gb_used': 0, 'host_memory_total': 99999999, 'disk_total': 99999999, 'host_memory_free': 99999999, 'disk_used': 0, 'hypervisor_type': 'fusionsphere', 'hypervisor_version': '5005000', 'hypervisor_hostname': hostname, 'cpu_info': '{"model": ["Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz"],' '"vendor": ["Huawei Technologies Co., Ltd."], ' '"topology": {"cores": 16, "threads": 32}}', 'supported_instances': jsonutils.dumps( [["i686", "xen", "uml"], ["x86_64", "xen", "uml"]]), 'numa_topology': None,} def get_available_resource(self, nodename): host_stats = self._get_host_stats(nodename) supported_instances = list() for one in jsonutils.loads(host_stats['supported_instances']): supported_instances.append((one[0], one[1], one[2])) return {'vcpus': host_stats['vcpus'], 'memory_mb': host_stats['host_memory_total'], 'local_gb': host_stats['disk_total'], 'vcpus_used': 0, 'memory_mb_used': host_stats['host_memory_total'] - host_stats[ 'host_memory_free'], 'local_gb_used': host_stats['disk_used'], 'hypervisor_type': host_stats['hypervisor_type'], 'hypervisor_version': host_stats['hypervisor_version'], 'hypervisor_hostname': host_stats['hypervisor_hostname'], 'cpu_info': jsonutils.dumps(host_stats['cpu_info']), 'supported_instances': supported_instances, 'numa_topology': None,} def get_info(self, instance): STATUS = power_state.NOSTATE context = req_context.RequestContext(is_admin=True, project_id=instance.project_id) server = self._get_provider_instance(context, instance) LOG.debug('server: %s' % server) if server: instance_power_state = getattr(server, 'OS-EXT-STS:power_state') STATUS = FS_POWER_STATE[instance_power_state] LOG.debug('end to get_info: %s' % STATUS) return hardware.InstanceInfo( state=STATUS, max_mem_kb=0, mem_kb=0, num_cpu=1) def get_instance_macs(self, instance): """ No need to implement. :param instance: :return: """ pass def get_volume_connector(self, instance): return {'ip': CONF.my_block_storage_ip, 'initiator': 'fake', 'host': 'fakehost'} def init_host(self, host): pass def power_off(self, instance, timeout=0, retry_interval=0): LOG.debug('start to stop server: %s' % instance.uuid) server = self._get_provider_instance(hybrid_instance=instance) if not server: LOG.debug('can not find sub os server for ' 'instance: %s' % instance.uuid) raise exception_ex.ServerNotExistException( server_name=instance.display_name) context = req_context.RequestContext(is_admin=True, project_id=instance.project_id) LOG.debug('server: %s status is: %s' % (server.id, server.status)) if server.status == vm_states.ACTIVE.upper(): LOG.debug('start to add stop task') server.stop() LOG.debug('submit stop task') self.os_novaclient(context).check_stop_server_complete(server) LOG.debug('stop server: %s success' % instance.uuid) elif server.status == 'SHUTOFF': LOG.debug('sub instance status is already STOPPED.') LOG.debug('stop server: %s success' % instance.uuid) return else: LOG.warning('server status is not in ACTIVE OR STOPPED,' 'can not do POWER_OFF operation') raise exception_ex.ServerStatusException(status=server.status) def power_on(self, context, instance, network_info, block_device_info=None): LOG.debug('start to start server: %s' % instance.uuid) server = self._get_provider_instance(context, instance) if not server: LOG.debug('can not find sub os server for ' 'instance: %s' % instance.uuid) raise exception_ex.ServerNotExistException(instance.display_name) LOG.debug('server: %s status is: %s' % (server.id, server.status)) if server.status == 'SHUTOFF': LOG.debug('start to add start task') server.start() LOG.debug('submit start task') self.os_novaclient(context).check_start_server_complete(server) LOG.debug('start server: %s success' % instance.uuid) elif server.status == vm_states.ACTIVE.upper(): LOG.debug('sub instance status is already ACTIVE.') return else: LOG.warning('server status is not in ACTIVE OR STOPPED,' 'can not do POWER_ON operation') raise exception_ex.ServerStatusException(status=server.status) def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None): LOG.debug('start to reboot server: %s' % instance.uuid) server = self._get_provider_instance(context, instance) if not server: LOG.debug('can not find sub os server for ' 'instance: %s' % instance.uuid) raise exception_ex.ServerNotExistException( server_name=instance.display_name) LOG.debug('server: %s status is: %s' % (server.id, server.status)) if server.status == vm_states.ACTIVE.upper(): server.reboot(reboot_type) self.os_novaclient(context).check_reboot_server_complete(server) LOG.debug('reboot server: %s success' % instance.uuid) elif server.status == 'SHUTOFF': server.start() self.os_novaclient(context).check_start_server_complete(server) LOG.debug('reboot server: %s success' % instance.uuid) else: LOG.warning('server status is not in ACTIVE OR STOPPED,' 'can not do POWER_OFF operation') raise exception_ex.ServerStatusException(status=server.status) def provider_create_image(self, context, instance, image, metadata): provider_instance = self._get_provider_instance(context, instance) provider_metadata = { "disk_format": metadata.get("disk_format", "raw"), "container_format": metadata.get("container_format", "bare")} # provider create image location, provider_image_id = self.os_novaclient( context).create_image( provider_instance, image['name'], provider_metadata) try: # wait create image success self.os_novaclient(context).check_create_image_server_complete( provider_instance) # wait image status is active self.os_glanceclient(context).check_image_active_complete( provider_image_id) except Exception as ex: LOG.exception(_LE("create image failed! ex = %s"), ex) with excutils.save_and_reraise_exception(): self.os_glanceclient(context).delete(provider_image_id) return provider_instance, provider_image_id def snapshot(self, context, instance, image_id, update_task_state): snapshot = self._image_api.get(context, image_id) image_format = None metadata = self._create_snapshot_metadata(instance.image_meta, instance, image_format, snapshot['name']) update_task_state(task_state=task_states.IMAGE_PENDING_UPLOAD) provider_instance, provider_image_id = self.provider_create_image( context, instance, snapshot, metadata) try: update_task_state(task_state=task_states.IMAGE_UPLOADING, expected_state=task_states.IMAGE_PENDING_UPLOAD) try: image = self.os_glanceclient(context).get_image( provider_image_id) LOG.debug("+++hw, image = %s", image) if hasattr(image, "direct_url"): direct_url = image.direct_url if direct_url.startswith("swift+http://") or \ direct_url.startswith("http://") or \ direct_url.startswith("https://"): metadata["location"] = direct_url self._image_api.update(context, image_id, metadata, purge_props=False) else: raise Exception() else: raise Exception() except Exception: metadata.pop("location", None) # download from provider glance LOG.debug("+++hw, begin to download image(%s)", provider_image_id) image_data = self.os_glanceclient(context).data( provider_image_id) LOG.debug("+++hw, image length = %s", len(image_data)) self._image_api.update(context, image_id, metadata, image_data) # create image mapper values = {"provider_image_id": provider_image_id} self.caa_db_api.image_mapper_create(context, image_id, context.project_id, values) except Exception as ex: LOG.exception(_LE("create image failed! ex = %s"), ex) with excutils.save_and_reraise_exception(): self.os_glanceclient(context).delete(provider_image_id) def get_provider_lxc_volume_id(self, context, instance, index): lxc_volume_id = instance.system_metadata.get('provider_lxc_volume_id', None) if lxc_volume_id: return lxc_volume_id provider_instance_uuid = self._get_provider_instance_id( context, instance.uuid) if provider_instance_uuid is None: return volumes = self.os_novaclient(context).get_server_volumes( provider_instance_uuid) volumes = sorted(volumes, key=lambda volume: volume.device) LOG.debug("+++hw, volumes = %s", volumes) lxc_volume = None if len(volumes) > index: lxc_volume = volumes[index] if lxc_volume is not None: return lxc_volume.volumeId def _spawn(self, context, instance, image_meta, injected_files, admin_password, network_info=None, block_device_info=None): try: LOG.debug('instance: %s' % instance) LOG.debug('block device info: %s' % block_device_info) flavor = instance.get_flavor() LOG.debug('flavor: %s' % flavor) sub_flavor_id = self._get_provider_flavor_id(context, flavor.flavorid) name = self._generate_provider_instance_name(instance.display_name, instance.uuid) LOG.debug('name: %s' % name) image_ref = None if instance.image_ref: sub_image_id = self._get_provider_base_image_id(context) try: image_ref = self.os_glanceclient(context).get_image( sub_image_id) except Exception as ex: LOG.exception(_LE("get image(%(image_id)s) failed, " "ex = %(ex)s"), image_id=sub_image_id, ex=ex) raise else: image_ref = None if instance.metadata: metadata = copy.deepcopy(instance.metadata) else: metadata = {} metadata = self._add_tag_to_metadata(metadata, instance.uuid) LOG.debug('metadata: %s' % metadata) app_security_groups = instance.security_groups LOG.debug('app_security_groups: %s' % app_security_groups) agent_inject_files = self._get_agent_inject_file(instance, injected_files) sub_bdm = self._transfer_to_sub_block_device_mapping_v2( context, instance, block_device_info) LOG.debug('sub_bdm: %s' % sub_bdm) project_mapper = self._get_project_mapper(context, context.project_id) security_groups = self._get_provider_security_groups_list( context, project_mapper) nics = self._get_provider_nics(context, project_mapper) provider_server = self.os_novaclient(context).create_server( name, image_ref, sub_flavor_id, meta=metadata, files=agent_inject_files, reservation_id=instance.reservation_id, security_groups=security_groups, nics=nics, availability_zone=project_mapper.get("availability_zone", None), block_device_mapping_v2=sub_bdm) LOG.debug('wait for server active') try: self.os_novaclient(context).check_create_server_complete( provider_server) except Exception as ex: # rollback with excutils.save_and_reraise_exception(): provider_server.delete() LOG.debug('create server success.............!!!') try: # instance mapper values = {'provider_instance_id': provider_server.id} self.caa_db_api.instance_mapper_create(context, instance.uuid, instance.project_id, values) except Exception as ex: LOG.exception(_LE("instance_mapper_create failed! ex = %s"), ex) provider_server.delete() raise interface_list = self.os_novaclient(context).interface_list( provider_server) ips = [] for interface in interface_list: ip = interface.fixed_ips[0].get('ip_address') ips.append(ip) instance_ips = ','.join(ips) LOG.debug('luorui debug instance_ips %s' % instance_ips) instance.system_metadata['instance_ips'] = instance_ips instance.system_metadata['instance_id'] = provider_server.id try: instance.save() except Exception: pass # raise exception_ex.InstanceSaveFailed( # instance_uuid=instance.uuid) except exception_ex.InstanceSaveFailed: raise except Exception as e: LOG.error( 'Exception when spawn, exception: %s' % traceback.format_exc(e)) raise Exception( 'Exception when spawn, exception: %s' % traceback.format_exc(e)) def spawn(self, context, instance, image_meta, injected_files, admin_password, network_info=None, block_device_info=None): """Create a new instance/VM/domain on the virtualization platform. Once this successfully completes, the instance should be running (power_state.RUNNING). If this fails, any partial instance should be completely cleaned up, and the virtualization platform should be in the state that it was before this call began. :param context: security context :param instance: nova.objects.instance.Instance This function should use the data there to guide the creation of the new instance. Instance( access_ip_v4=None, access_ip_v6=None, architecture=None, auto_disk_config=False, availability_zone='az31.shenzhen--aws', cell_name=None, cleaned=False, config_drive='', created_at=2015-08-31T02:44:36Z, default_ephemeral_device=None, default_swap_device=None, deleted=False, deleted_at=None, disable_terminate=False, display_description='server@daa5e17c-cb2c-4014-9726-b77109380ca6', display_name='server@daa5e17c-cb2c-4014-9726-b77109380ca6', ephemeral_gb=0, ephemeral_key_uuid=None, fault=<?>, host='42085B38-683D-7455-A6A3-52F35DF929E3', hostname='serverdaa5e17c-cb2c-4014-9726-b77109380ca6', id=49, image_ref='6004b47b-d453-4695-81be-cd127e23f59e', info_cache=InstanceInfoCache, instance_type_id=2, kernel_id='', key_data=None, key_name=None, launch_index=0, launched_at=None, launched_on='42085B38-683D-7455-A6A3-52F35DF929E3', locked=False, locked_by=None, memory_mb=512, metadata={}, node='h', numa_topology=None, os_type=None, pci_devices=<?>, power_state=0, progress=0, project_id='52957ad92b2146a0a2e2b3279cdc2c5a', ramdisk_id='', reservation_id='r-d1dkde4x', root_device_name='/dev/sda', root_gb=1, scheduled_at=None, security_groups=SecurityGroupList, shutdown_terminate=False, system_metadata={ image_base_image_ref='6004b47b-d453-4695-81be-cd127e23f59e', image_container_format='bare', image_disk_format='qcow2', image_min_disk='1', image_min_ram='0', instance_type_ephemeral_gb='0', instance_type_flavorid='1', instance_type_id='2', instance_type_memory_mb='512', instance_type_name='m1.tiny', instance_type_root_gb='1', instance_type_rxtx_factor='1.0', instance_type_swap='0', instance_type_vcpu_weight=None, instance_type_vcpus='1' }, task_state='spawning', terminated_at=None, updated_at=2015-08-31T02:44:38Z, user_data=u'<SANITIZED>, user_id='ea4393b196684c8ba907129181290e8d', uuid=92d22a62-c364-4169-9795-e5a34b5f5968, vcpus=1, vm_mode=None, vm_state='building') :param image_meta: image object returned by nova.image.glance that defines the image from which to boot this instance e.g. { u'status': u'active', u'deleted': False, u'container_format': u'bare', u'min_ram': 0, u'updated_at': u'2015-08-17T07:46:48.708903', u'min_disk': 0, u'owner': u'52957ad92b2146a0a2e2b3279cdc2c5a', u'is_public': True, u'deleted_at': None, u'properties': {}, u'size': 338735104, u'name': u'emall-backend', u'checksum': u'0f2294c98c7d113f0eb26ad3e76c86fa', u'created_at': u'2015-08-17T07:46:20.581706', u'disk_format': u'qcow2', u'id': u'6004b47b-d453-4695-81be-cd127e23f59e' } :param injected_files: User files to inject into instance. :param admin_password: <PASSWORD> password to set in instance. :param network_info: :py:meth:`~nova.network.manager.NetworkManager.get_instance_nw_info` :param block_device_info: Information about block devices to be attached to the instance. """ # self._binding_host(context, network_info, instance.uuid) self._spawn(context, instance, image_meta, injected_files, admin_password, network_info, block_device_info) # self._binding_host(context, network_info, instance.uuid) def pause(self, instance): context = req_context.RequestContext(is_admin=True, project_id=instance.project_id) provider_instance = self._get_provider_instance(context, instance) self.os_novaclient(context).pause(provider_instance) self.os_novaclient(context).check_pause_server_complete( provider_instance) def unpause(self, instance): context = req_context.RequestContext(is_admin=True, project_id=instance.project_id) provider_instance = self._get_provider_instance(context, instance) self.os_novaclient(context).unpause(provider_instance) self.os_novaclient(context).check_unpause_server_complete( provider_instance) def sub_flavor_detail(self, context): """get flavor detail""" ret = [] sub_flavors = self.os_novaclient(context).get_flavor_detail() for sub_flavor in sub_flavors: ret.append(sub_flavor._info) return ret def rename(self, ctxt, instance, display_name=None): provider_uuid = self._get_provider_instance_id(ctxt, instance.uuid) if not display_name: display_name = instance.display_name provider_name = self._generate_provider_instance_name(display_name, instance.uuid) self.os_novaclient(ctxt).rename(provider_uuid, provider_name) def get_diagnostics(self, instance): context = req_context.RequestContext(is_admin=True, project_id=instance.project_id) provider_uuid = self._get_provider_instance_id(context, instance.uuid) return self.os_novaclient(context).get_diagnostics(provider_uuid) def get_instance_diagnostics(self, instance): context = req_context.RequestContext(is_admin=True, project_id=instance.project_id) provider_uuid = self._get_provider_instance_id(context, instance.uuid) return self.os_novaclient(context).get_diagnostics(provider_uuid) def resume_state_on_host_boot(self, context, instance, network_info, block_device_info=None): """resume guest state when a host is booted.""" # Check if the instance is running already and avoid doing # anything if it is. try: provider_instance = self._get_provider_instance(context, instance) ignored_states = ("ACTIVE", "SUSPENDED", "PAUSED") if provider_instance.status in ignored_states: return provider_instance.reboot('HARD') except exception.NovaException: pass def rescue(self, context, instance, network_info, image_meta, rescue_password): provider_instance = self._get_provider_instance(context, instance) rescue_image_id = None if image_meta.obj_attr_is_set("id"): rescue_image_id = image_meta.id image_id = (rescue_image_id or CONF.libvirt.rescue_image_id or instance.image_ref) provider_image_id = self._get_provider_image_id(context, image_id) LOG.debug("+++image id = %s", provider_image_id) provider_instance.rescue(rescue_password, provider_image_id) self.os_novaclient(context).check_rescue_instance_complete( provider_instance) def unrescue(self, instance, network_info): context = req_context.RequestContext(is_admin=True, project_id=instance.project_id) provider_instance = self._get_provider_instance(context, instance) provider_instance.unrescue() self.os_novaclient(context).check_unrescue_instance_complete( provider_instance) def trigger_crash_dump(self, instance): context = req_context.RequestContext(is_admin=True, project_id=instance.project_id) provider_instance_uuid = self._get_provider_instance_id(context, instance.uuid) return self.os_novaclient(context).trigger_crash_dump( provider_instance_uuid) def set_admin_password(self, instance, new_pass): context = req_context.RequestContext(is_admin=True, project_id=instance.project_id) provider_instance_uuid = self._get_provider_instance_id(context, instance.uuid) self.os_novaclient(context).change_password( provider_instance_uuid, new_pass) def get_host_uptime(self): """Returns the result of calling "uptime".""" out, err = utils.execute('env', 'LANG=C', 'uptime') return out def attach_interface(self, instance, image_meta, vif): pass def detach_interface(self, instance, vif): pass def upload_image(self, context, instance, image_meta): LOG.debug("begin to upload image", instance=instance) image_id = image_meta['id'] lxc_volume_id = \ instance.system_metadata.get('lxc_volume_id', None) if not lxc_volume_id: raise exception_ex.LxcVolumeNotFound(instance_uuid=instance.uuid) provider_volume = self._get_provider_volume(context, lxc_volume_id) LOG.debug("lxc volume id = %s", provider_volume.id, instance=instance) image = self._image_api.get(context, image_id) LOG.debug("+++hw, image = %s", image) try: # provider create image provider_image = provider_volume.upload_to_image( True, image["name"], image_meta.get("container-format", "bare"), image_meta.get("disk_format", image.get('disk_format', 'raw'))) except Exception as ex: LOG.exception(_LE("upload image failed! ex = %s"), ex) raise provider_image = provider_image[1]["os-volume_upload_image"] try: # wait upload image success self.os_cinderclient(context).check_upload_image_volume_complete( provider_volume.id) # wait image status active self.os_glanceclient(context).check_image_active_complete( provider_image["image_id"]) # update image property kwargs = {} image_properties = image.get("properties", {}) if image_properties.get('__os_bit', None): kwargs['__os_bit'] = image_properties.get('__os_bit') if image_properties.get('__os_type', None): kwargs['__os_type'] = image_properties.get('__os_type') if image_properties.get('__os_version', None): kwargs['__os_version'] = image_properties.get('__os_version') if image_properties.get('__paltform', None): kwargs['__paltform'] = image_properties.get('__paltform') self.os_glanceclient(context).update(provider_image["image_id"], remove_props=None, **kwargs) # create image mapper values = {"provider_image_id": provider_image["image_id"], 'provider_checksum': provider_image.get("checksum", None)} self.caa_db_api.image_mapper_create(context, image_id, context.project_id, values) except Exception as ex: LOG.exception(_LE("upload image failed! ex = %s"), ex) with excutils.save_and_reraise_exception(): self.os_glanceclient(context).delete(provider_image["image_id"])
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 2178, 26863, 2538, 9841, 29889, 13, 29937, 13, 29937, 1678, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 366, 1122, 13, 29937, 1678, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 887, 1122, 4017, 13, 29937, 1678, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 308, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 1678, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 1678, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 399, 1806, 8187, 2692, 13, 29937, 1678, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 2823, 278, 13, 29937, 1678, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 27028, 13, 29937, 1678, 1090, 278, 19245, 29889, 13, 13, 15945, 29908, 13, 12376, 2967, 29899, 13203, 29901, 13, 13, 1678, 313, 17946, 1076, 310, 29897, 278, 8078, 393, 10272, 18563, 1818, 1101, 29892, 322, 7258, 13, 1678, 4072, 393, 2304, 393, 8078, 13, 15945, 29908, 13, 13, 5215, 3509, 13, 5215, 9909, 13, 5215, 9637, 1627, 13, 5215, 318, 5416, 13, 13, 3166, 2897, 417, 29918, 1188, 1053, 1480, 408, 12183, 13, 3166, 2897, 417, 29918, 15550, 2133, 1053, 4390, 13239, 13, 3166, 2897, 417, 29918, 13239, 1053, 5566, 13239, 13, 3166, 2897, 417, 29918, 13239, 1053, 851, 13239, 13, 13, 3166, 28015, 300, 29889, 26017, 29889, 9274, 1053, 3081, 29918, 3859, 13, 3166, 28015, 300, 29889, 26017, 29889, 9274, 1053, 3414, 29918, 28631, 13, 3166, 28015, 300, 29889, 26017, 29889, 9274, 1053, 22419, 29918, 28631, 13, 3166, 28015, 300, 29889, 26017, 29889, 15389, 1053, 7156, 13, 3166, 28015, 300, 29889, 26017, 29889, 15389, 1053, 12837, 13, 3166, 28015, 300, 1053, 1970, 13, 3166, 28015, 300, 1053, 3030, 408, 12428, 29918, 4703, 13, 3166, 28015, 300, 29889, 26017, 1053, 1967, 13, 3166, 28015, 300, 29889, 2585, 29889, 21843, 1053, 7882, 408, 5777, 29874, 29918, 2585, 29918, 2754, 13, 3166, 28015, 300, 29889, 24477, 874, 29889, 3150, 1429, 1053, 2967, 13, 3166, 28015, 300, 29889, 24477, 874, 29889, 3150, 1429, 1053, 3682, 29918, 735, 13, 3166, 28015, 300, 1053, 3682, 13, 3166, 28015, 300, 29889, 29875, 29896, 29947, 29876, 1053, 903, 1307, 13, 3166, 28015, 300, 1053, 3667, 29879, 13, 3166, 28015, 300, 29889, 12650, 1053, 10272, 408, 3618, 13, 13, 14480, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 6007, 29943, 353, 1970, 29889, 6007, 29943, 13, 13, 9998, 29918, 3970, 29032, 29918, 29940, 3718, 3040, 353, 29871, 29900, 13, 9998, 29918, 3970, 29032, 29918, 29934, 3904, 29940, 4214, 353, 29871, 29896, 13, 9998, 29918, 3970, 29032, 29918, 29933, 21339, 3352, 353, 29871, 29906, 13, 9998, 29918, 3970, 29032, 29918, 7228, 17171, 29928, 353, 29871, 29941, 13, 9998, 29918, 3970, 29032, 29918, 7068, 2692, 3970, 16048, 353, 29871, 29946, 13, 9998, 29918, 3970, 29032, 29918, 7068, 2692, 27681, 353, 29871, 29945, 13, 9998, 29918, 3970, 29032, 29918, 11341, 24943, 3352, 353, 29871, 29953, 13, 9998, 29918, 3970, 29032, 29918, 29925, 4345, 3308, 29925, 1430, 2287, 29928, 353, 29871, 29955, 13, 13, 9998, 29918, 29925, 9806, 1001, 29918, 19713, 353, 426, 13, 1678, 383, 29903, 29918, 3970, 29032, 29918, 29940, 3718, 3040, 29901, 3081, 29918, 3859, 29889, 29940, 3718, 3040, 29892, 13, 1678, 383, 29903, 29918, 3970, 29032, 29918, 29934, 3904, 29940, 4214, 29901, 3081, 29918, 3859, 29889, 29934, 3904, 29940, 4214, 29892, 13, 1678, 383, 29903, 29918, 3970, 29032, 29918, 29933, 21339, 3352, 29901, 3081, 29918, 3859, 29889, 29934, 3904, 29940, 4214, 29892, 13, 1678, 383, 29903, 29918, 3970, 29032, 29918, 7228, 17171, 29928, 29901, 3081, 29918, 3859, 29889, 7228, 17171, 29928, 29892, 13, 1678, 383, 29903, 29918, 3970, 29032, 29918, 7068, 2692, 3970, 16048, 29901, 3081, 29918, 3859, 29889, 7068, 2692, 3970, 16048, 29892, 13, 1678, 383, 29903, 29918, 3970, 29032, 29918, 7068, 2692, 27681, 29901, 3081, 29918, 3859, 29889, 7068, 2692, 3970, 16048, 29892, 13, 1678, 383, 29903, 29918, 3970, 29032, 29918, 11341, 24943, 3352, 29901, 3081, 29918, 3859, 29889, 11341, 24943, 3352, 29892, 13, 1678, 383, 29903, 29918, 3970, 29032, 29918, 29925, 4345, 3308, 29925, 1430, 2287, 29928, 29901, 3081, 29918, 3859, 29889, 29903, 3308, 29925, 1430, 2287, 29928, 29892, 13, 29913, 13, 13, 13, 1990, 6657, 20606, 29872, 12376, 29898, 9465, 29889, 20606, 29872, 12376, 29892, 2967, 29889, 24768, 12376, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 4610, 2754, 1125, 13, 4706, 1583, 3032, 359, 29918, 13715, 562, 1593, 353, 6213, 13, 4706, 1583, 3032, 359, 29918, 29883, 4995, 4645, 353, 6213, 13, 4706, 1583, 3032, 359, 29918, 3820, 749, 4645, 353, 6213, 13, 4706, 1583, 29889, 1113, 29874, 29918, 2585, 29918, 2754, 353, 5777, 29874, 29918, 2585, 29918, 2754, 13, 4706, 1583, 3032, 3027, 29918, 2754, 353, 1967, 29889, 8787, 580, 13, 4706, 2428, 29898, 24768, 20606, 29872, 12376, 29892, 1583, 467, 1649, 2344, 12035, 15389, 2754, 29897, 13, 13, 1678, 822, 1156, 29918, 4801, 496, 29918, 24623, 29918, 14057, 29898, 1311, 29892, 4982, 29918, 16432, 29918, 3888, 29892, 3579, 19290, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 1156, 29918, 4801, 496, 29918, 24623, 29918, 8698, 29898, 1311, 29892, 4982, 29918, 16432, 29918, 3888, 29892, 3579, 19290, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 903, 1202, 29918, 4039, 29918, 517, 29918, 19635, 29898, 1311, 29892, 15562, 29892, 5777, 29874, 29918, 8758, 29918, 333, 1125, 13, 4706, 565, 451, 15562, 29901, 13, 9651, 15562, 353, 6571, 13, 13, 4706, 15562, 1839, 4039, 29901, 1113, 29874, 29918, 8758, 29918, 333, 2033, 353, 5777, 29874, 29918, 8758, 29918, 333, 13, 4706, 736, 15562, 13, 13, 1678, 822, 903, 275, 29918, 4777, 287, 29918, 3166, 29918, 24623, 29898, 1311, 29892, 2777, 29892, 8086, 29918, 20698, 29922, 8516, 1125, 13, 4706, 9995, 6362, 837, 1475, 3692, 278, 11400, 338, 6579, 292, 515, 7977, 13, 13, 4706, 5953, 837, 1475, 3692, 278, 8086, 10417, 14088, 393, 278, 11400, 13, 4706, 338, 6579, 292, 515, 263, 7977, 29889, 13, 4706, 9995, 13, 4706, 736, 313, 1333, 6120, 29898, 8758, 29889, 657, 877, 3027, 29918, 999, 29915, 4961, 13, 13, 1678, 822, 903, 3286, 571, 29918, 517, 29918, 1491, 29918, 1271, 29918, 10141, 29918, 20698, 29918, 29894, 29906, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 13, 462, 462, 462, 2908, 29918, 10141, 29918, 20698, 1125, 13, 4706, 9995, 13, 13, 4706, 584, 3207, 2908, 29918, 10141, 29918, 20698, 29901, 13, 4706, 426, 13, 9651, 525, 1271, 29918, 10141, 29918, 20698, 2396, 15974, 13, 18884, 525, 2543, 342, 29918, 4830, 2396, 6213, 29892, 13, 18884, 525, 4777, 29918, 2248, 2396, 29871, 29900, 29892, 13, 18884, 525, 16476, 29918, 10141, 2396, 318, 29915, 29914, 3359, 29914, 29879, 1388, 742, 13, 18884, 525, 9965, 29918, 3888, 2396, 426, 13, 462, 1678, 318, 29915, 9465, 29918, 24623, 29918, 1853, 2396, 318, 29915, 5847, 29918, 9274, 29879, 29918, 24623, 742, 13, 462, 1678, 525, 15550, 2396, 318, 29915, 29947, 29896, 29955, 29946, 29929, 29906, 2176, 29899, 29941, 29872, 29955, 29888, 29899, 29946, 29941, 29929, 29874, 29899, 1635, 29890, 29941, 29899, 29953, 29883, 29906, 29888, 29953, 29946, 29947, 29947, 29874, 29953, 29872, 29945, 742, 13, 462, 1678, 318, 29915, 1272, 2396, 426, 13, 462, 4706, 318, 29915, 5943, 29918, 8513, 2396, 318, 29915, 13975, 742, 13, 462, 4706, 318, 29915, 29939, 359, 29918, 5965, 2395, 2396, 6213, 29892, 13, 462, 4706, 318, 29915, 4990, 29918, 978, 2396, 318, 29915, 3027, 29899, 29894, 29899, 29900, 29906, 742, 13, 462, 4706, 318, 29915, 24623, 29918, 333, 2396, 318, 29915, 29947, 29896, 29955, 29946, 29929, 29906, 2176, 29899, 29941, 29872, 29955, 29888, 29899, 29946, 29941, 29929, 29874, 29899, 1635, 29890, 29941, 29899, 29953, 29883, 29906, 29888, 29953, 29946, 29947, 29947, 29874, 29953, 29872, 29945, 742, 13, 462, 4706, 318, 29915, 27852, 2396, 318, 29915, 5847, 9274, 29879, 29915, 13, 462, 1678, 500, 13, 18884, 2981, 13, 18884, 525, 20960, 29918, 8262, 2396, 6213, 29892, 13, 18884, 525, 10141, 29918, 1853, 2396, 6213, 29892, 13, 18884, 525, 8143, 29918, 265, 29918, 18821, 362, 2396, 7700, 13, 9651, 500, 1402, 13, 9651, 525, 4632, 29918, 10141, 29918, 978, 2396, 318, 29915, 29914, 3359, 29914, 29879, 1388, 742, 13, 9651, 525, 29872, 561, 25154, 1338, 2396, 19997, 13, 9651, 525, 26276, 2396, 6213, 13, 4706, 500, 13, 4706, 584, 2457, 29901, 1134, 1051, 29892, 15974, 13, 462, 9651, 376, 4777, 29918, 2248, 1115, 29871, 29900, 29892, 13, 462, 9651, 376, 25118, 1115, 376, 29945, 29872, 29929, 2291, 29929, 29946, 29896, 29899, 29955, 29888, 328, 29899, 29946, 29945, 29896, 29945, 29899, 29947, 29955, 29906, 29874, 29899, 29900, 29890, 29906, 29888, 29896, 29874, 29900, 29945, 29881, 29945, 29955, 29955, 613, 13, 462, 9651, 376, 24623, 29918, 2311, 1115, 376, 29896, 613, 13, 462, 9651, 376, 10141, 29918, 978, 1115, 5591, 3359, 29914, 29879, 1388, 613, 13, 462, 9651, 376, 4993, 29918, 1853, 1115, 376, 24623, 613, 13, 462, 9651, 376, 24623, 29918, 333, 1115, 376, 29945, 29872, 29929, 2291, 29929, 29946, 29896, 29899, 29955, 29888, 328, 29899, 29946, 29945, 29896, 29945, 29899, 29947, 29955, 29906, 29874, 29899, 29900, 29890, 29906, 29888, 29896, 29874, 29900, 29945, 29881, 29945, 29955, 29955, 613, 13, 462, 9651, 376, 8143, 29918, 265, 29918, 18821, 362, 1115, 376, 8824, 29908, 6525, 13, 4706, 9995, 13, 4706, 1014, 29918, 6448, 1516, 353, 5159, 13, 4706, 289, 18933, 29918, 1761, 353, 2908, 29918, 10141, 29918, 20698, 29889, 657, 877, 1271, 29918, 10141, 29918, 20698, 742, 518, 2314, 13, 4706, 363, 289, 18933, 297, 289, 18933, 29918, 1761, 29901, 13, 9651, 289, 18933, 29918, 3888, 29918, 8977, 353, 6571, 13, 9651, 396, 289, 18933, 29918, 3888, 29918, 8977, 1839, 8143, 29918, 265, 29918, 18821, 362, 2033, 353, 289, 18933, 29889, 657, 29898, 13, 9651, 396, 1678, 525, 8143, 29918, 265, 29918, 18821, 362, 742, 7700, 29897, 13, 9651, 289, 18933, 29918, 3888, 29918, 8977, 1839, 4777, 29918, 2248, 2033, 353, 289, 18933, 29889, 657, 877, 4777, 29918, 2248, 1495, 13, 9651, 289, 18933, 29918, 3888, 29918, 8977, 1839, 23848, 29918, 1853, 2033, 353, 525, 24623, 29915, 13, 13, 9651, 2752, 29918, 1853, 353, 289, 18933, 29889, 657, 877, 4993, 29918, 1853, 742, 6213, 29897, 13, 9651, 396, 6058, 29923, 29898, 433, 12602, 29875, 29897, 2567, 29892, 871, 2304, 1967, 322, 9654, 13, 9651, 565, 2752, 29918, 1853, 1275, 525, 3027, 2396, 13, 18884, 1967, 29918, 333, 353, 289, 18933, 29889, 657, 877, 3027, 29918, 333, 742, 6213, 29897, 13, 18884, 565, 1967, 29918, 333, 29901, 13, 462, 1678, 13113, 29918, 3027, 29918, 333, 353, 1583, 3032, 657, 29918, 18121, 29918, 3027, 29918, 333, 29898, 4703, 29892, 13, 462, 462, 462, 462, 1678, 1967, 29918, 333, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 13113, 29918, 3027, 29918, 333, 353, 1583, 3032, 657, 29918, 18121, 29918, 3188, 29918, 3027, 29918, 333, 29898, 13, 462, 4706, 3030, 29897, 13, 18884, 565, 13113, 29918, 3027, 29918, 333, 29901, 13, 462, 1678, 289, 18933, 29918, 3888, 29918, 8977, 1839, 4993, 29918, 1853, 2033, 353, 525, 3027, 29915, 13, 462, 1678, 289, 18933, 29918, 3888, 29918, 8977, 1839, 25118, 2033, 353, 13113, 29918, 3027, 29918, 333, 13, 18884, 1683, 29901, 13, 462, 1678, 289, 18933, 29918, 3888, 29918, 8977, 1839, 4993, 29918, 1853, 2033, 353, 525, 19465, 29915, 13, 13, 18884, 289, 18933, 29918, 3888, 29918, 8977, 1839, 24623, 29918, 2311, 2033, 353, 851, 29898, 6448, 29885, 29889, 657, 877, 2311, 8785, 13, 18884, 289, 18933, 29918, 3888, 29918, 8977, 1839, 8143, 29918, 265, 29918, 18821, 362, 2033, 353, 289, 18933, 29889, 657, 29898, 13, 462, 1678, 525, 8143, 29918, 265, 29918, 18821, 362, 742, 7700, 29897, 13, 9651, 25342, 2752, 29918, 1853, 1275, 525, 19465, 2396, 13, 18884, 289, 18933, 29918, 3888, 29918, 8977, 1839, 4993, 29918, 1853, 2033, 353, 2752, 29918, 1853, 13, 18884, 289, 18933, 29918, 3888, 29918, 8977, 1839, 24623, 29918, 2311, 2033, 353, 851, 29898, 6448, 29885, 29889, 657, 877, 2311, 8785, 13, 18884, 289, 18933, 29918, 3888, 29918, 8977, 1839, 8143, 29918, 265, 29918, 18821, 362, 2033, 353, 289, 18933, 29889, 657, 29898, 13, 462, 1678, 525, 8143, 29918, 265, 29918, 18821, 362, 742, 7700, 29897, 13, 9651, 1683, 29901, 13, 18884, 7977, 29918, 333, 353, 289, 18933, 29889, 657, 877, 9965, 29918, 3888, 2824, 657, 877, 1272, 2824, 657, 29898, 13, 462, 1678, 525, 24623, 29918, 333, 1495, 13, 18884, 565, 7977, 29918, 333, 29901, 13, 462, 1678, 13113, 29918, 24623, 353, 1583, 3032, 657, 29918, 18121, 29918, 24623, 29898, 4703, 29892, 13, 462, 462, 462, 18884, 7977, 29918, 333, 29897, 13, 462, 1678, 289, 18933, 29918, 3888, 29918, 8977, 1839, 25118, 2033, 353, 13113, 29918, 24623, 29889, 333, 13, 462, 1678, 289, 18933, 29918, 3888, 29918, 8977, 1839, 24623, 29918, 2311, 2033, 353, 851, 29898, 18121, 29918, 24623, 29889, 2311, 29897, 13, 462, 1678, 396, 289, 18933, 29918, 3888, 29918, 8977, 1839, 10141, 29918, 978, 2033, 353, 4742, 29918, 978, 13, 462, 1678, 289, 18933, 29918, 3888, 29918, 8977, 1839, 4993, 29918, 1853, 2033, 353, 525, 24623, 29915, 13, 462, 1678, 289, 18933, 29918, 3888, 29918, 8977, 1839, 8143, 29918, 265, 29918, 18821, 362, 2033, 353, 289, 18933, 29889, 657, 29898, 13, 462, 4706, 525, 8143, 29918, 265, 29918, 18821, 362, 742, 7700, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 396, 14402, 29901, 817, 304, 2304, 22395, 1178, 13, 462, 1678, 6773, 13, 13, 9651, 1014, 29918, 6448, 1516, 29889, 4397, 29898, 6448, 29885, 29918, 3888, 29918, 8977, 29897, 13, 13, 4706, 565, 451, 1014, 29918, 6448, 1516, 29901, 13, 9651, 1014, 29918, 6448, 1516, 353, 6213, 13, 13, 4706, 736, 1014, 29918, 6448, 1516, 13, 13, 1678, 822, 903, 657, 29918, 18121, 29918, 8926, 29918, 13155, 29918, 1761, 29898, 1311, 29892, 3030, 29892, 2060, 29918, 655, 2496, 29922, 8516, 1125, 13, 4706, 565, 2060, 29918, 655, 2496, 338, 6213, 29901, 13, 9651, 2060, 29918, 655, 2496, 353, 1583, 3032, 657, 29918, 4836, 29918, 655, 2496, 29898, 4703, 29892, 13, 462, 462, 462, 418, 3030, 29889, 4836, 29918, 333, 29897, 13, 13, 4706, 13113, 29918, 5311, 353, 2060, 29918, 655, 2496, 29889, 657, 877, 8926, 29918, 13155, 742, 6213, 29897, 13, 4706, 565, 13113, 29918, 5311, 29901, 13, 9651, 6993, 29918, 13155, 353, 13113, 29918, 5311, 29889, 5451, 29317, 1495, 13, 4706, 1683, 29901, 13, 9651, 6993, 29918, 13155, 353, 6213, 13, 13, 4706, 736, 6993, 29918, 13155, 13, 13, 1678, 822, 903, 657, 29918, 18121, 29918, 29876, 1199, 29898, 1311, 29892, 3030, 29892, 2060, 29918, 655, 2496, 29922, 8516, 1125, 13, 4706, 565, 2060, 29918, 655, 2496, 338, 6213, 29901, 13, 9651, 2060, 29918, 655, 2496, 353, 1583, 3032, 657, 29918, 4836, 29918, 655, 2496, 29898, 4703, 29892, 13, 462, 462, 462, 418, 3030, 29889, 4836, 29918, 333, 29897, 13, 4706, 13113, 29918, 1212, 29918, 1272, 353, 2060, 29918, 655, 2496, 29889, 657, 877, 1212, 29918, 1272, 742, 6213, 29897, 13, 4706, 13113, 29918, 1212, 29918, 2754, 353, 2060, 29918, 655, 2496, 29889, 657, 877, 1212, 29918, 2754, 742, 6213, 29897, 13, 4706, 13113, 29918, 1212, 29918, 23176, 353, 2060, 29918, 655, 2496, 29889, 657, 877, 1212, 29918, 23176, 742, 6213, 29897, 13, 4706, 302, 1199, 353, 5159, 13, 4706, 565, 13113, 29918, 1212, 29918, 23176, 29901, 13, 9651, 302, 1199, 29889, 4397, 3319, 29915, 1212, 29899, 333, 2396, 13113, 29918, 1212, 29918, 23176, 1800, 13, 4706, 302, 1199, 29889, 4397, 3319, 29915, 1212, 29899, 333, 2396, 13113, 29918, 1212, 29918, 1272, 1800, 13, 4706, 302, 1199, 29889, 4397, 3319, 29915, 1212, 29899, 333, 2396, 13113, 29918, 1212, 29918, 2754, 1800, 13, 13, 4706, 736, 302, 1199, 13, 13, 1678, 822, 903, 657, 29918, 14748, 29918, 21920, 29918, 1445, 29898, 1311, 29892, 2777, 29892, 7156, 29918, 3207, 29918, 21920, 29918, 5325, 1125, 13, 4706, 736, 9657, 29898, 9465, 29918, 3207, 29918, 21920, 29918, 5325, 29897, 13, 13, 1678, 822, 903, 17158, 29918, 18121, 29918, 8758, 29918, 978, 29898, 1311, 29892, 2777, 29918, 978, 29892, 2777, 29918, 333, 1125, 13, 4706, 9995, 13, 13, 4706, 584, 3207, 2777, 29918, 978, 29901, 1134, 1347, 13, 4706, 584, 3207, 2777, 29918, 333, 29901, 1134, 1347, 13, 4706, 584, 2457, 29901, 1134, 1347, 29892, 321, 29889, 29887, 29889, 525, 1357, 29918, 6925, 29992, 29929, 29955, 29929, 29947, 29947, 29900, 29896, 29906, 29899, 29946, 29888, 29946, 29947, 29899, 29946, 29946, 29953, 29941, 29899, 29874, 29896, 29945, 29900, 29899, 29881, 29955, 29872, 29953, 29890, 29900, 29874, 29941, 29906, 29896, 29881, 29929, 29915, 13, 4706, 9995, 13, 4706, 565, 451, 2777, 29918, 978, 29901, 13, 9651, 2777, 29918, 978, 353, 525, 2974, 29915, 13, 4706, 736, 18803, 4286, 7122, 4197, 8758, 29918, 978, 29892, 2777, 29918, 333, 2314, 13, 13, 1678, 822, 903, 657, 29918, 18121, 29918, 29888, 4112, 272, 29918, 333, 29898, 1311, 29892, 3030, 29892, 21054, 272, 29918, 333, 1125, 13, 13, 4706, 396, 679, 2731, 21054, 272, 1178, 13, 4706, 21054, 272, 29918, 655, 2496, 353, 1583, 29889, 1113, 29874, 29918, 2585, 29918, 2754, 29889, 29888, 4112, 272, 29918, 655, 2496, 29918, 657, 29898, 4703, 29892, 13, 462, 462, 462, 3986, 21054, 272, 29918, 333, 29892, 13, 462, 462, 462, 3986, 3030, 29889, 4836, 29918, 333, 29897, 13, 13, 4706, 2731, 29918, 29888, 4112, 272, 29918, 333, 353, 21054, 272, 29918, 655, 2496, 29889, 657, 703, 7854, 29918, 29888, 4112, 272, 29918, 333, 613, 21054, 272, 29918, 333, 29897, 13, 13, 4706, 736, 2731, 29918, 29888, 4112, 272, 29918, 333, 13, 13, 1678, 822, 903, 3258, 29918, 29879, 14551, 29918, 19635, 29898, 1311, 29892, 1967, 29918, 7299, 29892, 2777, 29892, 13, 462, 462, 29871, 10153, 29918, 23479, 29892, 5807, 29886, 29918, 978, 1125, 13, 4706, 15562, 353, 11117, 275, 29918, 3597, 2396, 7700, 29892, 13, 462, 1678, 525, 4882, 2396, 525, 4925, 742, 13, 462, 1678, 525, 978, 2396, 5807, 29886, 29918, 978, 29892, 13, 462, 1678, 525, 11330, 2396, 426, 13, 462, 4706, 525, 17460, 29918, 333, 2396, 2777, 29889, 17460, 29918, 333, 29892, 13, 462, 4706, 525, 3027, 29918, 5479, 2396, 525, 29879, 14551, 742, 13, 462, 4706, 525, 3027, 29918, 3859, 2396, 525, 16515, 742, 13, 462, 4706, 525, 20348, 29918, 333, 2396, 2777, 29889, 4836, 29918, 333, 29892, 13, 462, 4706, 525, 2572, 20960, 29918, 333, 2396, 2777, 29889, 2572, 20960, 29918, 333, 29892, 13, 462, 1678, 500, 13, 462, 1678, 500, 13, 4706, 565, 2777, 29889, 359, 29918, 1853, 29901, 13, 9651, 15562, 1839, 11330, 16215, 359, 29918, 1853, 2033, 353, 2777, 29889, 359, 29918, 1853, 13, 13, 4706, 565, 10153, 29918, 23479, 29901, 13, 9651, 15562, 1839, 20960, 29918, 4830, 2033, 353, 10153, 29918, 23479, 13, 4706, 1683, 29901, 13, 9651, 15562, 1839, 20960, 29918, 4830, 2033, 353, 1967, 29918, 7299, 29889, 20960, 29918, 4830, 13, 13, 4706, 565, 1967, 29918, 7299, 29889, 5415, 29918, 5552, 29918, 275, 29918, 842, 703, 7611, 29918, 4830, 29908, 1125, 13, 9651, 15562, 1839, 7611, 29918, 4830, 2033, 353, 1967, 29918, 7299, 29889, 7611, 29918, 4830, 13, 4706, 1683, 29901, 13, 9651, 15562, 1839, 7611, 29918, 4830, 2033, 353, 376, 18354, 29908, 13, 13, 4706, 736, 15562, 13, 13, 1678, 822, 1051, 29918, 8758, 29918, 29884, 29884, 4841, 29898, 1311, 1125, 13, 4706, 318, 29884, 4841, 353, 5159, 13, 4706, 3030, 353, 12428, 29918, 4703, 29889, 3089, 2677, 29898, 275, 29918, 6406, 29922, 5574, 29892, 13, 462, 462, 632, 2060, 29918, 333, 2433, 4381, 1495, 13, 4706, 12424, 353, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 1761, 580, 13, 4706, 363, 1923, 297, 12424, 29901, 13, 9651, 1923, 29918, 333, 353, 1923, 29889, 333, 13, 9651, 318, 29884, 4841, 29889, 4397, 29898, 2974, 29918, 333, 29897, 13, 13, 4706, 25401, 29889, 8382, 877, 1761, 29918, 8758, 29918, 29884, 29884, 4841, 29901, 1273, 29879, 29915, 1273, 318, 29884, 4841, 29897, 13, 4706, 736, 318, 29884, 4841, 13, 13, 1678, 822, 1051, 29918, 2611, 2925, 29898, 1311, 1125, 13, 4706, 9995, 1293, 11400, 8871, 515, 599, 7573, 29889, 13, 4706, 584, 2457, 29901, 1051, 310, 2777, 1178, 29889, 321, 29889, 29887, 29889, 1839, 333, 29918, 29900, 29900, 29896, 742, 525, 333, 29918, 29900, 29900, 29906, 742, 2023, 29962, 13, 4706, 9995, 13, 13, 4706, 8871, 353, 5159, 13, 4706, 3030, 353, 12428, 29918, 4703, 29889, 3089, 2677, 29898, 275, 29918, 6406, 29922, 5574, 29892, 13, 462, 462, 632, 2060, 29918, 333, 2433, 4381, 1495, 13, 4706, 12424, 353, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 1761, 580, 13, 4706, 363, 1923, 297, 12424, 29901, 13, 9651, 1923, 29918, 978, 353, 1923, 29889, 978, 13, 9651, 8871, 29889, 4397, 29898, 2974, 29918, 978, 29897, 13, 13, 4706, 25401, 29889, 8382, 877, 1761, 29918, 8758, 29901, 1273, 29879, 29915, 1273, 8871, 29897, 13, 4706, 736, 8871, 13, 13, 1678, 822, 1051, 29918, 2611, 2925, 29918, 16202, 29898, 1311, 1125, 13, 4706, 9995, 1293, 11400, 8871, 515, 599, 7573, 29889, 13, 4706, 584, 2457, 29901, 1051, 310, 2777, 1178, 29889, 321, 29889, 29887, 29889, 1839, 333, 29918, 29900, 29900, 29896, 742, 525, 333, 29918, 29900, 29900, 29906, 742, 2023, 29962, 13, 4706, 9995, 13, 4706, 22663, 353, 6571, 13, 4706, 3030, 353, 12428, 29918, 4703, 29889, 3089, 2677, 29898, 275, 29918, 6406, 29922, 5574, 29892, 13, 462, 462, 632, 2060, 29918, 333, 2433, 4381, 1495, 13, 4706, 12424, 353, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 1761, 580, 13, 4706, 363, 1923, 297, 12424, 29901, 13, 9651, 1923, 29918, 333, 353, 1923, 29889, 333, 13, 9651, 2777, 29918, 13519, 29918, 3859, 353, 679, 5552, 29898, 2974, 29892, 525, 3267, 29899, 12194, 29899, 1254, 29903, 29901, 13519, 29918, 3859, 1495, 13, 9651, 22663, 29961, 2974, 29918, 333, 29962, 353, 383, 29903, 29918, 29925, 9806, 1001, 29918, 19713, 29961, 8758, 29918, 13519, 29918, 3859, 29962, 13, 13, 4706, 736, 22663, 13, 13, 1678, 822, 679, 29918, 11058, 29918, 4905, 29898, 1311, 29892, 3030, 29892, 2777, 1125, 13, 4706, 13113, 29918, 25118, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29918, 333, 29898, 4703, 29892, 2777, 29889, 25118, 29897, 13, 4706, 736, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 657, 29918, 11058, 29918, 4905, 29898, 18121, 29918, 25118, 29897, 13, 13, 1678, 822, 7977, 29918, 3258, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 1967, 29918, 333, 29922, 8516, 29892, 2159, 29922, 8516, 1125, 13, 4706, 565, 1967, 29918, 333, 322, 1967, 29918, 333, 1275, 376, 3188, 1115, 13, 9651, 13113, 29918, 3027, 29918, 333, 353, 1583, 3032, 657, 29918, 18121, 29918, 3188, 29918, 3027, 29918, 333, 29898, 4703, 29897, 13, 4706, 25342, 1967, 29918, 333, 29901, 13, 9651, 13113, 29918, 3027, 29918, 333, 353, 1583, 3032, 657, 29918, 18121, 29918, 3027, 29918, 333, 29898, 4703, 29892, 1967, 29918, 333, 29897, 13, 4706, 1683, 29901, 13, 9651, 13113, 29918, 3027, 29918, 333, 353, 6213, 13, 4706, 7977, 29918, 333, 353, 851, 29898, 25118, 29889, 25118, 29946, 3101, 13, 4706, 9049, 5085, 353, 6571, 13, 13, 4706, 565, 451, 2159, 29901, 13, 9651, 2159, 353, 2777, 29889, 657, 29918, 29888, 4112, 272, 2141, 657, 877, 4632, 29918, 26300, 1495, 13, 4706, 7977, 29918, 978, 353, 2777, 29889, 25118, 13, 4706, 9049, 5085, 1839, 4990, 29918, 978, 2033, 353, 7977, 29918, 978, 13, 4706, 565, 13113, 29918, 3027, 29918, 333, 29901, 13, 9651, 9049, 5085, 1839, 3027, 5620, 2033, 353, 13113, 29918, 3027, 29918, 333, 13, 13, 4706, 13113, 29918, 24623, 353, 1583, 29889, 359, 29918, 29883, 4995, 4645, 29898, 4703, 467, 3258, 29918, 24623, 29898, 2311, 29892, 13, 462, 462, 462, 462, 418, 3579, 19290, 29897, 13, 13, 4706, 1018, 29901, 13, 9651, 1583, 29889, 359, 29918, 29883, 4995, 4645, 29898, 4703, 467, 3198, 29918, 3258, 29918, 24623, 29918, 8835, 29898, 13, 18884, 13113, 29918, 24623, 29897, 13, 4706, 5174, 8960, 408, 429, 29901, 13, 9651, 25401, 29889, 11739, 7373, 1307, 703, 18121, 7977, 29414, 29879, 511, 376, 13, 462, 795, 376, 3198, 29918, 3258, 29918, 24623, 29918, 8835, 376, 13, 462, 795, 376, 26061, 29991, 429, 353, 1273, 29879, 4968, 13113, 29918, 24623, 29889, 333, 29892, 429, 29897, 13, 9651, 411, 5566, 13239, 29889, 7620, 29918, 392, 29918, 13941, 895, 29918, 11739, 7295, 13, 18884, 13113, 29918, 24623, 29889, 8143, 580, 13, 13, 4706, 1018, 29901, 13, 9651, 396, 1653, 7977, 611, 2496, 13, 9651, 1819, 353, 8853, 18121, 29918, 24623, 29918, 333, 1115, 13113, 29918, 24623, 29889, 333, 29913, 13, 9651, 1583, 29889, 1113, 29874, 29918, 2585, 29918, 2754, 29889, 24623, 29918, 655, 2496, 29918, 3258, 29898, 4703, 29892, 7977, 29918, 333, 29892, 13, 462, 462, 462, 3030, 29889, 4836, 29918, 333, 29892, 1819, 29897, 13, 4706, 5174, 8960, 408, 429, 29901, 13, 9651, 25401, 29889, 11739, 7373, 1307, 703, 24623, 29918, 655, 2496, 29918, 3258, 5229, 29991, 429, 353, 1273, 29879, 4968, 429, 29897, 13, 9651, 411, 5566, 13239, 29889, 7620, 29918, 392, 29918, 13941, 895, 29918, 11739, 7295, 13, 18884, 13113, 29918, 24623, 29889, 8143, 580, 13, 13, 4706, 736, 7977, 29918, 333, 13, 13, 1678, 822, 7977, 29918, 8143, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 7977, 29918, 333, 1125, 13, 4706, 1018, 29901, 13, 9651, 13113, 29918, 24623, 353, 1583, 3032, 657, 29918, 18121, 29918, 24623, 29898, 4703, 29892, 7977, 29918, 333, 29897, 13, 4706, 5174, 3682, 29889, 6691, 17413, 29901, 13, 9651, 25401, 29889, 8382, 877, 1217, 1014, 29899, 24623, 1863, 29892, 525, 13, 462, 418, 525, 1217, 817, 304, 5217, 13113, 7977, 1495, 13, 9651, 736, 13, 13, 4706, 25401, 29889, 8382, 877, 7892, 5217, 29899, 24623, 3414, 1495, 13, 4706, 13113, 29918, 24623, 29889, 8143, 580, 13, 4706, 25401, 29889, 8382, 877, 10685, 363, 7977, 5217, 1495, 13, 4706, 1583, 29889, 359, 29918, 29883, 4995, 4645, 29898, 4703, 467, 3198, 29918, 8143, 29918, 24623, 29918, 8835, 29898, 13, 9651, 13113, 29918, 24623, 29897, 13, 13, 4706, 1018, 29901, 13, 9651, 396, 316, 280, 29880, 371, 7977, 611, 2496, 13, 9651, 1583, 29889, 1113, 29874, 29918, 2585, 29918, 2754, 29889, 24623, 29918, 655, 2496, 29918, 8143, 29898, 4703, 29892, 7977, 29918, 333, 29892, 13, 462, 462, 462, 3030, 29889, 4836, 29918, 333, 29897, 13, 4706, 5174, 8960, 408, 429, 29901, 13, 9651, 25401, 29889, 2704, 7373, 1307, 703, 24623, 29918, 655, 2496, 29918, 8143, 5229, 29991, 429, 353, 1273, 29879, 4968, 429, 29897, 13, 13, 1678, 822, 903, 14930, 29918, 24623, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 13113, 29918, 24623, 29892, 5766, 3149, 1125, 13, 4706, 13113, 29918, 2974, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29898, 4703, 29892, 2777, 29897, 13, 4706, 565, 451, 13113, 29918, 2974, 29901, 13, 9651, 25401, 29889, 2704, 877, 6028, 451, 1284, 1923, 297, 13113, 2897, 29892, 525, 13, 462, 418, 525, 2974, 29901, 1273, 29879, 29915, 1273, 2777, 29889, 25118, 29897, 13, 9651, 12020, 3682, 29918, 735, 29889, 6004, 3664, 1252, 391, 2451, 29898, 13, 18884, 1923, 29918, 978, 29922, 8758, 29889, 4990, 29918, 978, 29897, 13, 13, 4706, 565, 13113, 29918, 24623, 29889, 4882, 1275, 376, 262, 29899, 1509, 1115, 13, 9651, 10641, 29918, 333, 29892, 1923, 29918, 333, 353, 1583, 3032, 657, 29918, 14930, 358, 29918, 333, 29918, 1454, 29918, 24623, 29898, 13, 18884, 13113, 29918, 24623, 29897, 13, 9651, 565, 1923, 29918, 333, 2804, 13113, 29918, 2974, 29889, 333, 29901, 13, 18884, 25401, 29889, 2704, 7373, 1307, 703, 18121, 7977, 29414, 29879, 29897, 756, 1063, 10959, 304, 376, 13, 462, 795, 376, 18121, 2777, 29414, 29879, 29897, 4968, 13113, 29918, 24623, 29889, 333, 29892, 13, 462, 3986, 1923, 29918, 333, 29897, 13, 18884, 12020, 3682, 29918, 735, 29889, 24679, 4165, 496, 17776, 29898, 13, 462, 1678, 7977, 29918, 333, 29922, 18121, 29918, 24623, 29889, 333, 29897, 13, 9651, 1683, 29901, 13, 18884, 736, 13, 13, 4706, 565, 13113, 29918, 24623, 29889, 4882, 1275, 525, 16515, 2396, 13, 9651, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 14930, 29918, 24623, 29898, 18121, 29918, 2974, 29889, 333, 29892, 13, 462, 462, 462, 418, 13113, 29918, 24623, 29889, 333, 29892, 13, 462, 462, 462, 418, 5766, 3149, 29897, 13, 9651, 1583, 29889, 359, 29918, 29883, 4995, 4645, 29898, 4703, 467, 3198, 29918, 14930, 29918, 24623, 29918, 8835, 29898, 13, 18884, 13113, 29918, 24623, 29897, 13, 4706, 1683, 29901, 13, 9651, 12020, 8960, 877, 18121, 7977, 1273, 29879, 338, 451, 3625, 29892, 525, 13, 462, 9651, 525, 4882, 338, 1273, 29879, 29915, 1273, 13, 462, 9651, 313, 18121, 29918, 24623, 29889, 333, 29892, 13, 462, 632, 13113, 29918, 24623, 29889, 4882, 876, 13, 13, 1678, 822, 10641, 29918, 24623, 29898, 1311, 29892, 3030, 29892, 3957, 29918, 3888, 29892, 2777, 29892, 5766, 3149, 29922, 8516, 29892, 13, 462, 418, 8086, 29918, 8262, 29922, 8516, 29892, 4742, 29918, 1853, 29922, 8516, 29892, 13, 462, 418, 20956, 29922, 8516, 1125, 13, 4706, 9995, 13, 13, 4706, 584, 3207, 3030, 29901, 13, 9651, 6024, 5150, 29918, 6979, 742, 13, 9651, 525, 29872, 2608, 630, 742, 13, 9651, 525, 3166, 29918, 8977, 742, 13, 9651, 525, 8758, 29918, 908, 29918, 11238, 742, 13, 9651, 525, 275, 29918, 6406, 742, 13, 9651, 525, 4836, 29918, 333, 742, 13, 9651, 525, 4836, 29918, 978, 742, 13, 9651, 525, 339, 4616, 29918, 1990, 742, 13, 9651, 525, 949, 29918, 311, 22742, 742, 13, 9651, 525, 16674, 29918, 7328, 742, 13, 9651, 525, 3827, 29918, 333, 742, 13, 9651, 525, 307, 793, 742, 13, 9651, 525, 5509, 29918, 28045, 742, 13, 9651, 525, 841, 424, 742, 13, 9651, 525, 16394, 742, 13, 9651, 525, 517, 29918, 8977, 742, 13, 9651, 525, 5504, 29918, 8899, 742, 13, 9651, 525, 1792, 742, 13, 9651, 525, 1792, 29918, 333, 742, 13, 9651, 525, 1792, 29918, 978, 2033, 13, 4706, 584, 3207, 3957, 29918, 3888, 29901, 13, 9651, 426, 13, 18884, 318, 29915, 9465, 29918, 24623, 29918, 1853, 2396, 318, 29915, 29894, 9274, 29918, 24623, 742, 13, 18884, 525, 15550, 2396, 318, 29915, 29947, 29906, 29946, 29881, 29941, 29929, 29955, 29872, 29899, 29946, 29896, 29941, 29947, 29899, 29946, 29947, 29872, 29946, 29899, 29890, 29900, 29900, 29890, 29899, 29900, 29953, 29946, 6854, 29929, 1389, 29946, 287, 29947, 742, 13, 18884, 318, 29915, 1272, 2396, 426, 13, 462, 1678, 318, 29915, 5943, 29918, 8513, 2396, 318, 29915, 13975, 742, 13, 462, 1678, 318, 29915, 29939, 359, 29918, 5965, 2395, 2396, 6213, 29892, 13, 462, 1678, 318, 29915, 4990, 29918, 978, 2396, 318, 29915, 24623, 29918, 29900, 29906, 742, 13, 462, 1678, 318, 29915, 24623, 29918, 333, 2396, 318, 29915, 29947, 29906, 29946, 29881, 29941, 29929, 29955, 29872, 29899, 29946, 29896, 29941, 29947, 29899, 29946, 29947, 29872, 29946, 29899, 29890, 29900, 29900, 29890, 29899, 29900, 29953, 29946, 6854, 29929, 1389, 29946, 287, 29947, 742, 13, 462, 1678, 318, 29915, 27852, 2396, 318, 29915, 29894, 9274, 29915, 13, 18884, 500, 13, 9651, 500, 13, 4706, 584, 3207, 2777, 29901, 13, 4706, 2799, 749, 29898, 13, 9651, 2130, 29918, 666, 29918, 29894, 29946, 29922, 8516, 29892, 13, 9651, 2130, 29918, 666, 29918, 29894, 29953, 29922, 8516, 29892, 13, 9651, 11258, 29922, 8516, 29892, 13, 9651, 4469, 29918, 20960, 29918, 2917, 29922, 8824, 29892, 13, 9651, 20847, 3097, 29918, 8028, 2433, 834, 29900, 29896, 29889, 29882, 5652, 489, 29888, 375, 1080, 9085, 742, 13, 9651, 3038, 29918, 978, 29922, 8516, 29892, 13, 9651, 5941, 287, 29922, 8824, 29892, 13, 9651, 2295, 29918, 21594, 2433, 742, 13, 9651, 2825, 29918, 271, 29922, 29906, 29900, 29896, 29953, 29899, 29900, 29896, 29899, 29896, 29946, 29911, 29900, 29955, 29901, 29871, 29896, 29955, 29901, 29871, 29946, 29900, 29999, 29892, 13, 9651, 2322, 29918, 29872, 561, 331, 13537, 29918, 10141, 29922, 8516, 29892, 13, 9651, 2322, 29918, 26276, 29918, 10141, 29922, 8516, 29892, 13, 9651, 11132, 29922, 8824, 29892, 13, 9651, 11132, 29918, 271, 29922, 8516, 29892, 13, 9651, 11262, 29918, 18821, 403, 29922, 8824, 29892, 13, 9651, 2479, 29918, 8216, 2433, 24623, 29918, 27852, 29918, 29900, 29896, 742, 13, 9651, 2479, 29918, 978, 2433, 24623, 29918, 27852, 29918, 29900, 29896, 742, 13, 9651, 321, 561, 331, 13537, 29918, 26300, 29922, 29900, 29892, 13, 9651, 321, 561, 331, 13537, 29918, 1989, 29918, 25118, 29922, 8516, 29892, 13, 9651, 12570, 29922, 8169, 10202, 13, 9651, 3495, 2433, 29946, 29906, 29900, 29947, 29906, 29946, 29933, 29947, 29899, 2477, 29946, 29933, 29899, 29955, 29909, 29953, 29946, 29899, 29953, 29933, 29947, 29928, 29899, 29928, 29945, 2477, 29933, 29929, 29900, 29923, 29896, 29941, 29953, 29909, 742, 13, 9651, 3495, 978, 2433, 24623, 29899, 27852, 29899, 29900, 29896, 742, 13, 9651, 1178, 29922, 29945, 29955, 29892, 13, 9651, 1967, 29918, 999, 2433, 742, 13, 9651, 5235, 29918, 8173, 29922, 4998, 3401, 10408, 29892, 13, 9651, 2777, 29918, 1853, 29918, 333, 29922, 29906, 29892, 13, 9651, 8466, 29918, 333, 2433, 742, 13, 9651, 1820, 29918, 1272, 29922, 8516, 29892, 13, 9651, 1820, 29918, 978, 29922, 8516, 29892, 13, 9651, 6826, 29918, 2248, 29922, 29900, 29892, 13, 9651, 15241, 29918, 271, 29922, 29906, 29900, 29896, 29953, 29899, 29900, 29896, 29899, 29896, 29946, 29911, 29900, 29955, 29901, 29871, 29896, 29955, 29901, 29871, 29946, 29941, 29999, 29892, 13, 9651, 15241, 29918, 265, 2433, 29946, 29906, 29900, 29947, 29906, 29946, 29933, 29947, 29899, 2477, 29946, 29933, 29899, 29955, 29909, 29953, 29946, 29899, 29953, 29933, 29947, 29928, 29899, 29928, 29945, 2477, 29933, 29929, 29900, 29923, 29896, 29941, 29953, 29909, 742, 13, 9651, 22822, 29922, 8824, 29892, 13, 9651, 22822, 29918, 1609, 29922, 8516, 29892, 13, 9651, 3370, 29918, 8337, 29922, 29945, 29896, 29906, 29892, 13, 9651, 15562, 3790, 13, 13, 9651, 2981, 13, 9651, 2943, 2433, 29946, 29906, 29900, 29947, 29906, 29946, 29933, 29947, 29899, 2477, 29946, 29933, 29899, 29955, 29909, 29953, 29946, 29899, 29953, 29933, 29947, 29928, 29899, 29928, 29945, 2477, 29933, 29929, 29900, 29923, 29896, 29941, 29953, 29909, 742, 13, 9651, 954, 29874, 29918, 3332, 3002, 29922, 8169, 10202, 13, 9651, 2897, 29918, 1853, 29922, 8516, 29892, 13, 9651, 282, 455, 29918, 3359, 1575, 29922, 8169, 10202, 13, 9651, 3081, 29918, 3859, 29922, 29900, 29892, 13, 9651, 6728, 29922, 29900, 29892, 13, 9651, 2060, 29918, 333, 2433, 29872, 29896, 29955, 29947, 29888, 29896, 29890, 29929, 29945, 29941, 29929, 29890, 29946, 29874, 29900, 29906, 29874, 29929, 29883, 29947, 29946, 29929, 1289, 29955, 11248, 29941, 11248, 29929, 29872, 742, 13, 9651, 13472, 20960, 29918, 333, 2433, 742, 13, 9651, 620, 20525, 29918, 333, 2433, 29878, 29899, 3034, 1365, 29939, 29947, 29887, 742, 13, 9651, 3876, 29918, 10141, 29918, 978, 2433, 29914, 3359, 29914, 29879, 1388, 742, 13, 9651, 3876, 29918, 26300, 29922, 29896, 29892, 13, 9651, 21467, 29918, 271, 29922, 8516, 29892, 13, 9651, 6993, 29918, 13155, 29922, 13228, 4782, 1293, 29892, 13, 9651, 12522, 3204, 29918, 18821, 403, 29922, 8824, 29892, 13, 9651, 1788, 29918, 19635, 3790, 13, 18884, 1967, 29918, 3188, 29918, 3027, 29918, 999, 2433, 742, 13, 18884, 1967, 29918, 3198, 2083, 2433, 29881, 29929, 29955, 29906, 29900, 29896, 29941, 29955, 29929, 29906, 29929, 29946, 29929, 29881, 29900, 29881, 29941, 2291, 29953, 29906, 29947, 29888, 915, 29947, 29953, 29947, 29945, 29890, 346, 742, 13, 18884, 1967, 29918, 7611, 29918, 4830, 2433, 18354, 742, 13, 18884, 1967, 29918, 20960, 29918, 4830, 2433, 29939, 20587, 29906, 742, 13, 18884, 1967, 29918, 3027, 29918, 333, 2433, 29953, 29896, 29955, 29872, 29955, 29906, 2176, 29899, 29946, 29896, 2291, 29899, 29946, 29872, 29900, 29881, 29899, 562, 29947, 29947, 29899, 29883, 18725, 29929, 29941, 29945, 29874, 29955, 13891, 29941, 742, 13, 18884, 1967, 29918, 3027, 29918, 978, 2433, 19052, 1883, 742, 13, 18884, 1967, 29918, 1195, 29918, 20960, 2433, 29900, 742, 13, 18884, 1967, 29918, 1195, 29918, 2572, 2433, 29900, 742, 13, 18884, 1967, 29918, 2311, 2433, 29896, 29941, 29896, 29946, 29955, 29953, 29946, 29947, 742, 13, 18884, 2777, 29918, 1853, 29918, 29872, 561, 331, 13537, 29918, 26300, 2433, 29900, 742, 13, 18884, 2777, 29918, 1853, 29918, 29888, 4112, 272, 333, 2433, 29896, 742, 13, 18884, 2777, 29918, 1853, 29918, 333, 2433, 29906, 742, 13, 18884, 2777, 29918, 1853, 29918, 14834, 29918, 8337, 2433, 29945, 29896, 29906, 742, 13, 18884, 2777, 29918, 1853, 29918, 978, 2433, 29885, 29896, 29889, 25649, 742, 13, 18884, 2777, 29918, 1853, 29918, 4632, 29918, 26300, 2433, 29896, 742, 13, 18884, 2777, 29918, 1853, 29918, 29878, 486, 29916, 29918, 19790, 2433, 29896, 29889, 29900, 742, 13, 18884, 2777, 29918, 1853, 29918, 26276, 2433, 29900, 742, 13, 18884, 2777, 29918, 1853, 29918, 7071, 3746, 29918, 7915, 29922, 8516, 29892, 13, 18884, 2777, 29918, 1853, 29918, 29894, 6814, 375, 2433, 29896, 29915, 13, 9651, 2981, 13, 9651, 3414, 29918, 3859, 29922, 8516, 29892, 13, 9651, 29185, 29918, 271, 29922, 8516, 29892, 13, 9651, 4784, 29918, 271, 29922, 29906, 29900, 29896, 29953, 29899, 29900, 29896, 29899, 29896, 29946, 29911, 29900, 29955, 29901, 29871, 29896, 29955, 29901, 29871, 29946, 29941, 29999, 29892, 13, 9651, 1404, 29918, 1272, 29922, 29884, 29915, 29966, 29903, 2190, 1806, 26664, 3352, 10202, 13, 9651, 1404, 29918, 333, 2433, 29881, 29941, 29947, 29955, 29941, 29906, 29890, 29900, 29874, 29947, 600, 29946, 29945, 29896, 774, 29900, 29946, 29946, 29900, 29896, 29945, 29872, 29947, 29900, 1327, 7340, 29953, 29945, 742, 13, 9651, 318, 5416, 29922, 29929, 29872, 1389, 29906, 29900, 29888, 29900, 29899, 29945, 774, 29888, 29899, 29946, 29955, 29929, 29941, 29899, 29890, 29946, 29874, 29906, 29899, 29945, 29874, 29953, 29953, 29955, 29890, 29900, 562, 328, 29900, 29892, 13, 9651, 325, 6814, 375, 29922, 29896, 29892, 13, 9651, 22419, 29918, 8513, 29922, 8516, 29892, 13, 9651, 22419, 29918, 3859, 2433, 4925, 1495, 13, 13, 4706, 16934, 1203, 29901, 13, 4706, 426, 13, 9651, 525, 4882, 2396, 318, 29915, 1131, 9733, 742, 13, 9651, 525, 24623, 29918, 1853, 29918, 333, 2396, 318, 29915, 1853, 29900, 29896, 742, 13, 9651, 525, 24623, 29918, 3027, 29918, 19635, 2396, 426, 13, 18884, 318, 29915, 7611, 29918, 4830, 2396, 318, 29915, 18354, 742, 13, 18884, 318, 29915, 1195, 29918, 2572, 2396, 318, 29915, 29900, 742, 13, 18884, 318, 29915, 20960, 29918, 4830, 2396, 318, 29915, 29939, 20587, 29906, 742, 13, 18884, 318, 29915, 3027, 29918, 978, 2396, 318, 29915, 19052, 1883, 742, 13, 18884, 318, 29915, 3027, 29918, 333, 2396, 318, 29915, 29953, 29896, 29955, 29872, 29955, 29906, 2176, 29899, 29946, 29896, 2291, 29899, 29946, 29872, 29900, 29881, 29899, 562, 29947, 29947, 29899, 29883, 18725, 29929, 29941, 29945, 29874, 29955, 13891, 29941, 742, 13, 18884, 318, 29915, 3198, 2083, 2396, 318, 29915, 29881, 29929, 29955, 29906, 29900, 29896, 29941, 29955, 29929, 29906, 29929, 29946, 29929, 29881, 29900, 29881, 29941, 2291, 29953, 29906, 29947, 29888, 915, 29947, 29953, 29947, 29945, 29890, 346, 742, 13, 18884, 318, 29915, 1195, 29918, 20960, 2396, 318, 29915, 29900, 742, 13, 18884, 318, 29915, 2311, 2396, 318, 29915, 29896, 29941, 29896, 29946, 29955, 29953, 29946, 29947, 29915, 13, 9651, 2981, 13, 9651, 525, 4990, 29918, 978, 2396, 318, 29915, 24623, 29918, 29900, 29906, 742, 13, 9651, 525, 14930, 1860, 2396, 19997, 13, 9651, 525, 14930, 29918, 2230, 2396, 15516, 13, 9651, 525, 485, 737, 3097, 29918, 8028, 2396, 318, 29915, 834, 29900, 29896, 29889, 29882, 5652, 489, 29888, 375, 1080, 9085, 742, 13, 9651, 525, 4777, 519, 2396, 5852, 29892, 13, 9651, 525, 11600, 29918, 271, 2396, 318, 29915, 29906, 29900, 29896, 29953, 29899, 29900, 29896, 29899, 29896, 29947, 29911, 29900, 29955, 29901, 29871, 29900, 29941, 29901, 29871, 29945, 29955, 29889, 29947, 29906, 29906, 29941, 29947, 29953, 742, 13, 9651, 525, 14930, 29918, 4882, 2396, 525, 4801, 3791, 742, 13, 9651, 525, 4990, 29918, 8216, 2396, 6213, 29892, 13, 9651, 525, 24623, 29918, 19635, 2396, 426, 13, 18884, 318, 29915, 949, 6194, 2396, 318, 29915, 8824, 29915, 13, 9651, 2981, 13, 9651, 525, 13653, 519, 2396, 318, 29915, 4541, 742, 13, 9651, 525, 29879, 14551, 29918, 333, 2396, 6213, 29892, 13, 9651, 525, 16476, 3149, 2396, 15516, 13, 9651, 525, 333, 2396, 318, 29915, 29947, 29906, 29946, 29881, 29941, 29929, 29955, 29872, 29899, 29946, 29896, 29941, 29947, 29899, 29946, 29947, 29872, 29946, 29899, 29890, 29900, 29900, 29890, 29899, 29900, 29953, 29946, 6854, 29929, 1389, 29946, 287, 29947, 742, 13, 9651, 525, 2311, 2396, 29871, 29896, 29906, 29900, 13, 4706, 500, 13, 4706, 584, 3207, 5766, 3149, 29901, 1347, 29889, 321, 29889, 29887, 29889, 5591, 3359, 29914, 29879, 2585, 29908, 13, 4706, 584, 3207, 8086, 29918, 8262, 29901, 13, 4706, 584, 3207, 4742, 29918, 1853, 29901, 13, 4706, 584, 3207, 20956, 29901, 13, 4706, 584, 2457, 29901, 13, 4706, 9995, 13, 4706, 25401, 29889, 8382, 877, 2962, 304, 10641, 7977, 29889, 1495, 13, 13, 4706, 3209, 29883, 9382, 29918, 24623, 29918, 333, 353, 3957, 29918, 3888, 1839, 1272, 16215, 24623, 29918, 333, 2033, 13, 13, 4706, 13113, 29918, 24623, 353, 1583, 3032, 657, 29918, 18121, 29918, 24623, 29898, 4703, 29892, 13, 462, 462, 462, 1678, 3209, 29883, 9382, 29918, 24623, 29918, 333, 29897, 13, 4706, 1583, 3032, 14930, 29918, 24623, 29898, 4703, 29892, 2777, 29892, 13113, 29918, 24623, 29892, 5766, 3149, 29897, 13, 13, 4706, 25401, 29889, 8382, 877, 14930, 7977, 584, 1273, 29879, 2551, 6169, 1273, 3209, 29883, 9382, 29918, 24623, 29918, 333, 29897, 13, 13, 1678, 822, 8174, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 3564, 29918, 3888, 29892, 2908, 29918, 10141, 29918, 3888, 29922, 8516, 29892, 13, 18884, 8174, 29918, 2218, 2039, 29922, 5574, 29892, 9725, 403, 29918, 1272, 29922, 8516, 1125, 13, 4706, 9995, 13, 4706, 584, 3207, 2777, 29901, 13, 4706, 584, 3207, 3564, 29918, 3888, 29901, 13, 4706, 584, 3207, 2908, 29918, 10141, 29918, 3888, 29901, 13, 4706, 584, 3207, 8174, 29918, 2218, 2039, 29901, 13, 4706, 584, 3207, 9725, 403, 29918, 1272, 29901, 13, 4706, 584, 2457, 29901, 13, 4706, 9995, 13, 4706, 1018, 29901, 13, 9651, 13113, 29918, 2974, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29898, 4703, 29892, 2777, 29897, 13, 4706, 5174, 3682, 29889, 6691, 17413, 29901, 13, 9651, 25401, 29889, 8382, 703, 8758, 338, 451, 1863, 29892, 694, 817, 304, 5217, 29991, 613, 13, 462, 418, 2777, 29922, 8758, 29897, 13, 9651, 736, 13, 13, 4706, 565, 13113, 29918, 2974, 29901, 13, 9651, 1018, 29901, 13, 18884, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 8143, 29898, 18121, 29918, 2974, 29897, 13, 18884, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3198, 29918, 8143, 29918, 2974, 29918, 8835, 29898, 13, 462, 1678, 13113, 29918, 2974, 29897, 13, 9651, 5174, 3682, 29889, 6848, 797, 2392, 29901, 13, 18884, 1053, 931, 29936, 931, 29889, 17059, 29898, 29941, 29900, 29897, 13, 18884, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3198, 29918, 8143, 29918, 2974, 29918, 8835, 29898, 13, 462, 1678, 13113, 29918, 2974, 29897, 13, 13, 4706, 1683, 29901, 13, 9651, 25401, 29889, 2704, 877, 6028, 451, 1476, 1923, 304, 5217, 29889, 1495, 13, 9651, 396, 12020, 3682, 29918, 735, 29889, 6004, 3664, 1252, 391, 2451, 29898, 2974, 29918, 978, 29922, 8758, 29889, 4990, 29918, 978, 29897, 13, 13, 4706, 1018, 29901, 13, 9651, 396, 5217, 2777, 611, 2496, 13, 9651, 1583, 29889, 1113, 29874, 29918, 2585, 29918, 2754, 29889, 8758, 29918, 655, 2496, 29918, 8143, 29898, 4703, 29892, 13, 462, 462, 462, 259, 2777, 29889, 25118, 29892, 13, 462, 462, 462, 259, 2777, 29889, 4836, 29918, 333, 29897, 13, 4706, 5174, 8960, 408, 429, 29901, 13, 9651, 25401, 29889, 2704, 7373, 1307, 703, 8758, 29918, 655, 2496, 29918, 8143, 5229, 29991, 429, 353, 1273, 29879, 4968, 429, 29897, 13, 13, 4706, 25401, 29889, 8382, 877, 8698, 304, 5217, 2777, 29901, 1273, 29879, 29915, 1273, 2777, 29889, 25118, 29897, 13, 13, 1678, 822, 903, 4801, 496, 29918, 24623, 29898, 1311, 29892, 3030, 29892, 13113, 29918, 24623, 1125, 13, 4706, 565, 13113, 29918, 24623, 29889, 4882, 1275, 376, 16515, 1115, 13, 9651, 25401, 29889, 8382, 703, 18121, 7977, 29414, 29879, 29897, 756, 1063, 1439, 496, 613, 13113, 29918, 24623, 29889, 333, 29897, 13, 9651, 736, 13, 13, 4706, 26305, 29918, 333, 29892, 1923, 29918, 333, 353, 1583, 3032, 657, 29918, 14930, 358, 29918, 333, 29918, 1454, 29918, 24623, 29898, 13, 9651, 13113, 29918, 24623, 29897, 13, 13, 4706, 25401, 29889, 8382, 877, 2974, 29918, 333, 29901, 1273, 29879, 29915, 1273, 1923, 29918, 333, 29897, 13, 4706, 25401, 29889, 8382, 877, 7892, 1439, 496, 3414, 1495, 13, 4706, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 4801, 496, 29918, 24623, 29898, 2974, 29918, 333, 29892, 13113, 29918, 24623, 29889, 333, 29897, 13, 13, 4706, 25401, 29889, 8382, 877, 10685, 363, 7977, 297, 3625, 4660, 29889, 1495, 13, 4706, 1583, 29889, 359, 29918, 29883, 4995, 4645, 29898, 4703, 467, 3198, 29918, 4801, 496, 29918, 24623, 29918, 8835, 29898, 13, 9651, 13113, 29918, 24623, 29897, 13, 13, 1678, 822, 1439, 496, 29918, 24623, 29898, 1311, 29892, 3957, 29918, 3888, 29892, 2777, 29892, 5766, 3149, 29892, 13, 462, 418, 20956, 29922, 8516, 1125, 13, 4706, 25401, 29889, 8382, 877, 2962, 304, 1439, 496, 7977, 29889, 1495, 13, 4706, 25401, 29889, 8382, 877, 8758, 29901, 1273, 29879, 29915, 1273, 2777, 29897, 13, 4706, 25401, 29889, 8382, 877, 9965, 29918, 3888, 29901, 1273, 29879, 29915, 1273, 3957, 29918, 3888, 29897, 13, 13, 4706, 3030, 353, 12428, 29918, 4703, 29889, 3089, 2677, 29898, 275, 29918, 6406, 29922, 5574, 29892, 13, 462, 462, 632, 2060, 29918, 333, 29922, 8758, 29889, 4836, 29918, 333, 29897, 13, 4706, 3209, 29883, 9382, 29918, 24623, 29918, 333, 353, 3957, 29918, 3888, 1839, 1272, 16215, 24623, 29918, 333, 2033, 13, 13, 4706, 13113, 29918, 24623, 353, 1583, 3032, 657, 29918, 18121, 29918, 24623, 29898, 4703, 29892, 13, 462, 462, 462, 1678, 3209, 29883, 9382, 29918, 24623, 29918, 333, 29897, 13, 4706, 1583, 3032, 4801, 496, 29918, 24623, 29898, 4703, 29892, 13113, 29918, 24623, 29897, 13, 4706, 25401, 29889, 8382, 703, 4801, 496, 7977, 2551, 29991, 613, 2777, 29922, 8758, 29897, 13, 13, 1678, 822, 679, 29918, 16515, 29918, 18010, 29898, 1311, 29892, 11086, 29922, 8824, 1125, 13, 4706, 9995, 11609, 29879, 302, 13183, 1280, 310, 599, 7573, 8745, 491, 278, 10272, 2669, 29889, 13, 13, 4706, 910, 1158, 338, 363, 2473, 10272, 29899, 18010, 2304, 29889, 960, 263, 7156, 11286, 13, 4706, 2473, 10272, 29899, 18010, 29892, 445, 1158, 3639, 263, 1051, 310, 302, 13183, 1280, 8745, 13, 4706, 491, 278, 2669, 29889, 13466, 29892, 445, 1158, 881, 736, 13, 4706, 518, 24947, 19188, 29918, 28988, 1822, 13, 4706, 9995, 13, 4706, 3495, 978, 353, 9909, 29889, 29887, 621, 520, 978, 580, 13, 4706, 736, 518, 28988, 29962, 13, 13, 1678, 822, 903, 657, 29918, 3069, 29918, 16202, 29898, 1311, 29892, 3495, 978, 1125, 13, 4706, 736, 11117, 29894, 6814, 375, 2396, 29871, 29929, 29929, 29929, 29929, 29929, 29929, 29892, 525, 29894, 6814, 375, 29918, 3880, 2396, 29871, 29900, 29892, 525, 14834, 29918, 8337, 2396, 29871, 29929, 29929, 29929, 29929, 29929, 29929, 29892, 13, 18884, 525, 14834, 29918, 8337, 29918, 3880, 2396, 29871, 29900, 29892, 525, 2997, 29918, 26300, 2396, 29871, 29929, 29929, 29929, 29929, 29929, 29929, 29929, 29929, 29892, 13, 18884, 525, 2997, 29918, 26300, 29918, 3880, 2396, 29871, 29900, 29892, 525, 3069, 29918, 14834, 29918, 7827, 2396, 29871, 29929, 29929, 29929, 29929, 29929, 29929, 29929, 29929, 29892, 13, 18884, 525, 20960, 29918, 7827, 2396, 29871, 29929, 29929, 29929, 29929, 29929, 29929, 29929, 29929, 29892, 525, 3069, 29918, 14834, 29918, 9021, 2396, 29871, 29929, 29929, 29929, 29929, 29929, 29929, 29929, 29929, 29892, 13, 18884, 525, 20960, 29918, 3880, 2396, 29871, 29900, 29892, 525, 24947, 19188, 29918, 1853, 2396, 525, 29888, 375, 1080, 9085, 742, 13, 18884, 525, 24947, 19188, 29918, 3259, 2396, 525, 29945, 29900, 29900, 29945, 29900, 29900, 29900, 742, 13, 18884, 525, 24947, 19188, 29918, 28988, 2396, 3495, 978, 29892, 13, 18884, 525, 21970, 29918, 3888, 2396, 525, 6377, 4299, 1115, 6796, 2928, 295, 29898, 29934, 29897, 1060, 29872, 265, 29898, 29934, 29897, 10808, 382, 29945, 29899, 29906, 29953, 29955, 29900, 29871, 29900, 732, 29871, 29906, 29889, 29953, 29900, 29954, 12661, 12436, 29915, 13, 462, 9651, 18793, 19167, 1115, 6796, 29950, 3357, 26599, 8364, 11763, 3189, 1696, 19806, 1213, 1402, 525, 13, 462, 9651, 18793, 3332, 3002, 1115, 8853, 29883, 2361, 1115, 29871, 29896, 29953, 29892, 376, 28993, 1115, 29871, 29941, 29906, 930, 742, 13, 18884, 525, 23765, 29918, 2611, 2925, 2396, 4390, 13239, 29889, 29881, 17204, 29898, 13, 462, 1678, 518, 3366, 29875, 29953, 29947, 29953, 613, 376, 29916, 264, 613, 376, 398, 29880, 12436, 6796, 29916, 29947, 29953, 29918, 29953, 29946, 613, 376, 29916, 264, 613, 376, 398, 29880, 3108, 11724, 13, 18884, 525, 1949, 29874, 29918, 3332, 3002, 2396, 6213, 29892, 29913, 13, 13, 1678, 822, 679, 29918, 16515, 29918, 10314, 29898, 1311, 29892, 18778, 3871, 1125, 13, 4706, 3495, 29918, 16202, 353, 1583, 3032, 657, 29918, 3069, 29918, 16202, 29898, 29876, 397, 3871, 29897, 13, 13, 4706, 6969, 29918, 2611, 2925, 353, 1051, 580, 13, 4706, 363, 697, 297, 4390, 13239, 29889, 18132, 29898, 3069, 29918, 16202, 1839, 23765, 29918, 2611, 2925, 2033, 1125, 13, 9651, 6969, 29918, 2611, 2925, 29889, 4397, 3552, 650, 29961, 29900, 1402, 697, 29961, 29896, 1402, 697, 29961, 29906, 12622, 13, 13, 4706, 736, 11117, 29894, 6814, 375, 2396, 3495, 29918, 16202, 1839, 29894, 6814, 375, 7464, 13, 18884, 525, 14834, 29918, 8337, 2396, 3495, 29918, 16202, 1839, 3069, 29918, 14834, 29918, 7827, 7464, 13, 18884, 525, 2997, 29918, 26300, 2396, 3495, 29918, 16202, 1839, 20960, 29918, 7827, 7464, 525, 29894, 6814, 375, 29918, 3880, 2396, 29871, 29900, 29892, 13, 18884, 525, 14834, 29918, 8337, 29918, 3880, 2396, 3495, 29918, 16202, 1839, 3069, 29918, 14834, 29918, 7827, 2033, 448, 3495, 29918, 16202, 29961, 13, 462, 1678, 525, 3069, 29918, 14834, 29918, 9021, 7464, 13, 18884, 525, 2997, 29918, 26300, 29918, 3880, 2396, 3495, 29918, 16202, 1839, 20960, 29918, 3880, 7464, 13, 18884, 525, 24947, 19188, 29918, 1853, 2396, 3495, 29918, 16202, 1839, 24947, 19188, 29918, 1853, 7464, 13, 18884, 525, 24947, 19188, 29918, 3259, 2396, 3495, 29918, 16202, 1839, 24947, 19188, 29918, 3259, 7464, 13, 18884, 525, 24947, 19188, 29918, 28988, 2396, 3495, 29918, 16202, 1839, 24947, 19188, 29918, 28988, 7464, 13, 18884, 525, 21970, 29918, 3888, 2396, 4390, 13239, 29889, 29881, 17204, 29898, 3069, 29918, 16202, 1839, 21970, 29918, 3888, 2033, 511, 13, 18884, 525, 23765, 29918, 2611, 2925, 2396, 6969, 29918, 2611, 2925, 29892, 13, 18884, 525, 1949, 29874, 29918, 3332, 3002, 2396, 6213, 29892, 29913, 13, 13, 1678, 822, 679, 29918, 3888, 29898, 1311, 29892, 2777, 1125, 13, 4706, 6850, 1299, 3308, 353, 3081, 29918, 3859, 29889, 29940, 3718, 3040, 13, 13, 4706, 3030, 353, 12428, 29918, 4703, 29889, 3089, 2677, 29898, 275, 29918, 6406, 29922, 5574, 29892, 13, 462, 462, 632, 2060, 29918, 333, 29922, 8758, 29889, 4836, 29918, 333, 29897, 13, 13, 4706, 1923, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29898, 4703, 29892, 2777, 29897, 13, 4706, 25401, 29889, 8382, 877, 2974, 29901, 1273, 29879, 29915, 1273, 1923, 29897, 13, 4706, 565, 1923, 29901, 13, 9651, 2777, 29918, 13519, 29918, 3859, 353, 679, 5552, 29898, 2974, 29892, 525, 3267, 29899, 12194, 29899, 1254, 29903, 29901, 13519, 29918, 3859, 1495, 13, 9651, 6850, 1299, 3308, 353, 383, 29903, 29918, 29925, 9806, 1001, 29918, 19713, 29961, 8758, 29918, 13519, 29918, 3859, 29962, 13, 4706, 25401, 29889, 8382, 877, 355, 304, 679, 29918, 3888, 29901, 1273, 29879, 29915, 1273, 6850, 1299, 3308, 29897, 13, 13, 4706, 736, 12837, 29889, 4998, 3401, 29898, 13, 9651, 2106, 29922, 27047, 29892, 13, 9651, 4236, 29918, 6954, 29918, 21066, 29922, 29900, 29892, 13, 9651, 2626, 29918, 21066, 29922, 29900, 29892, 13, 9651, 954, 29918, 21970, 29922, 29896, 29897, 13, 13, 1678, 822, 679, 29918, 8758, 29918, 8628, 29879, 29898, 1311, 29892, 2777, 1125, 13, 4706, 9995, 13, 4706, 1939, 817, 304, 2334, 29889, 13, 4706, 584, 3207, 2777, 29901, 13, 4706, 584, 2457, 29901, 13, 4706, 9995, 13, 4706, 1209, 13, 13, 1678, 822, 679, 29918, 24623, 29918, 11958, 2801, 29898, 1311, 29892, 2777, 1125, 13, 4706, 736, 11117, 666, 2396, 8707, 29943, 29889, 1357, 29918, 1271, 29918, 12925, 29918, 666, 29892, 13, 18884, 525, 2344, 29875, 1061, 2396, 525, 29888, 1296, 742, 13, 18884, 525, 3069, 2396, 525, 29888, 1296, 3069, 10827, 13, 13, 1678, 822, 2069, 29918, 3069, 29898, 1311, 29892, 3495, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 3081, 29918, 2696, 29898, 1311, 29892, 2777, 29892, 11815, 29922, 29900, 29892, 337, 2202, 29918, 19207, 29922, 29900, 1125, 13, 13, 4706, 25401, 29889, 8382, 877, 2962, 304, 5040, 1923, 29901, 1273, 29879, 29915, 1273, 2777, 29889, 25118, 29897, 13, 4706, 1923, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29898, 5819, 19515, 29918, 8758, 29922, 8758, 29897, 13, 4706, 565, 451, 1923, 29901, 13, 9651, 25401, 29889, 8382, 877, 3068, 451, 1284, 1014, 2897, 1923, 363, 525, 13, 462, 418, 525, 8758, 29901, 1273, 29879, 29915, 1273, 2777, 29889, 25118, 29897, 13, 9651, 12020, 3682, 29918, 735, 29889, 6004, 3664, 1252, 391, 2451, 29898, 13, 18884, 1923, 29918, 978, 29922, 8758, 29889, 4990, 29918, 978, 29897, 13, 13, 4706, 3030, 353, 12428, 29918, 4703, 29889, 3089, 2677, 29898, 275, 29918, 6406, 29922, 5574, 29892, 13, 462, 462, 632, 2060, 29918, 333, 29922, 8758, 29889, 4836, 29918, 333, 29897, 13, 13, 4706, 25401, 29889, 8382, 877, 2974, 29901, 1273, 29879, 4660, 338, 29901, 1273, 29879, 29915, 1273, 313, 2974, 29889, 333, 29892, 1923, 29889, 4882, 876, 13, 4706, 565, 1923, 29889, 4882, 1275, 22419, 29918, 28631, 29889, 17923, 18474, 29889, 21064, 7295, 13, 9651, 25401, 29889, 8382, 877, 2962, 304, 788, 5040, 3414, 1495, 13, 9651, 1923, 29889, 9847, 580, 13, 9651, 25401, 29889, 8382, 877, 7892, 5040, 3414, 1495, 13, 9651, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3198, 29918, 9847, 29918, 2974, 29918, 8835, 29898, 2974, 29897, 13, 9651, 25401, 29889, 8382, 877, 9847, 1923, 29901, 1273, 29879, 2551, 29915, 1273, 2777, 29889, 25118, 29897, 13, 4706, 25342, 1923, 29889, 4882, 1275, 525, 7068, 2692, 27681, 2396, 13, 9651, 25401, 29889, 8382, 877, 1491, 2777, 4660, 338, 2307, 6850, 4590, 29925, 3352, 29889, 1495, 13, 9651, 25401, 29889, 8382, 877, 9847, 1923, 29901, 1273, 29879, 2551, 29915, 1273, 2777, 29889, 25118, 29897, 13, 9651, 736, 13, 4706, 1683, 29901, 13, 9651, 25401, 29889, 27392, 877, 2974, 4660, 338, 451, 297, 319, 1783, 18474, 6323, 6850, 4590, 29925, 3352, 5501, 13, 462, 4706, 525, 3068, 451, 437, 349, 9806, 1001, 29918, 27681, 5858, 1495, 13, 9651, 12020, 3682, 29918, 735, 29889, 6004, 5709, 2451, 29898, 4882, 29922, 2974, 29889, 4882, 29897, 13, 13, 1678, 822, 3081, 29918, 265, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 3564, 29918, 3888, 29892, 13, 462, 2908, 29918, 10141, 29918, 3888, 29922, 8516, 1125, 13, 13, 4706, 25401, 29889, 8382, 877, 2962, 304, 1369, 1923, 29901, 1273, 29879, 29915, 1273, 2777, 29889, 25118, 29897, 13, 4706, 1923, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29898, 4703, 29892, 2777, 29897, 13, 4706, 565, 451, 1923, 29901, 13, 9651, 25401, 29889, 8382, 877, 3068, 451, 1284, 1014, 2897, 1923, 363, 525, 13, 462, 418, 525, 8758, 29901, 1273, 29879, 29915, 1273, 2777, 29889, 25118, 29897, 13, 9651, 12020, 3682, 29918, 735, 29889, 6004, 3664, 1252, 391, 2451, 29898, 8758, 29889, 4990, 29918, 978, 29897, 13, 13, 4706, 25401, 29889, 8382, 877, 2974, 29901, 1273, 29879, 4660, 338, 29901, 1273, 29879, 29915, 1273, 313, 2974, 29889, 333, 29892, 1923, 29889, 4882, 876, 13, 4706, 565, 1923, 29889, 4882, 1275, 525, 7068, 2692, 27681, 2396, 13, 9651, 25401, 29889, 8382, 877, 2962, 304, 788, 1369, 3414, 1495, 13, 9651, 1923, 29889, 2962, 580, 13, 9651, 25401, 29889, 8382, 877, 7892, 1369, 3414, 1495, 13, 9651, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3198, 29918, 2962, 29918, 2974, 29918, 8835, 29898, 2974, 29897, 13, 9651, 25401, 29889, 8382, 877, 2962, 1923, 29901, 1273, 29879, 2551, 29915, 1273, 2777, 29889, 25118, 29897, 13, 4706, 25342, 1923, 29889, 4882, 1275, 22419, 29918, 28631, 29889, 17923, 18474, 29889, 21064, 7295, 13, 9651, 25401, 29889, 8382, 877, 1491, 2777, 4660, 338, 2307, 319, 1783, 18474, 29889, 1495, 13, 9651, 736, 13, 4706, 1683, 29901, 13, 9651, 25401, 29889, 27392, 877, 2974, 4660, 338, 451, 297, 319, 1783, 18474, 6323, 6850, 4590, 29925, 3352, 5501, 13, 462, 4706, 525, 3068, 451, 437, 349, 9806, 1001, 29918, 1164, 5858, 1495, 13, 9651, 12020, 3682, 29918, 735, 29889, 6004, 5709, 2451, 29898, 4882, 29922, 2974, 29889, 4882, 29897, 13, 13, 1678, 822, 22538, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 3564, 29918, 3888, 29892, 22538, 29918, 1853, 29892, 13, 1669, 2908, 29918, 10141, 29918, 3888, 29922, 8516, 29892, 4319, 29918, 1555, 9351, 29918, 14035, 29922, 8516, 1125, 13, 13, 4706, 25401, 29889, 8382, 877, 2962, 304, 22538, 1923, 29901, 1273, 29879, 29915, 1273, 2777, 29889, 25118, 29897, 13, 4706, 1923, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29898, 4703, 29892, 2777, 29897, 13, 4706, 565, 451, 1923, 29901, 13, 9651, 25401, 29889, 8382, 877, 3068, 451, 1284, 1014, 2897, 1923, 363, 525, 13, 462, 418, 525, 8758, 29901, 1273, 29879, 29915, 1273, 2777, 29889, 25118, 29897, 13, 9651, 12020, 3682, 29918, 735, 29889, 6004, 3664, 1252, 391, 2451, 29898, 13, 18884, 1923, 29918, 978, 29922, 8758, 29889, 4990, 29918, 978, 29897, 13, 13, 4706, 25401, 29889, 8382, 877, 2974, 29901, 1273, 29879, 4660, 338, 29901, 1273, 29879, 29915, 1273, 313, 2974, 29889, 333, 29892, 1923, 29889, 4882, 876, 13, 4706, 565, 1923, 29889, 4882, 1275, 22419, 29918, 28631, 29889, 17923, 18474, 29889, 21064, 7295, 13, 9651, 1923, 29889, 276, 4777, 29898, 276, 4777, 29918, 1853, 29897, 13, 9651, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3198, 29918, 276, 4777, 29918, 2974, 29918, 8835, 29898, 2974, 29897, 13, 9651, 25401, 29889, 8382, 877, 276, 4777, 1923, 29901, 1273, 29879, 2551, 29915, 1273, 2777, 29889, 25118, 29897, 13, 4706, 25342, 1923, 29889, 4882, 1275, 525, 7068, 2692, 27681, 2396, 13, 9651, 1923, 29889, 2962, 580, 13, 9651, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3198, 29918, 2962, 29918, 2974, 29918, 8835, 29898, 2974, 29897, 13, 9651, 25401, 29889, 8382, 877, 276, 4777, 1923, 29901, 1273, 29879, 2551, 29915, 1273, 2777, 29889, 25118, 29897, 13, 4706, 1683, 29901, 13, 9651, 25401, 29889, 27392, 877, 2974, 4660, 338, 451, 297, 319, 1783, 18474, 6323, 6850, 4590, 29925, 3352, 5501, 13, 462, 4706, 525, 3068, 451, 437, 349, 9806, 1001, 29918, 27681, 5858, 1495, 13, 9651, 12020, 3682, 29918, 735, 29889, 6004, 5709, 2451, 29898, 4882, 29922, 2974, 29889, 4882, 29897, 13, 13, 1678, 822, 13113, 29918, 3258, 29918, 3027, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 1967, 29892, 15562, 1125, 13, 4706, 13113, 29918, 8758, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29898, 4703, 29892, 13, 462, 462, 462, 4706, 2777, 29897, 13, 13, 4706, 13113, 29918, 19635, 353, 426, 13, 9651, 376, 20960, 29918, 4830, 1115, 15562, 29889, 657, 703, 20960, 29918, 4830, 613, 376, 1610, 4968, 13, 9651, 376, 7611, 29918, 4830, 1115, 15562, 29889, 657, 703, 7611, 29918, 4830, 613, 376, 18354, 1159, 29913, 13, 13, 4706, 396, 13113, 1653, 1967, 13, 4706, 4423, 29892, 13113, 29918, 3027, 29918, 333, 353, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 13, 9651, 3030, 467, 3258, 29918, 3027, 29898, 13, 9651, 13113, 29918, 8758, 29892, 1967, 1839, 978, 7464, 13113, 29918, 19635, 29897, 13, 13, 4706, 1018, 29901, 13, 9651, 396, 4480, 1653, 1967, 2551, 13, 9651, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3198, 29918, 3258, 29918, 3027, 29918, 2974, 29918, 8835, 29898, 13, 18884, 13113, 29918, 8758, 29897, 13, 13, 9651, 396, 4480, 1967, 4660, 338, 6136, 13, 9651, 1583, 29889, 359, 29918, 3820, 749, 4645, 29898, 4703, 467, 3198, 29918, 3027, 29918, 4925, 29918, 8835, 29898, 13, 18884, 13113, 29918, 3027, 29918, 333, 29897, 13, 4706, 5174, 8960, 408, 429, 29901, 13, 9651, 25401, 29889, 11739, 7373, 1307, 703, 3258, 1967, 5229, 29991, 429, 353, 1273, 29879, 4968, 429, 29897, 13, 9651, 411, 5566, 13239, 29889, 7620, 29918, 392, 29918, 13941, 895, 29918, 11739, 7295, 13, 18884, 1583, 29889, 359, 29918, 3820, 749, 4645, 29898, 4703, 467, 8143, 29898, 18121, 29918, 3027, 29918, 333, 29897, 13, 13, 4706, 736, 13113, 29918, 8758, 29892, 13113, 29918, 3027, 29918, 333, 13, 13, 1678, 822, 22395, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 1967, 29918, 333, 29892, 2767, 29918, 7662, 29918, 3859, 1125, 13, 13, 4706, 22395, 353, 1583, 3032, 3027, 29918, 2754, 29889, 657, 29898, 4703, 29892, 1967, 29918, 333, 29897, 13, 13, 4706, 1967, 29918, 4830, 353, 6213, 13, 13, 4706, 15562, 353, 1583, 3032, 3258, 29918, 29879, 14551, 29918, 19635, 29898, 8758, 29889, 3027, 29918, 7299, 29892, 13, 462, 462, 462, 29871, 2777, 29892, 13, 462, 462, 462, 29871, 1967, 29918, 4830, 29892, 13, 462, 462, 462, 29871, 22395, 1839, 978, 11287, 13, 13, 4706, 2767, 29918, 7662, 29918, 3859, 29898, 7662, 29918, 3859, 29922, 7662, 29918, 28631, 29889, 2382, 29918, 29925, 11794, 4214, 29918, 4897, 29428, 29897, 13, 4706, 13113, 29918, 8758, 29892, 13113, 29918, 3027, 29918, 333, 353, 1583, 29889, 18121, 29918, 3258, 29918, 3027, 29898, 13, 9651, 3030, 29892, 2777, 29892, 22395, 29892, 15562, 29897, 13, 13, 4706, 1018, 29901, 13, 13, 9651, 2767, 29918, 7662, 29918, 3859, 29898, 7662, 29918, 3859, 29922, 7662, 29918, 28631, 29889, 2382, 29918, 4897, 29428, 4214, 29892, 13, 462, 795, 3806, 29918, 3859, 29922, 7662, 29918, 28631, 29889, 2382, 29918, 29925, 11794, 4214, 29918, 4897, 29428, 29897, 13, 13, 9651, 1018, 29901, 13, 18884, 1967, 353, 1583, 29889, 359, 29918, 3820, 749, 4645, 29898, 4703, 467, 657, 29918, 3027, 29898, 13, 462, 1678, 13113, 29918, 3027, 29918, 333, 29897, 13, 18884, 25401, 29889, 8382, 703, 1817, 29974, 26828, 29892, 1967, 353, 1273, 29879, 613, 1967, 29897, 13, 18884, 565, 756, 5552, 29898, 3027, 29892, 376, 11851, 29918, 2271, 29908, 1125, 13, 462, 1678, 1513, 29918, 2271, 353, 1967, 29889, 11851, 29918, 2271, 13, 462, 1678, 565, 1513, 29918, 2271, 29889, 27382, 2541, 703, 26792, 29974, 1124, 597, 1159, 470, 320, 13, 462, 9651, 1513, 29918, 2271, 29889, 27382, 2541, 703, 1124, 597, 1159, 470, 320, 13, 462, 9651, 1513, 29918, 2271, 29889, 27382, 2541, 703, 991, 597, 29908, 1125, 13, 13, 462, 4706, 15562, 3366, 5479, 3108, 353, 1513, 29918, 2271, 13, 462, 4706, 1583, 3032, 3027, 29918, 2754, 29889, 5504, 29898, 4703, 29892, 1967, 29918, 333, 29892, 15562, 29892, 13, 462, 462, 1669, 3708, 479, 29918, 11030, 29922, 8824, 29897, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 12020, 8960, 580, 13, 18884, 1683, 29901, 13, 462, 1678, 12020, 8960, 580, 13, 9651, 5174, 8960, 29901, 13, 18884, 15562, 29889, 7323, 703, 5479, 613, 6213, 29897, 13, 18884, 396, 5142, 515, 13113, 21798, 13, 18884, 25401, 29889, 8382, 703, 1817, 29974, 26828, 29892, 3380, 304, 5142, 1967, 29414, 29879, 19123, 13, 462, 3986, 13113, 29918, 3027, 29918, 333, 29897, 13, 18884, 1967, 29918, 1272, 353, 1583, 29889, 359, 29918, 3820, 749, 4645, 29898, 4703, 467, 1272, 29898, 13, 462, 1678, 13113, 29918, 3027, 29918, 333, 29897, 13, 18884, 25401, 29889, 8382, 703, 1817, 29974, 26828, 29892, 1967, 3309, 353, 1273, 29879, 613, 7431, 29898, 3027, 29918, 1272, 876, 13, 18884, 1583, 3032, 3027, 29918, 2754, 29889, 5504, 29898, 4703, 29892, 13, 462, 462, 539, 1967, 29918, 333, 29892, 13, 462, 462, 539, 15562, 29892, 13, 462, 462, 539, 1967, 29918, 1272, 29897, 13, 13, 9651, 396, 1653, 1967, 611, 2496, 13, 9651, 1819, 353, 8853, 18121, 29918, 3027, 29918, 333, 1115, 13113, 29918, 3027, 29918, 333, 29913, 13, 9651, 1583, 29889, 1113, 29874, 29918, 2585, 29918, 2754, 29889, 3027, 29918, 655, 2496, 29918, 3258, 29898, 4703, 29892, 1967, 29918, 333, 29892, 13, 462, 462, 18884, 3030, 29889, 4836, 29918, 333, 29892, 13, 462, 462, 18884, 1819, 29897, 13, 4706, 5174, 8960, 408, 429, 29901, 13, 9651, 25401, 29889, 11739, 7373, 1307, 703, 3258, 1967, 5229, 29991, 429, 353, 1273, 29879, 4968, 429, 29897, 13, 9651, 411, 5566, 13239, 29889, 7620, 29918, 392, 29918, 13941, 895, 29918, 11739, 7295, 13, 18884, 1583, 29889, 359, 29918, 3820, 749, 4645, 29898, 4703, 467, 8143, 29898, 18121, 29918, 3027, 29918, 333, 29897, 13, 13, 1678, 822, 679, 29918, 18121, 29918, 29880, 21791, 29918, 24623, 29918, 333, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 2380, 1125, 13, 4706, 301, 21791, 29918, 24623, 29918, 333, 353, 2777, 29889, 5205, 29918, 19635, 29889, 657, 877, 18121, 29918, 29880, 21791, 29918, 24623, 29918, 333, 742, 13, 462, 462, 462, 268, 6213, 29897, 13, 4706, 565, 301, 21791, 29918, 24623, 29918, 333, 29901, 13, 9651, 736, 301, 21791, 29918, 24623, 29918, 333, 13, 13, 4706, 13113, 29918, 8758, 29918, 25118, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29918, 333, 29898, 13, 9651, 3030, 29892, 2777, 29889, 25118, 29897, 13, 4706, 565, 13113, 29918, 8758, 29918, 25118, 338, 6213, 29901, 13, 9651, 736, 13, 4706, 18167, 353, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 657, 29918, 2974, 29918, 1555, 9351, 29898, 13, 9651, 13113, 29918, 8758, 29918, 25118, 29897, 13, 4706, 18167, 353, 12705, 29898, 1555, 9351, 29892, 1820, 29922, 2892, 7977, 29901, 7977, 29889, 10141, 29897, 13, 4706, 25401, 29889, 8382, 703, 1817, 29974, 26828, 29892, 18167, 353, 1273, 29879, 613, 18167, 29897, 13, 4706, 301, 21791, 29918, 24623, 353, 6213, 13, 4706, 565, 7431, 29898, 1555, 9351, 29897, 1405, 2380, 29901, 13, 9651, 301, 21791, 29918, 24623, 353, 18167, 29961, 2248, 29962, 13, 4706, 565, 301, 21791, 29918, 24623, 338, 451, 6213, 29901, 13, 9651, 736, 301, 21791, 29918, 24623, 29889, 24623, 1204, 13, 13, 1678, 822, 903, 1028, 18101, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 1967, 29918, 7299, 29892, 11658, 287, 29918, 5325, 29892, 13, 1669, 4113, 29918, 5630, 29892, 3564, 29918, 3888, 29922, 8516, 29892, 2908, 29918, 10141, 29918, 3888, 29922, 8516, 1125, 13, 4706, 1018, 29901, 13, 9651, 25401, 29889, 8382, 877, 8758, 29901, 1273, 29879, 29915, 1273, 2777, 29897, 13, 9651, 25401, 29889, 8382, 877, 1271, 4742, 5235, 29901, 1273, 29879, 29915, 1273, 2908, 29918, 10141, 29918, 3888, 29897, 13, 13, 9651, 21054, 272, 353, 2777, 29889, 657, 29918, 29888, 4112, 272, 580, 13, 9651, 25401, 29889, 8382, 877, 29888, 4112, 272, 29901, 1273, 29879, 29915, 1273, 21054, 272, 29897, 13, 13, 9651, 1014, 29918, 29888, 4112, 272, 29918, 333, 353, 1583, 3032, 657, 29918, 18121, 29918, 29888, 4112, 272, 29918, 333, 29898, 4703, 29892, 13, 462, 462, 462, 308, 21054, 272, 29889, 29888, 4112, 272, 333, 29897, 13, 13, 9651, 1024, 353, 1583, 3032, 17158, 29918, 18121, 29918, 8758, 29918, 978, 29898, 8758, 29889, 4990, 29918, 978, 29892, 13, 462, 462, 462, 308, 2777, 29889, 25118, 29897, 13, 9651, 25401, 29889, 8382, 877, 978, 29901, 1273, 29879, 29915, 1273, 1024, 29897, 13, 13, 9651, 1967, 29918, 999, 353, 6213, 13, 13, 9651, 565, 2777, 29889, 3027, 29918, 999, 29901, 13, 18884, 1014, 29918, 3027, 29918, 333, 353, 1583, 3032, 657, 29918, 18121, 29918, 3188, 29918, 3027, 29918, 333, 29898, 4703, 29897, 13, 18884, 1018, 29901, 13, 462, 1678, 1967, 29918, 999, 353, 1583, 29889, 359, 29918, 3820, 749, 4645, 29898, 4703, 467, 657, 29918, 3027, 29898, 13, 462, 4706, 1014, 29918, 3027, 29918, 333, 29897, 13, 18884, 5174, 8960, 408, 429, 29901, 13, 462, 1678, 25401, 29889, 11739, 7373, 1307, 703, 657, 1967, 29414, 29898, 3027, 29918, 333, 29897, 29879, 29897, 5229, 29892, 376, 13, 462, 462, 418, 376, 735, 353, 1273, 29898, 735, 29897, 29879, 4968, 1967, 29918, 333, 29922, 1491, 29918, 3027, 29918, 333, 29892, 13, 462, 462, 29871, 429, 29922, 735, 29897, 13, 462, 1678, 12020, 13, 9651, 1683, 29901, 13, 18884, 1967, 29918, 999, 353, 6213, 13, 9651, 565, 2777, 29889, 19635, 29901, 13, 18884, 15562, 353, 3509, 29889, 24535, 8552, 29898, 8758, 29889, 19635, 29897, 13, 9651, 1683, 29901, 13, 18884, 15562, 353, 6571, 13, 13, 9651, 15562, 353, 1583, 3032, 1202, 29918, 4039, 29918, 517, 29918, 19635, 29898, 19635, 29892, 2777, 29889, 25118, 29897, 13, 9651, 25401, 29889, 8382, 877, 19635, 29901, 1273, 29879, 29915, 1273, 15562, 29897, 13, 13, 9651, 623, 29918, 8926, 29918, 13155, 353, 2777, 29889, 8926, 29918, 13155, 13, 9651, 25401, 29889, 8382, 877, 932, 29918, 8926, 29918, 13155, 29901, 1273, 29879, 29915, 1273, 623, 29918, 8926, 29918, 13155, 29897, 13, 13, 9651, 10823, 29918, 21920, 29918, 5325, 353, 1583, 3032, 657, 29918, 14748, 29918, 21920, 29918, 1445, 29898, 8758, 29892, 13, 462, 462, 462, 632, 11658, 287, 29918, 5325, 29897, 13, 13, 9651, 1014, 29918, 6448, 29885, 353, 1583, 3032, 3286, 571, 29918, 517, 29918, 1491, 29918, 1271, 29918, 10141, 29918, 20698, 29918, 29894, 29906, 29898, 13, 18884, 3030, 29892, 2777, 29892, 2908, 29918, 10141, 29918, 3888, 29897, 13, 9651, 25401, 29889, 8382, 877, 1491, 29918, 6448, 29885, 29901, 1273, 29879, 29915, 1273, 1014, 29918, 6448, 29885, 29897, 13, 13, 9651, 2060, 29918, 655, 2496, 353, 1583, 3032, 657, 29918, 4836, 29918, 655, 2496, 29898, 4703, 29892, 13, 462, 462, 462, 418, 3030, 29889, 4836, 29918, 333, 29897, 13, 13, 9651, 6993, 29918, 13155, 353, 1583, 3032, 657, 29918, 18121, 29918, 8926, 29918, 13155, 29918, 1761, 29898, 13, 18884, 3030, 29892, 2060, 29918, 655, 2496, 29897, 13, 9651, 302, 1199, 353, 1583, 3032, 657, 29918, 18121, 29918, 29876, 1199, 29898, 4703, 29892, 2060, 29918, 655, 2496, 29897, 13, 13, 9651, 13113, 29918, 2974, 353, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3258, 29918, 2974, 29898, 13, 18884, 1024, 29892, 1967, 29918, 999, 29892, 1014, 29918, 29888, 4112, 272, 29918, 333, 29892, 12700, 29922, 19635, 29892, 13, 18884, 2066, 29922, 14748, 29918, 21920, 29918, 5325, 29892, 13, 18884, 620, 20525, 29918, 333, 29922, 8758, 29889, 690, 20525, 29918, 333, 29892, 13, 18884, 6993, 29918, 13155, 29922, 8926, 29918, 13155, 29892, 13, 18884, 302, 1199, 29922, 29876, 1199, 29892, 13, 18884, 20847, 3097, 29918, 8028, 29922, 4836, 29918, 655, 2496, 29889, 657, 703, 485, 737, 3097, 29918, 8028, 613, 6213, 511, 13, 18884, 2908, 29918, 10141, 29918, 20698, 29918, 29894, 29906, 29922, 1491, 29918, 6448, 29885, 29897, 13, 13, 9651, 25401, 29889, 8382, 877, 10685, 363, 1923, 6136, 1495, 13, 9651, 1018, 29901, 13, 18884, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3198, 29918, 3258, 29918, 2974, 29918, 8835, 29898, 13, 462, 1678, 13113, 29918, 2974, 29897, 13, 9651, 5174, 8960, 408, 429, 29901, 13, 18884, 396, 9679, 1627, 13, 18884, 411, 5566, 13239, 29889, 7620, 29918, 392, 29918, 13941, 895, 29918, 11739, 7295, 13, 462, 1678, 13113, 29918, 2974, 29889, 8143, 580, 13, 9651, 25401, 29889, 8382, 877, 3258, 1923, 2551, 11296, 18598, 21004, 1495, 13, 13, 9651, 1018, 29901, 13, 18884, 396, 2777, 611, 2496, 13, 18884, 1819, 353, 11117, 18121, 29918, 8758, 29918, 333, 2396, 13113, 29918, 2974, 29889, 333, 29913, 13, 18884, 1583, 29889, 1113, 29874, 29918, 2585, 29918, 2754, 29889, 8758, 29918, 655, 2496, 29918, 3258, 29898, 4703, 29892, 13, 462, 462, 462, 539, 2777, 29889, 25118, 29892, 13, 462, 462, 462, 539, 2777, 29889, 4836, 29918, 333, 29892, 13, 462, 462, 462, 539, 1819, 29897, 13, 9651, 5174, 8960, 408, 429, 29901, 13, 18884, 25401, 29889, 11739, 7373, 1307, 703, 8758, 29918, 655, 2496, 29918, 3258, 5229, 29991, 429, 353, 1273, 29879, 4968, 429, 29897, 13, 18884, 13113, 29918, 2974, 29889, 8143, 580, 13, 18884, 12020, 13, 13, 9651, 5067, 29918, 1761, 353, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 13248, 29918, 1761, 29898, 13, 18884, 13113, 29918, 2974, 29897, 13, 9651, 474, 567, 353, 5159, 13, 9651, 363, 5067, 297, 5067, 29918, 1761, 29901, 13, 18884, 10377, 353, 5067, 29889, 20227, 29918, 4512, 29961, 29900, 1822, 657, 877, 666, 29918, 7328, 1495, 13, 18884, 474, 567, 29889, 4397, 29898, 666, 29897, 13, 9651, 2777, 29918, 4512, 353, 13420, 4286, 7122, 29898, 4512, 29897, 13, 9651, 25401, 29889, 8382, 877, 6092, 272, 1481, 4744, 2777, 29918, 4512, 1273, 29879, 29915, 1273, 2777, 29918, 4512, 29897, 13, 9651, 2777, 29889, 5205, 29918, 19635, 1839, 8758, 29918, 4512, 2033, 353, 2777, 29918, 4512, 13, 9651, 2777, 29889, 5205, 29918, 19635, 1839, 8758, 29918, 333, 2033, 353, 13113, 29918, 2974, 29889, 333, 13, 9651, 1018, 29901, 13, 18884, 2777, 29889, 7620, 580, 13, 9651, 5174, 8960, 29901, 13, 18884, 1209, 13, 18884, 396, 12020, 3682, 29918, 735, 29889, 4998, 11371, 17776, 29898, 13, 18884, 396, 1678, 2777, 29918, 25118, 29922, 8758, 29889, 25118, 29897, 13, 4706, 5174, 3682, 29918, 735, 29889, 4998, 11371, 17776, 29901, 13, 9651, 12020, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 25401, 29889, 2704, 29898, 13, 18884, 525, 2451, 746, 29178, 29892, 3682, 29901, 1273, 29879, 29915, 1273, 9637, 1627, 29889, 4830, 29918, 735, 29883, 29898, 29872, 876, 13, 9651, 12020, 8960, 29898, 13, 18884, 525, 2451, 746, 29178, 29892, 3682, 29901, 1273, 29879, 29915, 1273, 9637, 1627, 29889, 4830, 29918, 735, 29883, 29898, 29872, 876, 13, 13, 1678, 822, 29178, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 1967, 29918, 7299, 29892, 11658, 287, 29918, 5325, 29892, 13, 795, 4113, 29918, 5630, 29892, 3564, 29918, 3888, 29922, 8516, 29892, 2908, 29918, 10141, 29918, 3888, 29922, 8516, 1125, 13, 4706, 9995, 4391, 263, 716, 2777, 29914, 9219, 29914, 7247, 373, 278, 6901, 2133, 7481, 29889, 13, 13, 4706, 9038, 445, 8472, 1614, 2167, 29892, 278, 2777, 881, 367, 13, 4706, 2734, 313, 13519, 29918, 3859, 29889, 29934, 3904, 29940, 4214, 467, 13, 13, 4706, 960, 445, 8465, 29892, 738, 7687, 2777, 881, 367, 6446, 13, 4706, 5941, 287, 701, 29892, 322, 278, 6901, 2133, 7481, 881, 367, 297, 278, 2106, 13, 4706, 393, 372, 471, 1434, 445, 1246, 4689, 29889, 13, 13, 4706, 584, 3207, 3030, 29901, 6993, 3030, 13, 4706, 584, 3207, 2777, 29901, 26121, 29889, 12650, 29889, 8758, 29889, 4998, 13, 462, 308, 910, 740, 881, 671, 278, 848, 727, 304, 10754, 13, 462, 308, 278, 11265, 310, 278, 716, 2777, 29889, 13, 462, 308, 2799, 749, 29898, 13, 462, 632, 2130, 29918, 666, 29918, 29894, 29946, 29922, 8516, 29892, 13, 462, 632, 2130, 29918, 666, 29918, 29894, 29953, 29922, 8516, 29892, 13, 462, 632, 11258, 29922, 8516, 29892, 13, 462, 632, 4469, 29918, 20960, 29918, 2917, 29922, 8824, 29892, 13, 462, 632, 20847, 3097, 29918, 8028, 2433, 834, 29941, 29896, 29889, 845, 4666, 3169, 489, 10467, 742, 13, 462, 632, 3038, 29918, 978, 29922, 8516, 29892, 13, 462, 632, 5941, 287, 29922, 8824, 29892, 13, 462, 632, 2295, 29918, 21594, 2433, 742, 13, 462, 632, 2825, 29918, 271, 29922, 29906, 29900, 29896, 29945, 29899, 29900, 29947, 29899, 29941, 29896, 29911, 29900, 29906, 29901, 29946, 29946, 29901, 29941, 29953, 29999, 29892, 13, 462, 632, 2322, 29918, 29872, 561, 331, 13537, 29918, 10141, 29922, 8516, 29892, 13, 462, 632, 2322, 29918, 26276, 29918, 10141, 29922, 8516, 29892, 13, 462, 632, 11132, 29922, 8824, 29892, 13, 462, 632, 11132, 29918, 271, 29922, 8516, 29892, 13, 462, 632, 11262, 29918, 18821, 403, 29922, 8824, 29892, 13, 462, 632, 2479, 29918, 8216, 2433, 2974, 29992, 1388, 29874, 29945, 29872, 29896, 29955, 29883, 29899, 10702, 29906, 29883, 29899, 29946, 29900, 29896, 29946, 29899, 29929, 29955, 29906, 29953, 29899, 29890, 29955, 29955, 29896, 29900, 29929, 29941, 29947, 29900, 1113, 29953, 742, 13, 462, 632, 2479, 29918, 978, 2433, 2974, 29992, 1388, 29874, 29945, 29872, 29896, 29955, 29883, 29899, 10702, 29906, 29883, 29899, 29946, 29900, 29896, 29946, 29899, 29929, 29955, 29906, 29953, 29899, 29890, 29955, 29955, 29896, 29900, 29929, 29941, 29947, 29900, 1113, 29953, 742, 13, 462, 632, 321, 561, 331, 13537, 29918, 26300, 29922, 29900, 29892, 13, 462, 632, 321, 561, 331, 13537, 29918, 1989, 29918, 25118, 29922, 8516, 29892, 13, 462, 632, 12570, 29922, 8169, 10202, 13, 462, 632, 3495, 2433, 29946, 29906, 29900, 29947, 29945, 29933, 29941, 29947, 29899, 29953, 29947, 29941, 29928, 29899, 29955, 29946, 29945, 29945, 29899, 29909, 29953, 29909, 29941, 29899, 29945, 29906, 29943, 29941, 29945, 4037, 29929, 29906, 29929, 29923, 29941, 742, 13, 462, 632, 3495, 978, 2433, 2974, 1388, 29874, 29945, 29872, 29896, 29955, 29883, 29899, 10702, 29906, 29883, 29899, 29946, 29900, 29896, 29946, 29899, 29929, 29955, 29906, 29953, 29899, 29890, 29955, 29955, 29896, 29900, 29929, 29941, 29947, 29900, 1113, 29953, 742, 13, 462, 632, 1178, 29922, 29946, 29929, 29892, 13, 462, 632, 1967, 29918, 999, 2433, 29953, 29900, 29900, 29946, 29890, 29946, 29955, 29890, 29899, 29881, 29946, 29945, 29941, 29899, 29946, 29953, 29929, 29945, 29899, 29947, 29896, 915, 29899, 2252, 29896, 29906, 29955, 29872, 29906, 29941, 29888, 29945, 29929, 29872, 742, 13, 462, 632, 5235, 29918, 8173, 29922, 4998, 3401, 10408, 29892, 13, 462, 632, 2777, 29918, 1853, 29918, 333, 29922, 29906, 29892, 13, 462, 632, 8466, 29918, 333, 2433, 742, 13, 462, 632, 1820, 29918, 1272, 29922, 8516, 29892, 13, 462, 632, 1820, 29918, 978, 29922, 8516, 29892, 13, 462, 632, 6826, 29918, 2248, 29922, 29900, 29892, 13, 462, 632, 15241, 29918, 271, 29922, 8516, 29892, 13, 462, 632, 15241, 29918, 265, 2433, 29946, 29906, 29900, 29947, 29945, 29933, 29941, 29947, 29899, 29953, 29947, 29941, 29928, 29899, 29955, 29946, 29945, 29945, 29899, 29909, 29953, 29909, 29941, 29899, 29945, 29906, 29943, 29941, 29945, 4037, 29929, 29906, 29929, 29923, 29941, 742, 13, 462, 632, 22822, 29922, 8824, 29892, 13, 462, 632, 22822, 29918, 1609, 29922, 8516, 29892, 13, 462, 632, 3370, 29918, 8337, 29922, 29945, 29896, 29906, 29892, 13, 462, 632, 15562, 3790, 1118, 13, 462, 632, 2943, 2433, 29882, 742, 13, 462, 632, 954, 29874, 29918, 3332, 3002, 29922, 8516, 29892, 13, 462, 632, 2897, 29918, 1853, 29922, 8516, 29892, 13, 462, 632, 282, 455, 29918, 3359, 1575, 29922, 8169, 10202, 13, 462, 632, 3081, 29918, 3859, 29922, 29900, 29892, 13, 462, 632, 6728, 29922, 29900, 29892, 13, 462, 632, 2060, 29918, 333, 2433, 29945, 29906, 29929, 29945, 29955, 328, 29929, 29906, 29890, 29906, 29896, 29946, 29953, 29874, 29900, 29874, 29906, 29872, 29906, 29890, 29941, 29906, 29955, 29929, 2252, 29883, 29906, 29883, 29945, 29874, 742, 13, 462, 632, 13472, 20960, 29918, 333, 2433, 742, 13, 462, 632, 620, 20525, 29918, 333, 2433, 29878, 29899, 29881, 29896, 8181, 311, 29946, 29916, 742, 13, 462, 632, 3876, 29918, 10141, 29918, 978, 2433, 29914, 3359, 29914, 29879, 1388, 742, 13, 462, 632, 3876, 29918, 26300, 29922, 29896, 29892, 13, 462, 632, 21467, 29918, 271, 29922, 8516, 29892, 13, 462, 632, 6993, 29918, 13155, 29922, 13228, 4782, 1293, 29892, 13, 462, 632, 12522, 3204, 29918, 18821, 403, 29922, 8824, 29892, 13, 462, 632, 1788, 29918, 19635, 3790, 13, 462, 462, 1967, 29918, 3188, 29918, 3027, 29918, 999, 2433, 29953, 29900, 29900, 29946, 29890, 29946, 29955, 29890, 29899, 29881, 29946, 29945, 29941, 29899, 29946, 29953, 29929, 29945, 29899, 29947, 29896, 915, 29899, 2252, 29896, 29906, 29955, 29872, 29906, 29941, 29888, 29945, 29929, 29872, 742, 13, 462, 462, 1967, 29918, 7611, 29918, 4830, 2433, 18354, 742, 13, 462, 462, 1967, 29918, 20960, 29918, 4830, 2433, 29939, 20587, 29906, 742, 13, 462, 462, 1967, 29918, 1195, 29918, 20960, 2433, 29896, 742, 13, 462, 462, 1967, 29918, 1195, 29918, 2572, 2433, 29900, 742, 13, 462, 462, 2777, 29918, 1853, 29918, 29872, 561, 331, 13537, 29918, 26300, 2433, 29900, 742, 13, 462, 462, 2777, 29918, 1853, 29918, 29888, 4112, 272, 333, 2433, 29896, 742, 13, 462, 462, 2777, 29918, 1853, 29918, 333, 2433, 29906, 742, 13, 462, 462, 2777, 29918, 1853, 29918, 14834, 29918, 8337, 2433, 29945, 29896, 29906, 742, 13, 462, 462, 2777, 29918, 1853, 29918, 978, 2433, 29885, 29896, 29889, 25649, 742, 13, 462, 462, 2777, 29918, 1853, 29918, 4632, 29918, 26300, 2433, 29896, 742, 13, 462, 462, 2777, 29918, 1853, 29918, 29878, 486, 29916, 29918, 19790, 2433, 29896, 29889, 29900, 742, 13, 462, 462, 2777, 29918, 1853, 29918, 26276, 2433, 29900, 742, 13, 462, 462, 2777, 29918, 1853, 29918, 7071, 3746, 29918, 7915, 29922, 8516, 29892, 13, 462, 462, 2777, 29918, 1853, 29918, 29894, 6814, 375, 2433, 29896, 29915, 13, 462, 462, 2981, 13, 462, 632, 3414, 29918, 3859, 2433, 1028, 1450, 1076, 742, 13, 462, 632, 29185, 29918, 271, 29922, 8516, 29892, 13, 462, 632, 4784, 29918, 271, 29922, 29906, 29900, 29896, 29945, 29899, 29900, 29947, 29899, 29941, 29896, 29911, 29900, 29906, 29901, 29946, 29946, 29901, 29941, 29947, 29999, 29892, 13, 462, 632, 1404, 29918, 1272, 29922, 29884, 29915, 29966, 29903, 2190, 1806, 26664, 3352, 10202, 13, 462, 632, 1404, 29918, 333, 2433, 11248, 29946, 29941, 29929, 29941, 29890, 29896, 29929, 29953, 29953, 29947, 29946, 29883, 29947, 2291, 29929, 29900, 29955, 29896, 29906, 29929, 29896, 29947, 29896, 29906, 29929, 29900, 29872, 29947, 29881, 742, 13, 462, 632, 318, 5416, 29922, 29929, 29906, 29881, 29906, 29906, 29874, 29953, 29906, 29899, 29883, 29941, 29953, 29946, 29899, 29946, 29896, 29953, 29929, 29899, 29929, 29955, 29929, 29945, 29899, 29872, 29945, 29874, 29941, 29946, 29890, 29945, 29888, 29945, 29929, 29953, 29947, 29892, 13, 462, 632, 325, 6814, 375, 29922, 29896, 29892, 13, 462, 632, 22419, 29918, 8513, 29922, 8516, 29892, 13, 462, 632, 22419, 29918, 3859, 2433, 25237, 1495, 13, 4706, 584, 3207, 1967, 29918, 7299, 29901, 1967, 1203, 4133, 491, 26121, 29889, 3027, 29889, 3820, 749, 393, 13, 462, 965, 17645, 278, 1967, 515, 607, 304, 6579, 445, 2777, 13, 462, 965, 321, 29889, 29887, 29889, 13, 462, 965, 426, 13, 462, 1669, 318, 29915, 4882, 2396, 318, 29915, 4925, 742, 13, 462, 1669, 318, 29915, 311, 22742, 2396, 7700, 29892, 13, 462, 1669, 318, 29915, 7611, 29918, 4830, 2396, 318, 29915, 18354, 742, 13, 462, 1669, 318, 29915, 1195, 29918, 2572, 2396, 29871, 29900, 29892, 13, 462, 1669, 318, 29915, 21402, 29918, 271, 2396, 318, 29915, 29906, 29900, 29896, 29945, 29899, 29900, 29947, 29899, 29896, 29955, 29911, 29900, 29955, 29901, 29946, 29953, 29901, 29946, 29947, 29889, 29955, 29900, 29947, 29929, 29900, 29941, 742, 13, 462, 1669, 318, 29915, 1195, 29918, 20960, 2396, 29871, 29900, 29892, 13, 462, 1669, 318, 29915, 20348, 2396, 318, 29915, 29945, 29906, 29929, 29945, 29955, 328, 29929, 29906, 29890, 29906, 29896, 29946, 29953, 29874, 29900, 29874, 29906, 29872, 29906, 29890, 29941, 29906, 29955, 29929, 2252, 29883, 29906, 29883, 29945, 29874, 742, 13, 462, 1669, 318, 29915, 275, 29918, 3597, 2396, 5852, 29892, 13, 462, 1669, 318, 29915, 311, 22742, 29918, 271, 2396, 6213, 29892, 13, 462, 1669, 318, 29915, 11330, 2396, 24335, 13, 462, 1669, 318, 29915, 2311, 2396, 29871, 29941, 29941, 29947, 29955, 29941, 29945, 29896, 29900, 29946, 29892, 13, 462, 1669, 318, 29915, 978, 2396, 318, 29915, 331, 497, 29899, 27852, 742, 13, 462, 1669, 318, 29915, 3198, 2083, 2396, 318, 29915, 29900, 29888, 29906, 29906, 29929, 29946, 29883, 29929, 29947, 29883, 29955, 29881, 29896, 29896, 29941, 29888, 29900, 774, 29906, 29953, 328, 29941, 29872, 29955, 29953, 29883, 29947, 29953, 5444, 742, 13, 462, 1669, 318, 29915, 11600, 29918, 271, 2396, 318, 29915, 29906, 29900, 29896, 29945, 29899, 29900, 29947, 29899, 29896, 29955, 29911, 29900, 29955, 29901, 29946, 29953, 29901, 29906, 29900, 29889, 29945, 29947, 29896, 29955, 29900, 29953, 742, 13, 462, 1669, 318, 29915, 20960, 29918, 4830, 2396, 318, 29915, 29939, 20587, 29906, 742, 13, 462, 1669, 318, 29915, 333, 2396, 318, 29915, 29953, 29900, 29900, 29946, 29890, 29946, 29955, 29890, 29899, 29881, 29946, 29945, 29941, 29899, 29946, 29953, 29929, 29945, 29899, 29947, 29896, 915, 29899, 2252, 29896, 29906, 29955, 29872, 29906, 29941, 29888, 29945, 29929, 29872, 29915, 13, 462, 9651, 500, 13, 13, 4706, 584, 3207, 11658, 287, 29918, 5325, 29901, 4911, 2066, 304, 11658, 964, 2777, 29889, 13, 4706, 584, 3207, 4113, 29918, 5630, 29901, 529, 25711, 17013, 29958, 4800, 304, 731, 297, 2777, 29889, 13, 4706, 584, 3207, 3564, 29918, 3888, 29901, 13, 965, 584, 2272, 29901, 29885, 621, 18078, 30022, 29876, 4273, 29889, 11618, 29889, 12847, 29889, 13724, 3260, 29889, 657, 29918, 8758, 29918, 29876, 29893, 29918, 3888, 29952, 13, 4706, 584, 3207, 2908, 29918, 10141, 29918, 3888, 29901, 10343, 1048, 2908, 9224, 304, 367, 13, 462, 462, 29871, 10959, 304, 278, 2777, 29889, 13, 4706, 9995, 13, 13, 4706, 396, 1583, 3032, 19672, 29918, 3069, 29898, 4703, 29892, 3564, 29918, 3888, 29892, 2777, 29889, 25118, 29897, 13, 4706, 1583, 3032, 1028, 18101, 29898, 4703, 29892, 2777, 29892, 1967, 29918, 7299, 29892, 11658, 287, 29918, 5325, 29892, 13, 462, 1678, 4113, 29918, 5630, 29892, 3564, 29918, 3888, 29892, 2908, 29918, 10141, 29918, 3888, 29897, 13, 4706, 396, 1583, 3032, 19672, 29918, 3069, 29898, 4703, 29892, 3564, 29918, 3888, 29892, 2777, 29889, 25118, 29897, 13, 13, 1678, 822, 19957, 29898, 1311, 29892, 2777, 1125, 13, 4706, 3030, 353, 12428, 29918, 4703, 29889, 3089, 2677, 29898, 275, 29918, 6406, 29922, 5574, 29892, 13, 462, 462, 632, 2060, 29918, 333, 29922, 8758, 29889, 4836, 29918, 333, 29897, 13, 4706, 13113, 29918, 8758, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29898, 4703, 29892, 2777, 29897, 13, 4706, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 29886, 1071, 29898, 18121, 29918, 8758, 29897, 13, 4706, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3198, 29918, 29886, 1071, 29918, 2974, 29918, 8835, 29898, 13, 9651, 13113, 29918, 8758, 29897, 13, 13, 1678, 822, 443, 29886, 1071, 29898, 1311, 29892, 2777, 1125, 13, 4706, 3030, 353, 12428, 29918, 4703, 29889, 3089, 2677, 29898, 275, 29918, 6406, 29922, 5574, 29892, 13, 462, 462, 632, 2060, 29918, 333, 29922, 8758, 29889, 4836, 29918, 333, 29897, 13, 4706, 13113, 29918, 8758, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29898, 4703, 29892, 2777, 29897, 13, 4706, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 348, 29886, 1071, 29898, 18121, 29918, 8758, 29897, 13, 4706, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3198, 29918, 348, 29886, 1071, 29918, 2974, 29918, 8835, 29898, 13, 9651, 13113, 29918, 8758, 29897, 13, 13, 1678, 822, 1014, 29918, 29888, 4112, 272, 29918, 16432, 29898, 1311, 29892, 3030, 1125, 13, 4706, 9995, 657, 21054, 272, 9493, 15945, 29908, 13, 13, 4706, 3240, 353, 5159, 13, 4706, 1014, 29918, 29888, 4112, 943, 353, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 657, 29918, 29888, 4112, 272, 29918, 16432, 580, 13, 4706, 363, 1014, 29918, 29888, 4112, 272, 297, 1014, 29918, 29888, 4112, 943, 29901, 13, 9651, 3240, 29889, 4397, 29898, 1491, 29918, 29888, 4112, 272, 3032, 3888, 29897, 13, 13, 4706, 736, 3240, 13, 13, 1678, 822, 19508, 29898, 1311, 29892, 274, 3945, 29892, 2777, 29892, 2479, 29918, 978, 29922, 8516, 1125, 13, 4706, 13113, 29918, 25118, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29918, 333, 29898, 312, 486, 29892, 2777, 29889, 25118, 29897, 13, 4706, 565, 451, 2479, 29918, 978, 29901, 13, 9651, 2479, 29918, 978, 353, 2777, 29889, 4990, 29918, 978, 13, 13, 4706, 13113, 29918, 978, 353, 1583, 3032, 17158, 29918, 18121, 29918, 8758, 29918, 978, 29898, 4990, 29918, 978, 29892, 13, 462, 462, 462, 795, 2777, 29889, 25118, 29897, 13, 4706, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 312, 486, 467, 1267, 420, 29898, 18121, 29918, 25118, 29892, 13113, 29918, 978, 29897, 13, 13, 1678, 822, 679, 29918, 6051, 20921, 29898, 1311, 29892, 2777, 1125, 13, 4706, 3030, 353, 12428, 29918, 4703, 29889, 3089, 2677, 29898, 275, 29918, 6406, 29922, 5574, 29892, 13, 462, 462, 632, 2060, 29918, 333, 29922, 8758, 29889, 4836, 29918, 333, 29897, 13, 4706, 13113, 29918, 25118, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29918, 333, 29898, 4703, 29892, 2777, 29889, 25118, 29897, 13, 4706, 736, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 657, 29918, 6051, 20921, 29898, 18121, 29918, 25118, 29897, 13, 13, 1678, 822, 679, 29918, 8758, 29918, 6051, 20921, 29898, 1311, 29892, 2777, 1125, 13, 4706, 3030, 353, 12428, 29918, 4703, 29889, 3089, 2677, 29898, 275, 29918, 6406, 29922, 5574, 29892, 13, 462, 462, 632, 2060, 29918, 333, 29922, 8758, 29889, 4836, 29918, 333, 29897, 13, 4706, 13113, 29918, 25118, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29918, 333, 29898, 4703, 29892, 2777, 29889, 25118, 29897, 13, 4706, 736, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 657, 29918, 6051, 20921, 29898, 18121, 29918, 25118, 29897, 13, 13, 1678, 822, 620, 2017, 29918, 3859, 29918, 265, 29918, 3069, 29918, 4777, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 3564, 29918, 3888, 29892, 13, 462, 462, 29871, 2908, 29918, 10141, 29918, 3888, 29922, 8516, 1125, 13, 4706, 9995, 690, 2017, 17838, 2106, 746, 263, 3495, 338, 1045, 5715, 1213, 15945, 13, 4706, 396, 5399, 565, 278, 2777, 338, 2734, 2307, 322, 4772, 2599, 13, 4706, 396, 3099, 565, 372, 338, 29889, 13, 4706, 1018, 29901, 13, 9651, 13113, 29918, 8758, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29898, 4703, 29892, 2777, 29897, 13, 13, 9651, 17262, 29918, 28631, 353, 4852, 17923, 18474, 613, 13, 462, 795, 376, 29903, 3308, 29925, 1430, 2287, 29928, 613, 13, 462, 795, 376, 7228, 17171, 29928, 1159, 13, 13, 9651, 565, 13113, 29918, 8758, 29889, 4882, 297, 17262, 29918, 28631, 29901, 13, 18884, 736, 13, 13, 9651, 13113, 29918, 8758, 29889, 276, 4777, 877, 29950, 17011, 1495, 13, 4706, 5174, 3682, 29889, 29940, 4273, 2451, 29901, 13, 9651, 1209, 13, 13, 1678, 822, 26429, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 3564, 29918, 3888, 29892, 1967, 29918, 7299, 29892, 13, 1669, 26429, 29918, 5630, 1125, 13, 13, 4706, 13113, 29918, 8758, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29898, 4703, 29892, 2777, 29897, 13, 13, 4706, 26429, 29918, 3027, 29918, 333, 353, 6213, 13, 4706, 565, 1967, 29918, 7299, 29889, 5415, 29918, 5552, 29918, 275, 29918, 842, 703, 333, 29908, 1125, 13, 9651, 26429, 29918, 3027, 29918, 333, 353, 1967, 29918, 7299, 29889, 333, 13, 13, 4706, 1967, 29918, 333, 353, 313, 690, 18376, 29918, 3027, 29918, 333, 470, 8707, 29943, 29889, 1982, 15389, 29889, 690, 18376, 29918, 3027, 29918, 333, 470, 13, 462, 1678, 2777, 29889, 3027, 29918, 999, 29897, 13, 13, 4706, 13113, 29918, 3027, 29918, 333, 353, 1583, 3032, 657, 29918, 18121, 29918, 3027, 29918, 333, 29898, 4703, 29892, 1967, 29918, 333, 29897, 13, 13, 4706, 25401, 29889, 8382, 703, 1817, 29974, 3027, 1178, 353, 1273, 29879, 613, 13113, 29918, 3027, 29918, 333, 29897, 13, 13, 4706, 13113, 29918, 8758, 29889, 690, 18376, 29898, 690, 18376, 29918, 5630, 29892, 13113, 29918, 3027, 29918, 333, 29897, 13, 13, 4706, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3198, 29918, 690, 18376, 29918, 8758, 29918, 8835, 29898, 13, 9651, 13113, 29918, 8758, 29897, 13, 13, 1678, 822, 443, 690, 18376, 29898, 1311, 29892, 2777, 29892, 3564, 29918, 3888, 1125, 13, 13, 4706, 3030, 353, 12428, 29918, 4703, 29889, 3089, 2677, 29898, 275, 29918, 6406, 29922, 5574, 29892, 13, 462, 462, 632, 2060, 29918, 333, 29922, 8758, 29889, 4836, 29918, 333, 29897, 13, 13, 4706, 13113, 29918, 8758, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29898, 4703, 29892, 2777, 29897, 13, 4706, 13113, 29918, 8758, 29889, 348, 690, 18376, 580, 13, 13, 4706, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3198, 29918, 348, 690, 18376, 29918, 8758, 29918, 8835, 29898, 13, 9651, 13113, 29918, 8758, 29897, 13, 13, 1678, 822, 7135, 29918, 7283, 1161, 29918, 15070, 29898, 1311, 29892, 2777, 1125, 13, 4706, 3030, 353, 12428, 29918, 4703, 29889, 3089, 2677, 29898, 275, 29918, 6406, 29922, 5574, 29892, 13, 462, 462, 632, 2060, 29918, 333, 29922, 8758, 29889, 4836, 29918, 333, 29897, 13, 13, 4706, 13113, 29918, 8758, 29918, 25118, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29918, 333, 29898, 4703, 29892, 13, 462, 462, 462, 18884, 2777, 29889, 25118, 29897, 13, 4706, 736, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 21001, 29918, 7283, 1161, 29918, 15070, 29898, 13, 9651, 13113, 29918, 8758, 29918, 25118, 29897, 13, 13, 1678, 822, 731, 29918, 6406, 29918, 5630, 29898, 1311, 29892, 2777, 29892, 716, 29918, 3364, 1125, 13, 4706, 3030, 353, 12428, 29918, 4703, 29889, 3089, 2677, 29898, 275, 29918, 6406, 29922, 5574, 29892, 13, 462, 462, 632, 2060, 29918, 333, 29922, 8758, 29889, 4836, 29918, 333, 29897, 13, 13, 4706, 13113, 29918, 8758, 29918, 25118, 353, 1583, 3032, 657, 29918, 18121, 29918, 8758, 29918, 333, 29898, 4703, 29892, 13, 462, 462, 462, 18884, 2777, 29889, 25118, 29897, 13, 4706, 1583, 29889, 359, 29918, 13715, 562, 1593, 29898, 4703, 467, 3167, 29918, 5630, 29898, 13, 9651, 13113, 29918, 8758, 29918, 25118, 29892, 716, 29918, 3364, 29897, 13, 13, 1678, 822, 679, 29918, 3069, 29918, 21245, 603, 29898, 1311, 1125, 13, 4706, 9995, 11609, 29879, 278, 1121, 310, 5432, 376, 21245, 603, 29908, 1213, 15945, 13, 4706, 714, 29892, 4589, 353, 3667, 29879, 29889, 7978, 877, 6272, 742, 525, 29931, 19453, 29922, 29907, 742, 525, 21245, 603, 1495, 13, 4706, 736, 714, 13, 13, 1678, 822, 10641, 29918, 13248, 29898, 1311, 29892, 2777, 29892, 1967, 29918, 7299, 29892, 325, 361, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 1439, 496, 29918, 13248, 29898, 1311, 29892, 2777, 29892, 325, 361, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 6441, 29918, 3027, 29898, 1311, 29892, 3030, 29892, 2777, 29892, 1967, 29918, 7299, 1125, 13, 13, 4706, 25401, 29889, 8382, 703, 463, 304, 6441, 1967, 613, 2777, 29922, 8758, 29897, 13, 13, 4706, 1967, 29918, 333, 353, 1967, 29918, 7299, 1839, 333, 2033, 13, 4706, 301, 21791, 29918, 24623, 29918, 333, 353, 320, 13, 9651, 2777, 29889, 5205, 29918, 19635, 29889, 657, 877, 29880, 21791, 29918, 24623, 29918, 333, 742, 6213, 29897, 13, 4706, 565, 451, 301, 21791, 29918, 24623, 29918, 333, 29901, 13, 9651, 12020, 3682, 29918, 735, 29889, 29931, 21791, 24679, 17413, 29898, 8758, 29918, 25118, 29922, 8758, 29889, 25118, 29897, 13, 4706, 13113, 29918, 24623, 353, 1583, 3032, 657, 29918, 18121, 29918, 24623, 29898, 4703, 29892, 301, 21791, 29918, 24623, 29918, 333, 29897, 13, 13, 4706, 25401, 29889, 8382, 703, 29880, 21791, 7977, 1178, 353, 1273, 29879, 613, 13113, 29918, 24623, 29889, 333, 29892, 13, 462, 29871, 2777, 29922, 8758, 29897, 13, 4706, 1967, 353, 1583, 3032, 3027, 29918, 2754, 29889, 657, 29898, 4703, 29892, 1967, 29918, 333, 29897, 13, 4706, 25401, 29889, 8382, 703, 1817, 29974, 26828, 29892, 1967, 353, 1273, 29879, 613, 1967, 29897, 13, 13, 4706, 1018, 29901, 13, 9651, 396, 13113, 1653, 1967, 13, 9651, 13113, 29918, 3027, 353, 13113, 29918, 24623, 29889, 9009, 29918, 517, 29918, 3027, 29898, 13, 18884, 5852, 29892, 1967, 3366, 978, 12436, 13, 18884, 1967, 29918, 7299, 29889, 657, 703, 7611, 29899, 4830, 613, 376, 18354, 4968, 13, 18884, 1967, 29918, 7299, 29889, 657, 703, 20960, 29918, 4830, 613, 1967, 29889, 657, 877, 20960, 29918, 4830, 742, 525, 1610, 29915, 4961, 13, 4706, 5174, 8960, 408, 429, 29901, 13, 9651, 25401, 29889, 11739, 7373, 1307, 703, 9009, 1967, 5229, 29991, 429, 353, 1273, 29879, 4968, 429, 29897, 13, 9651, 12020, 13, 13, 4706, 13113, 29918, 3027, 353, 13113, 29918, 3027, 29961, 29896, 29962, 3366, 359, 29899, 24623, 29918, 9009, 29918, 3027, 3108, 13, 13, 4706, 1018, 29901, 13, 9651, 396, 4480, 6441, 1967, 2551, 13, 9651, 1583, 29889, 359, 29918, 29883, 4995, 4645, 29898, 4703, 467, 3198, 29918, 9009, 29918, 3027, 29918, 24623, 29918, 8835, 29898, 13, 18884, 13113, 29918, 24623, 29889, 333, 29897, 13, 13, 9651, 396, 4480, 1967, 4660, 6136, 13, 9651, 1583, 29889, 359, 29918, 3820, 749, 4645, 29898, 4703, 467, 3198, 29918, 3027, 29918, 4925, 29918, 8835, 29898, 13, 18884, 13113, 29918, 3027, 3366, 3027, 29918, 333, 20068, 13, 13, 9651, 396, 2767, 1967, 2875, 13, 9651, 9049, 5085, 353, 6571, 13, 9651, 1967, 29918, 11330, 353, 1967, 29889, 657, 703, 11330, 613, 426, 1800, 13, 9651, 565, 1967, 29918, 11330, 29889, 657, 877, 1649, 359, 29918, 2966, 742, 6213, 1125, 13, 18884, 9049, 5085, 1839, 1649, 359, 29918, 2966, 2033, 353, 1967, 29918, 11330, 29889, 657, 877, 1649, 359, 29918, 2966, 1495, 13, 9651, 565, 1967, 29918, 11330, 29889, 657, 877, 1649, 359, 29918, 1853, 742, 6213, 1125, 13, 18884, 9049, 5085, 1839, 1649, 359, 29918, 1853, 2033, 353, 1967, 29918, 11330, 29889, 657, 877, 1649, 359, 29918, 1853, 1495, 13, 9651, 565, 1967, 29918, 11330, 29889, 657, 877, 1649, 359, 29918, 3259, 742, 6213, 1125, 13, 18884, 9049, 5085, 1839, 1649, 359, 29918, 3259, 2033, 353, 1967, 29918, 11330, 29889, 657, 877, 1649, 359, 29918, 3259, 1495, 13, 9651, 565, 1967, 29918, 11330, 29889, 657, 877, 1649, 29886, 1997, 689, 742, 6213, 1125, 13, 18884, 9049, 5085, 1839, 1649, 29886, 1997, 689, 2033, 353, 1967, 29918, 11330, 29889, 657, 877, 1649, 29886, 1997, 689, 1495, 13, 13, 9651, 1583, 29889, 359, 29918, 3820, 749, 4645, 29898, 4703, 467, 5504, 29898, 18121, 29918, 3027, 3366, 3027, 29918, 333, 12436, 13, 462, 462, 462, 3349, 29918, 11030, 29922, 8516, 29892, 3579, 19290, 29897, 13, 13, 9651, 396, 1653, 1967, 611, 2496, 13, 9651, 1819, 353, 8853, 18121, 29918, 3027, 29918, 333, 1115, 13113, 29918, 3027, 3366, 3027, 29918, 333, 12436, 13, 462, 418, 525, 18121, 29918, 3198, 2083, 2396, 13113, 29918, 3027, 29889, 657, 703, 3198, 2083, 613, 6213, 2915, 13, 9651, 1583, 29889, 1113, 29874, 29918, 2585, 29918, 2754, 29889, 3027, 29918, 655, 2496, 29918, 3258, 29898, 4703, 29892, 1967, 29918, 333, 29892, 13, 462, 462, 18884, 3030, 29889, 4836, 29918, 333, 29892, 13, 462, 462, 18884, 1819, 29897, 13, 13, 4706, 5174, 8960, 408, 429, 29901, 13, 9651, 25401, 29889, 11739, 7373, 1307, 703, 9009, 1967, 5229, 29991, 429, 353, 1273, 29879, 4968, 429, 29897, 13, 9651, 411, 5566, 13239, 29889, 7620, 29918, 392, 29918, 13941, 895, 29918, 11739, 7295, 13, 18884, 1583, 29889, 359, 29918, 3820, 749, 4645, 29898, 4703, 467, 8143, 29898, 18121, 29918, 3027, 3366, 3027, 29918, 333, 20068, 13, 2 ]
proxyclient/linux.py
modwizcode/m1n1
1
6370
<filename>proxyclient/linux.py #!/usr/bin/python from setup import * payload = open(sys.argv[1], "rb").read() dtb = open(sys.argv[2], "rb").read() if len(sys.argv) > 3: initramfs = open(sys.argv[3], "rb").read() initramfs_size = len(initramfs) else: initramfs = None initramfs_size = 0 compressed_size = len(payload) compressed_addr = u.malloc(compressed_size) dtb_addr = u.malloc(len(dtb)) print("Loading %d bytes to 0x%x..0x%x..." % (compressed_size, compressed_addr, compressed_addr + compressed_size)) iface.writemem(compressed_addr, payload, True) print("Loading DTB to 0x%x..." % dtb_addr) iface.writemem(dtb_addr, dtb) kernel_size = 32 * 1024 * 1024 kernel_base = u.memalign(2 * 1024 * 1024, kernel_size) print("Kernel_base: 0x%x" % kernel_base) assert not (kernel_base & 0xffff) if initramfs is not None: initramfs_base = u.memalign(65536, initramfs_size) print("Loading %d initramfs bytes to 0x%x..." % (initramfs_size, initramfs_base)) iface.writemem(initramfs_base, initramfs, True) p.kboot_set_initrd(initramfs_base, initramfs_size) if p.kboot_prepare_dt(dtb_addr): print("DT prepare failed") sys.exit(1) #kernel_size = p.xzdec(compressed_addr, compressed_size) #if kernel_size < 0: #raise Exception("Decompression header check error!",) #print("Uncompressed kernel size: %d bytes" % kernel_size) print("Uncompressing...") iface.dev.timeout = 40 kernel_size = p.gzdec(compressed_addr, compressed_size, kernel_base, kernel_size) print(kernel_size) if kernel_size < 0: raise Exception("Decompression error!") print("Decompress OK...") p.dc_cvau(kernel_base, kernel_size) p.ic_ivau(kernel_base, kernel_size) print("Ready to boot") daif = u.mrs(DAIF) daif |= 0x3c0 u.msr(DAIF, daif) print("DAIF: %x" % daif) p.kboot_boot(kernel_base) iface.ttymode()
[ 1, 529, 9507, 29958, 14701, 4645, 29914, 9389, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 4691, 13, 13, 3166, 6230, 1053, 334, 13, 13, 23813, 353, 1722, 29898, 9675, 29889, 19218, 29961, 29896, 1402, 376, 6050, 2564, 949, 580, 13, 6008, 29890, 353, 1722, 29898, 9675, 29889, 19218, 29961, 29906, 1402, 376, 6050, 2564, 949, 580, 13, 361, 7431, 29898, 9675, 29889, 19218, 29897, 1405, 29871, 29941, 29901, 13, 1678, 2069, 2572, 5847, 353, 1722, 29898, 9675, 29889, 19218, 29961, 29941, 1402, 376, 6050, 2564, 949, 580, 13, 1678, 2069, 2572, 5847, 29918, 2311, 353, 7431, 29898, 2344, 2572, 5847, 29897, 13, 2870, 29901, 13, 1678, 2069, 2572, 5847, 353, 6213, 13, 1678, 2069, 2572, 5847, 29918, 2311, 353, 29871, 29900, 13, 13, 510, 13120, 29918, 2311, 353, 7431, 29898, 23813, 29897, 13, 510, 13120, 29918, 10030, 353, 318, 29889, 27631, 29898, 510, 13120, 29918, 2311, 29897, 13, 13, 6008, 29890, 29918, 10030, 353, 318, 29889, 27631, 29898, 2435, 29898, 6008, 29890, 876, 13, 13, 2158, 703, 23456, 1273, 29881, 6262, 304, 29871, 29900, 29916, 29995, 29916, 636, 29900, 29916, 29995, 29916, 17794, 1273, 313, 510, 13120, 29918, 2311, 29892, 419, 13120, 29918, 10030, 29892, 419, 13120, 29918, 10030, 718, 419, 13120, 29918, 2311, 876, 13, 13, 361, 815, 29889, 15866, 667, 331, 29898, 510, 13120, 29918, 10030, 29892, 20092, 29892, 5852, 29897, 13, 13, 2158, 703, 23456, 360, 24895, 304, 29871, 29900, 29916, 29995, 29916, 17794, 1273, 11636, 29890, 29918, 10030, 29897, 13, 13, 361, 815, 29889, 15866, 667, 331, 29898, 6008, 29890, 29918, 10030, 29892, 11636, 29890, 29897, 13, 13, 17460, 29918, 2311, 353, 29871, 29941, 29906, 334, 29871, 29896, 29900, 29906, 29946, 334, 29871, 29896, 29900, 29906, 29946, 13, 17460, 29918, 3188, 353, 318, 29889, 6954, 2520, 29898, 29906, 334, 29871, 29896, 29900, 29906, 29946, 334, 29871, 29896, 29900, 29906, 29946, 29892, 8466, 29918, 2311, 29897, 13, 13, 2158, 703, 29968, 5851, 29918, 3188, 29901, 29871, 29900, 29916, 29995, 29916, 29908, 1273, 8466, 29918, 3188, 29897, 13, 13, 9294, 451, 313, 17460, 29918, 3188, 669, 29871, 29900, 29916, 17156, 29897, 13, 13, 361, 2069, 2572, 5847, 338, 451, 6213, 29901, 13, 1678, 2069, 2572, 5847, 29918, 3188, 353, 318, 29889, 6954, 2520, 29898, 29953, 29945, 29945, 29941, 29953, 29892, 2069, 2572, 5847, 29918, 2311, 29897, 13, 1678, 1596, 703, 23456, 1273, 29881, 2069, 2572, 5847, 6262, 304, 29871, 29900, 29916, 29995, 29916, 17794, 1273, 313, 2344, 2572, 5847, 29918, 2311, 29892, 2069, 2572, 5847, 29918, 3188, 876, 13, 1678, 565, 815, 29889, 15866, 667, 331, 29898, 2344, 2572, 5847, 29918, 3188, 29892, 2069, 2572, 5847, 29892, 5852, 29897, 13, 1678, 282, 29889, 29895, 4777, 29918, 842, 29918, 2344, 5499, 29898, 2344, 2572, 5847, 29918, 3188, 29892, 2069, 2572, 5847, 29918, 2311, 29897, 13, 13, 361, 282, 29889, 29895, 4777, 29918, 19125, 29918, 6008, 29898, 6008, 29890, 29918, 10030, 1125, 13, 1678, 1596, 703, 12972, 19012, 5229, 1159, 13, 1678, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 29937, 17460, 29918, 2311, 353, 282, 29889, 29916, 29920, 7099, 29898, 510, 13120, 29918, 10030, 29892, 419, 13120, 29918, 2311, 29897, 13, 13, 29937, 361, 8466, 29918, 2311, 529, 29871, 29900, 29901, 13, 1678, 396, 22692, 8960, 703, 2772, 510, 2590, 4839, 1423, 1059, 29991, 613, 29897, 13, 13, 29937, 2158, 703, 2525, 510, 13120, 8466, 2159, 29901, 1273, 29881, 6262, 29908, 1273, 8466, 29918, 2311, 29897, 13, 2158, 703, 2525, 510, 2139, 292, 856, 1159, 13, 13, 361, 815, 29889, 3359, 29889, 15619, 353, 29871, 29946, 29900, 13, 13, 17460, 29918, 2311, 353, 282, 29889, 18828, 7099, 29898, 510, 13120, 29918, 10030, 29892, 419, 13120, 29918, 2311, 29892, 8466, 29918, 3188, 29892, 8466, 29918, 2311, 29897, 13, 2158, 29898, 17460, 29918, 2311, 29897, 13, 13, 361, 8466, 29918, 2311, 529, 29871, 29900, 29901, 13, 1678, 12020, 8960, 703, 2772, 510, 2590, 1059, 29991, 1159, 13, 13, 2158, 703, 2772, 510, 2139, 9280, 856, 1159, 13, 13, 29886, 29889, 13891, 29918, 11023, 585, 29898, 17460, 29918, 3188, 29892, 8466, 29918, 2311, 29897, 13, 29886, 29889, 293, 29918, 440, 585, 29898, 17460, 29918, 3188, 29892, 8466, 29918, 2311, 29897, 13, 13, 2158, 703, 28181, 304, 6579, 1159, 13, 13, 1388, 361, 353, 318, 29889, 29885, 2288, 29898, 7698, 6545, 29897, 13, 1388, 361, 891, 29922, 29871, 29900, 29916, 29941, 29883, 29900, 13, 29884, 29889, 1516, 29878, 29898, 7698, 6545, 29892, 1146, 361, 29897, 13, 2158, 703, 7698, 6545, 29901, 1273, 29916, 29908, 1273, 1146, 361, 29897, 13, 13, 29886, 29889, 29895, 4777, 29918, 4777, 29898, 17460, 29918, 3188, 29897, 13, 361, 815, 29889, 698, 962, 356, 580, 13, 2 ]
tests/test_base_class_erosion_model_output_writers_old_style.py
BCampforts/terrainbento
18
1616445
# coding: utf8 # !/usr/env/python # This file has tests for the old style output writers to ensure backwards # compatibility. All of the existing tests for output writers are kept as is. # There are a few new ones too. import glob import os import numpy as np from terrainbento import Basic, NotCoreNodeBaselevelHandler from terrainbento.utilities import filecmp _TEST_OUTPUT_DIR = os.path.join(os.curdir, "output") _TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "data") def get_output_filepath(filename): return os.path.join(_TEST_OUTPUT_DIR, filename) def cleanup_files(searchpath): files = glob.glob(searchpath) for f in files: os.remove(f) # Some output writers def output_writer_function_a(model): average_elevation = np.mean(model.z[model.grid.core_nodes]) filepath = get_output_filepath(f"ow_func_a.{str(model.model_time)}.txt") with open(filepath, "w") as f: f.write(str(average_elevation)) def output_writer_function_b(model): minimum_elevation = np.min(model.z[model.grid.core_nodes]) filepath = get_output_filepath(f"ow_func_b.{str(model.model_time)}.txt") with open(filepath, "w") as f: f.write(str(minimum_elevation)) class output_writer_class_a(object): def __init__(self, model): self.model = model self.change = model.grid.at_node["cumulative_elevation_change"] def run_one_step(self): average_change = np.mean(self.change[self.model.grid.core_nodes]) model_time_str = str(self.model.model_time) filepath = get_output_filepath(f"ow_class_a.{model_time_str}.txt") with open(filepath, "w") as f: f.write(str(average_change)) class output_writer_class_b(object): def __init__(self, model): self.model = model self.change = model.grid.at_node["cumulative_elevation_change"] def run_one_step(self): min_change = np.min(self.change[self.model.grid.core_nodes]) model_time_str = str(self.model.model_time) filepath = get_output_filepath(f"ow_class_b.{model_time_str}.txt") with open(filepath, "w") as f: f.write(str(min_change)) # Unchanged tests # These tests should have minimal changes to ensure backwards compatibility # I only changed where output files are saved (because failed tests don't clean # up so they fill my test directory with junk files) def test_one_function_writer(clock_08, almost_default_grid): ncnblh = NotCoreNodeBaselevelHandler( almost_default_grid, modify_core_nodes=True, lowering_rate=-1 ) # construct and run model model = Basic( clock_08, almost_default_grid, save_first_timestep=False, water_erodibility=0.0, regolith_transport_parameter=0.0, boundary_handlers={"NotCoreNodeBaselevelHandler": ncnblh}, output_writers={"function": [output_writer_function_a]}, ) model.run() # assert things were done correctly truth_file = os.path.join(_TEST_DATA_DIR, "truth_ow_func_a.20.0.txt") test_file = get_output_filepath("ow_func_a.20.0.txt") assert filecmp(test_file, truth_file) is True model.remove_output_netcdfs() cleanup_files("ow_func_a.*.txt") def test_one_class_writer(clock_08, almost_default_grid): ncnblh = NotCoreNodeBaselevelHandler( almost_default_grid, modify_core_nodes=True, lowering_rate=-1 ) # construct and run model model = Basic( clock_08, almost_default_grid, save_first_timestep=False, water_erodibility=0.0, regolith_transport_parameter=0.0, boundary_handlers={"NotCoreNodeBaselevelHandler": ncnblh}, output_writers={"class": [output_writer_class_a]}, ) model.run() # assert things were done correctly truth_file = os.path.join(_TEST_DATA_DIR, "truth_ow_class_a.20.0.txt") test_file = get_output_filepath("ow_class_a.20.0.txt") assert filecmp(test_file, truth_file) is True model.remove_output_netcdfs() cleanup_files("ow_class_a.*.txt") def test_two_function_writers(clock_08, almost_default_grid): ncnblh = NotCoreNodeBaselevelHandler( almost_default_grid, modify_core_nodes=True, lowering_rate=-1 ) # construct and run model model = Basic( clock_08, almost_default_grid, save_first_timestep=False, water_erodibility=0.0, regolith_transport_parameter=0.0, boundary_handlers={"NotCoreNodeBaselevelHandler": ncnblh}, output_writers={ "function": [output_writer_function_a, output_writer_function_b] }, ) model.run() # assert things were done correctly truth_file = os.path.join(_TEST_DATA_DIR, "truth_ow_func_a.20.0.txt") test_file = get_output_filepath("ow_func_a.20.0.txt") assert filecmp(test_file, truth_file) is True truth_file = os.path.join(_TEST_DATA_DIR, "truth_ow_func_b.20.0.txt") test_file = get_output_filepath("ow_func_b.20.0.txt") assert filecmp(test_file, truth_file) is True model.remove_output_netcdfs() cleanup_files("ow_func_*.txt") def test_two_class_writers(clock_08, almost_default_grid): ncnblh = NotCoreNodeBaselevelHandler( almost_default_grid, modify_core_nodes=True, lowering_rate=-1 ) # construct and run model model = Basic( clock_08, almost_default_grid, save_first_timestep=False, water_erodibility=0.0, regolith_transport_parameter=0.0, boundary_handlers={"NotCoreNodeBaselevelHandler": ncnblh}, output_writers={ "class": [output_writer_class_a, output_writer_class_b] }, ) model.run() # assert things were done correctly truth_file = os.path.join(_TEST_DATA_DIR, "truth_ow_class_a.20.0.txt") test_file = get_output_filepath("ow_class_a.20.0.txt") assert filecmp(test_file, truth_file) is True truth_file = os.path.join(_TEST_DATA_DIR, "truth_ow_class_b.20.0.txt") test_file = get_output_filepath("ow_class_b.20.0.txt") assert filecmp(test_file, truth_file) is True model.remove_output_netcdfs() cleanup_files("ow_class_*.txt") def test_all_four_writers(clock_08, almost_default_grid): ncnblh = NotCoreNodeBaselevelHandler( almost_default_grid, modify_core_nodes=True, lowering_rate=-1 ) # construct and run model model = Basic( clock_08, almost_default_grid, save_first_timestep=False, water_erodibility=0.0, regolith_transport_parameter=0.0, boundary_handlers={"NotCoreNodeBaselevelHandler": ncnblh}, output_writers={ "function": [output_writer_function_a, output_writer_function_b], "class": [output_writer_class_a, output_writer_class_b], }, ) model.run() # assert things were done correctly truth_file = os.path.join(_TEST_DATA_DIR, "truth_ow_func_a.20.0.txt") test_file = get_output_filepath("ow_func_a.20.0.txt") assert filecmp(test_file, truth_file) is True truth_file = os.path.join(_TEST_DATA_DIR, "truth_ow_func_b.20.0.txt") test_file = get_output_filepath("ow_func_b.20.0.txt") assert filecmp(test_file, truth_file) is True truth_file = os.path.join(_TEST_DATA_DIR, "truth_ow_class_a.20.0.txt") test_file = get_output_filepath("ow_class_a.20.0.txt") assert filecmp(test_file, truth_file) is True truth_file = os.path.join(_TEST_DATA_DIR, "truth_ow_class_b.20.0.txt") test_file = get_output_filepath("ow_class_b.20.0.txt") assert filecmp(test_file, truth_file) is True model.remove_output_netcdfs() cleanup_files("ow_func_*.txt") cleanup_files("ow_class_*.txt") # New tests for old style output writers def test_save_first_last_and_multiple_times(clock_08, almost_default_grid): """Test save_first_timestep, save_last_timestep, and saving at multiple timesteps.""" ncnblh = NotCoreNodeBaselevelHandler( almost_default_grid, modify_core_nodes=True, lowering_rate=-1 ) # construct and run model model = Basic( clock_08, almost_default_grid, water_erodibility=0.0, regolith_transport_parameter=0.0, boundary_handlers={"NotCoreNodeBaselevelHandler": ncnblh}, output_writers={ "function": [output_writer_function_a, output_writer_function_b], "class": [output_writer_class_a, output_writer_class_b], }, output_interval=6.0, output_dir=_TEST_OUTPUT_DIR, save_first_timestep=True, save_last_timestep=True, ) model.run() for t in ["0.0", "6.0", "12.0", "18.0", "20.0"]: # assert things were done correctly filename_bases = [ f"ow_func_a.{t}.txt", f"ow_func_b.{t}.txt", f"ow_class_a.{t}.txt", f"ow_class_b.{t}.txt", ] for filename_base in filename_bases: truth_file = os.path.join(_TEST_DATA_DIR, f"truth_{filename_base}") test_file = os.path.join(os.curdir, "output", filename_base) assert filecmp(test_file, truth_file) is True model.remove_output_netcdfs() cleanup_files(get_output_filepath("ow_func_*.txt")) cleanup_files(get_output_filepath("ow_class_*.txt"))
[ 1, 396, 14137, 29901, 23616, 29947, 13, 29937, 1738, 29914, 4855, 29914, 6272, 29914, 4691, 13, 13, 29937, 910, 934, 756, 6987, 363, 278, 2030, 3114, 1962, 23550, 304, 9801, 28953, 13, 29937, 24521, 29889, 2178, 310, 278, 5923, 6987, 363, 1962, 23550, 526, 8126, 408, 338, 29889, 13, 29937, 1670, 526, 263, 2846, 716, 6743, 2086, 29889, 13, 13, 5215, 13149, 13, 5215, 2897, 13, 13, 5215, 12655, 408, 7442, 13, 13, 3166, 28439, 29890, 9239, 1053, 19219, 29892, 2216, 9203, 4247, 5160, 5563, 4598, 13, 3166, 28439, 29890, 9239, 29889, 4422, 1907, 1053, 934, 21058, 13, 13, 29918, 18267, 29918, 12015, 12336, 29918, 9464, 353, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2764, 3972, 29892, 376, 4905, 1159, 13, 29918, 18267, 29918, 14573, 29918, 9464, 353, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 511, 376, 1272, 1159, 13, 13, 13, 1753, 679, 29918, 4905, 29918, 1445, 2084, 29898, 9507, 1125, 13, 1678, 736, 2897, 29889, 2084, 29889, 7122, 7373, 18267, 29918, 12015, 12336, 29918, 9464, 29892, 10422, 29897, 13, 13, 13, 1753, 5941, 786, 29918, 5325, 29898, 4478, 2084, 1125, 13, 1678, 2066, 353, 13149, 29889, 23705, 29898, 4478, 2084, 29897, 13, 1678, 363, 285, 297, 2066, 29901, 13, 4706, 2897, 29889, 5992, 29898, 29888, 29897, 13, 13, 13, 29937, 3834, 1962, 23550, 13, 1753, 1962, 29918, 13236, 29918, 2220, 29918, 29874, 29898, 4299, 1125, 13, 1678, 6588, 29918, 29872, 2608, 362, 353, 7442, 29889, 12676, 29898, 4299, 29889, 29920, 29961, 4299, 29889, 7720, 29889, 3221, 29918, 18010, 2314, 13, 13, 1678, 934, 2084, 353, 679, 29918, 4905, 29918, 1445, 2084, 29898, 29888, 29908, 340, 29918, 9891, 29918, 29874, 29889, 29912, 710, 29898, 4299, 29889, 4299, 29918, 2230, 29512, 3945, 1159, 13, 1678, 411, 1722, 29898, 1445, 2084, 29892, 376, 29893, 1159, 408, 285, 29901, 13, 4706, 285, 29889, 3539, 29898, 710, 29898, 12483, 482, 29918, 29872, 2608, 362, 876, 13, 13, 13, 1753, 1962, 29918, 13236, 29918, 2220, 29918, 29890, 29898, 4299, 1125, 13, 1678, 9212, 29918, 29872, 2608, 362, 353, 7442, 29889, 1195, 29898, 4299, 29889, 29920, 29961, 4299, 29889, 7720, 29889, 3221, 29918, 18010, 2314, 13, 1678, 934, 2084, 353, 679, 29918, 4905, 29918, 1445, 2084, 29898, 29888, 29908, 340, 29918, 9891, 29918, 29890, 29889, 29912, 710, 29898, 4299, 29889, 4299, 29918, 2230, 29512, 3945, 1159, 13, 1678, 411, 1722, 29898, 1445, 2084, 29892, 376, 29893, 1159, 408, 285, 29901, 13, 4706, 285, 29889, 3539, 29898, 710, 29898, 1195, 12539, 29918, 29872, 2608, 362, 876, 13, 13, 13, 1990, 1962, 29918, 13236, 29918, 1990, 29918, 29874, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1904, 1125, 13, 4706, 1583, 29889, 4299, 353, 1904, 13, 4706, 1583, 29889, 3167, 353, 1904, 29889, 7720, 29889, 271, 29918, 3177, 3366, 29883, 398, 28524, 29918, 29872, 2608, 362, 29918, 3167, 3108, 13, 13, 1678, 822, 1065, 29918, 650, 29918, 10568, 29898, 1311, 1125, 13, 4706, 6588, 29918, 3167, 353, 7442, 29889, 12676, 29898, 1311, 29889, 3167, 29961, 1311, 29889, 4299, 29889, 7720, 29889, 3221, 29918, 18010, 2314, 13, 4706, 1904, 29918, 2230, 29918, 710, 353, 851, 29898, 1311, 29889, 4299, 29889, 4299, 29918, 2230, 29897, 13, 4706, 934, 2084, 353, 679, 29918, 4905, 29918, 1445, 2084, 29898, 29888, 29908, 340, 29918, 1990, 29918, 29874, 29889, 29912, 4299, 29918, 2230, 29918, 710, 1836, 3945, 1159, 13, 4706, 411, 1722, 29898, 1445, 2084, 29892, 376, 29893, 1159, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 29898, 710, 29898, 12483, 482, 29918, 3167, 876, 13, 13, 13, 1990, 1962, 29918, 13236, 29918, 1990, 29918, 29890, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1904, 1125, 13, 4706, 1583, 29889, 4299, 353, 1904, 13, 4706, 1583, 29889, 3167, 353, 1904, 29889, 7720, 29889, 271, 29918, 3177, 3366, 29883, 398, 28524, 29918, 29872, 2608, 362, 29918, 3167, 3108, 13, 13, 1678, 822, 1065, 29918, 650, 29918, 10568, 29898, 1311, 1125, 13, 4706, 1375, 29918, 3167, 353, 7442, 29889, 1195, 29898, 1311, 29889, 3167, 29961, 1311, 29889, 4299, 29889, 7720, 29889, 3221, 29918, 18010, 2314, 13, 4706, 1904, 29918, 2230, 29918, 710, 353, 851, 29898, 1311, 29889, 4299, 29889, 4299, 29918, 2230, 29897, 13, 4706, 934, 2084, 353, 679, 29918, 4905, 29918, 1445, 2084, 29898, 29888, 29908, 340, 29918, 1990, 29918, 29890, 29889, 29912, 4299, 29918, 2230, 29918, 710, 1836, 3945, 1159, 13, 4706, 411, 1722, 29898, 1445, 2084, 29892, 376, 29893, 1159, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 29898, 710, 29898, 1195, 29918, 3167, 876, 13, 13, 13, 29937, 853, 15033, 6987, 13, 29937, 4525, 6987, 881, 505, 13114, 3620, 304, 9801, 28953, 24521, 13, 29937, 306, 871, 3939, 988, 1962, 2066, 526, 7160, 313, 18103, 5229, 6987, 1016, 29915, 29873, 5941, 13, 29937, 701, 577, 896, 5445, 590, 1243, 3884, 411, 432, 2960, 2066, 29897, 13, 13, 13, 1753, 1243, 29918, 650, 29918, 2220, 29918, 13236, 29898, 13058, 29918, 29900, 29947, 29892, 4359, 29918, 4381, 29918, 7720, 1125, 13, 1678, 302, 18038, 2204, 29882, 353, 2216, 9203, 4247, 5160, 5563, 4598, 29898, 13, 4706, 4359, 29918, 4381, 29918, 7720, 29892, 6623, 29918, 3221, 29918, 18010, 29922, 5574, 29892, 5224, 292, 29918, 10492, 10457, 29896, 13, 1678, 1723, 13, 1678, 396, 3386, 322, 1065, 1904, 13, 1678, 1904, 353, 19219, 29898, 13, 4706, 12006, 29918, 29900, 29947, 29892, 13, 4706, 4359, 29918, 4381, 29918, 7720, 29892, 13, 4706, 4078, 29918, 4102, 29918, 9346, 342, 1022, 29922, 8824, 29892, 13, 4706, 4094, 29918, 261, 397, 4127, 29922, 29900, 29889, 29900, 29892, 13, 4706, 1072, 324, 389, 29918, 27882, 29918, 15501, 29922, 29900, 29889, 29900, 29892, 13, 4706, 10452, 29918, 3179, 9306, 3790, 29908, 3664, 9203, 4247, 5160, 5563, 4598, 1115, 302, 18038, 2204, 29882, 1118, 13, 4706, 1962, 29918, 8231, 414, 3790, 29908, 2220, 1115, 518, 4905, 29918, 13236, 29918, 2220, 29918, 29874, 29962, 1118, 13, 1678, 1723, 13, 1678, 1904, 29889, 3389, 580, 13, 13, 1678, 396, 4974, 2712, 892, 2309, 5149, 13, 1678, 8760, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 7373, 18267, 29918, 14573, 29918, 9464, 29892, 376, 509, 2806, 29918, 340, 29918, 9891, 29918, 29874, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 1243, 29918, 1445, 353, 679, 29918, 4905, 29918, 1445, 2084, 703, 340, 29918, 9891, 29918, 29874, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 4974, 934, 21058, 29898, 1688, 29918, 1445, 29892, 8760, 29918, 1445, 29897, 338, 5852, 13, 13, 1678, 1904, 29889, 5992, 29918, 4905, 29918, 1212, 29883, 29069, 580, 13, 1678, 5941, 786, 29918, 5325, 703, 340, 29918, 9891, 29918, 29874, 5575, 29889, 3945, 1159, 13, 13, 13, 1753, 1243, 29918, 650, 29918, 1990, 29918, 13236, 29898, 13058, 29918, 29900, 29947, 29892, 4359, 29918, 4381, 29918, 7720, 1125, 13, 1678, 302, 18038, 2204, 29882, 353, 2216, 9203, 4247, 5160, 5563, 4598, 29898, 13, 4706, 4359, 29918, 4381, 29918, 7720, 29892, 6623, 29918, 3221, 29918, 18010, 29922, 5574, 29892, 5224, 292, 29918, 10492, 10457, 29896, 13, 1678, 1723, 13, 1678, 396, 3386, 322, 1065, 1904, 13, 1678, 1904, 353, 19219, 29898, 13, 4706, 12006, 29918, 29900, 29947, 29892, 13, 4706, 4359, 29918, 4381, 29918, 7720, 29892, 13, 4706, 4078, 29918, 4102, 29918, 9346, 342, 1022, 29922, 8824, 29892, 13, 4706, 4094, 29918, 261, 397, 4127, 29922, 29900, 29889, 29900, 29892, 13, 4706, 1072, 324, 389, 29918, 27882, 29918, 15501, 29922, 29900, 29889, 29900, 29892, 13, 4706, 10452, 29918, 3179, 9306, 3790, 29908, 3664, 9203, 4247, 5160, 5563, 4598, 1115, 302, 18038, 2204, 29882, 1118, 13, 4706, 1962, 29918, 8231, 414, 3790, 29908, 1990, 1115, 518, 4905, 29918, 13236, 29918, 1990, 29918, 29874, 29962, 1118, 13, 1678, 1723, 13, 1678, 1904, 29889, 3389, 580, 13, 13, 1678, 396, 4974, 2712, 892, 2309, 5149, 13, 1678, 8760, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 7373, 18267, 29918, 14573, 29918, 9464, 29892, 376, 509, 2806, 29918, 340, 29918, 1990, 29918, 29874, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 1243, 29918, 1445, 353, 679, 29918, 4905, 29918, 1445, 2084, 703, 340, 29918, 1990, 29918, 29874, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 4974, 934, 21058, 29898, 1688, 29918, 1445, 29892, 8760, 29918, 1445, 29897, 338, 5852, 13, 13, 1678, 1904, 29889, 5992, 29918, 4905, 29918, 1212, 29883, 29069, 580, 13, 1678, 5941, 786, 29918, 5325, 703, 340, 29918, 1990, 29918, 29874, 5575, 29889, 3945, 1159, 13, 13, 13, 1753, 1243, 29918, 10184, 29918, 2220, 29918, 8231, 414, 29898, 13058, 29918, 29900, 29947, 29892, 4359, 29918, 4381, 29918, 7720, 1125, 13, 1678, 302, 18038, 2204, 29882, 353, 2216, 9203, 4247, 5160, 5563, 4598, 29898, 13, 4706, 4359, 29918, 4381, 29918, 7720, 29892, 6623, 29918, 3221, 29918, 18010, 29922, 5574, 29892, 5224, 292, 29918, 10492, 10457, 29896, 13, 1678, 1723, 13, 1678, 396, 3386, 322, 1065, 1904, 13, 1678, 1904, 353, 19219, 29898, 13, 4706, 12006, 29918, 29900, 29947, 29892, 13, 4706, 4359, 29918, 4381, 29918, 7720, 29892, 13, 4706, 4078, 29918, 4102, 29918, 9346, 342, 1022, 29922, 8824, 29892, 13, 4706, 4094, 29918, 261, 397, 4127, 29922, 29900, 29889, 29900, 29892, 13, 4706, 1072, 324, 389, 29918, 27882, 29918, 15501, 29922, 29900, 29889, 29900, 29892, 13, 4706, 10452, 29918, 3179, 9306, 3790, 29908, 3664, 9203, 4247, 5160, 5563, 4598, 1115, 302, 18038, 2204, 29882, 1118, 13, 4706, 1962, 29918, 8231, 414, 3790, 13, 9651, 376, 2220, 1115, 518, 4905, 29918, 13236, 29918, 2220, 29918, 29874, 29892, 1962, 29918, 13236, 29918, 2220, 29918, 29890, 29962, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 1904, 29889, 3389, 580, 13, 13, 1678, 396, 4974, 2712, 892, 2309, 5149, 13, 1678, 8760, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 7373, 18267, 29918, 14573, 29918, 9464, 29892, 376, 509, 2806, 29918, 340, 29918, 9891, 29918, 29874, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 1243, 29918, 1445, 353, 679, 29918, 4905, 29918, 1445, 2084, 703, 340, 29918, 9891, 29918, 29874, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 4974, 934, 21058, 29898, 1688, 29918, 1445, 29892, 8760, 29918, 1445, 29897, 338, 5852, 13, 13, 1678, 8760, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 7373, 18267, 29918, 14573, 29918, 9464, 29892, 376, 509, 2806, 29918, 340, 29918, 9891, 29918, 29890, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 1243, 29918, 1445, 353, 679, 29918, 4905, 29918, 1445, 2084, 703, 340, 29918, 9891, 29918, 29890, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 4974, 934, 21058, 29898, 1688, 29918, 1445, 29892, 8760, 29918, 1445, 29897, 338, 5852, 13, 13, 1678, 1904, 29889, 5992, 29918, 4905, 29918, 1212, 29883, 29069, 580, 13, 1678, 5941, 786, 29918, 5325, 703, 340, 29918, 9891, 29918, 10521, 3945, 1159, 13, 13, 13, 1753, 1243, 29918, 10184, 29918, 1990, 29918, 8231, 414, 29898, 13058, 29918, 29900, 29947, 29892, 4359, 29918, 4381, 29918, 7720, 1125, 13, 1678, 302, 18038, 2204, 29882, 353, 2216, 9203, 4247, 5160, 5563, 4598, 29898, 13, 4706, 4359, 29918, 4381, 29918, 7720, 29892, 6623, 29918, 3221, 29918, 18010, 29922, 5574, 29892, 5224, 292, 29918, 10492, 10457, 29896, 13, 1678, 1723, 13, 1678, 396, 3386, 322, 1065, 1904, 13, 1678, 1904, 353, 19219, 29898, 13, 4706, 12006, 29918, 29900, 29947, 29892, 13, 4706, 4359, 29918, 4381, 29918, 7720, 29892, 13, 4706, 4078, 29918, 4102, 29918, 9346, 342, 1022, 29922, 8824, 29892, 13, 4706, 4094, 29918, 261, 397, 4127, 29922, 29900, 29889, 29900, 29892, 13, 4706, 1072, 324, 389, 29918, 27882, 29918, 15501, 29922, 29900, 29889, 29900, 29892, 13, 4706, 10452, 29918, 3179, 9306, 3790, 29908, 3664, 9203, 4247, 5160, 5563, 4598, 1115, 302, 18038, 2204, 29882, 1118, 13, 4706, 1962, 29918, 8231, 414, 3790, 13, 9651, 376, 1990, 1115, 518, 4905, 29918, 13236, 29918, 1990, 29918, 29874, 29892, 1962, 29918, 13236, 29918, 1990, 29918, 29890, 29962, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 1904, 29889, 3389, 580, 13, 13, 1678, 396, 4974, 2712, 892, 2309, 5149, 13, 1678, 8760, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 7373, 18267, 29918, 14573, 29918, 9464, 29892, 376, 509, 2806, 29918, 340, 29918, 1990, 29918, 29874, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 1243, 29918, 1445, 353, 679, 29918, 4905, 29918, 1445, 2084, 703, 340, 29918, 1990, 29918, 29874, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 4974, 934, 21058, 29898, 1688, 29918, 1445, 29892, 8760, 29918, 1445, 29897, 338, 5852, 13, 13, 1678, 8760, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 7373, 18267, 29918, 14573, 29918, 9464, 29892, 376, 509, 2806, 29918, 340, 29918, 1990, 29918, 29890, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 1243, 29918, 1445, 353, 679, 29918, 4905, 29918, 1445, 2084, 703, 340, 29918, 1990, 29918, 29890, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 4974, 934, 21058, 29898, 1688, 29918, 1445, 29892, 8760, 29918, 1445, 29897, 338, 5852, 13, 13, 1678, 1904, 29889, 5992, 29918, 4905, 29918, 1212, 29883, 29069, 580, 13, 1678, 5941, 786, 29918, 5325, 703, 340, 29918, 1990, 29918, 10521, 3945, 1159, 13, 13, 13, 1753, 1243, 29918, 497, 29918, 17823, 29918, 8231, 414, 29898, 13058, 29918, 29900, 29947, 29892, 4359, 29918, 4381, 29918, 7720, 1125, 13, 1678, 302, 18038, 2204, 29882, 353, 2216, 9203, 4247, 5160, 5563, 4598, 29898, 13, 4706, 4359, 29918, 4381, 29918, 7720, 29892, 6623, 29918, 3221, 29918, 18010, 29922, 5574, 29892, 5224, 292, 29918, 10492, 10457, 29896, 13, 1678, 1723, 13, 13, 1678, 396, 3386, 322, 1065, 1904, 13, 1678, 1904, 353, 19219, 29898, 13, 4706, 12006, 29918, 29900, 29947, 29892, 13, 4706, 4359, 29918, 4381, 29918, 7720, 29892, 13, 4706, 4078, 29918, 4102, 29918, 9346, 342, 1022, 29922, 8824, 29892, 13, 4706, 4094, 29918, 261, 397, 4127, 29922, 29900, 29889, 29900, 29892, 13, 4706, 1072, 324, 389, 29918, 27882, 29918, 15501, 29922, 29900, 29889, 29900, 29892, 13, 4706, 10452, 29918, 3179, 9306, 3790, 29908, 3664, 9203, 4247, 5160, 5563, 4598, 1115, 302, 18038, 2204, 29882, 1118, 13, 4706, 1962, 29918, 8231, 414, 3790, 13, 9651, 376, 2220, 1115, 518, 4905, 29918, 13236, 29918, 2220, 29918, 29874, 29892, 1962, 29918, 13236, 29918, 2220, 29918, 29890, 1402, 13, 9651, 376, 1990, 1115, 518, 4905, 29918, 13236, 29918, 1990, 29918, 29874, 29892, 1962, 29918, 13236, 29918, 1990, 29918, 29890, 1402, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 1904, 29889, 3389, 580, 13, 13, 1678, 396, 4974, 2712, 892, 2309, 5149, 13, 1678, 8760, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 7373, 18267, 29918, 14573, 29918, 9464, 29892, 376, 509, 2806, 29918, 340, 29918, 9891, 29918, 29874, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 1243, 29918, 1445, 353, 679, 29918, 4905, 29918, 1445, 2084, 703, 340, 29918, 9891, 29918, 29874, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 4974, 934, 21058, 29898, 1688, 29918, 1445, 29892, 8760, 29918, 1445, 29897, 338, 5852, 13, 13, 1678, 8760, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 7373, 18267, 29918, 14573, 29918, 9464, 29892, 376, 509, 2806, 29918, 340, 29918, 9891, 29918, 29890, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 1243, 29918, 1445, 353, 679, 29918, 4905, 29918, 1445, 2084, 703, 340, 29918, 9891, 29918, 29890, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 4974, 934, 21058, 29898, 1688, 29918, 1445, 29892, 8760, 29918, 1445, 29897, 338, 5852, 13, 13, 1678, 8760, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 7373, 18267, 29918, 14573, 29918, 9464, 29892, 376, 509, 2806, 29918, 340, 29918, 1990, 29918, 29874, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 1243, 29918, 1445, 353, 679, 29918, 4905, 29918, 1445, 2084, 703, 340, 29918, 1990, 29918, 29874, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 4974, 934, 21058, 29898, 1688, 29918, 1445, 29892, 8760, 29918, 1445, 29897, 338, 5852, 13, 13, 1678, 8760, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 7373, 18267, 29918, 14573, 29918, 9464, 29892, 376, 509, 2806, 29918, 340, 29918, 1990, 29918, 29890, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 1243, 29918, 1445, 353, 679, 29918, 4905, 29918, 1445, 2084, 703, 340, 29918, 1990, 29918, 29890, 29889, 29906, 29900, 29889, 29900, 29889, 3945, 1159, 13, 1678, 4974, 934, 21058, 29898, 1688, 29918, 1445, 29892, 8760, 29918, 1445, 29897, 338, 5852, 13, 13, 1678, 1904, 29889, 5992, 29918, 4905, 29918, 1212, 29883, 29069, 580, 13, 1678, 5941, 786, 29918, 5325, 703, 340, 29918, 9891, 29918, 10521, 3945, 1159, 13, 1678, 5941, 786, 29918, 5325, 703, 340, 29918, 1990, 29918, 10521, 3945, 1159, 13, 13, 13, 29937, 1570, 6987, 363, 2030, 3114, 1962, 23550, 13, 13, 13, 1753, 1243, 29918, 7620, 29918, 4102, 29918, 4230, 29918, 392, 29918, 20787, 29918, 3706, 29898, 13058, 29918, 29900, 29947, 29892, 4359, 29918, 4381, 29918, 7720, 1125, 13, 1678, 9995, 3057, 4078, 29918, 4102, 29918, 9346, 342, 1022, 29892, 4078, 29918, 4230, 29918, 9346, 342, 1022, 29892, 322, 14238, 472, 2999, 13, 1678, 5335, 4196, 567, 1213, 15945, 13, 1678, 302, 18038, 2204, 29882, 353, 2216, 9203, 4247, 5160, 5563, 4598, 29898, 13, 4706, 4359, 29918, 4381, 29918, 7720, 29892, 6623, 29918, 3221, 29918, 18010, 29922, 5574, 29892, 5224, 292, 29918, 10492, 10457, 29896, 13, 1678, 1723, 13, 13, 1678, 396, 3386, 322, 1065, 1904, 13, 1678, 1904, 353, 19219, 29898, 13, 4706, 12006, 29918, 29900, 29947, 29892, 13, 4706, 4359, 29918, 4381, 29918, 7720, 29892, 13, 4706, 4094, 29918, 261, 397, 4127, 29922, 29900, 29889, 29900, 29892, 13, 4706, 1072, 324, 389, 29918, 27882, 29918, 15501, 29922, 29900, 29889, 29900, 29892, 13, 4706, 10452, 29918, 3179, 9306, 3790, 29908, 3664, 9203, 4247, 5160, 5563, 4598, 1115, 302, 18038, 2204, 29882, 1118, 13, 4706, 1962, 29918, 8231, 414, 3790, 13, 9651, 376, 2220, 1115, 518, 4905, 29918, 13236, 29918, 2220, 29918, 29874, 29892, 1962, 29918, 13236, 29918, 2220, 29918, 29890, 1402, 13, 9651, 376, 1990, 1115, 518, 4905, 29918, 13236, 29918, 1990, 29918, 29874, 29892, 1962, 29918, 13236, 29918, 1990, 29918, 29890, 1402, 13, 4706, 2981, 13, 4706, 1962, 29918, 19207, 29922, 29953, 29889, 29900, 29892, 13, 4706, 1962, 29918, 3972, 29922, 29918, 18267, 29918, 12015, 12336, 29918, 9464, 29892, 13, 4706, 4078, 29918, 4102, 29918, 9346, 342, 1022, 29922, 5574, 29892, 13, 4706, 4078, 29918, 4230, 29918, 9346, 342, 1022, 29922, 5574, 29892, 13, 1678, 1723, 13, 1678, 1904, 29889, 3389, 580, 13, 13, 1678, 363, 260, 297, 6796, 29900, 29889, 29900, 613, 376, 29953, 29889, 29900, 613, 376, 29896, 29906, 29889, 29900, 613, 376, 29896, 29947, 29889, 29900, 613, 376, 29906, 29900, 29889, 29900, 3108, 29901, 13, 4706, 396, 4974, 2712, 892, 2309, 5149, 13, 4706, 10422, 29918, 29890, 2129, 353, 518, 13, 9651, 285, 29908, 340, 29918, 9891, 29918, 29874, 29889, 29912, 29873, 1836, 3945, 613, 13, 9651, 285, 29908, 340, 29918, 9891, 29918, 29890, 29889, 29912, 29873, 1836, 3945, 613, 13, 9651, 285, 29908, 340, 29918, 1990, 29918, 29874, 29889, 29912, 29873, 1836, 3945, 613, 13, 9651, 285, 29908, 340, 29918, 1990, 29918, 29890, 29889, 29912, 29873, 1836, 3945, 613, 13, 4706, 4514, 13, 4706, 363, 10422, 29918, 3188, 297, 10422, 29918, 29890, 2129, 29901, 13, 9651, 8760, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 7373, 18267, 29918, 14573, 29918, 9464, 29892, 285, 29908, 509, 2806, 648, 9507, 29918, 3188, 27195, 13, 9651, 1243, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2764, 3972, 29892, 376, 4905, 613, 10422, 29918, 3188, 29897, 13, 9651, 4974, 934, 21058, 29898, 1688, 29918, 1445, 29892, 8760, 29918, 1445, 29897, 338, 5852, 13, 13, 1678, 1904, 29889, 5992, 29918, 4905, 29918, 1212, 29883, 29069, 580, 13, 1678, 5941, 786, 29918, 5325, 29898, 657, 29918, 4905, 29918, 1445, 2084, 703, 340, 29918, 9891, 29918, 10521, 3945, 5783, 13, 1678, 5941, 786, 29918, 5325, 29898, 657, 29918, 4905, 29918, 1445, 2084, 703, 340, 29918, 1990, 29918, 10521, 3945, 5783, 13, 2 ]
src/glip/gl/input/__init__.py
anibali/glip
0
181481
<filename>src/glip/gl/input/__init__.py from .keyboard import Key, ModifierKey, KeyboardShortcut, Keyboard from .mouse import MouseButton, Mouse
[ 1, 529, 9507, 29958, 4351, 29914, 29887, 3466, 29914, 3820, 29914, 2080, 29914, 1649, 2344, 26914, 2272, 13, 3166, 869, 1989, 3377, 1053, 7670, 29892, 3382, 3709, 2558, 29892, 7670, 3377, 21322, 7582, 29892, 7670, 3377, 13, 3166, 869, 15769, 1053, 25992, 3125, 29892, 25992, 13, 2 ]
model/criterions/__init__.py
UESTC-Liuxin/CVMI_Sementic_Segmentation
0
161563
<reponame>UESTC-Liuxin/CVMI_Sementic_Segmentation<filename>model/criterions/__init__.py ''' Author: <NAME> Date: 2021-11-18 09:58:40 LastEditors: <NAME> LastEditTime: 2021-11-29 22:50:42 Description: file content FilePath: /CVMI_Sementic_Segmentation/model/criterions/__init__.py ''' from model.criterions.ce_loss import * from model.criterions.dice_loss import * from model.criterions.ce_loss import * from model.criterions.se_loss import * from model.criterions.encnet_loss import *
[ 1, 529, 276, 1112, 420, 29958, 4462, 1254, 29907, 29899, 23410, 1314, 262, 29914, 29907, 9219, 29902, 29918, 29903, 882, 293, 29918, 17669, 358, 362, 29966, 9507, 29958, 4299, 29914, 29883, 5385, 1080, 29914, 1649, 2344, 26914, 2272, 13, 12008, 13, 13720, 29901, 529, 5813, 29958, 13, 2539, 29901, 29871, 29906, 29900, 29906, 29896, 29899, 29896, 29896, 29899, 29896, 29947, 29871, 29900, 29929, 29901, 29945, 29947, 29901, 29946, 29900, 13, 8897, 6103, 943, 29901, 529, 5813, 29958, 13, 8897, 6103, 2481, 29901, 29871, 29906, 29900, 29906, 29896, 29899, 29896, 29896, 29899, 29906, 29929, 29871, 29906, 29906, 29901, 29945, 29900, 29901, 29946, 29906, 13, 9868, 29901, 934, 2793, 13, 2283, 2605, 29901, 847, 29907, 9219, 29902, 29918, 29903, 882, 293, 29918, 17669, 358, 362, 29914, 4299, 29914, 29883, 5385, 1080, 29914, 1649, 2344, 26914, 2272, 13, 12008, 13, 3166, 1904, 29889, 29883, 5385, 1080, 29889, 346, 29918, 6758, 1053, 334, 13, 3166, 1904, 29889, 29883, 5385, 1080, 29889, 29881, 625, 29918, 6758, 1053, 334, 13, 3166, 1904, 29889, 29883, 5385, 1080, 29889, 346, 29918, 6758, 1053, 334, 13, 3166, 1904, 29889, 29883, 5385, 1080, 29889, 344, 29918, 6758, 1053, 334, 13, 3166, 1904, 29889, 29883, 5385, 1080, 29889, 3977, 1212, 29918, 6758, 1053, 334, 13, 13, 13, 2 ]
api/movie_database/movies/migrations/0001_initial.py
cocorocho/movie_database
0
124554
# Generated by Django 3.2.7 on 2022-02-04 13:40 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Director', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=100)), ], options={ 'verbose_name_plural': 'Directors', }, ), migrations.CreateModel( name='Genre', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=40)), ], options={ 'verbose_name_plural': 'Genres', }, ), migrations.CreateModel( name='Language', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=200)), ], options={ 'verbose_name_plural': 'Languages', }, ), migrations.CreateModel( name='Poster', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('path', models.FileField(max_length=500, null=True, upload_to='p')), ], ), migrations.CreateModel( name='Movie', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=100)), ('year', models.IntegerField(null=True)), ('description', models.TextField(max_length=900, null=True)), ('score_imdb', models.IntegerField(null=True)), ('score_rotten_tomatoes_critic', models.IntegerField(null=True)), ('score_rotten_tomatoes_audience', models.IntegerField(null=True)), ('score_metacritic_viewer', models.FloatField(null=True)), ('score_metacritic_critic', models.FloatField(null=True)), ('imdb_id', models.CharField(max_length=100, null=True)), ('tmdb_id', models.IntegerField(null=True)), ('adult', models.BooleanField(null=True)), ('vote_count_imdb', models.CharField(max_length=100, null=True)), ('vote_count_metacritic_viewer', models.CharField(max_length=100, null=True)), ('vote_count_metacritic_critic', models.CharField(max_length=100, null=True)), ('genres', models.ManyToManyField(to='movies.Genre')), ('language', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='movies.language')), ('poster', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='movies.poster')), ], options={ 'verbose_name_plural': 'Movies', }, ), migrations.CreateModel( name='Actor', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=255)), ('movies', models.ManyToManyField(to='movies.Movie')), ], options={ 'verbose_name_plural': 'Actors', }, ), ]
[ 1, 396, 3251, 630, 491, 15337, 29871, 29941, 29889, 29906, 29889, 29955, 373, 29871, 29906, 29900, 29906, 29906, 29899, 29900, 29906, 29899, 29900, 29946, 29871, 29896, 29941, 29901, 29946, 29900, 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, 2847, 353, 5852, 13, 13, 1678, 9962, 353, 518, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 17392, 272, 742, 13, 9651, 4235, 11759, 13, 18884, 6702, 333, 742, 4733, 29889, 6970, 12300, 3073, 29898, 6921, 29918, 11600, 29922, 5574, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 28755, 29922, 8824, 29892, 26952, 29918, 978, 2433, 1367, 1495, 511, 13, 18884, 6702, 978, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 8243, 13, 9651, 21251, 13, 9651, 3987, 3790, 13, 18884, 525, 369, 15828, 29918, 978, 29918, 572, 3631, 2396, 525, 17392, 943, 742, 13, 9651, 2981, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 15462, 276, 742, 13, 9651, 4235, 11759, 13, 18884, 6702, 333, 742, 4733, 29889, 6970, 12300, 3073, 29898, 6921, 29918, 11600, 29922, 5574, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 28755, 29922, 8824, 29892, 26952, 29918, 978, 2433, 1367, 1495, 511, 13, 18884, 6702, 978, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29946, 29900, 8243, 13, 9651, 21251, 13, 9651, 3987, 3790, 13, 18884, 525, 369, 15828, 29918, 978, 29918, 572, 3631, 2396, 525, 15462, 690, 742, 13, 9651, 2981, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 21233, 742, 13, 9651, 4235, 11759, 13, 18884, 6702, 333, 742, 4733, 29889, 6970, 12300, 3073, 29898, 6921, 29918, 11600, 29922, 5574, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 28755, 29922, 8824, 29892, 26952, 29918, 978, 2433, 1367, 1495, 511, 13, 18884, 6702, 978, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29906, 29900, 29900, 8243, 13, 9651, 21251, 13, 9651, 3987, 3790, 13, 18884, 525, 369, 15828, 29918, 978, 29918, 572, 3631, 2396, 525, 29931, 8737, 742, 13, 9651, 2981, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 6747, 261, 742, 13, 9651, 4235, 11759, 13, 18884, 6702, 333, 742, 4733, 29889, 6970, 12300, 3073, 29898, 6921, 29918, 11600, 29922, 5574, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 28755, 29922, 8824, 29892, 26952, 29918, 978, 2433, 1367, 1495, 511, 13, 18884, 6702, 2084, 742, 4733, 29889, 2283, 3073, 29898, 3317, 29918, 2848, 29922, 29945, 29900, 29900, 29892, 1870, 29922, 5574, 29892, 6441, 29918, 517, 2433, 29886, 1495, 511, 13, 9651, 21251, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 18749, 742, 13, 9651, 4235, 11759, 13, 18884, 6702, 333, 742, 4733, 29889, 6970, 12300, 3073, 29898, 6921, 29918, 11600, 29922, 5574, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 28755, 29922, 8824, 29892, 26952, 29918, 978, 2433, 1367, 1495, 511, 13, 18884, 6702, 978, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 8243, 13, 18884, 6702, 6360, 742, 4733, 29889, 7798, 3073, 29898, 4304, 29922, 5574, 8243, 13, 18884, 6702, 8216, 742, 4733, 29889, 15778, 29898, 3317, 29918, 2848, 29922, 29929, 29900, 29900, 29892, 1870, 29922, 5574, 8243, 13, 18884, 6702, 13628, 29918, 326, 2585, 742, 4733, 29889, 7798, 3073, 29898, 4304, 29922, 5574, 8243, 13, 18884, 6702, 13628, 29918, 26970, 264, 29918, 15135, 20452, 29918, 9695, 293, 742, 4733, 29889, 7798, 3073, 29898, 4304, 29922, 5574, 8243, 13, 18884, 6702, 13628, 29918, 26970, 264, 29918, 15135, 20452, 29918, 28863, 663, 742, 4733, 29889, 7798, 3073, 29898, 4304, 29922, 5574, 8243, 13, 18884, 6702, 13628, 29918, 2527, 562, 768, 293, 29918, 29894, 15580, 742, 4733, 29889, 11031, 3073, 29898, 4304, 29922, 5574, 8243, 13, 18884, 6702, 13628, 29918, 2527, 562, 768, 293, 29918, 9695, 293, 742, 4733, 29889, 11031, 3073, 29898, 4304, 29922, 5574, 8243, 13, 18884, 6702, 326, 2585, 29918, 333, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 1870, 29922, 5574, 8243, 13, 18884, 6702, 18276, 2585, 29918, 333, 742, 4733, 29889, 7798, 3073, 29898, 4304, 29922, 5574, 8243, 13, 18884, 6702, 328, 499, 742, 4733, 29889, 18146, 3073, 29898, 4304, 29922, 5574, 8243, 13, 18884, 6702, 15814, 29918, 2798, 29918, 326, 2585, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 1870, 29922, 5574, 8243, 13, 18884, 6702, 15814, 29918, 2798, 29918, 2527, 562, 768, 293, 29918, 29894, 15580, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 1870, 29922, 5574, 8243, 13, 18884, 6702, 15814, 29918, 2798, 29918, 2527, 562, 768, 293, 29918, 9695, 293, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 1870, 29922, 5574, 8243, 13, 18884, 6702, 1885, 690, 742, 4733, 29889, 14804, 1762, 14804, 3073, 29898, 517, 2433, 13529, 583, 29889, 15462, 276, 1495, 511, 13, 18884, 6702, 11675, 742, 4733, 29889, 27755, 2558, 29898, 4304, 29922, 5574, 29892, 373, 29918, 8143, 29922, 14095, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 29889, 29907, 3289, 5454, 2287, 29892, 304, 2433, 13529, 583, 29889, 11675, 1495, 511, 13, 18884, 6702, 2490, 261, 742, 4733, 29889, 27755, 2558, 29898, 265, 29918, 8143, 29922, 14095, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 29889, 29907, 3289, 5454, 2287, 29892, 304, 2433, 13529, 583, 29889, 2490, 261, 1495, 511, 13, 9651, 21251, 13, 9651, 3987, 3790, 13, 18884, 525, 369, 15828, 29918, 978, 29918, 572, 3631, 2396, 525, 29924, 586, 583, 742, 13, 9651, 2981, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 29909, 2801, 742, 13, 9651, 4235, 11759, 13, 18884, 6702, 333, 742, 4733, 29889, 6970, 12300, 3073, 29898, 6921, 29918, 11600, 29922, 5574, 29892, 7601, 29918, 1989, 29922, 5574, 29892, 28755, 29922, 8824, 29892, 26952, 29918, 978, 2433, 1367, 1495, 511, 13, 18884, 6702, 978, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29906, 29945, 29945, 8243, 13, 18884, 6702, 13529, 583, 742, 4733, 29889, 14804, 1762, 14804, 3073, 29898, 517, 2433, 13529, 583, 29889, 18749, 1495, 511, 13, 9651, 21251, 13, 9651, 3987, 3790, 13, 18884, 525, 369, 15828, 29918, 978, 29918, 572, 3631, 2396, 525, 2865, 943, 742, 13, 9651, 2981, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
tests/st/ops/cpu/test_minimum_op.py
PowerOlive/mindspore
3,200
192912
<gh_stars>1000+ # Copyright 2020 Huawei Technologies Co., Ltd # # 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 numpy as np import pytest import mindspore.context as context from mindspore.common.tensor import Tensor from mindspore.nn import Cell from mindspore.ops import operations as P class ConstScalarAndTensorMinimum(Cell): def __init__(self): super(ConstScalarAndTensorMinimum, self).__init__() self.min = P.Minimum() self.x = 20 def construct(self, y): return self.min(self.x, y) class TwoTensorsMinimum(Cell): def __init__(self): super(TwoTensorsMinimum, self).__init__() self.min = P.Minimum() def construct(self, x, y): return self.min(x, y) @pytest.mark.level0 @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard def test_minimum_constScalar_tensor_int(): x = Tensor(np.array([[2, 3, 4], [100, 200, 300]]).astype(np.int32)) expect = [[2, 3, 4], [20, 20, 20]] context.set_context(mode=context.GRAPH_MODE, device_target="CPU") min_op = ConstScalarAndTensorMinimum() output = min_op(x) assert np.all(output.asnumpy() == expect) @pytest.mark.level0 @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard def test_minimum_two_tensors_Not_Broadcast_int(): prop = 100 if np.random.random() > 0.5 else -100 x = np.random.randn(3, 4, 5).astype(np.int32) * prop y = np.random.randn(3, 4, 5).astype(np.int32) * prop expect = np.minimum(x, y).astype(np.int32) context.set_context(mode=context.GRAPH_MODE, device_target="CPU") min_op = TwoTensorsMinimum() output = min_op(Tensor(x), Tensor(y)) assert np.all(output.asnumpy() == expect) @pytest.mark.level0 @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard def test_minimum_two_tensors_Broadcast_int(): prop = 100 if np.random.random() > 0.5 else -100 x = np.random.randn(3, 4, 5).astype(np.int32) * prop y = np.random.randn(3, 1, 1).astype(np.int32) * prop expect = np.minimum(x, y).astype(np.int32) context.set_context(mode=context.GRAPH_MODE, device_target="CPU") min_op = TwoTensorsMinimum() output = min_op(Tensor(x), Tensor(y)) assert np.all(output.asnumpy() == expect) @pytest.mark.level0 @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard def test_minimum_two_tensors_Broadcast_oneDimension_int(): prop = 100 if np.random.random() > 0.5 else -100 x = np.random.randn(3).astype(np.int32) * prop y = np.random.randn(3).astype(np.int32) * prop expect = np.minimum(x, y).astype(np.int32) context.set_context(mode=context.GRAPH_MODE, device_target="CPU") min_op = TwoTensorsMinimum() output = min_op(Tensor(x), Tensor(y)) assert np.all(output.asnumpy() == expect) @pytest.mark.level0 @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard def test_minimum_two_tensors_notBroadcast_all_oneDimension_int(): x = Tensor(np.array([[2]]).astype(np.int32)) y = Tensor(np.array([[100]]).astype(np.int32)) expect = [[2]] context.set_context(mode=context.GRAPH_MODE, device_target="CPU") min_op = TwoTensorsMinimum() output = min_op(x, y) assert np.all(output.asnumpy() == expect) @pytest.mark.level0 @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard def test_minimum_two_tensors_notBroadcast_float32(): prop = 100 if np.random.random() > 0.5 else -100 x = np.random.randn(3, 4, 5).astype(np.float32) * prop y = np.random.randn(3, 4, 5).astype(np.float32) * prop expect = np.minimum(x, y).astype(np.float32) error = np.ones(shape=expect.shape) * 1.0e-5 context.set_context(mode=context.GRAPH_MODE, device_target="CPU") min_op = TwoTensorsMinimum() output = min_op(Tensor(x), Tensor(y)) diff = output.asnumpy() - expect assert np.all(np.abs(diff) < error) assert output.shape == expect.shape @pytest.mark.level0 @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard def test_minimum_two_tensors_notBroadcast_float16(): prop = 100 if np.random.random() > 0.5 else -100 x = np.random.randn(3, 4, 5).astype(np.float16) * prop y = np.random.randn(3, 4, 5).astype(np.float16) * prop expect = np.minimum(x, y).astype(np.float16) error = np.ones(shape=expect.shape) * 1.0e-5 context.set_context(mode=context.GRAPH_MODE, device_target="CPU") min_op = TwoTensorsMinimum() output = min_op(Tensor(x), Tensor(y)) diff = output.asnumpy() - expect assert np.all(np.abs(diff) < error) assert output.shape == expect.shape @pytest.mark.level0 @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard def test_minimum_two_tensors_Broadcast_float16(): prop = 100 if np.random.random() > 0.5 else -100 x = np.random.randn(3, 4, 5).astype(np.float16) * prop y = np.random.randn(3, 4, 1).astype(np.float16) * prop expect = np.minimum(x, y).astype(np.float16) error = np.ones(shape=expect.shape) * 1.0e-5 context.set_context(mode=context.GRAPH_MODE, device_target="CPU") min_op = TwoTensorsMinimum() output = min_op(Tensor(x), Tensor(y)) diff = output.asnumpy() - expect assert np.all(np.abs(diff) < error) assert output.shape == expect.shape @pytest.mark.level0 @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard def test_minimum_two_tensors_notBroadcast_float64(): prop = 100 if np.random.random() > 0.5 else -100 x = np.random.randn(3, 4, 1).astype(np.float64) * prop y = np.random.randn(3, 4, 5).astype(np.float64) * prop expect = np.minimum(x, y).astype(np.float64) error = np.ones(shape=expect.shape) * 1.0e-5 context.set_context(mode=context.GRAPH_MODE, device_target="CPU") min_op = TwoTensorsMinimum() output = min_op(Tensor(x), Tensor(y)) diff = output.asnumpy() - expect assert np.all(np.abs(diff) < error) assert output.shape == expect.shape
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29900, 29974, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29900, 379, 3357, 26599, 8364, 11763, 3189, 1696, 19806, 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, 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, 29937, 1275, 9166, 9166, 9166, 9166, 4936, 1360, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 11451, 1688, 13, 13, 5215, 3458, 1028, 487, 29889, 4703, 408, 3030, 13, 3166, 3458, 1028, 487, 29889, 9435, 29889, 20158, 1053, 323, 6073, 13, 3166, 3458, 1028, 487, 29889, 15755, 1053, 19413, 13, 3166, 3458, 1028, 487, 29889, 3554, 1053, 6931, 408, 349, 13, 13, 13, 1990, 5798, 29636, 279, 2855, 29911, 6073, 8140, 12539, 29898, 4617, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 29898, 12075, 29636, 279, 2855, 29911, 6073, 8140, 12539, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 1195, 353, 349, 29889, 8140, 12539, 580, 13, 4706, 1583, 29889, 29916, 353, 29871, 29906, 29900, 13, 13, 1678, 822, 3386, 29898, 1311, 29892, 343, 1125, 13, 4706, 736, 1583, 29889, 1195, 29898, 1311, 29889, 29916, 29892, 343, 29897, 13, 13, 13, 1990, 7803, 29911, 575, 943, 8140, 12539, 29898, 4617, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 29898, 13985, 29911, 575, 943, 8140, 12539, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 1195, 353, 349, 29889, 8140, 12539, 580, 13, 13, 1678, 822, 3386, 29898, 1311, 29892, 921, 29892, 343, 1125, 13, 4706, 736, 1583, 29889, 1195, 29898, 29916, 29892, 343, 29897, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 5563, 29900, 13, 29992, 2272, 1688, 29889, 3502, 29889, 12120, 29918, 29916, 29947, 29953, 29918, 21970, 13, 29992, 2272, 1688, 29889, 3502, 29889, 6272, 29918, 650, 7543, 13, 1753, 1243, 29918, 1195, 12539, 29918, 3075, 29636, 279, 29918, 20158, 29918, 524, 7295, 13, 1678, 921, 353, 323, 6073, 29898, 9302, 29889, 2378, 4197, 29961, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 1402, 518, 29896, 29900, 29900, 29892, 29871, 29906, 29900, 29900, 29892, 29871, 29941, 29900, 29900, 5262, 467, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 876, 13, 1678, 2149, 353, 5519, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 1402, 518, 29906, 29900, 29892, 29871, 29906, 29900, 29892, 29871, 29906, 29900, 5262, 13, 13, 1678, 3030, 29889, 842, 29918, 4703, 29898, 8513, 29922, 4703, 29889, 14345, 3301, 29950, 29918, 20387, 29892, 4742, 29918, 5182, 543, 6271, 29965, 1159, 13, 1678, 1375, 29918, 459, 353, 5798, 29636, 279, 2855, 29911, 6073, 8140, 12539, 580, 13, 1678, 1962, 353, 1375, 29918, 459, 29898, 29916, 29897, 13, 1678, 4974, 7442, 29889, 497, 29898, 4905, 29889, 294, 23749, 580, 1275, 2149, 29897, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 5563, 29900, 13, 29992, 2272, 1688, 29889, 3502, 29889, 12120, 29918, 29916, 29947, 29953, 29918, 21970, 13, 29992, 2272, 1688, 29889, 3502, 29889, 6272, 29918, 650, 7543, 13, 1753, 1243, 29918, 1195, 12539, 29918, 10184, 29918, 29873, 575, 943, 29918, 3664, 29918, 29933, 9972, 4384, 29918, 524, 7295, 13, 1678, 3107, 353, 29871, 29896, 29900, 29900, 565, 7442, 29889, 8172, 29889, 8172, 580, 1405, 29871, 29900, 29889, 29945, 1683, 448, 29896, 29900, 29900, 13, 1678, 921, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 467, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 29897, 334, 3107, 13, 1678, 343, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 467, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 29897, 334, 3107, 13, 1678, 2149, 353, 7442, 29889, 1195, 12539, 29898, 29916, 29892, 343, 467, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 29897, 13, 13, 1678, 3030, 29889, 842, 29918, 4703, 29898, 8513, 29922, 4703, 29889, 14345, 3301, 29950, 29918, 20387, 29892, 4742, 29918, 5182, 543, 6271, 29965, 1159, 13, 1678, 1375, 29918, 459, 353, 7803, 29911, 575, 943, 8140, 12539, 580, 13, 1678, 1962, 353, 1375, 29918, 459, 29898, 29911, 6073, 29898, 29916, 511, 323, 6073, 29898, 29891, 876, 13, 1678, 4974, 7442, 29889, 497, 29898, 4905, 29889, 294, 23749, 580, 1275, 2149, 29897, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 5563, 29900, 13, 29992, 2272, 1688, 29889, 3502, 29889, 12120, 29918, 29916, 29947, 29953, 29918, 21970, 13, 29992, 2272, 1688, 29889, 3502, 29889, 6272, 29918, 650, 7543, 13, 1753, 1243, 29918, 1195, 12539, 29918, 10184, 29918, 29873, 575, 943, 29918, 29933, 9972, 4384, 29918, 524, 7295, 13, 1678, 3107, 353, 29871, 29896, 29900, 29900, 565, 7442, 29889, 8172, 29889, 8172, 580, 1405, 29871, 29900, 29889, 29945, 1683, 448, 29896, 29900, 29900, 13, 1678, 921, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 467, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 29897, 334, 3107, 13, 1678, 343, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 29892, 29871, 29896, 29892, 29871, 29896, 467, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 29897, 334, 3107, 13, 1678, 2149, 353, 7442, 29889, 1195, 12539, 29898, 29916, 29892, 343, 467, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 29897, 13, 13, 1678, 3030, 29889, 842, 29918, 4703, 29898, 8513, 29922, 4703, 29889, 14345, 3301, 29950, 29918, 20387, 29892, 4742, 29918, 5182, 543, 6271, 29965, 1159, 13, 1678, 1375, 29918, 459, 353, 7803, 29911, 575, 943, 8140, 12539, 580, 13, 1678, 1962, 353, 1375, 29918, 459, 29898, 29911, 6073, 29898, 29916, 511, 323, 6073, 29898, 29891, 876, 13, 1678, 4974, 7442, 29889, 497, 29898, 4905, 29889, 294, 23749, 580, 1275, 2149, 29897, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 5563, 29900, 13, 29992, 2272, 1688, 29889, 3502, 29889, 12120, 29918, 29916, 29947, 29953, 29918, 21970, 13, 29992, 2272, 1688, 29889, 3502, 29889, 6272, 29918, 650, 7543, 13, 1753, 1243, 29918, 1195, 12539, 29918, 10184, 29918, 29873, 575, 943, 29918, 29933, 9972, 4384, 29918, 650, 16142, 2673, 29918, 524, 7295, 13, 1678, 3107, 353, 29871, 29896, 29900, 29900, 565, 7442, 29889, 8172, 29889, 8172, 580, 1405, 29871, 29900, 29889, 29945, 1683, 448, 29896, 29900, 29900, 13, 1678, 921, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 467, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 29897, 334, 3107, 13, 1678, 343, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 467, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 29897, 334, 3107, 13, 1678, 2149, 353, 7442, 29889, 1195, 12539, 29898, 29916, 29892, 343, 467, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 29897, 13, 13, 1678, 3030, 29889, 842, 29918, 4703, 29898, 8513, 29922, 4703, 29889, 14345, 3301, 29950, 29918, 20387, 29892, 4742, 29918, 5182, 543, 6271, 29965, 1159, 13, 1678, 1375, 29918, 459, 353, 7803, 29911, 575, 943, 8140, 12539, 580, 13, 1678, 1962, 353, 1375, 29918, 459, 29898, 29911, 6073, 29898, 29916, 511, 323, 6073, 29898, 29891, 876, 13, 1678, 4974, 7442, 29889, 497, 29898, 4905, 29889, 294, 23749, 580, 1275, 2149, 29897, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 5563, 29900, 13, 29992, 2272, 1688, 29889, 3502, 29889, 12120, 29918, 29916, 29947, 29953, 29918, 21970, 13, 29992, 2272, 1688, 29889, 3502, 29889, 6272, 29918, 650, 7543, 13, 1753, 1243, 29918, 1195, 12539, 29918, 10184, 29918, 29873, 575, 943, 29918, 1333, 29933, 9972, 4384, 29918, 497, 29918, 650, 16142, 2673, 29918, 524, 7295, 13, 1678, 921, 353, 323, 6073, 29898, 9302, 29889, 2378, 4197, 29961, 29906, 5262, 467, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 876, 13, 1678, 343, 353, 323, 6073, 29898, 9302, 29889, 2378, 4197, 29961, 29896, 29900, 29900, 5262, 467, 579, 668, 29898, 9302, 29889, 524, 29941, 29906, 876, 13, 1678, 2149, 353, 5519, 29906, 5262, 13, 13, 1678, 3030, 29889, 842, 29918, 4703, 29898, 8513, 29922, 4703, 29889, 14345, 3301, 29950, 29918, 20387, 29892, 4742, 29918, 5182, 543, 6271, 29965, 1159, 13, 1678, 1375, 29918, 459, 353, 7803, 29911, 575, 943, 8140, 12539, 580, 13, 1678, 1962, 353, 1375, 29918, 459, 29898, 29916, 29892, 343, 29897, 13, 1678, 4974, 7442, 29889, 497, 29898, 4905, 29889, 294, 23749, 580, 1275, 2149, 29897, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 5563, 29900, 13, 29992, 2272, 1688, 29889, 3502, 29889, 12120, 29918, 29916, 29947, 29953, 29918, 21970, 13, 29992, 2272, 1688, 29889, 3502, 29889, 6272, 29918, 650, 7543, 13, 1753, 1243, 29918, 1195, 12539, 29918, 10184, 29918, 29873, 575, 943, 29918, 1333, 29933, 9972, 4384, 29918, 7411, 29941, 29906, 7295, 13, 1678, 3107, 353, 29871, 29896, 29900, 29900, 565, 7442, 29889, 8172, 29889, 8172, 580, 1405, 29871, 29900, 29889, 29945, 1683, 448, 29896, 29900, 29900, 13, 1678, 921, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 467, 579, 668, 29898, 9302, 29889, 7411, 29941, 29906, 29897, 334, 3107, 13, 1678, 343, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 467, 579, 668, 29898, 9302, 29889, 7411, 29941, 29906, 29897, 334, 3107, 13, 1678, 2149, 353, 7442, 29889, 1195, 12539, 29898, 29916, 29892, 343, 467, 579, 668, 29898, 9302, 29889, 7411, 29941, 29906, 29897, 13, 1678, 1059, 353, 7442, 29889, 2873, 29898, 12181, 29922, 17854, 29889, 12181, 29897, 334, 29871, 29896, 29889, 29900, 29872, 29899, 29945, 13, 13, 1678, 3030, 29889, 842, 29918, 4703, 29898, 8513, 29922, 4703, 29889, 14345, 3301, 29950, 29918, 20387, 29892, 4742, 29918, 5182, 543, 6271, 29965, 1159, 13, 1678, 1375, 29918, 459, 353, 7803, 29911, 575, 943, 8140, 12539, 580, 13, 1678, 1962, 353, 1375, 29918, 459, 29898, 29911, 6073, 29898, 29916, 511, 323, 6073, 29898, 29891, 876, 13, 1678, 2923, 353, 1962, 29889, 294, 23749, 580, 448, 2149, 13, 1678, 4974, 7442, 29889, 497, 29898, 9302, 29889, 6897, 29898, 12765, 29897, 529, 1059, 29897, 13, 1678, 4974, 1962, 29889, 12181, 1275, 2149, 29889, 12181, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 5563, 29900, 13, 29992, 2272, 1688, 29889, 3502, 29889, 12120, 29918, 29916, 29947, 29953, 29918, 21970, 13, 29992, 2272, 1688, 29889, 3502, 29889, 6272, 29918, 650, 7543, 13, 1753, 1243, 29918, 1195, 12539, 29918, 10184, 29918, 29873, 575, 943, 29918, 1333, 29933, 9972, 4384, 29918, 7411, 29896, 29953, 7295, 13, 1678, 3107, 353, 29871, 29896, 29900, 29900, 565, 7442, 29889, 8172, 29889, 8172, 580, 1405, 29871, 29900, 29889, 29945, 1683, 448, 29896, 29900, 29900, 13, 1678, 921, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 467, 579, 668, 29898, 9302, 29889, 7411, 29896, 29953, 29897, 334, 3107, 13, 1678, 343, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 467, 579, 668, 29898, 9302, 29889, 7411, 29896, 29953, 29897, 334, 3107, 13, 1678, 2149, 353, 7442, 29889, 1195, 12539, 29898, 29916, 29892, 343, 467, 579, 668, 29898, 9302, 29889, 7411, 29896, 29953, 29897, 13, 1678, 1059, 353, 7442, 29889, 2873, 29898, 12181, 29922, 17854, 29889, 12181, 29897, 334, 29871, 29896, 29889, 29900, 29872, 29899, 29945, 13, 13, 1678, 3030, 29889, 842, 29918, 4703, 29898, 8513, 29922, 4703, 29889, 14345, 3301, 29950, 29918, 20387, 29892, 4742, 29918, 5182, 543, 6271, 29965, 1159, 13, 1678, 1375, 29918, 459, 353, 7803, 29911, 575, 943, 8140, 12539, 580, 13, 1678, 1962, 353, 1375, 29918, 459, 29898, 29911, 6073, 29898, 29916, 511, 323, 6073, 29898, 29891, 876, 13, 1678, 2923, 353, 1962, 29889, 294, 23749, 580, 448, 2149, 13, 1678, 4974, 7442, 29889, 497, 29898, 9302, 29889, 6897, 29898, 12765, 29897, 529, 1059, 29897, 13, 1678, 4974, 1962, 29889, 12181, 1275, 2149, 29889, 12181, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 5563, 29900, 13, 29992, 2272, 1688, 29889, 3502, 29889, 12120, 29918, 29916, 29947, 29953, 29918, 21970, 13, 29992, 2272, 1688, 29889, 3502, 29889, 6272, 29918, 650, 7543, 13, 1753, 1243, 29918, 1195, 12539, 29918, 10184, 29918, 29873, 575, 943, 29918, 29933, 9972, 4384, 29918, 7411, 29896, 29953, 7295, 13, 1678, 3107, 353, 29871, 29896, 29900, 29900, 565, 7442, 29889, 8172, 29889, 8172, 580, 1405, 29871, 29900, 29889, 29945, 1683, 448, 29896, 29900, 29900, 13, 1678, 921, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 467, 579, 668, 29898, 9302, 29889, 7411, 29896, 29953, 29897, 334, 3107, 13, 1678, 343, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29896, 467, 579, 668, 29898, 9302, 29889, 7411, 29896, 29953, 29897, 334, 3107, 13, 1678, 2149, 353, 7442, 29889, 1195, 12539, 29898, 29916, 29892, 343, 467, 579, 668, 29898, 9302, 29889, 7411, 29896, 29953, 29897, 13, 1678, 1059, 353, 7442, 29889, 2873, 29898, 12181, 29922, 17854, 29889, 12181, 29897, 334, 29871, 29896, 29889, 29900, 29872, 29899, 29945, 13, 13, 1678, 3030, 29889, 842, 29918, 4703, 29898, 8513, 29922, 4703, 29889, 14345, 3301, 29950, 29918, 20387, 29892, 4742, 29918, 5182, 543, 6271, 29965, 1159, 13, 1678, 1375, 29918, 459, 353, 7803, 29911, 575, 943, 8140, 12539, 580, 13, 1678, 1962, 353, 1375, 29918, 459, 29898, 29911, 6073, 29898, 29916, 511, 323, 6073, 29898, 29891, 876, 13, 1678, 2923, 353, 1962, 29889, 294, 23749, 580, 448, 2149, 13, 1678, 4974, 7442, 29889, 497, 29898, 9302, 29889, 6897, 29898, 12765, 29897, 529, 1059, 29897, 13, 1678, 4974, 1962, 29889, 12181, 1275, 2149, 29889, 12181, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 5563, 29900, 13, 29992, 2272, 1688, 29889, 3502, 29889, 12120, 29918, 29916, 29947, 29953, 29918, 21970, 13, 29992, 2272, 1688, 29889, 3502, 29889, 6272, 29918, 650, 7543, 13, 1753, 1243, 29918, 1195, 12539, 29918, 10184, 29918, 29873, 575, 943, 29918, 1333, 29933, 9972, 4384, 29918, 7411, 29953, 29946, 7295, 13, 1678, 3107, 353, 29871, 29896, 29900, 29900, 565, 7442, 29889, 8172, 29889, 8172, 580, 1405, 29871, 29900, 29889, 29945, 1683, 448, 29896, 29900, 29900, 13, 1678, 921, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29896, 467, 579, 668, 29898, 9302, 29889, 7411, 29953, 29946, 29897, 334, 3107, 13, 1678, 343, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 467, 579, 668, 29898, 9302, 29889, 7411, 29953, 29946, 29897, 334, 3107, 13, 1678, 2149, 353, 7442, 29889, 1195, 12539, 29898, 29916, 29892, 343, 467, 579, 668, 29898, 9302, 29889, 7411, 29953, 29946, 29897, 13, 1678, 1059, 353, 7442, 29889, 2873, 29898, 12181, 29922, 17854, 29889, 12181, 29897, 334, 29871, 29896, 29889, 29900, 29872, 29899, 29945, 13, 13, 1678, 3030, 29889, 842, 29918, 4703, 29898, 8513, 29922, 4703, 29889, 14345, 3301, 29950, 29918, 20387, 29892, 4742, 29918, 5182, 543, 6271, 29965, 1159, 13, 1678, 1375, 29918, 459, 353, 7803, 29911, 575, 943, 8140, 12539, 580, 13, 1678, 1962, 353, 1375, 29918, 459, 29898, 29911, 6073, 29898, 29916, 511, 323, 6073, 29898, 29891, 876, 13, 1678, 2923, 353, 1962, 29889, 294, 23749, 580, 448, 2149, 13, 1678, 4974, 7442, 29889, 497, 29898, 9302, 29889, 6897, 29898, 12765, 29897, 529, 1059, 29897, 13, 1678, 4974, 1962, 29889, 12181, 1275, 2149, 29889, 12181, 13, 2 ]
narnia/common.py
maisammusthafa/narnia
0
180444
<reponame>maisammusthafa/narnia<filename>narnia/common.py #!/usr/bin/env python3 """ common objects """ import argparse import configparser import curses import io import os import re import sys import narnia.pyaria2 as pyaria2 from narnia.colorstr import add_cstr from datetime import datetime class Globals: tty = {'curr_h': 0, 'curr_w': 0, 'prev_h': 0, 'prev_w': 0} header = None status = None downloads = [] download_states = [[], [], []] num_downloads = 0 focused = None start_idx = 0 curr_pos = 0 timer_ui = 0 queue = None s_pos = '<status.b> [top]</status.b>' s_textbox = '' def log(message): with open('log.txt', 'a') as log_file: time = datetime.now().strftime('%H:%M:%S') line = '{} {}\n'.format(time, message) log_file.write(line) g = Globals def refresh_windows(): """ update window widths and refresh them """ g.tty['curr_h'], g.tty['curr_w'] = list(map( int, os.popen('stty size', 'r').read().split())) if g.num_downloads < g.tty['curr_h']: g.start_idx = 0 c.widths.name = g.tty['curr_w'] - \ (c.widths.size + c.widths.status + c.widths.progress + c.widths.percent + c.widths.seeds_peers + c.widths.speed + c.widths.eta) g.header.update() g.file_status.clear() g.file_status.noutrefresh() g.file_status = curses.newwin(1, g.tty['curr_w'], g.tty['curr_h'] - 2, 0) g.pos_status.clear() g.pos_status.noutrefresh() g.pos_status = curses.newwin(1, 8, g.tty['curr_h'] - 1, g.tty['curr_w'] - 7) add_cstr(0, 0, g.s_pos, g.pos_status) g.status.win.clear() g.status.win.noutrefresh() g.status.update(g.status.data) for i in range(g.start_idx, min(g.num_downloads, g.tty['curr_h'] - 3) + g.start_idx): g.downloads[i].draw(i - g.start_idx + 1, True) curses.doupdate() g.timer_ui = (c.refresh_interval * 100) - 1 class Keybindings: def __init__(self, keybindings): self.key_up = ord(keybindings.get('up', 'k')) self.key_down = ord(keybindings.get('down', 'j')) self.pause_all = ord(keybindings.get('pause-all', 'P')) self.pause = ord(keybindings.get('pause', 'p')) self.add = ord(keybindings.get('add', 'a')) self.delete = ord(keybindings.get('delete', 'd')) self.purge = ord(keybindings.get('purge', 'D')) self.queue_up = ord(keybindings.get('queue-up', 'K')) self.queue_down = ord(keybindings.get('queue-down', 'J')) self.select = ord(keybindings.get('select-file', 'v')) self.expand = ord(keybindings.get('expand-torrent', 'h')) self.retry = ord(keybindings.get('retry', 'r')) self.quit = ord(keybindings.get('quit', 'q')) class Colors: def __init__(self, colors): self.enable_colors = colors.getboolean('colors', True) if self.enable_colors: self.status_colors = { 'active': colors.get('dl-active', 'base2').join('<>'), 'paused': colors.get('dl-paused', 'default').join('<>'), 'skip': colors.get('dl-skip', 'default').join('<>'), 'waiting': colors.get('dl-waiting', 'blue').join('<>'), 'pending': colors.get('dl-pending', 'blue').join('<>'), 'complete': colors.get('dl-complete', 'green').join('<>'), 'removed': colors.get('dl-removed', 'yellow').join('<>'), 'error': colors.get('dl-error', 'red').join('<>'), } else: self.status_colors = { } class Widths: def __init__(self, interface): self.size = interface.getint('width-size', 10) self.status = interface.getint('width-status', 11) self.progress = interface.getint('width-progress', 15) self.percent = interface.getint('width-percent', 10) self.seeds_peers = interface.getint('width-seeds-peers', 10) self.speed = interface.getint('width-speed', 14) self.eta = interface.getint('width-eta', 12) self.name = g.tty['curr_w'] - \ (self.size + self.status + self.progress + self.percent + self.seeds_peers + self.speed + self.eta) class Config: def load_conf(name, sections): conf = configparser.ConfigParser() conf_file = os.path.expanduser("~/.config/narnia/" + name) if not os.path.isfile(conf_file): conf_file = io.StringIO(sections) conf.readfp(conf_file) else: conf.read(conf_file) return conf # TODO: Fix crash on missing config sections config = load_conf('config', '[Connection]\n[UI]\n[Colors]\n[Keybindings]') profiles = load_conf('profiles', '[default]') profile = config['Connection'].get('profile', 'default') parser = argparse.ArgumentParser(description='A curses-based console client for aria2') parser.add_argument('-c', '--connection', help='Pre-configured narnia connection profile to use', default=profile) parser.add_argument('-s', '--server', help='Server to connect to') parser.add_argument('-p', '--port', help='Port to connect through') parser.add_argument('-t', '--token', help='aria2 RPC secret token') parser.add_argument('-d', '--delete', help='Delete a download using its GID') parser.add_argument('-i', '--info', help='Returns info on a download using its GID') parser.add_argument('file', nargs='*') args = parser.parse_args() profile = args.connection server = profiles[profile].get('server', 'localhost') if args.server is None else \ args.server port = profiles[profile].getint('port', 6800) if args.port is None else \ int(args.port) token = profiles[profile].get('rpc-secret', '') if args.token is None else \ args.token aria2 = pyaria2.PyAria2(server, port, token) if args.file != []: for i_file in args.file: aria2.add_uri([i_file]) sys.exit() elif args.delete is not None: aria2.remove_download_result(args.delete) sys.exit() elif args.info is not None: print(aria2.tell_status(token, args.info)) sys.exit() interface = config['UI'] keys = Keybindings(config['Keybindings']) colors = Colors(config['Colors']) widths = Widths(interface) refresh_interval = interface.getfloat('refresh-interval', 0.5) progress_markers = interface.get('progress-bar-markers', '[]') progress_char = interface.get('progress-bar-char', '#') c = Config def format_size(raw_size, spacing=''): suffixes = [(1024 ** 3, 'G'), (1024 ** 2, 'M'), (1024, 'K'), (1, 'B')] size = 0 for item in suffixes: if raw_size >= item[0]: size = raw_size / item[0] if size > 999 and size < 1024: size /= 1024 suffix = suffixes[suffixes.index(item) - 1][1] break suffix = item[1] break suffix = item[1] rounding = "%0.0f" if any(x in suffix for x in ['K', 'B']) else "%0.1f" return str(rounding % size) + spacing + suffix def format_time(eta_s): mins, secs = divmod(eta_s, 60) hrs, mins = divmod(mins, 60) days, hrs = divmod(hrs, 24) if days > 0: d_eta = "%dd %dh %dm" % (days, hrs, mins) else: d_eta = "%dh %dm %ds" % (hrs, mins, secs) d_eta = re.sub(r'(^0\w)|(\s0\w)', '', d_eta).strip() return d_eta def create_row(*fields): """ generate aligned row """ row = "" for field in fields: value, width, padding, alignment = \ field[0], field[1], field[2], field[3] value = value[:(width - padding)] + ".." \ if len(value) > width - padding else value if alignment == 'right': row += (value + (width - len(value)) * ' ') else: row += ((width - len(value) - padding) * ' ' + value + padding * ' ') return row class Header: def __init__(self): self.update() def update(self): """ generate header """ self.win = curses.newwin(1, g.tty['curr_w'], 0, 0) name, size, status, progress, percent, seeds_peers, speed, eta = \ "NAME", "SIZE", "STATUS", "PROGRESS", "", "S/P", "D/U", "ETA" self.string = create_row( (name, c.widths.name, 3, 'right'), (size, c.widths.size, 3, 'left'), (status, c.widths.status, 3, 'right'), (progress, c.widths.progress, 3, 'right'), (percent, c.widths.percent, 3, 'right'), (seeds_peers, c.widths.seeds_peers, 3, 'left'), (speed, c.widths.speed, 3, 'left'), (eta, c.widths.eta, 1, 'left') ) def draw(self, init): """ draw header """ if g.tty['prev_w'] == g.tty['curr_w'] and not init: return self.win.clear() try: add_cstr(0, 0, '<header.b>' + self.string + '</header.b>', self.win) except curses.error: pass self.win.noutrefresh() class Status: def __init__(self): self.data = {'downloadSpeed': '0', 'numActive': '0', 'numStopped': '0', 'numStoppedTotal': '0', 'numWaiting': '0', 'uploadSpeed': '0'} self.version = '0.00.0' self.string = None self.update(self.data) def refresh_data(self): """ refresh status bar data """ # TODO: [BUG] Does not set connected status to False if internet is disconnected try: if self.version == '0.00.0': self.version = c.aria2.get_version()['version'] self.data = c.aria2.get_global_stat() except: self.version = '0.00.0' c.aria2.connected = False def create_string(self): s_server = 'server: {}:{} (v{})'.format(c.server, c.port, self.version) num_downloads = int(self.data['numActive']) + \ int(self.data['numWaiting']) + int(self.data['numStopped']) s_downloads = 'downloads: ' + self.data['numStopped'] + \ '/' + str(num_downloads) s_speed = 'D/U: ' + format_size(int(self.data['downloadSpeed'])) + '/' + \ format_size(int(self.data['uploadSpeed'])) self.string = create_row( (s_server, g.tty['curr_w'] - 21 - 14 - 7, 3, 'right'), (s_downloads, 21, 3, 'right'), (s_speed, 14, 1, 'left') ) def update(self, data): """ generate status """ if self.string is not None and \ g.tty['prev_h'] == g.tty['curr_h'] and \ g.tty['prev_w'] == g.tty['curr_w'] and \ self.data == data: self.changed = False return self.changed = True self.data = data self.win = curses.newwin(1, g.tty['curr_w'] - 7, g.tty['curr_h'] - 1, 0) self.create_string() def draw(self, init): # TODO: Evaluate the init logic here if not self.changed and not init: return self.win.clear() self.win.noutrefresh() self.create_string() c_string = self.string if not c.aria2.connected: c_string = self.string.replace('server: ', 'server: <status_err.b>').replace(') ', ')</status_err.b><status.b> ') c_string = '<status.b>{}</status.b>'.format(c_string) try: add_cstr(0, 0, c_string, self.win) except curses.error: pass self.win.noutrefresh()
[ 1, 529, 276, 1112, 420, 29958, 655, 275, 4850, 504, 29882, 2142, 29874, 29914, 29876, 2753, 423, 29966, 9507, 29958, 29876, 2753, 423, 29914, 9435, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 15945, 29908, 3619, 3618, 9995, 13, 13, 5215, 1852, 5510, 13, 5215, 2295, 16680, 13, 5215, 18580, 267, 13, 5215, 12013, 13, 5215, 2897, 13, 5215, 337, 13, 5215, 10876, 13, 13, 5215, 302, 2753, 423, 29889, 2272, 4568, 29906, 408, 11451, 4568, 29906, 13, 13, 3166, 302, 2753, 423, 29889, 2780, 710, 1053, 788, 29918, 29883, 710, 13, 3166, 12865, 1053, 12865, 13, 13, 1990, 402, 2127, 1338, 29901, 13, 1678, 260, 1017, 353, 11117, 21962, 29918, 29882, 2396, 29871, 29900, 29892, 525, 21962, 29918, 29893, 2396, 29871, 29900, 29892, 525, 16304, 29918, 29882, 2396, 29871, 29900, 29892, 525, 16304, 29918, 29893, 2396, 29871, 29900, 29913, 13, 13, 1678, 4839, 353, 6213, 13, 1678, 4660, 353, 6213, 13, 13, 1678, 5142, 29879, 353, 5159, 13, 1678, 5142, 29918, 28631, 353, 5519, 1402, 19997, 5159, 29962, 13, 1678, 954, 29918, 10382, 29879, 353, 29871, 29900, 13, 1678, 21309, 353, 6213, 13, 1678, 1369, 29918, 13140, 353, 29871, 29900, 13, 1678, 16256, 29918, 1066, 353, 29871, 29900, 13, 1678, 12237, 29918, 1481, 353, 29871, 29900, 13, 1678, 9521, 353, 6213, 13, 1678, 269, 29918, 1066, 353, 12801, 4882, 29889, 29890, 29958, 29871, 518, 3332, 29962, 829, 4882, 29889, 29890, 16299, 13, 1678, 269, 29918, 726, 1884, 353, 6629, 13, 13, 1678, 822, 1480, 29898, 4906, 1125, 13, 4706, 411, 1722, 877, 1188, 29889, 3945, 742, 525, 29874, 1495, 408, 1480, 29918, 1445, 29901, 13, 9651, 931, 353, 12865, 29889, 3707, 2141, 710, 615, 603, 877, 29995, 29950, 16664, 29924, 16664, 29903, 1495, 13, 9651, 1196, 353, 525, 8875, 426, 1012, 29876, 4286, 4830, 29898, 2230, 29892, 2643, 29897, 13, 9651, 1480, 29918, 1445, 29889, 3539, 29898, 1220, 29897, 13, 13, 13, 29887, 353, 402, 2127, 1338, 13, 13, 13, 1753, 11086, 29918, 10499, 7295, 13, 1678, 9995, 2767, 3474, 2920, 29879, 322, 11086, 963, 9995, 13, 13, 1678, 330, 29889, 4349, 1839, 21962, 29918, 29882, 7464, 330, 29889, 4349, 1839, 21962, 29918, 29893, 2033, 353, 1051, 29898, 1958, 29898, 13, 4706, 938, 29892, 2897, 29889, 29886, 3150, 877, 303, 1017, 2159, 742, 525, 29878, 2824, 949, 2141, 5451, 22130, 13, 13, 1678, 565, 330, 29889, 1949, 29918, 10382, 29879, 529, 330, 29889, 4349, 1839, 21962, 29918, 29882, 2033, 29901, 13, 4706, 330, 29889, 2962, 29918, 13140, 353, 29871, 29900, 13, 13, 1678, 274, 29889, 2103, 29879, 29889, 978, 353, 330, 29889, 4349, 1839, 21962, 29918, 29893, 2033, 448, 320, 13, 4706, 313, 29883, 29889, 2103, 29879, 29889, 2311, 718, 274, 29889, 2103, 29879, 29889, 4882, 718, 13, 308, 274, 29889, 2103, 29879, 29889, 18035, 718, 274, 29889, 2103, 29879, 29889, 25376, 718, 13, 308, 274, 29889, 2103, 29879, 29889, 344, 5779, 29918, 412, 414, 718, 274, 29889, 2103, 29879, 29889, 19322, 718, 13, 308, 274, 29889, 2103, 29879, 29889, 1187, 29897, 13, 13, 1678, 330, 29889, 6672, 29889, 5504, 580, 13, 13, 1678, 330, 29889, 1445, 29918, 4882, 29889, 8551, 580, 13, 1678, 330, 29889, 1445, 29918, 4882, 29889, 29876, 449, 22379, 580, 13, 1678, 330, 29889, 1445, 29918, 4882, 353, 18580, 267, 29889, 1482, 5080, 29898, 29896, 29892, 330, 29889, 4349, 1839, 21962, 29918, 29893, 7464, 330, 29889, 4349, 1839, 21962, 29918, 29882, 2033, 448, 29871, 29906, 29892, 29871, 29900, 29897, 13, 13, 1678, 330, 29889, 1066, 29918, 4882, 29889, 8551, 580, 13, 1678, 330, 29889, 1066, 29918, 4882, 29889, 29876, 449, 22379, 580, 13, 1678, 330, 29889, 1066, 29918, 4882, 353, 18580, 267, 29889, 1482, 5080, 29898, 29896, 29892, 29871, 29947, 29892, 330, 29889, 4349, 1839, 21962, 29918, 29882, 2033, 448, 29871, 29896, 29892, 330, 29889, 4349, 1839, 21962, 29918, 29893, 2033, 448, 29871, 29955, 29897, 13, 1678, 788, 29918, 29883, 710, 29898, 29900, 29892, 29871, 29900, 29892, 330, 29889, 29879, 29918, 1066, 29892, 330, 29889, 1066, 29918, 4882, 29897, 13, 13, 1678, 330, 29889, 4882, 29889, 5080, 29889, 8551, 580, 13, 1678, 330, 29889, 4882, 29889, 5080, 29889, 29876, 449, 22379, 580, 13, 1678, 330, 29889, 4882, 29889, 5504, 29898, 29887, 29889, 4882, 29889, 1272, 29897, 13, 13, 1678, 363, 474, 297, 3464, 29898, 29887, 29889, 2962, 29918, 13140, 29892, 1375, 29898, 29887, 29889, 1949, 29918, 10382, 29879, 29892, 330, 29889, 4349, 1839, 21962, 29918, 29882, 2033, 448, 29871, 29941, 29897, 718, 330, 29889, 2962, 29918, 13140, 1125, 13, 4706, 330, 29889, 10382, 29879, 29961, 29875, 1822, 4012, 29898, 29875, 448, 330, 29889, 2962, 29918, 13140, 718, 29871, 29896, 29892, 5852, 29897, 13, 1678, 18580, 267, 29889, 29881, 1132, 1256, 580, 13, 13, 1678, 330, 29889, 20404, 29918, 1481, 353, 313, 29883, 29889, 22379, 29918, 19207, 334, 29871, 29896, 29900, 29900, 29897, 448, 29871, 29896, 13, 13, 13, 1990, 7670, 5355, 886, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1820, 5355, 886, 1125, 13, 4706, 1583, 29889, 1989, 29918, 786, 353, 4356, 29898, 1989, 5355, 886, 29889, 657, 877, 786, 742, 525, 29895, 8785, 13, 4706, 1583, 29889, 1989, 29918, 3204, 353, 4356, 29898, 1989, 5355, 886, 29889, 657, 877, 3204, 742, 525, 29926, 8785, 13, 4706, 1583, 29889, 29886, 1071, 29918, 497, 353, 4356, 29898, 1989, 5355, 886, 29889, 657, 877, 29886, 1071, 29899, 497, 742, 525, 29925, 8785, 13, 4706, 1583, 29889, 29886, 1071, 353, 4356, 29898, 1989, 5355, 886, 29889, 657, 877, 29886, 1071, 742, 525, 29886, 8785, 13, 4706, 1583, 29889, 1202, 353, 4356, 29898, 1989, 5355, 886, 29889, 657, 877, 1202, 742, 525, 29874, 8785, 13, 4706, 1583, 29889, 8143, 353, 4356, 29898, 1989, 5355, 886, 29889, 657, 877, 8143, 742, 525, 29881, 8785, 13, 4706, 1583, 29889, 15503, 479, 353, 4356, 29898, 1989, 5355, 886, 29889, 657, 877, 15503, 479, 742, 525, 29928, 8785, 13, 4706, 1583, 29889, 9990, 29918, 786, 353, 4356, 29898, 1989, 5355, 886, 29889, 657, 877, 9990, 29899, 786, 742, 525, 29968, 8785, 13, 4706, 1583, 29889, 9990, 29918, 3204, 353, 4356, 29898, 1989, 5355, 886, 29889, 657, 877, 9990, 29899, 3204, 742, 525, 29967, 8785, 13, 4706, 1583, 29889, 2622, 353, 4356, 29898, 1989, 5355, 886, 29889, 657, 877, 2622, 29899, 1445, 742, 525, 29894, 8785, 13, 4706, 1583, 29889, 18837, 353, 4356, 29898, 1989, 5355, 886, 29889, 657, 877, 18837, 29899, 7345, 7771, 742, 525, 29882, 8785, 13, 4706, 1583, 29889, 276, 2202, 353, 4356, 29898, 1989, 5355, 886, 29889, 657, 877, 276, 2202, 742, 525, 29878, 8785, 13, 4706, 1583, 29889, 28358, 353, 4356, 29898, 1989, 5355, 886, 29889, 657, 877, 28358, 742, 525, 29939, 8785, 13, 13, 13, 1990, 29183, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 11955, 1125, 13, 4706, 1583, 29889, 12007, 29918, 27703, 353, 11955, 29889, 657, 20054, 877, 27703, 742, 5852, 29897, 13, 4706, 565, 1583, 29889, 12007, 29918, 27703, 29901, 13, 9651, 1583, 29889, 4882, 29918, 27703, 353, 426, 13, 462, 1678, 525, 4925, 2396, 11955, 29889, 657, 877, 11671, 29899, 4925, 742, 525, 3188, 29906, 2824, 7122, 877, 25299, 5477, 13, 462, 1678, 525, 29886, 15244, 2396, 11955, 29889, 657, 877, 11671, 29899, 29886, 15244, 742, 525, 4381, 2824, 7122, 877, 25299, 5477, 13, 462, 1678, 525, 11014, 2396, 11955, 29889, 657, 877, 11671, 29899, 11014, 742, 525, 4381, 2824, 7122, 877, 25299, 5477, 13, 462, 1678, 525, 10685, 292, 2396, 11955, 29889, 657, 877, 11671, 29899, 10685, 292, 742, 525, 9539, 2824, 7122, 877, 25299, 5477, 13, 462, 1678, 525, 29886, 2548, 2396, 11955, 29889, 657, 877, 11671, 29899, 29886, 2548, 742, 525, 9539, 2824, 7122, 877, 25299, 5477, 13, 462, 1678, 525, 8835, 2396, 11955, 29889, 657, 877, 11671, 29899, 8835, 742, 525, 12692, 2824, 7122, 877, 25299, 5477, 13, 462, 1678, 525, 1745, 8238, 2396, 11955, 29889, 657, 877, 11671, 29899, 1745, 8238, 742, 525, 29136, 2824, 7122, 877, 25299, 5477, 13, 462, 1678, 525, 2704, 2396, 11955, 29889, 657, 877, 11671, 29899, 2704, 742, 525, 1127, 2824, 7122, 877, 25299, 5477, 13, 462, 1678, 500, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 4882, 29918, 27703, 353, 426, 13, 462, 1678, 500, 13, 13, 13, 1990, 21485, 29879, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5067, 1125, 13, 4706, 1583, 29889, 2311, 353, 5067, 29889, 657, 524, 877, 2103, 29899, 2311, 742, 29871, 29896, 29900, 29897, 13, 4706, 1583, 29889, 4882, 353, 5067, 29889, 657, 524, 877, 2103, 29899, 4882, 742, 29871, 29896, 29896, 29897, 13, 4706, 1583, 29889, 18035, 353, 5067, 29889, 657, 524, 877, 2103, 29899, 18035, 742, 29871, 29896, 29945, 29897, 13, 4706, 1583, 29889, 25376, 353, 5067, 29889, 657, 524, 877, 2103, 29899, 25376, 742, 29871, 29896, 29900, 29897, 13, 4706, 1583, 29889, 344, 5779, 29918, 412, 414, 353, 5067, 29889, 657, 524, 877, 2103, 29899, 344, 5779, 29899, 412, 414, 742, 29871, 29896, 29900, 29897, 13, 4706, 1583, 29889, 19322, 353, 5067, 29889, 657, 524, 877, 2103, 29899, 19322, 742, 29871, 29896, 29946, 29897, 13, 4706, 1583, 29889, 1187, 353, 5067, 29889, 657, 524, 877, 2103, 29899, 1187, 742, 29871, 29896, 29906, 29897, 13, 4706, 1583, 29889, 978, 353, 330, 29889, 4349, 1839, 21962, 29918, 29893, 2033, 448, 320, 13, 9651, 313, 1311, 29889, 2311, 718, 1583, 29889, 4882, 718, 1583, 29889, 18035, 718, 13, 632, 1583, 29889, 25376, 718, 1583, 29889, 344, 5779, 29918, 412, 414, 718, 13, 632, 1583, 29889, 19322, 718, 1583, 29889, 1187, 29897, 13, 13, 13, 1990, 12782, 29901, 13, 1678, 822, 2254, 29918, 5527, 29898, 978, 29892, 13926, 1125, 13, 4706, 1970, 353, 2295, 16680, 29889, 3991, 11726, 580, 13, 4706, 1970, 29918, 1445, 353, 2897, 29889, 2084, 29889, 18837, 1792, 703, 30022, 6294, 2917, 29914, 29876, 2753, 423, 12975, 718, 1024, 29897, 13, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 275, 1445, 29898, 5527, 29918, 1445, 1125, 13, 9651, 1970, 29918, 1445, 353, 12013, 29889, 1231, 5971, 29898, 27117, 29897, 13, 9651, 1970, 29889, 949, 18091, 29898, 5527, 29918, 1445, 29897, 13, 4706, 1683, 29901, 13, 9651, 1970, 29889, 949, 29898, 5527, 29918, 1445, 29897, 13, 4706, 736, 1970, 13, 13, 1678, 396, 14402, 29901, 24778, 8095, 373, 4567, 2295, 13926, 13, 1678, 2295, 353, 2254, 29918, 5527, 877, 2917, 742, 525, 29961, 5350, 10725, 29876, 29961, 3120, 10725, 29876, 29961, 1625, 943, 10725, 29876, 29961, 2558, 5355, 886, 29962, 1495, 13, 1678, 28723, 353, 2254, 29918, 5527, 877, 771, 5325, 742, 525, 29961, 4381, 29962, 1495, 13, 13, 1678, 8722, 353, 2295, 1839, 5350, 13359, 657, 877, 10185, 742, 525, 4381, 1495, 13, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 29909, 18580, 267, 29899, 6707, 2991, 3132, 363, 27347, 29906, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29883, 742, 525, 489, 9965, 742, 1371, 2433, 6572, 29899, 2917, 2955, 302, 2753, 423, 3957, 8722, 304, 671, 742, 2322, 29922, 10185, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29879, 742, 525, 489, 2974, 742, 1371, 2433, 6004, 304, 4511, 304, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29886, 742, 525, 489, 637, 742, 1371, 2433, 2290, 304, 4511, 1549, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29873, 742, 525, 489, 6979, 742, 1371, 2433, 4568, 29906, 390, 9026, 7035, 5993, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29881, 742, 525, 489, 8143, 742, 1371, 2433, 12498, 263, 5142, 773, 967, 402, 1367, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29875, 742, 525, 489, 3888, 742, 1371, 2433, 11609, 29879, 5235, 373, 263, 5142, 773, 967, 402, 1367, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 1445, 742, 302, 5085, 2433, 29930, 1495, 13, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 8722, 353, 6389, 29889, 9965, 13, 13, 1678, 1923, 353, 28723, 29961, 10185, 1822, 657, 877, 2974, 742, 525, 7640, 1495, 565, 6389, 29889, 2974, 338, 6213, 1683, 320, 13, 4706, 6389, 29889, 2974, 13, 1678, 2011, 353, 28723, 29961, 10185, 1822, 657, 524, 877, 637, 742, 29871, 29953, 29947, 29900, 29900, 29897, 565, 6389, 29889, 637, 338, 6213, 1683, 320, 13, 4706, 938, 29898, 5085, 29889, 637, 29897, 13, 1678, 5993, 353, 28723, 29961, 10185, 1822, 657, 877, 29878, 6739, 29899, 19024, 742, 27255, 565, 6389, 29889, 6979, 338, 6213, 1683, 320, 13, 4706, 6389, 29889, 6979, 13, 13, 1678, 27347, 29906, 353, 11451, 4568, 29906, 29889, 19737, 29909, 2849, 29906, 29898, 2974, 29892, 2011, 29892, 5993, 29897, 13, 13, 1678, 565, 6389, 29889, 1445, 2804, 5159, 29901, 13, 4706, 363, 474, 29918, 1445, 297, 6389, 29889, 1445, 29901, 13, 9651, 27347, 29906, 29889, 1202, 29918, 5338, 4197, 29875, 29918, 1445, 2314, 13, 4706, 10876, 29889, 13322, 580, 13, 1678, 25342, 6389, 29889, 8143, 338, 451, 6213, 29901, 13, 4706, 27347, 29906, 29889, 5992, 29918, 10382, 29918, 2914, 29898, 5085, 29889, 8143, 29897, 13, 4706, 10876, 29889, 13322, 580, 13, 1678, 25342, 6389, 29889, 3888, 338, 451, 6213, 29901, 13, 4706, 1596, 29898, 4568, 29906, 29889, 29873, 514, 29918, 4882, 29898, 6979, 29892, 6389, 29889, 3888, 876, 13, 4706, 10876, 29889, 13322, 580, 13, 13, 1678, 5067, 353, 2295, 1839, 3120, 2033, 13, 1678, 6611, 353, 7670, 5355, 886, 29898, 2917, 1839, 2558, 5355, 886, 11287, 13, 1678, 11955, 353, 29183, 29898, 2917, 1839, 1625, 943, 11287, 13, 1678, 2920, 29879, 353, 21485, 29879, 29898, 13248, 29897, 13, 13, 1678, 11086, 29918, 19207, 353, 5067, 29889, 657, 7411, 877, 22379, 29899, 19207, 742, 29871, 29900, 29889, 29945, 29897, 13, 1678, 6728, 29918, 3502, 414, 353, 5067, 29889, 657, 877, 18035, 29899, 1646, 29899, 3502, 414, 742, 525, 2636, 1495, 13, 1678, 6728, 29918, 3090, 353, 5067, 29889, 657, 877, 18035, 29899, 1646, 29899, 3090, 742, 16321, 1495, 13, 13, 13, 29883, 353, 12782, 13, 13, 13, 1753, 3402, 29918, 2311, 29898, 1610, 29918, 2311, 29892, 29250, 2433, 29374, 13, 1678, 25557, 267, 353, 17288, 29896, 29900, 29906, 29946, 3579, 29871, 29941, 29892, 525, 29954, 5477, 313, 29896, 29900, 29906, 29946, 3579, 29871, 29906, 29892, 525, 29924, 5477, 313, 29896, 29900, 29906, 29946, 29892, 525, 29968, 5477, 313, 29896, 29892, 525, 29933, 1495, 29962, 13, 1678, 2159, 353, 29871, 29900, 13, 13, 1678, 363, 2944, 297, 25557, 267, 29901, 13, 4706, 565, 10650, 29918, 2311, 6736, 2944, 29961, 29900, 5387, 13, 9651, 2159, 353, 10650, 29918, 2311, 847, 2944, 29961, 29900, 29962, 13, 9651, 565, 2159, 1405, 29871, 29929, 29929, 29929, 322, 2159, 529, 29871, 29896, 29900, 29906, 29946, 29901, 13, 18884, 2159, 847, 29922, 29871, 29896, 29900, 29906, 29946, 13, 18884, 25557, 353, 25557, 267, 29961, 2146, 600, 861, 267, 29889, 2248, 29898, 667, 29897, 448, 29871, 29896, 3816, 29896, 29962, 13, 18884, 2867, 13, 9651, 25557, 353, 2944, 29961, 29896, 29962, 13, 9651, 2867, 13, 4706, 25557, 353, 2944, 29961, 29896, 29962, 13, 13, 1678, 4513, 292, 353, 11860, 29900, 29889, 29900, 29888, 29908, 565, 738, 29898, 29916, 297, 25557, 363, 921, 297, 6024, 29968, 742, 525, 29933, 11287, 1683, 11860, 29900, 29889, 29896, 29888, 29908, 13, 13, 1678, 736, 851, 29898, 29878, 12449, 1273, 2159, 29897, 718, 29250, 718, 25557, 13, 13, 13, 1753, 3402, 29918, 2230, 29898, 1187, 29918, 29879, 1125, 13, 1678, 286, 1144, 29892, 409, 2395, 353, 1933, 1545, 29898, 1187, 29918, 29879, 29892, 29871, 29953, 29900, 29897, 13, 1678, 298, 2288, 29892, 286, 1144, 353, 1933, 1545, 29898, 29885, 1144, 29892, 29871, 29953, 29900, 29897, 13, 1678, 3841, 29892, 298, 2288, 353, 1933, 1545, 29898, 1092, 29879, 29892, 29871, 29906, 29946, 29897, 13, 13, 1678, 565, 3841, 1405, 29871, 29900, 29901, 13, 4706, 270, 29918, 1187, 353, 11860, 1289, 1273, 12744, 1273, 18933, 29908, 1273, 313, 16700, 29892, 298, 2288, 29892, 286, 1144, 29897, 13, 1678, 1683, 29901, 13, 4706, 270, 29918, 1187, 353, 11860, 12744, 1273, 18933, 1273, 6289, 29908, 1273, 313, 1092, 29879, 29892, 286, 1144, 29892, 409, 2395, 29897, 13, 13, 1678, 270, 29918, 1187, 353, 337, 29889, 1491, 29898, 29878, 12215, 29985, 29900, 29905, 29893, 10531, 1194, 29879, 29900, 29905, 29893, 29897, 742, 15516, 270, 29918, 1187, 467, 17010, 580, 13, 13, 1678, 736, 270, 29918, 1187, 13, 13, 13, 1753, 1653, 29918, 798, 10456, 9621, 1125, 13, 1678, 9995, 5706, 26118, 1948, 9995, 13, 13, 1678, 1948, 353, 5124, 13, 1678, 363, 1746, 297, 4235, 29901, 13, 4706, 995, 29892, 2920, 29892, 7164, 29892, 22239, 353, 320, 13, 18884, 1746, 29961, 29900, 1402, 1746, 29961, 29896, 1402, 1746, 29961, 29906, 1402, 1746, 29961, 29941, 29962, 13, 13, 4706, 995, 353, 995, 29961, 5919, 2103, 448, 7164, 4638, 718, 376, 636, 29908, 320, 13, 9651, 565, 7431, 29898, 1767, 29897, 1405, 2920, 448, 7164, 1683, 995, 13, 13, 4706, 565, 22239, 1275, 525, 1266, 2396, 13, 9651, 1948, 4619, 313, 1767, 718, 313, 2103, 448, 7431, 29898, 1767, 876, 334, 525, 25710, 13, 4706, 1683, 29901, 13, 9651, 1948, 4619, 5135, 2103, 448, 7431, 29898, 1767, 29897, 448, 7164, 29897, 334, 525, 525, 718, 13, 462, 1678, 995, 718, 7164, 334, 525, 25710, 13, 13, 1678, 736, 1948, 13, 13, 13, 1990, 19345, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 5504, 580, 13, 13, 1678, 822, 2767, 29898, 1311, 1125, 13, 4706, 9995, 5706, 4839, 9995, 13, 13, 4706, 1583, 29889, 5080, 353, 18580, 267, 29889, 1482, 5080, 29898, 29896, 29892, 330, 29889, 4349, 1839, 21962, 29918, 29893, 7464, 29871, 29900, 29892, 29871, 29900, 29897, 13, 13, 4706, 1024, 29892, 2159, 29892, 4660, 29892, 6728, 29892, 10151, 29892, 409, 5779, 29918, 412, 414, 29892, 6210, 29892, 634, 29874, 353, 320, 13, 9651, 376, 5813, 613, 376, 14226, 613, 376, 27047, 613, 376, 8618, 29954, 26785, 613, 12633, 376, 29903, 29914, 29925, 613, 376, 29928, 29914, 29965, 613, 376, 2544, 29909, 29908, 13, 13, 4706, 1583, 29889, 1807, 353, 1653, 29918, 798, 29898, 13, 9651, 313, 978, 29892, 274, 29889, 2103, 29879, 29889, 978, 29892, 29871, 29941, 29892, 525, 1266, 5477, 13, 9651, 313, 2311, 29892, 274, 29889, 2103, 29879, 29889, 2311, 29892, 29871, 29941, 29892, 525, 1563, 5477, 13, 9651, 313, 4882, 29892, 274, 29889, 2103, 29879, 29889, 4882, 29892, 29871, 29941, 29892, 525, 1266, 5477, 13, 9651, 313, 18035, 29892, 274, 29889, 2103, 29879, 29889, 18035, 29892, 29871, 29941, 29892, 525, 1266, 5477, 13, 9651, 313, 25376, 29892, 274, 29889, 2103, 29879, 29889, 25376, 29892, 29871, 29941, 29892, 525, 1266, 5477, 13, 9651, 313, 344, 5779, 29918, 412, 414, 29892, 274, 29889, 2103, 29879, 29889, 344, 5779, 29918, 412, 414, 29892, 29871, 29941, 29892, 525, 1563, 5477, 13, 9651, 313, 19322, 29892, 274, 29889, 2103, 29879, 29889, 19322, 29892, 29871, 29941, 29892, 525, 1563, 5477, 13, 9651, 313, 1187, 29892, 274, 29889, 2103, 29879, 29889, 1187, 29892, 29871, 29896, 29892, 525, 1563, 1495, 13, 9651, 1723, 13, 13, 1678, 822, 4216, 29898, 1311, 29892, 2069, 1125, 13, 4706, 9995, 4216, 4839, 9995, 13, 13, 4706, 565, 330, 29889, 4349, 1839, 16304, 29918, 29893, 2033, 1275, 330, 29889, 4349, 1839, 21962, 29918, 29893, 2033, 322, 451, 2069, 29901, 13, 9651, 736, 13, 13, 4706, 1583, 29889, 5080, 29889, 8551, 580, 13, 4706, 1018, 29901, 13, 9651, 788, 29918, 29883, 710, 29898, 29900, 29892, 29871, 29900, 29892, 12801, 6672, 29889, 29890, 16299, 718, 1583, 29889, 1807, 718, 525, 829, 6672, 29889, 29890, 29958, 742, 1583, 29889, 5080, 29897, 13, 4706, 5174, 18580, 267, 29889, 2704, 29901, 13, 9651, 1209, 13, 4706, 1583, 29889, 5080, 29889, 29876, 449, 22379, 580, 13, 13, 13, 1990, 16034, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 1272, 353, 11117, 10382, 26539, 2396, 525, 29900, 742, 525, 1949, 9966, 2396, 525, 29900, 742, 525, 1949, 20754, 2986, 2396, 525, 29900, 742, 13, 462, 268, 525, 1949, 20754, 2986, 11536, 2396, 525, 29900, 742, 525, 1949, 15716, 292, 2396, 525, 29900, 742, 525, 9009, 26539, 2396, 525, 29900, 10827, 13, 4706, 1583, 29889, 3259, 353, 525, 29900, 29889, 29900, 29900, 29889, 29900, 29915, 13, 4706, 1583, 29889, 1807, 353, 6213, 13, 4706, 1583, 29889, 5504, 29898, 1311, 29889, 1272, 29897, 13, 13, 1678, 822, 11086, 29918, 1272, 29898, 1311, 1125, 13, 4706, 9995, 11086, 4660, 2594, 848, 9995, 13, 13, 4706, 396, 14402, 29901, 518, 11578, 29962, 5538, 451, 731, 6631, 4660, 304, 7700, 565, 8986, 338, 766, 18045, 13, 4706, 1018, 29901, 13, 9651, 565, 1583, 29889, 3259, 1275, 525, 29900, 29889, 29900, 29900, 29889, 29900, 2396, 13, 18884, 1583, 29889, 3259, 353, 274, 29889, 4568, 29906, 29889, 657, 29918, 3259, 580, 1839, 3259, 2033, 13, 9651, 1583, 29889, 1272, 353, 274, 29889, 4568, 29906, 29889, 657, 29918, 10945, 29918, 6112, 580, 13, 4706, 5174, 29901, 13, 9651, 1583, 29889, 3259, 353, 525, 29900, 29889, 29900, 29900, 29889, 29900, 29915, 13, 9651, 274, 29889, 4568, 29906, 29889, 18045, 353, 7700, 13, 13, 13, 1678, 822, 1653, 29918, 1807, 29898, 1311, 1125, 13, 4706, 269, 29918, 2974, 353, 525, 2974, 29901, 426, 6177, 8875, 313, 29894, 29912, 1800, 4286, 4830, 29898, 29883, 29889, 2974, 29892, 274, 29889, 637, 29892, 1583, 29889, 3259, 29897, 13, 13, 4706, 954, 29918, 10382, 29879, 353, 938, 29898, 1311, 29889, 1272, 1839, 1949, 9966, 11287, 718, 320, 13, 9651, 938, 29898, 1311, 29889, 1272, 1839, 1949, 15716, 292, 11287, 718, 938, 29898, 1311, 29889, 1272, 1839, 1949, 20754, 2986, 11287, 13, 4706, 269, 29918, 10382, 29879, 353, 525, 10382, 29879, 29901, 525, 718, 1583, 29889, 1272, 1839, 1949, 20754, 2986, 2033, 718, 320, 13, 9651, 8207, 29915, 718, 851, 29898, 1949, 29918, 10382, 29879, 29897, 13, 13, 4706, 269, 29918, 19322, 353, 525, 29928, 29914, 29965, 29901, 525, 718, 3402, 29918, 2311, 29898, 524, 29898, 1311, 29889, 1272, 1839, 10382, 26539, 25901, 718, 8207, 29915, 718, 320, 13, 9651, 3402, 29918, 2311, 29898, 524, 29898, 1311, 29889, 1272, 1839, 9009, 26539, 25901, 13, 13, 4706, 1583, 29889, 1807, 353, 1653, 29918, 798, 29898, 13, 9651, 313, 29879, 29918, 2974, 29892, 330, 29889, 4349, 1839, 21962, 29918, 29893, 2033, 448, 29871, 29906, 29896, 448, 29871, 29896, 29946, 448, 29871, 29955, 29892, 29871, 29941, 29892, 525, 1266, 5477, 13, 9651, 313, 29879, 29918, 10382, 29879, 29892, 29871, 29906, 29896, 29892, 29871, 29941, 29892, 525, 1266, 5477, 13, 9651, 313, 29879, 29918, 19322, 29892, 29871, 29896, 29946, 29892, 29871, 29896, 29892, 525, 1563, 1495, 13, 4706, 1723, 13, 13, 1678, 822, 2767, 29898, 1311, 29892, 848, 1125, 13, 4706, 9995, 5706, 4660, 9995, 13, 13, 4706, 565, 1583, 29889, 1807, 338, 451, 6213, 322, 320, 13, 18884, 330, 29889, 4349, 1839, 16304, 29918, 29882, 2033, 1275, 330, 29889, 4349, 1839, 21962, 29918, 29882, 2033, 322, 320, 13, 18884, 330, 29889, 4349, 1839, 16304, 29918, 29893, 2033, 1275, 330, 29889, 4349, 1839, 21962, 29918, 29893, 2033, 322, 320, 13, 18884, 1583, 29889, 1272, 1275, 848, 29901, 13, 9651, 1583, 29889, 15033, 353, 7700, 13, 9651, 736, 13, 13, 4706, 1583, 29889, 15033, 353, 5852, 13, 4706, 1583, 29889, 1272, 353, 848, 13, 4706, 1583, 29889, 5080, 353, 18580, 267, 29889, 1482, 5080, 29898, 29896, 29892, 330, 29889, 4349, 1839, 21962, 29918, 29893, 2033, 448, 29871, 29955, 29892, 13, 462, 462, 330, 29889, 4349, 1839, 21962, 29918, 29882, 2033, 448, 29871, 29896, 29892, 29871, 29900, 29897, 13, 4706, 1583, 29889, 3258, 29918, 1807, 580, 13, 13, 13, 1678, 822, 4216, 29898, 1311, 29892, 2069, 1125, 13, 4706, 396, 14402, 29901, 382, 4387, 403, 278, 2069, 5900, 1244, 13, 4706, 565, 451, 1583, 29889, 15033, 322, 451, 2069, 29901, 13, 9651, 736, 13, 13, 4706, 1583, 29889, 5080, 29889, 8551, 580, 13, 4706, 1583, 29889, 5080, 29889, 29876, 449, 22379, 580, 13, 13, 4706, 1583, 29889, 3258, 29918, 1807, 580, 13, 4706, 274, 29918, 1807, 353, 1583, 29889, 1807, 13, 4706, 565, 451, 274, 29889, 4568, 29906, 29889, 18045, 29901, 13, 9651, 274, 29918, 1807, 353, 1583, 29889, 1807, 29889, 6506, 877, 2974, 29901, 13420, 525, 2974, 29901, 529, 4882, 29918, 3127, 29889, 29890, 29958, 2824, 6506, 877, 29897, 13420, 25710, 829, 4882, 29918, 3127, 29889, 29890, 5299, 4882, 29889, 29890, 29958, 25710, 13, 4706, 274, 29918, 1807, 353, 12801, 4882, 29889, 29890, 29958, 8875, 829, 4882, 29889, 29890, 29958, 4286, 4830, 29898, 29883, 29918, 1807, 29897, 13, 13, 4706, 1018, 29901, 13, 9651, 788, 29918, 29883, 710, 29898, 29900, 29892, 29871, 29900, 29892, 274, 29918, 1807, 29892, 1583, 29889, 5080, 29897, 13, 4706, 5174, 18580, 267, 29889, 2704, 29901, 13, 9651, 1209, 13, 4706, 1583, 29889, 5080, 29889, 29876, 449, 22379, 580, 13, 2 ]
tests/aat/spec/modules_spec.py
DerangedMonkeyNinja/openperf
20
1604706
<filename>tests/aat/spec/modules_spec.py from mamba import description, before, after, it from expects import * import os import client.api import client.models from common import Config, Service from common.matcher import be_valid_module, raise_api_exception CONFIG = Config(os.path.join(os.path.dirname(__file__), os.environ.get('MAMBA_CONFIG', 'config.yaml'))) with description('Modules, ', 'modules') as self: with before.all: service = Service(CONFIG.service()) self.process = service.start() self.api = client.api.ModulesApi(service.client()) with description('list, '): with description('all, '): with it('returns list of modules'): modules = self.api.list_modules() expect(modules).not_to(be_empty) for module in modules: expect(module).to(be_valid_module) with description('unsupported method, '): with it('returns 405'): expect(lambda: self.api.api_client.call_api('/modules', 'PUT')).to(raise_api_exception( 405, headers={'Allow': "GET"})) with description('get, '): with description('known module, '): with description('packetio'): with it('succeeds'): module = self.api.get_module('packetio') expect(module).to(be_valid_module) expect(module.id).to(equal('packetio')) expect(module.version.version).to(equal(1)) with description('non-existent module, '): with it('returns 404'): expect(lambda: self.api.get_module('insertnotfoundmodulenamehere')).to(raise_api_exception(404)) with description('unsupported method, '): with it('returns 405'): expect(lambda: self.api.api_client.call_api('/modules/hi', 'PUT')).to(raise_api_exception( 405, headers={'Allow': "GET"})) with description('invalid module name, '): with it('returns 400'): expect(lambda: self.api.get_module('and&').to(raise_api_exception(400))) with after.all: try: self.process.terminate() self.process.wait() except AttributeError: pass
[ 1, 529, 9507, 29958, 21150, 29914, 29874, 271, 29914, 6550, 29914, 7576, 29918, 6550, 29889, 2272, 13, 3166, 286, 20027, 1053, 6139, 29892, 1434, 29892, 1156, 29892, 372, 13, 3166, 23347, 1053, 334, 13, 5215, 2897, 13, 13, 5215, 3132, 29889, 2754, 13, 5215, 3132, 29889, 9794, 13, 3166, 3619, 1053, 12782, 29892, 6692, 13, 3166, 3619, 29889, 4352, 261, 1053, 367, 29918, 3084, 29918, 5453, 29892, 12020, 29918, 2754, 29918, 11739, 13, 13, 13, 25903, 353, 12782, 29898, 359, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 511, 2897, 29889, 21813, 29889, 657, 877, 1529, 29924, 5688, 29918, 25903, 742, 525, 2917, 29889, 25162, 29915, 4961, 13, 13, 13, 2541, 6139, 877, 2111, 2540, 29892, 13420, 525, 7576, 1495, 408, 1583, 29901, 13, 1678, 411, 1434, 29889, 497, 29901, 13, 4706, 2669, 353, 6692, 29898, 25903, 29889, 5509, 3101, 13, 4706, 1583, 29889, 5014, 353, 2669, 29889, 2962, 580, 13, 4706, 1583, 29889, 2754, 353, 3132, 29889, 2754, 29889, 2111, 2540, 11713, 29898, 5509, 29889, 4645, 3101, 13, 13, 1678, 411, 6139, 877, 1761, 29892, 525, 1125, 13, 4706, 411, 6139, 877, 497, 29892, 525, 1125, 13, 9651, 411, 372, 877, 18280, 1051, 310, 10585, 29374, 13, 18884, 10585, 353, 1583, 29889, 2754, 29889, 1761, 29918, 7576, 580, 13, 18884, 2149, 29898, 7576, 467, 1333, 29918, 517, 29898, 915, 29918, 6310, 29897, 13, 18884, 363, 3883, 297, 10585, 29901, 13, 462, 1678, 2149, 29898, 5453, 467, 517, 29898, 915, 29918, 3084, 29918, 5453, 29897, 13, 13, 9651, 411, 6139, 877, 348, 23765, 1158, 29892, 525, 1125, 13, 18884, 411, 372, 877, 18280, 29871, 29946, 29900, 29945, 29374, 13, 462, 1678, 2149, 29898, 2892, 29901, 1583, 29889, 2754, 29889, 2754, 29918, 4645, 29889, 4804, 29918, 2754, 11219, 7576, 742, 525, 12336, 1495, 467, 517, 29898, 22692, 29918, 2754, 29918, 11739, 29898, 13, 462, 268, 29946, 29900, 29945, 29892, 9066, 3790, 29915, 15930, 2396, 376, 7194, 9092, 876, 13, 13, 1678, 411, 6139, 877, 657, 29892, 525, 1125, 13, 4706, 411, 6139, 877, 5203, 3883, 29892, 525, 1125, 13, 9651, 411, 6139, 877, 4058, 300, 601, 29374, 13, 18884, 411, 372, 877, 29879, 1682, 3947, 29879, 29374, 13, 462, 1678, 3883, 353, 1583, 29889, 2754, 29889, 657, 29918, 5453, 877, 4058, 300, 601, 1495, 13, 462, 1678, 2149, 29898, 5453, 467, 517, 29898, 915, 29918, 3084, 29918, 5453, 29897, 13, 462, 1678, 2149, 29898, 5453, 29889, 333, 467, 517, 29898, 11745, 877, 4058, 300, 601, 8785, 13, 462, 1678, 2149, 29898, 5453, 29889, 3259, 29889, 3259, 467, 517, 29898, 11745, 29898, 29896, 876, 13, 13, 4706, 411, 6139, 877, 5464, 29899, 735, 9696, 3883, 29892, 525, 1125, 13, 9651, 411, 372, 877, 18280, 29871, 29946, 29900, 29946, 29374, 13, 18884, 2149, 29898, 2892, 29901, 1583, 29889, 2754, 29889, 657, 29918, 5453, 877, 7851, 1333, 11940, 1545, 352, 3871, 4150, 1495, 467, 517, 29898, 22692, 29918, 2754, 29918, 11739, 29898, 29946, 29900, 29946, 876, 13, 13, 4706, 411, 6139, 877, 348, 23765, 1158, 29892, 525, 1125, 13, 9651, 411, 372, 877, 18280, 29871, 29946, 29900, 29945, 29374, 13, 18884, 2149, 29898, 2892, 29901, 1583, 29889, 2754, 29889, 2754, 29918, 4645, 29889, 4804, 29918, 2754, 11219, 7576, 29914, 2918, 742, 525, 12336, 1495, 467, 517, 29898, 22692, 29918, 2754, 29918, 11739, 29898, 13, 462, 268, 29946, 29900, 29945, 29892, 9066, 3790, 29915, 15930, 2396, 376, 7194, 9092, 876, 13, 13, 4706, 411, 6139, 877, 20965, 3883, 1024, 29892, 525, 1125, 13, 9651, 411, 372, 877, 18280, 29871, 29946, 29900, 29900, 29374, 13, 18884, 2149, 29898, 2892, 29901, 1583, 29889, 2754, 29889, 657, 29918, 5453, 877, 392, 29987, 2824, 517, 29898, 22692, 29918, 2754, 29918, 11739, 29898, 29946, 29900, 29900, 4961, 13, 13, 1678, 411, 1156, 29889, 497, 29901, 13, 4706, 1018, 29901, 13, 9651, 1583, 29889, 5014, 29889, 18821, 403, 580, 13, 9651, 1583, 29889, 5014, 29889, 10685, 580, 13, 4706, 5174, 23833, 2392, 29901, 13, 9651, 1209, 13, 2 ]
utils/strings_util.py
ScriptHound/vk_schema_codegen
9
166878
<reponame>ScriptHound/vk_schema_codegen import json import re from keyword import kwlist def get_type_from_reference(str_ref, convert_to_calmel_case=True) -> str: pattern = r".*/(.*)" ref_type = re.search(pattern, str_ref).group(1) if convert_to_calmel_case: return snake_case_to_camel_case(ref_type) return ref_type def get_annotation_type(item: dict): if item.get("type") == "array": if item["items"].get("type"): type_anno = [item["items"]["type"]] else: type_anno = item["items"].get("$ref") type_anno = [get_type_from_reference(type_anno)] elif item.get("type") and not item.get("$ref"): type_anno = item.get("type") elif item.get("oneOf"): type_anno = [get_annotation_type(item) for item in item["oneOf"]] else: type_anno = item.get("$ref") type_anno = get_type_from_reference(type_anno) return type_anno def output_switch_decorator(function): """If input is dict, then return dict If input is a single element, return single element """ def wrapper(arg): keys_type = type(dict().keys()) if not isinstance(arg, (keys_type, list)): arg = {arg: arg} result = function(arg) if len(arg) == 1: # get first value in returned dict return result[next(iter(result))] return result return wrapper def get_json_dict(path: str) -> dict: with open(path, "r") as f: return json.loads(f.read()) @output_switch_decorator def snake_case_to_camel_case(string_list: list) -> dict: words_list: list = [] for item in string_list: words_list.append( "".join(word[0].upper() + word[1:] for word in item.split("_")) ) return dict(zip(string_list, words_list)) def camel_case_to_snake_case(string: str) -> dict: return "".join( "_" + symbol.lower() if symbol.isupper() else symbol for symbol in list(string) ).strip("_") def convert_to_python_type(field): if field.lower() == "array": return "list" elif field.lower() == "boolean": return "bool" elif field.lower() == "integer": return "int" elif field.lower() == "number": return "float" elif field.lower() == "object": return "typing.Any" elif field.lower() == "string": return "str" else: return str(field) def shift_json_dict_names(plain_data: str, classnames: str) -> dict: return {v: plain_data[k] for k, v in classnames.items()} def categorize_methods_as_files(json_dict: dict) -> dict: filenames = set() for method_dict in json_dict["methods"]: method_name = method_dict["name"].split(".")[0] filenames.add(method_name) return {name: {} for name in filenames} def resolve_property_name(name: str): if name[0].isdigit() or name in kwlist: name = "_" + name return name
[ 1, 529, 276, 1112, 420, 29958, 4081, 29950, 618, 29914, 29894, 29895, 29918, 11010, 29918, 401, 1885, 13, 5215, 4390, 13, 5215, 337, 13, 3166, 13553, 1053, 9049, 1761, 13, 13, 13, 1753, 679, 29918, 1853, 29918, 3166, 29918, 5679, 29898, 710, 29918, 999, 29892, 3588, 29918, 517, 29918, 1052, 12873, 29918, 4878, 29922, 5574, 29897, 1599, 851, 29901, 13, 1678, 4766, 353, 364, 1642, 3877, 28104, 5513, 13, 1678, 2143, 29918, 1853, 353, 337, 29889, 4478, 29898, 11037, 29892, 851, 29918, 999, 467, 2972, 29898, 29896, 29897, 13, 1678, 565, 3588, 29918, 517, 29918, 1052, 12873, 29918, 4878, 29901, 13, 4706, 736, 269, 21040, 29918, 4878, 29918, 517, 29918, 11108, 295, 29918, 4878, 29898, 999, 29918, 1853, 29897, 13, 1678, 736, 2143, 29918, 1853, 13, 13, 13, 1753, 679, 29918, 18317, 29918, 1853, 29898, 667, 29901, 9657, 1125, 13, 1678, 565, 2944, 29889, 657, 703, 1853, 1159, 1275, 376, 2378, 1115, 13, 4706, 565, 2944, 3366, 7076, 16862, 657, 703, 1853, 29908, 1125, 13, 9651, 1134, 29918, 7665, 353, 518, 667, 3366, 7076, 3108, 3366, 1853, 3108, 29962, 13, 4706, 1683, 29901, 13, 9651, 1134, 29918, 7665, 353, 2944, 3366, 7076, 16862, 657, 703, 29938, 999, 1159, 13, 9651, 1134, 29918, 7665, 353, 518, 657, 29918, 1853, 29918, 3166, 29918, 5679, 29898, 1853, 29918, 7665, 4638, 13, 1678, 25342, 2944, 29889, 657, 703, 1853, 1159, 322, 451, 2944, 29889, 657, 703, 29938, 999, 29908, 1125, 13, 4706, 1134, 29918, 7665, 353, 2944, 29889, 657, 703, 1853, 1159, 13, 1678, 25342, 2944, 29889, 657, 703, 650, 2776, 29908, 1125, 13, 4706, 1134, 29918, 7665, 353, 518, 657, 29918, 18317, 29918, 1853, 29898, 667, 29897, 363, 2944, 297, 2944, 3366, 650, 2776, 3108, 29962, 13, 1678, 1683, 29901, 13, 4706, 1134, 29918, 7665, 353, 2944, 29889, 657, 703, 29938, 999, 1159, 13, 4706, 1134, 29918, 7665, 353, 679, 29918, 1853, 29918, 3166, 29918, 5679, 29898, 1853, 29918, 7665, 29897, 13, 1678, 736, 1134, 29918, 7665, 13, 13, 13, 1753, 1962, 29918, 15123, 29918, 19557, 1061, 29898, 2220, 1125, 13, 1678, 9995, 3644, 1881, 338, 9657, 29892, 769, 736, 9657, 13, 1678, 960, 1881, 338, 263, 2323, 1543, 29892, 736, 2323, 1543, 13, 1678, 9995, 13, 13, 1678, 822, 14476, 29898, 1191, 1125, 13, 4706, 6611, 29918, 1853, 353, 1134, 29898, 8977, 2141, 8149, 3101, 13, 4706, 565, 451, 338, 8758, 29898, 1191, 29892, 313, 8149, 29918, 1853, 29892, 1051, 22164, 13, 9651, 1852, 353, 426, 1191, 29901, 1852, 29913, 13, 4706, 1121, 353, 740, 29898, 1191, 29897, 13, 4706, 565, 7431, 29898, 1191, 29897, 1275, 29871, 29896, 29901, 13, 9651, 396, 679, 937, 995, 297, 4133, 9657, 13, 9651, 736, 1121, 29961, 4622, 29898, 1524, 29898, 2914, 28166, 13, 4706, 736, 1121, 13, 13, 1678, 736, 14476, 13, 13, 13, 1753, 679, 29918, 3126, 29918, 8977, 29898, 2084, 29901, 851, 29897, 1599, 9657, 29901, 13, 1678, 411, 1722, 29898, 2084, 29892, 376, 29878, 1159, 408, 285, 29901, 13, 4706, 736, 4390, 29889, 18132, 29898, 29888, 29889, 949, 3101, 13, 13, 13, 29992, 4905, 29918, 15123, 29918, 19557, 1061, 13, 1753, 269, 21040, 29918, 4878, 29918, 517, 29918, 11108, 295, 29918, 4878, 29898, 1807, 29918, 1761, 29901, 1051, 29897, 1599, 9657, 29901, 13, 1678, 3838, 29918, 1761, 29901, 1051, 353, 5159, 13, 1678, 363, 2944, 297, 1347, 29918, 1761, 29901, 13, 4706, 3838, 29918, 1761, 29889, 4397, 29898, 13, 9651, 376, 1642, 7122, 29898, 1742, 29961, 29900, 1822, 21064, 580, 718, 1734, 29961, 29896, 17531, 363, 1734, 297, 2944, 29889, 5451, 703, 29918, 5783, 13, 4706, 1723, 13, 1678, 736, 9657, 29898, 7554, 29898, 1807, 29918, 1761, 29892, 3838, 29918, 1761, 876, 13, 13, 13, 1753, 3949, 295, 29918, 4878, 29918, 517, 29918, 29879, 21040, 29918, 4878, 29898, 1807, 29901, 851, 29897, 1599, 9657, 29901, 13, 1678, 736, 376, 1642, 7122, 29898, 13, 4706, 11119, 29908, 718, 5829, 29889, 13609, 580, 565, 5829, 29889, 275, 21064, 580, 1683, 5829, 363, 5829, 297, 1051, 29898, 1807, 29897, 13, 1678, 13742, 17010, 703, 29918, 1159, 13, 13, 13, 1753, 3588, 29918, 517, 29918, 4691, 29918, 1853, 29898, 2671, 1125, 13, 1678, 565, 1746, 29889, 13609, 580, 1275, 376, 2378, 1115, 13, 4706, 736, 376, 1761, 29908, 13, 1678, 25342, 1746, 29889, 13609, 580, 1275, 376, 20054, 1115, 13, 4706, 736, 376, 11227, 29908, 13, 1678, 25342, 1746, 29889, 13609, 580, 1275, 376, 16031, 1115, 13, 4706, 736, 376, 524, 29908, 13, 1678, 25342, 1746, 29889, 13609, 580, 1275, 376, 4537, 1115, 13, 4706, 736, 376, 7411, 29908, 13, 1678, 25342, 1746, 29889, 13609, 580, 1275, 376, 3318, 1115, 13, 4706, 736, 376, 1017, 15702, 29889, 10773, 29908, 13, 1678, 25342, 1746, 29889, 13609, 580, 1275, 376, 1807, 1115, 13, 4706, 736, 376, 710, 29908, 13, 1678, 1683, 29901, 13, 4706, 736, 851, 29898, 2671, 29897, 13, 13, 13, 1753, 9500, 29918, 3126, 29918, 8977, 29918, 7039, 29898, 24595, 29918, 1272, 29901, 851, 29892, 770, 7039, 29901, 851, 29897, 1599, 9657, 29901, 13, 1678, 736, 426, 29894, 29901, 8656, 29918, 1272, 29961, 29895, 29962, 363, 413, 29892, 325, 297, 770, 7039, 29889, 7076, 28296, 13, 13, 13, 1753, 11608, 675, 29918, 23515, 29918, 294, 29918, 5325, 29898, 3126, 29918, 8977, 29901, 9657, 29897, 1599, 9657, 29901, 13, 1678, 977, 264, 1280, 353, 731, 580, 13, 1678, 363, 1158, 29918, 8977, 297, 4390, 29918, 8977, 3366, 23515, 3108, 29901, 13, 4706, 1158, 29918, 978, 353, 1158, 29918, 8977, 3366, 978, 16862, 5451, 17350, 1159, 29961, 29900, 29962, 13, 4706, 977, 264, 1280, 29889, 1202, 29898, 5696, 29918, 978, 29897, 13, 13, 1678, 736, 426, 978, 29901, 6571, 363, 1024, 297, 977, 264, 1280, 29913, 13, 13, 13, 1753, 8814, 29918, 6799, 29918, 978, 29898, 978, 29901, 851, 1125, 13, 1678, 565, 1024, 29961, 29900, 1822, 275, 26204, 580, 470, 1024, 297, 9049, 1761, 29901, 13, 4706, 1024, 353, 11119, 29908, 718, 1024, 13, 1678, 736, 1024, 13, 2 ]
filer/server/backends/xsendfile.py
PeterW-LWL/django-filer
134
1609923
# -*- coding: utf-8 -*- from __future__ import absolute_import from django.http import HttpResponse from .base import ServerBase class ApacheXSendfileServer(ServerBase): def serve(self, request, file_obj, **kwargs): response = HttpResponse() response['X-Sendfile'] = file_obj.path # This is needed for lighttpd, hopefully this will # not be needed after this is fixed: # http://redmine.lighttpd.net/issues/2076 response['Content-Type'] = self.get_mimetype(file_obj.path) self.default_headers(request=request, response=response, file_obj=file_obj, **kwargs) return response
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 13, 3166, 9557, 29889, 1124, 1053, 9056, 5103, 13, 13, 3166, 869, 3188, 1053, 5656, 5160, 13, 13, 13, 1990, 13380, 29990, 12600, 1445, 6004, 29898, 6004, 5160, 1125, 13, 1678, 822, 9080, 29898, 1311, 29892, 2009, 29892, 934, 29918, 5415, 29892, 3579, 19290, 1125, 13, 4706, 2933, 353, 9056, 5103, 580, 13, 4706, 2933, 1839, 29990, 29899, 12600, 1445, 2033, 353, 934, 29918, 5415, 29889, 2084, 13, 13, 4706, 396, 910, 338, 4312, 363, 3578, 9392, 29881, 29892, 27581, 445, 674, 13, 4706, 396, 451, 367, 4312, 1156, 445, 338, 4343, 29901, 13, 4706, 396, 1732, 597, 1127, 24669, 29889, 4366, 9392, 29881, 29889, 1212, 29914, 12175, 29914, 29906, 29900, 29955, 29953, 13, 4706, 2933, 1839, 3916, 29899, 1542, 2033, 353, 1583, 29889, 657, 29918, 29885, 17528, 668, 29898, 1445, 29918, 5415, 29889, 2084, 29897, 13, 13, 4706, 1583, 29889, 4381, 29918, 13662, 29898, 3827, 29922, 3827, 29892, 2933, 29922, 5327, 29892, 934, 29918, 5415, 29922, 1445, 29918, 5415, 29892, 3579, 19290, 29897, 13, 4706, 736, 2933, 13, 2 ]
app/auth/forms.py
AngelMunoz/FlaskBlueprintsDemo
2
1600536
<filename>app/auth/forms.py from flask_wtf import FlaskForm # , RecaptchaField from wtforms import StringField, PasswordField #, BooleanField from wtforms.validators import Required, Email, EqualTo class LoginForm(FlaskForm): email = StringField('Email Address', [Email(), Required(message='Forgot your email address?')]) password = PasswordField('Password', [ Required(message='Must provide a password.')]) class RegisterForm(FlaskForm): email = StringField('Email Address', [Email(), Required(message='Forgot your email address?')]) password = PasswordField('Password', [ Required(message='Must provide a password.')]) password_repeat = PasswordField('Please Repeat your Password',[ Required(message="You must type your password again")]) name = StringField('Name', [Required(message='Please add your name')]) second_name = StringField('Second Name') lastname = StringField('last Name', [Required(message='Please add your Last Name')]) second_lastname = StringField('Second Lastname') rfc = StringField('RFC', [Required(message='Please add your RFC')]) company = StringField('Company', [Required(message="Please add your Company's Name")])
[ 1, 529, 9507, 29958, 932, 29914, 5150, 29914, 9514, 29889, 2272, 13, 3166, 29784, 29918, 29893, 13264, 1053, 2379, 1278, 2500, 396, 1919, 3599, 2156, 5815, 3073, 13, 3166, 281, 29873, 9514, 1053, 1714, 3073, 29892, 25280, 3073, 396, 29892, 11185, 3073, 13, 3166, 281, 29873, 9514, 29889, 3084, 4097, 1053, 830, 5958, 29892, 22608, 29892, 11243, 284, 1762, 13, 13, 13, 1990, 19130, 2500, 29898, 8754, 1278, 2500, 1125, 13, 1678, 4876, 539, 353, 1714, 3073, 877, 9823, 16428, 742, 518, 9823, 3285, 13, 462, 1678, 830, 5958, 29898, 4906, 2433, 29943, 990, 327, 596, 4876, 3211, 29973, 1495, 2314, 13, 1678, 4800, 1678, 353, 25280, 3073, 877, 10048, 742, 518, 13, 462, 1678, 830, 5958, 29898, 4906, 2433, 29924, 504, 3867, 263, 4800, 29889, 1495, 2314, 13, 462, 268, 13, 13, 1990, 12577, 2500, 29898, 8754, 1278, 2500, 1125, 13, 1678, 4876, 1669, 353, 1714, 3073, 877, 9823, 16428, 742, 518, 9823, 3285, 13, 462, 9651, 830, 5958, 29898, 4906, 2433, 29943, 990, 327, 596, 4876, 3211, 29973, 1495, 2314, 13, 1678, 4800, 9651, 353, 25280, 3073, 877, 10048, 742, 518, 13, 462, 9651, 830, 5958, 29898, 4906, 2433, 29924, 504, 3867, 263, 4800, 29889, 1495, 2314, 13, 1678, 4800, 29918, 14358, 268, 353, 25280, 3073, 877, 12148, 830, 11666, 596, 25280, 742, 29961, 13, 462, 9651, 830, 5958, 29898, 4906, 543, 3492, 1818, 1134, 596, 4800, 1449, 1159, 2314, 462, 632, 13, 1678, 1024, 18884, 353, 1714, 3073, 877, 1170, 742, 518, 19347, 29898, 4906, 2433, 12148, 788, 596, 1024, 1495, 2314, 13, 1678, 1473, 29918, 978, 308, 353, 1714, 3073, 877, 11863, 4408, 1495, 13, 1678, 1833, 978, 9651, 353, 1714, 3073, 877, 4230, 4408, 742, 518, 19347, 29898, 4906, 2433, 12148, 788, 596, 9208, 4408, 1495, 2314, 13, 1678, 1473, 29918, 4230, 978, 268, 353, 1714, 3073, 877, 11863, 9208, 978, 1495, 13, 1678, 364, 13801, 462, 353, 1714, 3073, 877, 29934, 8610, 742, 518, 19347, 29898, 4906, 2433, 12148, 788, 596, 390, 8610, 1495, 2314, 13, 1678, 5001, 632, 353, 1714, 3073, 877, 21410, 742, 518, 19347, 29898, 4906, 543, 12148, 788, 596, 6938, 29915, 29879, 4408, 1159, 2314, 2 ]
chess.py
asomfai/pgn_compress
0
123096
from decimal import * import math import string import colorama import sys import copy colorama.init() # rows and columns are indexed by numbers [0:7] #DONE: fill default board #DONE: read a play from a file #DONE: castling #DONE: fix castling #DONE: play back and check every steps validity #DONE: generate numeric code #DONE: read PGN file with more games #DONE: decoding #DONE: create castling move class #DONE: create e.p. move class #DONE: support Pawn promotion (pawn move followed by =<piece type>) #DONE: handle ambiguous moves: if more piece can do the move, the one NOT letting the king in a checked position can move #todo: make table a class #DONE: en passant #todo: batch files: more binaries in bin, more tables in in one log file ############################# Chess Table Representation ############################# class Piece (object): # pieces: color:w/b Type:King,Queen,Rooks,Bishops,kNights,Pawns def __init__(self, Color, Type, Moved=False): self.Color = Color self.Type = Type self.Moved = Moved if Color not in ["w","b"]: raise Exception("Bad color",Color) if Type not in ["Q","K","B","R","N","P"]: raise Exception("Bad Type",Type) if Moved not in [True,False]: raise Exception("Bad Moved",Moved) def __eq__(self, other): return type(other)==Piece and self.Color == other.Color and self.Type == other.Type and self.Moved == other.Moved def __ne__(self, other): return not self.__eq__(other) def isWhite(self):return self.Color=="w"; def isBlack(self):return self.Color=="b"; def isMoved(self):return self.Moved; def isQueen(self):return self.Type == "Q"; def isKing(self):return self.Type == "K"; def isRook(self):return self.Type == "R"; def isBishop(self):return self.Type == "B"; def isKnight(self):return self.Type == "N"; def isPawn(self):return self.Type == "P"; def toString(self):return self.Color+self.Type; ############################# define move ############################# class Move (object): def __init__(self, piece, to_x,to_y,capture=False,kingcapture=False): self.piece = piece self.to_x = to_x self.to_y = to_y self.capture = capture self.from_x=None self.from_y=None self.promotion=None #piece promoted to self.Kingcapture=kingcapture if self.to_x not in range(0,8):raise Exception("Bad move to",self.to_x,self.to_y,capture) if self.to_y not in range(0,8):raise Exception("Bad move to",self.to_x,self.to_y,capture) if self.capture not in [True,False] :raise Exception("Bad move to",to_x,to_y,capture) def isKingCapture(self): return self.Kingcapture def toString(self): string = self.piece.toString() if self.from_x != None: string += 'abcdefgh'[self.from_x] if self.from_y != None: string += str(self.from_y+1) string += 'abcdefgh'[self.to_x] string += str(self.to_y+1) if self.capture: if self.Kingcapture: string += "+" else: string += "X" if self.promotion!=None: string += "=" + self.promotion.toString() return string def Match(self, other): if type(other) is Castling: return False if type(other) is EnPassant: return self.piece.isPawn() and other.piece.isPawn() and self.to_x == other.to_x and self.to_y == other.to_y if self.to_x != other.to_x or self.to_y != other.to_y : return False if self.promotion != other.promotion : return False return self.piece.Type == other.piece.Type class Castling (object): def __init__(self, piece, to_x,to_y): self.piece = piece self.to_x = to_x self.to_y = to_y self.from_x=None self.from_y=None def isKingCapture(self): return False def toString(self): string = self.piece.toString() if self.to_x==2: string += " O-O-O to "+str(self.to_x) else: string += " O-O to "+str(self.to_x) return string def Match(self, other): if not type(other) is Castling: return False if self.to_x != other.to_x: return False return True class EnPassant (Move): def __init__(self, piece, to_x,to_y,capture_x,capture_y): super(EnPassant,self).__init__(piece, to_x,to_y,True) self.ep_x=capture_x self.ep_y=capture_y def isKingCapture(self): return False def toString(self): return super(EnPassant,self).toString()+"e.p." ############################# directional moves: King,Queen,Bishop,Rook ############################# # direction table: direction=[[-1,-1],[-1, 0],[-1, 1],[ 0, 1],[ 1, 1],[ 1, 0],[ 1,-1],[ 0,-1]] # return: [] if not valid, [to_x,to_y] if valid, [to_x,to_y,"!<captured_piece>"] if opposite players piece is captured def ValidMove(to_x,to_y,piece): #print "piece",piece.toString()," move to ",to_x,to_y, #print "" if LastMove==None else LastMove.toString() #if LastMove!=None and LastMove.piece.isPawn() and piece.isPawn(): #print LastMove.from_x,LastMove.from_y,LastMove.to_x, LastMove.to_y ,to_x, to_y if not to_x in range(0,8) or not to_y in range(0,8): #print "out" return None if table[to_x][to_y]==None: #print "valid, free", #check en passant if LastMove!=None and LastMove.piece.isPawn() and piece.isPawn(): if LastMove.from_y-LastMove.to_y in [-2,2] and LastMove.from_x == to_x and LastMove.from_x == LastMove.to_x and (LastMove.from_y+LastMove.to_y)/2 == to_y: #print "e.p." return EnPassant(piece,to_x,to_y,LastMove.to_x,LastMove.to_y) return Move(piece,to_x,to_y) elif table[to_x][to_y].Color!=piece.Color: #print "valid, capture" return Move(piece,to_x,to_y,True,table[to_x][to_y].isKing()) #print "occupied" return None def DirectionalMove(x,y,start,step,max_range,piece): steps=[] # possible steps if table[x][y] != piece: print 'figure @',x,' ',y,'=',table[x][y].toString(),'is not a '+piece.toString()+'!' return steps else: for dir in range(start,8,step): dx=direction[dir][0] dy=direction[dir][1] for distance in range(1,max_range+1): next_x=x+dx*distance next_y=y+dy*distance valid_step=ValidMove(next_x,next_y,piece); if valid_step!=None:steps.append(valid_step) if valid_step==None or valid_step.capture: break; return steps def QueenMoves(x,y,piece): return DirectionalMove(x,y,0,1,7,piece) def RookMoves(x,y,piece): return DirectionalMove(x,y,1,2,7,piece) def BishopMoves(x,y,piece): return DirectionalMove(x,y,0,2,7,piece) ############################# special moves ############################# def KingMoves(x,y,piece): steps = [] if not piece.Moved: if not(y == 0 and piece.isWhite() or y==7 and piece.isBlack()):raise Exception("King.Moved does not match its rank!") if not(x == 4):raise Exception("King.Moved does not match its file!") for rook_file,castling_direction in [(0,-1),(7,+1)]: #rook at start position, not moved if table[rook_file][y]!=None and table[rook_file][y].Moved==False and table[rook_file][y].isRook(): #no pieces between them castling_possible=True for x_r in range(x+castling_direction,rook_file,castling_direction): if table[x_r][y]!=None: castling_possible=False break if castling_possible: steps.append(Castling(piece,x+2*castling_direction,y)) return steps+DirectionalMove(x,y,0,1,1,piece) KnightMoveDeltas=[[-1,-2],[-1, 2],[ 1,-2],[ 1, 2],[-2,-1],[-2, 1],[ 2,-1],[ 2, 1]] def KnightMoves(x,y,piece): steps=[] if table[x][y] != piece: print 'figure @',x,' ',y,'=',table[x][y].toString(),'is not a '+piece.toString()+'!' return steps for knigt_move in KnightMoveDeltas: valid_move=ValidMove(x+knigt_move[0],y+knigt_move[1],piece) if valid_move!=None: steps.append(valid_move) return steps def PawnMoves(x,y,piece): #print "check pawn moves @",x,y steps=[] if table[x][y] != piece: print 'figure @',x,' ',y,'=',table[x][y].toString(),'is not a '+piece.toString()+'!' return steps direction = 1 if piece.isWhite() else -1 #print direction # forward valid_move=ValidMove(x,y+direction,piece) if valid_move != None and valid_move.capture==False: steps.append(valid_move) #print steps #when not moved yet, pawn may step make 2 steps forward if valid_move!= None and valid_move.capture==False and not piece.Moved: valid_move=ValidMove(x,y+direction+direction,piece) if valid_move != None:steps.append(valid_move) #capture left or right valid_move=ValidMove(x-1,y+direction,piece) if valid_move != None and valid_move.capture:steps.append(valid_move) valid_move=ValidMove(x+1,y+direction,piece) if valid_move != None and valid_move.capture:steps.append(valid_move) if False: for move in steps:print move.toString(), #create possible promotions new_steps = [] for step in steps: if piece.Color=="w" and step.to_y==7 or piece.Color=="b" and step.to_y==0: # print "PROMOTIONS" promotion_types="QNBR" for type in promotion_types: new_step=copy.copy(step) new_step.promotion=Piece(piece.Color,type) new_steps.append(new_step) # print new_step.toString(),new_step.promotion==Piece(piece.Color,type) else: new_steps.append(step) return new_steps def GeneralMove(x,y): steps=[] piece=table[x][y] if piece==None:return [] # print x,y,piece.toString() if piece.isKing():return KingMoves(x,y,piece) if piece.isQueen():return QueenMoves(x,y,piece) if piece.isBishop():return BishopMoves(x,y,piece) if piece.isRook():return RookMoves(x,y,piece) if piece.isKnight():return KnightMoves(x,y,piece) if piece.isPawn():return PawnMoves(x,y,piece) raise Exception("Something really bad happened @"+x+y) return [] #do a move def DoMove(x_from,y_from,move): # last move - used for e.p. global LastMove # print "Make Move:",move.toString() x_to=move.to_x y_to=move.to_y #check piece=table[x_from][y_from] if piece==None: raise Exception('Move from empty field',x_from,y_from) #castling if type(move) is Castling: if y_to not in [0,7]:raise Exception("Castling move error - bad rank") if x_to not in [2,6]:raise Exception("Castling move error - bad file") if table[x_to][y_to]!=None:raise Exception("Castling move error - occupied") if x_to==2: if table[0][y_to]==None or not table[0][y_to].isRook():raise Exception("Castling rook missing") table[3][y_to],table[0][y_to]=table[0][y_to],table[3][y_to] # move rook table[4][y_to],table[2][y_to]=table[2][y_to],table[4][y_to] # move king table[2][y_to].Moved=table[3][y_to].Moved=True elif x_to==6: if table[7][y_to]==None or not table[7][y_to].isRook():raise Exception("Castling rook missing") table[7][y_to],table[5][y_to]=table[5][y_to],table[7][y_to] # move rook table[6][y_to],table[4][y_to]=table[4][y_to],table[6][y_to] # move king table[5][y_to].Moved=table[6][y_to].Moved=True else: raise Exception('Not a valid castling move.') elif type(move) is EnPassant: assert(table[x_to][y_to]==None) table[x_to][y_to],table[x_from][y_from]=table[x_from][y_from],table[x_to][y_to] table[x_to][y_to].Moved=True #capture en passant pawn assert LastMove.piece.isPawn() table[LastMove.to_x][LastMove.to_y]=None else: #print x_to,y_to,table[x_to][y_to] #normal move #empty field? if table[x_to][y_to]==None: table[x_to][y_to],table[x_from][y_from]=table[x_from][y_from],table[x_to][y_to] #capture other players piece? elif table[x_to][y_to].Color!=table[x_from][y_from].Color: table[x_to][y_to]=table[x_from][y_from] table[x_from][y_from]=None else: raise Exception('Field occupied by friendly piece',table[x_to][y_to]) if type(move.promotion)==Piece: # print "Promotion done" table[x_to][y_to].Type = move.promotion.Type table[x_to][y_to].Moved=True LastMove = move; LastMove.from_x=x_from; LastMove.from_y=y_from # print "New Last Move=",LastMove.toString() # except Exception as inst: # print inst # raise inst # pass # setup initial table table = [] LastMove = None def SetupTable(): global table empty_square=None line=[empty_square,empty_square,empty_square,empty_square,empty_square,empty_square,empty_square,empty_square] table=[line[:],line[:],line[:],line[:],line[:],line[:],line[:],line[:]] table[0][0]=Piece('w','R');table[7][0]=Piece('w','R') table[1][0]=Piece('w','N');table[6][0]=Piece('w','N') table[2][0]=Piece('w','B');table[5][0]=Piece('w','B') table[3][0]=Piece('w','Q') table[4][0]=Piece('w','K') for i in range(0,8):table[i][1]=Piece('w','P');table[i][6]=Piece('b','P');table[i][7]=None if table[i][0]==None else Piece('b',table[i][0].Type) def PrintTable(): return print " abcdefgh" for y in range(7,-1,-1): line_string=str(y+1) for x in range(0,8): line_string += colorama.Back.YELLOW if (x+y) % 2 == 1 else colorama.Back.BLUE field=table[x][y] if field == None: line_string += " " else: if field.Color=="w": line_string += colorama.Fore.WHITE else: line_string += colorama.Fore.BLACK line_string += field.Type print line_string+colorama.Style.RESET_ALL def LogTable(step): string=str(step)+".\n" string+=" abcdefgh\n" for y in range(7,-1,-1): string+=str(y+1) for x in range(0,8): field=table[x][y] if field == None: string += " " else: string += field.Type if field.Color =="w" else field.Type.lower() string+="\n" string+="\n" return string ############################# read PGN file ############################# class TokenFile: class EndOfFile: def __init__(self): pass def __init__(self,filename): print "opening ",filename, my_file=open(filename) self.string = my_file.read() self.pos=0 self.len=len(self.string) my_file.close() print self.len,"chars" def isWhiteSpaceChar(self,char): return char in " \t\n" def skip_whitespaces(self): while True: c = self.getChar() if not self.isWhiteSpaceChar(c): return c self.nextChar() def getChar(self): if self.pos>=self.len: print "TokenFile.EndOfFile" raise TokenFile.EndOfFile() return self.string[self.pos] def readLine(self): try: lineend_pos= self.string.index("\n",self.pos) except ValueError: lineend_pos = self.len prev_pos,self.pos = self.pos, lineend_pos+1 return self.string[prev_pos:lineend_pos] def isWhitespace(self): return False if self.pos>=self.len else self.isWhiteSpaceChar(self.string[self.pos]) def nextChar(self,step=1): #print(self.string[self.pos:self.pos+step]) self.pos = self.pos+step def readChars(self,size=1): string=self.string[self.pos:self.pos+size] self.pos = self.pos+step def readNumber(self): self.skip_whitespaces() string_number="" while self.pos<self.len: c=self.getChar() if c in "0123456789": string_number+=c self.nextChar() else: return int(string_number) def readToken(self): string="" while not self.isWhitespace() and self.pos<self.len: string += self.getChar() self.nextChar() #print string return string def expectString(self,string): if self.string[self.pos:self.pos+len(string)]!=string: raise Exception("file syntax error") self.nextChar(len(string)) def acceptString(self,string): if self.string[self.pos:self.pos+len(string)]==string: self.nextChar(len(string)) return True return False def isString(self,string,case_sensitive=True): return self.string[self.pos:self.pos+len(string)]==string if case_sensitive else self.string[self.pos:self.pos+len(string)].lower()==string.lower() class Step: def __init__(self,type,to_x,to_y,from_x=None,from_y=None,capture=None): pass #color: "w"/"b" def readStep(input_file,color): #read step notation type='P' input_file.skip_whitespaces() #read notation string - until next whitespace capture = False dis_file=None dis_rank=None trg_file=None trg_rank=None promotion_type=None king_castling=False; queen_castling=False; token = input_file.readToken() #capture - not interesting if 'x' in token or ":" in token : capture = True token=token.replace("x","") token=token.replace(":","") #check or checkmate - not interesting if '+' in token or "#" in token: token=token.replace("+","") token=token.replace("#","") if '=' in token : print token[-2:-1],token[-1:] assert token[-2:-1]=="=" promotion_type = token[-1:] token=token[:-2] if token == "O-O": king_castling=True; type='K' elif token == "O-O-O": queen_castling=True; type='K' else: #normal move if token[-4:]=="e.p.": #en passage - not supported yet raise Exception("en passage - not supported yet") #last 2 chars: target file, rank trg_file=token[-2] trg_rank=token[-1] token=token[:-2] #cut target field #first char: type (or omitted if pawn) if len(token)>0: c1=token[0] if c1 in "QKNBR": #other move type=c1 token = token[1:] #cut piece identification #remaining chars: disambiguation if len(token)==1: if token[0] in string.digits: dis_rank=token[0] elif token[0] in string.ascii_lowercase: dis_file=token[0] elif len(token)==2: dis_file=token[0] dis_rank=token[1] elif len(token)!=0: raise Exception("token error") if queen_castling: trg_file = "c" trg_rank == 0 if color == "w" else 7 elif king_castling: trg_file = "g" trg_rank == 0 if color =="w" else 7 # print type,trg_file,trg_rank,dis_file,dis_rank,capture # transform a..h,1..8 to 0..7,0..7 files = ["a","b","c","d","e","f","g","h"] if trg_file != None:trg_file=files.index(trg_file) if trg_rank != None:trg_rank = int(trg_rank)-1 if dis_file!=None:dis_file=files.index(dis_file) if dis_rank!=None:dis_rank = int(dis_rank)-1 if capture == None:capture = False if queen_castling or king_castling: move = Castling(Piece(color,type), trg_file, trg_rank) else: move = Move(Piece(color,type), trg_file, trg_rank, capture) move.from_x = dis_file move.from_y = dis_rank if promotion_type!=None: assert promotion_type in "QNBR" move.promotion=Piece(color,promotion_type) return move class PGNFile: class End: def __init__(self): pass def __init__(self, filename): self.input_file = TokenFile(filename) def TestEnd(self): self.input_file.skip_whitespaces() if self.input_file.acceptString("1-0"): return "w" if self.input_file.acceptString("0-1"): return "b" if self.input_file.acceptString("1/2-1/2"): return "d" return None def ReadGame(self): try: step_ex=0 moves = [] self.input_file.skip_whitespaces() #skip tags while self.input_file.getChar()=="[": print self.input_file.readLine() self.input_file.skip_whitespaces() while True: #read step if self.TestEnd()!=None:break step=self.input_file.readNumber() if step==None: break step_ex = step_ex+1 if step!=step_ex: raise Exception("file step mismatch @ step"+step_ex+1) #read . (dot) self.input_file.expectString(".") #print str(step_ex),":", moves.append(readStep(self.input_file,"w")) #print moves[-1].toString(), if self.TestEnd()!=None:break moves.append(readStep(self.input_file,"b")) #print moves[-1].toString(), except TokenFile.EndOfFile: print "PGNFile.End" raise PGNFile.End() pass print "read",step_ex,"steps" return moves #test: collect all valid moves def MakeCode(game_steps): #generate code sum_bits=0 n=Decimal(0) for (range,index) in reversed(game_steps): assert range>index n=n*range n=n+index sum_bits = sum_bits + math.log(range,2) #print as binary print "code=",n bits="" ctx = getcontext() assert ctx.prec > len(n.as_tuple().digits) + 2 while n>0: if n % Decimal(2)==1: bits="1"+bits n = n - 1 else: bits="0"+bits n = n / 2 print "bits=",len(bits),"theoretical=",sum_bits,"avg bit/move",float(len(bits))/len(game_steps) return bits def CheckKingCaptureMovesAfterMove(x_from,y_from,move,color): global table,LastMove #print move.toString() has_checking = False saved_table=copy.deepcopy(table) saved_LastMove=copy.deepcopy(LastMove) DoMove(x_from,y_from,move) #find pieces on table for y in range(0,8): for x in range(0,8): if table[x][y]!=None and table[x][y].Color == color: for pmove in GeneralMove(x,y): #print " ",pmove.toString() has_checking |= pmove.isKingCapture() table=saved_table LastMove=saved_LastMove return has_checking def LogError(game,file_name,log_string,step,possible_moves,matching_moves,player_move): PrintTable() print "Possible moves:",len(possible_moves) for [x,y,pmove] in possible_moves:print pmove.toString(), print print "Matching nonchecking moves:" for [x,y,pmove] in matching_moves:print pmove.toString(), print logfile=open(file_name+"."+str(game)+".tbl","w") logfile.write(log_string) logfile.close() raise Exception("Bad move in step",step/2,player_move.toString()) def ProcessPGN(file_name): pgn_file = PGNFile(file_name) game = 1 while True: game_desc=[] # list of tuples(number of possible steps, players step index in possible step list) log_string="" try: moves = pgn_file.ReadGame() except PGNFile.End: break print "GAME ",game, SetupTable() PrintTable() log_string+=LogTable(0) #for each move: look for possible moves, make the move side = True #True:white False:black continous = True verbose = False step=0 for move in moves: log_string+=move.toString() log_string+="\n" step = step + 1 color = "w" if side else "b" piece = move.piece possible_moves = [] #find pieces on table for y in range(0,8): for x in range(0,8): if table[x][y]!=None and table[x][y].Color == color: for pmove in GeneralMove(x,y): possible_moves.append([x,y,pmove]) if verbose:print "step",step,"players move: ",move.toString(),"possible moves",len(possible_moves) matching_moves=[] for [x,y,pmove] in possible_moves: if move.Match(pmove) and (move.from_x==None or move.from_x==x) and (move.from_y==None or move.from_y==y): if verbose:print "found move",pmove.piece.toString()+'abcdefgh'[x]+str(y+1),pmove.toString() matching_moves.append([x,y,pmove]) matching_move = None # print "Number of matching moves:",len(matching_moves) if len(matching_moves) > 1: #see if some moves will put the King in a checking position. Find the one that wont nochecking_moves=[] for [x,y,pmove] in matching_moves: kingcapture = CheckKingCaptureMovesAfterMove(x,y,pmove,"b" if side else "w") #print kingcapture if not kingcapture: nochecking_moves.append([x,y,pmove]) #print "No-checking moves:",len(nochecking_moves) if len(nochecking_moves) != 1: LogError(game,file_name,log_string,step,possible_moves,nochecking_moves,move) else: matching_move=nochecking_moves[0] elif len(matching_moves) == 1: matching_move=matching_moves[0] else: LogError(game,file_name,log_string,step,possible_moves,matching_moves,move) DoMove(matching_move[0],matching_move[1],matching_move[2]) if False and verbose: PrintTable() game_desc.append((len(possible_moves),possible_moves.index(matching_move))) log_string+=LogTable(step) try: if not continous: cont = raw_input("Continue? ") if cont=="n":break if cont== "a": continous = True except: pass side = not side #all moves processed if verbose: PrintTable() logfile=open(file_name+"."+str(game)+".tbl","w") logfile.write(log_string) logfile.close() print game_desc binary = MakeCode(game_desc) bin_file=open(file_name+"."+str(game)+".bin","w") bin_file.write(binary) bin_file.close() print binary game = game + 1 #all games processed def ProcessBIN(file_name): binary_str=TokenFile(file_name).readLine() pos_value = Decimal(1) value = Decimal(0) for pos in range(len(binary_str)-1,-1,-1): value += pos_value if binary_str[pos]=="1" else Decimal(0) pos_value *= Decimal(2) SetupTable(); game_desc = [] print "code=",value log_string="" step = 0 log_string+=LogTable(step); color ="b" while value != 0: color = "w" if color =="b" else "b" possible_moves = [] #find pieces on table for y in range(0,8): for x in range(0,8): if table[x][y]!=None and table[x][y].Color == color: for pmove in GeneralMove(x,y): possible_moves.append([x,y,pmove]) step_range = len(possible_moves) index = value % step_range game_desc.append((int(step_range),int(index))) value -= index value = value / step_range int_index = int(index) assert Decimal(int_index) == index DoMove(possible_moves[int_index][0],possible_moves[int_index][1],possible_moves[int_index][2]) step += 1 log_string+=LogTable(step); print game_desc game = 1 logfile=open(file_name+"."+str(game)+".tbl","w") logfile.write(log_string) logfile.close() if False: test_moves=[] test_moves+=GeneralMove(4,0) test_moves+=GeneralMove(4,7) for move in test_moves:print move.toString(), print DoMove(4,0,test_moves[1]) PrintTable() setcontext(Context(prec=300)) filename = sys.argv[1].strip().replace("\\","/") if filename[-4:]==".pgn": ProcessPGN(filename) elif sys.argv[1][-4:]==".bin": ProcessBIN(filename)
[ 1, 515, 13677, 1053, 334, 13, 5215, 5844, 13, 5215, 1347, 13, 5215, 2927, 3304, 13, 5215, 10876, 13, 5215, 3509, 13, 13, 2780, 3304, 29889, 2344, 580, 13, 13, 29937, 4206, 322, 4341, 526, 27541, 491, 3694, 518, 29900, 29901, 29955, 29962, 13, 13, 29937, 29928, 12413, 29901, 5445, 2322, 7613, 13, 29937, 29928, 12413, 29901, 1303, 263, 1708, 515, 263, 934, 13, 29937, 29928, 12413, 29901, 4320, 1847, 13, 29937, 29928, 12413, 29901, 2329, 4320, 1847, 13, 29937, 29928, 12413, 29901, 1708, 1250, 322, 1423, 1432, 6576, 2854, 537, 13, 29937, 29928, 12413, 29901, 5706, 16985, 775, 13, 29937, 29928, 12413, 29901, 1303, 349, 20728, 934, 411, 901, 8090, 13, 29937, 29928, 12413, 29901, 1602, 3689, 13, 29937, 29928, 12413, 29901, 1653, 4320, 1847, 4337, 770, 13, 29937, 29928, 12413, 29901, 1653, 321, 29889, 29886, 29889, 4337, 770, 13, 29937, 29928, 12413, 29901, 2304, 2621, 1233, 22360, 313, 3274, 1233, 4337, 5643, 491, 353, 29966, 12343, 346, 1134, 12948, 13, 29937, 29928, 12413, 29901, 4386, 22363, 681, 16229, 29901, 565, 901, 8424, 508, 437, 278, 4337, 29892, 278, 697, 6058, 27697, 278, 6989, 297, 263, 7120, 2602, 508, 4337, 13, 29937, 29873, 8144, 29901, 1207, 1591, 263, 770, 13, 29937, 29928, 12413, 29901, 427, 1209, 424, 13, 29937, 29873, 8144, 29901, 9853, 2066, 29901, 901, 9016, 4314, 297, 9016, 29892, 901, 6131, 297, 297, 697, 1480, 934, 13, 13, 13383, 7346, 4136, 29937, 678, 404, 6137, 16314, 362, 835, 13383, 7346, 2277, 13, 1990, 26005, 346, 313, 3318, 1125, 13, 29937, 12785, 29901, 2927, 29901, 29893, 29914, 29890, 5167, 29901, 29968, 292, 29892, 8654, 264, 29892, 29934, 2550, 29879, 29892, 29933, 728, 3554, 29892, 29895, 29940, 5861, 29892, 11868, 1233, 29879, 13, 12, 1753, 4770, 2344, 12035, 1311, 29892, 9159, 29892, 5167, 29892, 341, 8238, 29922, 8824, 1125, 13, 12, 12, 1311, 29889, 3306, 353, 9159, 13, 12, 12, 1311, 29889, 1542, 353, 5167, 13, 12, 12, 1311, 29889, 29924, 8238, 353, 341, 8238, 13, 12, 12, 13, 12, 12, 361, 9159, 451, 297, 6796, 29893, 3284, 29890, 3108, 29901, 13, 12, 12, 12, 22692, 8960, 703, 22050, 2927, 613, 3306, 29897, 13, 13, 12, 12, 361, 5167, 451, 297, 6796, 29984, 3284, 29968, 3284, 29933, 3284, 29934, 3284, 29940, 3284, 29925, 3108, 29901, 13, 12, 12, 12, 22692, 8960, 703, 22050, 5167, 613, 1542, 29897, 13, 13, 12, 12, 361, 341, 8238, 451, 297, 518, 5574, 29892, 8824, 5387, 13, 12, 12, 12, 22692, 8960, 703, 22050, 341, 8238, 613, 29924, 8238, 29897, 13, 12, 12, 12, 13, 12, 1753, 4770, 1837, 12035, 1311, 29892, 916, 1125, 13, 12, 12, 2457, 1134, 29898, 1228, 29897, 1360, 29925, 347, 346, 322, 1583, 29889, 3306, 1275, 916, 29889, 3306, 322, 1583, 29889, 1542, 1275, 916, 29889, 1542, 322, 1583, 29889, 29924, 8238, 1275, 916, 29889, 29924, 8238, 13, 12, 12, 12, 12, 12, 12, 13, 12, 1753, 4770, 484, 12035, 1311, 29892, 916, 1125, 13, 12, 12, 2457, 451, 1583, 17255, 1837, 12035, 1228, 29897, 13, 13, 12, 1753, 338, 21823, 29898, 1311, 1125, 2457, 1583, 29889, 3306, 26359, 29893, 1769, 13, 12, 1753, 338, 18700, 29898, 1311, 1125, 2457, 1583, 29889, 3306, 26359, 29890, 1769, 13, 13, 12, 1753, 338, 29924, 8238, 29898, 1311, 1125, 2457, 1583, 29889, 29924, 8238, 29936, 13, 13, 12, 1753, 338, 8654, 264, 29898, 1311, 1125, 2457, 1583, 29889, 1542, 1275, 376, 29984, 1769, 13, 12, 1753, 338, 29968, 292, 29898, 1311, 1125, 2457, 1583, 29889, 1542, 1275, 376, 29968, 1769, 13, 12, 1753, 338, 29934, 2550, 29898, 1311, 1125, 2457, 1583, 29889, 1542, 1275, 376, 29934, 1769, 13, 12, 1753, 338, 29933, 9835, 29898, 1311, 1125, 2457, 1583, 29889, 1542, 1275, 376, 29933, 1769, 13, 12, 1753, 338, 29968, 11147, 29898, 1311, 1125, 2457, 1583, 29889, 1542, 1275, 376, 29940, 1769, 13, 12, 1753, 338, 11868, 1233, 29898, 1311, 1125, 2457, 1583, 29889, 1542, 1275, 376, 29925, 1769, 13, 12, 13, 12, 1753, 304, 1231, 29898, 1311, 1125, 2457, 1583, 29889, 3306, 29974, 1311, 29889, 1542, 29936, 13, 12, 13, 12, 12, 13, 13, 13383, 7346, 4136, 29937, 4529, 4337, 835, 13383, 7346, 2277, 13, 1990, 25249, 313, 3318, 1125, 13, 12, 1753, 4770, 2344, 12035, 1311, 29892, 8424, 29892, 304, 29918, 29916, 29892, 517, 29918, 29891, 29892, 17885, 545, 29922, 8824, 29892, 9292, 17885, 545, 29922, 8824, 1125, 13, 12, 12, 1311, 29889, 12343, 346, 353, 8424, 13, 12, 12, 1311, 29889, 517, 29918, 29916, 353, 304, 29918, 29916, 13, 12, 12, 1311, 29889, 517, 29918, 29891, 353, 304, 29918, 29891, 13, 12, 12, 1311, 29889, 17885, 545, 353, 10446, 13, 12, 12, 1311, 29889, 3166, 29918, 29916, 29922, 8516, 13, 12, 12, 1311, 29889, 3166, 29918, 29891, 29922, 8516, 13, 12, 12, 1311, 29889, 14032, 8194, 29922, 8516, 396, 12343, 346, 21201, 304, 13, 12, 12, 1311, 29889, 29968, 292, 17885, 545, 29922, 9292, 17885, 545, 13, 12, 12, 12, 12, 13, 12, 12, 361, 1583, 29889, 517, 29918, 29916, 451, 297, 3464, 29898, 29900, 29892, 29947, 1125, 22692, 8960, 703, 22050, 4337, 304, 613, 1311, 29889, 517, 29918, 29916, 29892, 1311, 29889, 517, 29918, 29891, 29892, 17885, 545, 29897, 13, 12, 12, 361, 1583, 29889, 517, 29918, 29891, 451, 297, 3464, 29898, 29900, 29892, 29947, 1125, 22692, 8960, 703, 22050, 4337, 304, 613, 1311, 29889, 517, 29918, 29916, 29892, 1311, 29889, 517, 29918, 29891, 29892, 17885, 545, 29897, 13, 12, 12, 361, 1583, 29889, 17885, 545, 451, 297, 518, 5574, 29892, 8824, 29962, 584, 22692, 8960, 703, 22050, 4337, 304, 613, 517, 29918, 29916, 29892, 517, 29918, 29891, 29892, 17885, 545, 29897, 13, 12, 12, 13, 12, 1753, 338, 29968, 292, 21133, 545, 29898, 1311, 1125, 13, 12, 12, 2457, 1583, 29889, 29968, 292, 17885, 545, 13, 12, 12, 13, 12, 1753, 304, 1231, 29898, 1311, 1125, 13, 12, 12, 1807, 353, 1583, 29889, 12343, 346, 29889, 7711, 580, 13, 12, 12, 361, 1583, 29889, 3166, 29918, 29916, 2804, 6213, 29901, 1347, 4619, 525, 10736, 1753, 12443, 29915, 29961, 1311, 29889, 3166, 29918, 29916, 29962, 13, 12, 12, 361, 1583, 29889, 3166, 29918, 29891, 2804, 6213, 29901, 1347, 4619, 851, 29898, 1311, 29889, 3166, 29918, 29891, 29974, 29896, 29897, 13, 12, 12, 1807, 4619, 525, 10736, 1753, 12443, 29915, 29961, 1311, 29889, 517, 29918, 29916, 29962, 29871, 13, 12, 12, 1807, 4619, 851, 29898, 1311, 29889, 517, 29918, 29891, 29974, 29896, 29897, 13, 12, 12, 361, 1583, 29889, 17885, 545, 29901, 13, 12, 12, 12, 361, 1583, 29889, 29968, 292, 17885, 545, 29901, 13, 12, 12, 12, 12, 1807, 4619, 376, 13578, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 1807, 4619, 376, 29990, 29908, 13, 12, 12, 361, 1583, 29889, 14032, 8194, 19216, 8516, 29901, 13, 12, 12, 12, 1807, 4619, 376, 543, 718, 1583, 29889, 14032, 8194, 29889, 7711, 580, 13, 13, 12, 12, 2457, 1347, 13, 12, 12, 13, 12, 1753, 14514, 29898, 1311, 29892, 916, 1125, 13, 12, 12, 361, 1134, 29898, 1228, 29897, 338, 4834, 1847, 29901, 736, 7700, 13, 12, 12, 361, 1134, 29898, 1228, 29897, 338, 1174, 7129, 424, 29901, 13, 12, 12, 12, 2457, 1583, 29889, 12343, 346, 29889, 275, 11868, 1233, 580, 322, 916, 29889, 12343, 346, 29889, 275, 11868, 1233, 580, 322, 1583, 29889, 517, 29918, 29916, 1275, 916, 29889, 517, 29918, 29916, 322, 1583, 29889, 517, 29918, 29891, 1275, 916, 29889, 517, 29918, 29891, 13, 12, 12, 361, 1583, 29889, 517, 29918, 29916, 2804, 916, 29889, 517, 29918, 29916, 470, 1583, 29889, 517, 29918, 29891, 2804, 916, 29889, 517, 29918, 29891, 584, 736, 7700, 13, 12, 12, 361, 1583, 29889, 14032, 8194, 2804, 916, 29889, 14032, 8194, 584, 736, 7700, 13, 12, 12, 2457, 1583, 29889, 12343, 346, 29889, 1542, 1275, 916, 29889, 12343, 346, 29889, 1542, 13, 13, 13, 1990, 4834, 1847, 313, 3318, 1125, 13, 12, 1753, 4770, 2344, 12035, 1311, 29892, 8424, 29892, 304, 29918, 29916, 29892, 517, 29918, 29891, 1125, 13, 12, 12, 1311, 29889, 12343, 346, 353, 8424, 13, 12, 12, 1311, 29889, 517, 29918, 29916, 353, 304, 29918, 29916, 13, 12, 12, 1311, 29889, 517, 29918, 29891, 353, 304, 29918, 29891, 13, 12, 12, 1311, 29889, 3166, 29918, 29916, 29922, 8516, 13, 12, 12, 1311, 29889, 3166, 29918, 29891, 29922, 8516, 13, 12, 12, 13, 12, 1753, 338, 29968, 292, 21133, 545, 29898, 1311, 1125, 13, 12, 12, 2457, 7700, 13, 13, 12, 1753, 304, 1231, 29898, 1311, 1125, 13, 12, 12, 1807, 353, 1583, 29889, 12343, 346, 29889, 7711, 580, 13, 12, 12, 361, 1583, 29889, 517, 29918, 29916, 1360, 29906, 29901, 1347, 4619, 376, 438, 29899, 29949, 29899, 29949, 304, 15691, 710, 29898, 1311, 29889, 517, 29918, 29916, 29897, 13, 12, 12, 2870, 29901, 1347, 4619, 376, 438, 29899, 29949, 304, 15691, 710, 29898, 1311, 29889, 517, 29918, 29916, 29897, 13, 12, 12, 2457, 1347, 13, 13, 12, 1753, 14514, 29898, 1311, 29892, 916, 1125, 13, 12, 12, 361, 451, 1134, 29898, 1228, 29897, 338, 4834, 1847, 29901, 736, 7700, 13, 12, 12, 361, 1583, 29889, 517, 29918, 29916, 2804, 916, 29889, 517, 29918, 29916, 29901, 736, 7700, 13, 12, 12, 2457, 5852, 13, 13, 1990, 1174, 7129, 424, 313, 16619, 1125, 13, 12, 1753, 4770, 2344, 12035, 1311, 29892, 8424, 29892, 304, 29918, 29916, 29892, 517, 29918, 29891, 29892, 17885, 545, 29918, 29916, 29892, 17885, 545, 29918, 29891, 1125, 13, 12, 12, 9136, 29898, 2369, 7129, 424, 29892, 1311, 467, 1649, 2344, 12035, 12343, 346, 29892, 304, 29918, 29916, 29892, 517, 29918, 29891, 29892, 5574, 29897, 13, 12, 12, 1311, 29889, 1022, 29918, 29916, 29922, 17885, 545, 29918, 29916, 13, 12, 12, 1311, 29889, 1022, 29918, 29891, 29922, 17885, 545, 29918, 29891, 13, 13, 12, 1753, 338, 29968, 292, 21133, 545, 29898, 1311, 1125, 13, 12, 12, 2457, 7700, 13, 13, 12, 1753, 304, 1231, 29898, 1311, 1125, 13, 12, 12, 2457, 2428, 29898, 2369, 7129, 424, 29892, 1311, 467, 7711, 580, 13578, 29872, 29889, 29886, 1213, 13, 12, 12, 13, 13383, 7346, 4136, 29937, 5305, 284, 16229, 29901, 4088, 29892, 8654, 264, 29892, 29933, 9835, 29892, 29934, 2550, 835, 13383, 7346, 2277, 13, 13, 29937, 5305, 1591, 29901, 13, 20845, 29922, 8999, 29899, 29896, 6653, 29896, 1402, 14352, 29896, 29892, 29871, 29900, 1402, 14352, 29896, 29892, 29871, 29896, 16272, 29871, 29900, 29892, 29871, 29896, 16272, 29871, 29896, 29892, 29871, 29896, 16272, 29871, 29896, 29892, 29871, 29900, 16272, 29871, 29896, 6653, 29896, 16272, 29871, 29900, 6653, 29896, 5262, 13, 13, 13, 29937, 736, 29901, 5159, 565, 451, 2854, 29892, 518, 517, 29918, 29916, 29892, 517, 29918, 29891, 29962, 565, 2854, 29892, 518, 517, 29918, 29916, 29892, 517, 29918, 29891, 1699, 29991, 29966, 17885, 2955, 29918, 12343, 346, 29958, 3108, 565, 11564, 10769, 8424, 338, 15468, 13, 1753, 15758, 16619, 29898, 517, 29918, 29916, 29892, 517, 29918, 29891, 29892, 12343, 346, 1125, 13, 12, 29937, 2158, 376, 12343, 346, 613, 12343, 346, 29889, 7711, 3285, 29908, 4337, 304, 9162, 517, 29918, 29916, 29892, 517, 29918, 29891, 29892, 13, 12, 29937, 2158, 5124, 565, 9208, 16619, 1360, 8516, 1683, 9208, 16619, 29889, 7711, 580, 13, 12, 29937, 361, 9208, 16619, 19216, 8516, 322, 9208, 16619, 29889, 12343, 346, 29889, 275, 11868, 1233, 580, 322, 8424, 29889, 275, 11868, 1233, 7295, 13, 12, 12, 29937, 2158, 9208, 16619, 29889, 3166, 29918, 29916, 29892, 8897, 16619, 29889, 3166, 29918, 29891, 29892, 8897, 16619, 29889, 517, 29918, 29916, 29892, 9208, 16619, 29889, 517, 29918, 29891, 1919, 517, 29918, 29916, 29892, 304, 29918, 29891, 13, 13, 12, 361, 451, 304, 29918, 29916, 297, 3464, 29898, 29900, 29892, 29947, 29897, 470, 451, 304, 29918, 29891, 297, 3464, 29898, 29900, 29892, 29947, 1125, 13, 12, 12, 29937, 2158, 376, 449, 29908, 13, 12, 12, 2457, 6213, 13, 12, 361, 1591, 29961, 517, 29918, 29916, 3816, 517, 29918, 29891, 29962, 1360, 8516, 29901, 13, 12, 12, 29937, 2158, 376, 3084, 29892, 3889, 613, 13, 12, 12, 29937, 3198, 427, 1209, 424, 13, 12, 12, 361, 9208, 16619, 19216, 8516, 322, 9208, 16619, 29889, 12343, 346, 29889, 275, 11868, 1233, 580, 322, 8424, 29889, 275, 11868, 1233, 7295, 13, 12, 12, 12, 361, 9208, 16619, 29889, 3166, 29918, 29891, 29899, 8897, 16619, 29889, 517, 29918, 29891, 297, 21069, 29906, 29892, 29906, 29962, 322, 9208, 16619, 29889, 3166, 29918, 29916, 1275, 304, 29918, 29916, 322, 9208, 16619, 29889, 3166, 29918, 29916, 1275, 9208, 16619, 29889, 517, 29918, 29916, 322, 313, 8897, 16619, 29889, 3166, 29918, 29891, 29974, 8897, 16619, 29889, 517, 29918, 29891, 6802, 29906, 1275, 304, 29918, 29891, 29901, 13, 12, 12, 12, 12, 29937, 2158, 376, 29872, 29889, 29886, 1213, 13, 12, 12, 12, 12, 2457, 1174, 7129, 424, 29898, 12343, 346, 29892, 517, 29918, 29916, 29892, 517, 29918, 29891, 29892, 8897, 16619, 29889, 517, 29918, 29916, 29892, 8897, 16619, 29889, 517, 29918, 29891, 29897, 13, 12, 12, 2457, 25249, 29898, 12343, 346, 29892, 517, 29918, 29916, 29892, 517, 29918, 29891, 29897, 13, 12, 23681, 1591, 29961, 517, 29918, 29916, 3816, 517, 29918, 29891, 1822, 3306, 19216, 12343, 346, 29889, 3306, 29901, 13, 12, 12, 29937, 2158, 376, 3084, 29892, 10446, 29908, 13, 12, 12, 2457, 25249, 29898, 12343, 346, 29892, 517, 29918, 29916, 29892, 517, 29918, 29891, 29892, 5574, 29892, 2371, 29961, 517, 29918, 29916, 3816, 517, 29918, 29891, 1822, 275, 29968, 292, 3101, 13, 13, 12, 29937, 2158, 376, 16770, 1000, 29908, 13, 12, 2457, 6213, 13, 12, 13, 13, 1753, 360, 8684, 284, 16619, 29898, 29916, 29892, 29891, 29892, 2962, 29892, 10568, 29892, 3317, 29918, 3881, 29892, 12343, 346, 1125, 13, 12, 24530, 29922, 2636, 396, 1950, 6576, 13, 12, 361, 1591, 29961, 29916, 3816, 29891, 29962, 2804, 8424, 29901, 13, 12, 12, 2158, 525, 4532, 732, 742, 29916, 5501, 13420, 29891, 5501, 29922, 742, 2371, 29961, 29916, 3816, 29891, 1822, 7711, 3285, 29915, 275, 451, 263, 525, 29974, 12343, 346, 29889, 7711, 580, 23097, 20714, 13, 12, 12, 2457, 6576, 13, 12, 2870, 29901, 13, 12, 12, 1454, 4516, 297, 3464, 29898, 2962, 29892, 29947, 29892, 10568, 1125, 13, 12, 12, 12, 8235, 29922, 20845, 29961, 3972, 3816, 29900, 29962, 13, 12, 12, 12, 4518, 29922, 20845, 29961, 3972, 3816, 29896, 29962, 13, 12, 12, 12, 1454, 5418, 297, 3464, 29898, 29896, 29892, 3317, 29918, 3881, 29974, 29896, 1125, 13, 12, 12, 12, 12, 4622, 29918, 29916, 29922, 29916, 29974, 8235, 29930, 19244, 13, 12, 12, 12, 12, 4622, 29918, 29891, 29922, 29891, 29974, 4518, 29930, 19244, 13, 12, 12, 12, 12, 3084, 29918, 10568, 29922, 7211, 16619, 29898, 4622, 29918, 29916, 29892, 4622, 29918, 29891, 29892, 12343, 346, 416, 13, 12, 12, 12, 12, 361, 2854, 29918, 10568, 19216, 8516, 29901, 24530, 29889, 4397, 29898, 3084, 29918, 10568, 29897, 13, 12, 12, 12, 12, 361, 2854, 29918, 10568, 1360, 8516, 470, 2854, 29918, 10568, 29889, 17885, 545, 29901, 13, 12, 12, 12, 12, 12, 8690, 29936, 13, 12, 2457, 6576, 13, 13, 1753, 10470, 29924, 586, 267, 29898, 29916, 29892, 29891, 29892, 12343, 346, 1125, 13, 12, 2457, 360, 8684, 284, 16619, 29898, 29916, 29892, 29891, 29892, 29900, 29892, 29896, 29892, 29955, 29892, 12343, 346, 29897, 13, 13, 1753, 1528, 554, 29924, 586, 267, 29898, 29916, 29892, 29891, 29892, 12343, 346, 1125, 13, 12, 2457, 360, 8684, 284, 16619, 29898, 29916, 29892, 29891, 29892, 29896, 29892, 29906, 29892, 29955, 29892, 12343, 346, 29897, 13, 13, 1753, 16880, 29924, 586, 267, 29898, 29916, 29892, 29891, 29892, 12343, 346, 1125, 13, 12, 2457, 360, 8684, 284, 16619, 29898, 29916, 29892, 29891, 29892, 29900, 29892, 29906, 29892, 29955, 29892, 12343, 346, 29897, 13, 13, 13383, 7346, 4136, 29937, 4266, 16229, 835, 13383, 7346, 2277, 13, 13, 1753, 4088, 29924, 586, 267, 29898, 29916, 29892, 29891, 29892, 12343, 346, 1125, 13, 12, 24530, 353, 5159, 13, 12, 361, 451, 8424, 29889, 29924, 8238, 29901, 13, 12, 12, 361, 451, 29898, 29891, 1275, 29871, 29900, 322, 8424, 29889, 275, 21823, 580, 470, 343, 1360, 29955, 322, 8424, 29889, 275, 18700, 580, 1125, 22692, 8960, 703, 29968, 292, 29889, 29924, 8238, 947, 451, 1993, 967, 7115, 29991, 1159, 13, 12, 12, 361, 451, 29898, 29916, 1275, 29871, 29946, 1125, 22692, 8960, 703, 29968, 292, 29889, 29924, 8238, 947, 451, 1993, 967, 934, 29991, 1159, 13, 12, 12, 1454, 696, 554, 29918, 1445, 29892, 4384, 1847, 29918, 20845, 297, 17288, 29900, 6653, 29896, 21336, 29955, 29892, 29974, 29896, 4638, 29901, 13, 12, 12, 12, 29937, 307, 554, 472, 1369, 2602, 29892, 451, 6153, 13, 12, 12, 12, 361, 1591, 29961, 307, 554, 29918, 1445, 3816, 29891, 29962, 19216, 8516, 322, 1591, 29961, 307, 554, 29918, 1445, 3816, 29891, 1822, 29924, 8238, 1360, 8824, 322, 1591, 29961, 307, 554, 29918, 1445, 3816, 29891, 1822, 275, 29934, 2550, 7295, 13, 12, 12, 12, 12, 29937, 1217, 12785, 1546, 963, 13, 12, 12, 12, 12, 4384, 1847, 29918, 27338, 29922, 5574, 13, 12, 12, 12, 12, 1454, 921, 29918, 29878, 297, 3464, 29898, 29916, 29974, 4384, 1847, 29918, 20845, 29892, 307, 554, 29918, 1445, 29892, 4384, 1847, 29918, 20845, 1125, 13, 12, 12, 12, 12, 12, 361, 1591, 29961, 29916, 29918, 29878, 3816, 29891, 29962, 19216, 8516, 29901, 13, 12, 12, 12, 12, 12, 12, 4384, 1847, 29918, 27338, 29922, 8824, 13, 12, 12, 12, 12, 12, 12, 8690, 13, 12, 12, 12, 12, 361, 4320, 1847, 29918, 27338, 29901, 13, 12, 12, 12, 12, 12, 24530, 29889, 4397, 29898, 15738, 1847, 29898, 12343, 346, 29892, 29916, 29974, 29906, 29930, 4384, 1847, 29918, 20845, 29892, 29891, 876, 13, 12, 12, 12, 12, 12, 13, 12, 2457, 6576, 29974, 21602, 284, 16619, 29898, 29916, 29892, 29891, 29892, 29900, 29892, 29896, 29892, 29896, 29892, 12343, 346, 29897, 13, 13, 29968, 11147, 16619, 29928, 2152, 294, 29922, 8999, 29899, 29896, 6653, 29906, 1402, 14352, 29896, 29892, 29871, 29906, 16272, 29871, 29896, 6653, 29906, 16272, 29871, 29896, 29892, 29871, 29906, 1402, 14352, 29906, 6653, 29896, 1402, 14352, 29906, 29892, 29871, 29896, 16272, 29871, 29906, 6653, 29896, 16272, 29871, 29906, 29892, 29871, 29896, 5262, 13, 1753, 22980, 29924, 586, 267, 29898, 29916, 29892, 29891, 29892, 12343, 346, 1125, 13, 12, 24530, 29922, 2636, 13, 12, 361, 1591, 29961, 29916, 3816, 29891, 29962, 2804, 8424, 29901, 13, 12, 12, 2158, 525, 4532, 732, 742, 29916, 5501, 13420, 29891, 5501, 29922, 742, 2371, 29961, 29916, 3816, 29891, 1822, 7711, 3285, 29915, 275, 451, 263, 525, 29974, 12343, 346, 29889, 7711, 580, 23097, 20714, 13, 12, 12, 2457, 6576, 13, 12, 1454, 889, 5523, 29918, 11631, 297, 22980, 16619, 29928, 2152, 294, 29901, 13, 12, 12, 3084, 29918, 11631, 29922, 7211, 16619, 29898, 29916, 29974, 3959, 5523, 29918, 11631, 29961, 29900, 1402, 29891, 29974, 3959, 5523, 29918, 11631, 29961, 29896, 1402, 12343, 346, 29897, 13, 12, 12, 361, 2854, 29918, 11631, 19216, 8516, 29901, 13, 12, 12, 12, 24530, 29889, 4397, 29898, 3084, 29918, 11631, 29897, 13, 12, 2457, 6576, 13, 12, 13, 1753, 2621, 1233, 29924, 586, 267, 29898, 29916, 29892, 29891, 29892, 12343, 346, 1125, 13, 12, 29937, 2158, 376, 3198, 3300, 1233, 16229, 732, 613, 29916, 29892, 29891, 13, 12, 24530, 29922, 2636, 13, 12, 361, 1591, 29961, 29916, 3816, 29891, 29962, 2804, 8424, 29901, 13, 12, 12, 2158, 525, 4532, 732, 742, 29916, 5501, 13420, 29891, 5501, 29922, 742, 2371, 29961, 29916, 3816, 29891, 1822, 7711, 3285, 29915, 275, 451, 263, 525, 29974, 12343, 346, 29889, 7711, 580, 23097, 20714, 13, 12, 12, 2457, 6576, 13, 12, 12, 13, 12, 20845, 353, 29871, 29896, 565, 8424, 29889, 275, 21823, 580, 1683, 448, 29896, 13, 12, 29937, 2158, 5305, 13, 12, 29937, 6375, 13, 12, 3084, 29918, 11631, 29922, 7211, 16619, 29898, 29916, 29892, 29891, 29974, 20845, 29892, 12343, 346, 29897, 13, 12, 361, 2854, 29918, 11631, 2804, 6213, 322, 2854, 29918, 11631, 29889, 17885, 545, 1360, 8824, 29901, 13, 12, 12, 24530, 29889, 4397, 29898, 3084, 29918, 11631, 29897, 13, 12, 12, 29937, 2158, 6576, 13, 12, 12, 29937, 8256, 451, 6153, 3447, 29892, 3300, 1233, 1122, 4331, 1207, 29871, 29906, 6576, 6375, 13, 12, 12, 361, 2854, 29918, 11631, 19216, 6213, 322, 2854, 29918, 11631, 29889, 17885, 545, 1360, 8824, 322, 451, 8424, 29889, 29924, 8238, 29901, 13, 12, 12, 12, 3084, 29918, 11631, 29922, 7211, 16619, 29898, 29916, 29892, 29891, 29974, 20845, 29974, 20845, 29892, 12343, 346, 29897, 13, 12, 12, 12, 361, 2854, 29918, 11631, 2804, 6213, 29901, 24530, 29889, 4397, 29898, 3084, 29918, 11631, 29897, 13, 12, 29937, 17885, 545, 2175, 470, 1492, 13, 12, 3084, 29918, 11631, 29922, 7211, 16619, 29898, 29916, 29899, 29896, 29892, 29891, 29974, 20845, 29892, 12343, 346, 29897, 13, 12, 361, 2854, 29918, 11631, 2804, 6213, 322, 2854, 29918, 11631, 29889, 17885, 545, 29901, 24530, 29889, 4397, 29898, 3084, 29918, 11631, 29897, 13, 12, 3084, 29918, 11631, 29922, 7211, 16619, 29898, 29916, 29974, 29896, 29892, 29891, 29974, 20845, 29892, 12343, 346, 29897, 13, 12, 361, 2854, 29918, 11631, 2804, 6213, 322, 2854, 29918, 11631, 29889, 17885, 545, 29901, 24530, 29889, 4397, 29898, 3084, 29918, 11631, 29897, 13, 13, 12, 361, 7700, 29901, 13, 12, 12, 1454, 4337, 297, 6576, 29901, 2158, 4337, 29889, 7711, 3285, 13, 12, 12, 13, 12, 29937, 3258, 1950, 2504, 327, 1080, 13, 12, 1482, 29918, 24530, 353, 5159, 13, 12, 1454, 4331, 297, 6576, 29901, 13, 12, 12, 361, 8424, 29889, 3306, 26359, 29893, 29908, 322, 4331, 29889, 517, 29918, 29891, 1360, 29955, 470, 8424, 29889, 3306, 26359, 29890, 29908, 322, 4331, 29889, 517, 29918, 29891, 1360, 29900, 29901, 13, 29937, 12, 12, 12, 2158, 376, 29925, 3491, 2891, 27946, 29908, 13, 12, 12, 12, 14032, 8194, 29918, 8768, 543, 29984, 29940, 15176, 29908, 13, 12, 12, 12, 1454, 1134, 297, 22360, 29918, 8768, 29901, 13, 12, 12, 12, 12, 1482, 29918, 10568, 29922, 8552, 29889, 8552, 29898, 10568, 29897, 13, 12, 12, 12, 12, 1482, 29918, 10568, 29889, 14032, 8194, 29922, 29925, 347, 346, 29898, 12343, 346, 29889, 3306, 29892, 1853, 29897, 13, 12, 12, 12, 12, 1482, 29918, 24530, 29889, 4397, 29898, 1482, 29918, 10568, 29897, 13, 29937, 12, 12, 12, 12, 2158, 716, 29918, 10568, 29889, 7711, 3285, 1482, 29918, 10568, 29889, 14032, 8194, 1360, 29925, 347, 346, 29898, 12343, 346, 29889, 3306, 29892, 1853, 29897, 13, 12, 12, 2870, 29901, 13, 12, 12, 12, 1482, 29918, 24530, 29889, 4397, 29898, 10568, 29897, 13, 12, 12, 12, 13, 12, 2457, 716, 29918, 24530, 13, 13, 1753, 4593, 16619, 29898, 29916, 29892, 29891, 1125, 13, 12, 24530, 29922, 2636, 13, 12, 12343, 346, 29922, 2371, 29961, 29916, 3816, 29891, 29962, 13, 12, 361, 8424, 1360, 8516, 29901, 2457, 5159, 13, 29937, 12, 2158, 921, 29892, 29891, 29892, 12343, 346, 29889, 7711, 580, 13, 12, 361, 8424, 29889, 275, 29968, 292, 7295, 2457, 4088, 29924, 586, 267, 29898, 29916, 29892, 29891, 29892, 12343, 346, 29897, 13, 12, 361, 8424, 29889, 275, 8654, 264, 7295, 2457, 10470, 29924, 586, 267, 29898, 29916, 29892, 29891, 29892, 12343, 346, 29897, 13, 12, 361, 8424, 29889, 275, 29933, 9835, 7295, 2457, 16880, 29924, 586, 267, 29898, 29916, 29892, 29891, 29892, 12343, 346, 29897, 13, 12, 361, 8424, 29889, 275, 29934, 2550, 7295, 2457, 1528, 554, 29924, 586, 267, 29898, 29916, 29892, 29891, 29892, 12343, 346, 29897, 13, 12, 361, 8424, 29889, 275, 29968, 11147, 7295, 2457, 22980, 29924, 586, 267, 29898, 29916, 29892, 29891, 29892, 12343, 346, 29897, 13, 12, 361, 8424, 29889, 275, 11868, 1233, 7295, 2457, 2621, 1233, 29924, 586, 267, 29898, 29916, 29892, 29891, 29892, 12343, 346, 29897, 13, 12, 12, 12, 13, 12, 22692, 8960, 703, 16804, 2289, 4319, 9559, 12490, 29974, 29916, 29974, 29891, 29897, 13, 12, 2457, 5159, 13, 12, 13, 29937, 1867, 263, 4337, 13, 1753, 1938, 16619, 29898, 29916, 29918, 3166, 29892, 29891, 29918, 3166, 29892, 11631, 1125, 13, 13, 12, 29937, 1833, 4337, 448, 1304, 363, 321, 29889, 29886, 29889, 13, 12, 10945, 9208, 16619, 13, 12, 13, 29937, 12, 2158, 376, 9984, 25249, 29901, 613, 11631, 29889, 7711, 580, 13, 12, 29916, 29918, 517, 29922, 11631, 29889, 517, 29918, 29916, 13, 12, 29891, 29918, 517, 29922, 11631, 29889, 517, 29918, 29891, 13, 12, 29937, 3198, 13, 12, 12343, 346, 29922, 2371, 29961, 29916, 29918, 3166, 3816, 29891, 29918, 3166, 29962, 13, 12, 361, 8424, 1360, 8516, 29901, 13, 12, 12, 22692, 8960, 877, 16619, 515, 4069, 1746, 742, 29916, 29918, 3166, 29892, 29891, 29918, 3166, 29897, 13, 12, 13, 12, 29937, 4384, 1847, 13, 12, 361, 1134, 29898, 11631, 29897, 338, 4834, 1847, 29901, 13, 12, 12, 361, 343, 29918, 517, 451, 297, 518, 29900, 29892, 29955, 5387, 22692, 8960, 703, 15738, 1847, 4337, 1059, 448, 4319, 7115, 1159, 13, 12, 12, 361, 921, 29918, 517, 451, 297, 518, 29906, 29892, 29953, 5387, 22692, 8960, 703, 15738, 1847, 4337, 1059, 448, 4319, 934, 1159, 13, 12, 12, 361, 1591, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 29962, 19216, 8516, 29901, 22692, 8960, 703, 15738, 1847, 4337, 1059, 448, 16404, 1159, 13, 12, 12, 361, 921, 29918, 517, 1360, 29906, 29901, 13, 12, 12, 12, 361, 1591, 29961, 29900, 3816, 29891, 29918, 517, 29962, 1360, 8516, 470, 451, 1591, 29961, 29900, 3816, 29891, 29918, 517, 1822, 275, 29934, 2550, 7295, 22692, 8960, 703, 15738, 1847, 696, 554, 4567, 1159, 13, 12, 12, 12, 2371, 29961, 29941, 3816, 29891, 29918, 517, 1402, 2371, 29961, 29900, 3816, 29891, 29918, 517, 13192, 2371, 29961, 29900, 3816, 29891, 29918, 517, 1402, 2371, 29961, 29941, 3816, 29891, 29918, 517, 29962, 396, 4337, 696, 554, 13, 12, 12, 12, 2371, 29961, 29946, 3816, 29891, 29918, 517, 1402, 2371, 29961, 29906, 3816, 29891, 29918, 517, 13192, 2371, 29961, 29906, 3816, 29891, 29918, 517, 1402, 2371, 29961, 29946, 3816, 29891, 29918, 517, 29962, 396, 4337, 6989, 13, 12, 12, 12, 2371, 29961, 29906, 3816, 29891, 29918, 517, 1822, 29924, 8238, 29922, 2371, 29961, 29941, 3816, 29891, 29918, 517, 1822, 29924, 8238, 29922, 5574, 13, 12, 12, 23681, 921, 29918, 517, 1360, 29953, 29901, 13, 12, 12, 12, 361, 1591, 29961, 29955, 3816, 29891, 29918, 517, 29962, 1360, 8516, 470, 451, 1591, 29961, 29955, 3816, 29891, 29918, 517, 1822, 275, 29934, 2550, 7295, 22692, 8960, 703, 15738, 1847, 696, 554, 4567, 1159, 13, 12, 12, 12, 2371, 29961, 29955, 3816, 29891, 29918, 517, 1402, 2371, 29961, 29945, 3816, 29891, 29918, 517, 13192, 2371, 29961, 29945, 3816, 29891, 29918, 517, 1402, 2371, 29961, 29955, 3816, 29891, 29918, 517, 29962, 396, 4337, 696, 554, 13, 12, 12, 12, 2371, 29961, 29953, 3816, 29891, 29918, 517, 1402, 2371, 29961, 29946, 3816, 29891, 29918, 517, 13192, 2371, 29961, 29946, 3816, 29891, 29918, 517, 1402, 2371, 29961, 29953, 3816, 29891, 29918, 517, 29962, 396, 4337, 6989, 13, 12, 12, 12, 2371, 29961, 29945, 3816, 29891, 29918, 517, 1822, 29924, 8238, 29922, 2371, 29961, 29953, 3816, 29891, 29918, 517, 1822, 29924, 8238, 29922, 5574, 13, 12, 12, 2870, 29901, 13, 12, 12, 12, 22692, 8960, 877, 3664, 263, 2854, 4320, 1847, 4337, 29889, 1495, 13, 12, 23681, 1134, 29898, 11631, 29897, 338, 1174, 7129, 424, 29901, 13, 12, 12, 9294, 29898, 2371, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 29962, 1360, 8516, 29897, 13, 12, 12, 2371, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 1402, 2371, 29961, 29916, 29918, 3166, 3816, 29891, 29918, 3166, 13192, 2371, 29961, 29916, 29918, 3166, 3816, 29891, 29918, 3166, 1402, 2371, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 29962, 13, 12, 12, 2371, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 1822, 29924, 8238, 29922, 5574, 13, 12, 12, 29937, 17885, 545, 427, 1209, 424, 3300, 1233, 13, 12, 12, 9294, 9208, 16619, 29889, 12343, 346, 29889, 275, 11868, 1233, 580, 13, 12, 12, 2371, 29961, 8897, 16619, 29889, 517, 29918, 29916, 3816, 8897, 16619, 29889, 517, 29918, 29891, 13192, 8516, 13, 12, 2870, 29901, 13, 12, 12, 29937, 2158, 921, 29918, 517, 29892, 29891, 29918, 517, 29892, 2371, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 29962, 13, 12, 12, 29937, 8945, 4337, 13, 12, 12, 29937, 6310, 1746, 29973, 13, 12, 12, 361, 1591, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 29962, 1360, 8516, 29901, 13, 12, 12, 12, 2371, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 1402, 2371, 29961, 29916, 29918, 3166, 3816, 29891, 29918, 3166, 13192, 2371, 29961, 29916, 29918, 3166, 3816, 29891, 29918, 3166, 1402, 2371, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 29962, 13, 12, 12, 29937, 17885, 545, 916, 10769, 8424, 29973, 13, 12, 12, 23681, 1591, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 1822, 3306, 19216, 2371, 29961, 29916, 29918, 3166, 3816, 29891, 29918, 3166, 1822, 3306, 29901, 13, 12, 12, 12, 2371, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 13192, 2371, 29961, 29916, 29918, 3166, 3816, 29891, 29918, 3166, 29962, 13, 12, 12, 12, 2371, 29961, 29916, 29918, 3166, 3816, 29891, 29918, 3166, 13192, 8516, 13, 12, 12, 2870, 29901, 13, 12, 12, 12, 22692, 8960, 877, 3073, 16404, 491, 19780, 8424, 742, 2371, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 2314, 13, 12, 12, 13, 12, 12, 361, 1134, 29898, 11631, 29889, 14032, 8194, 29897, 1360, 29925, 347, 346, 29901, 13, 29937, 12, 12, 12, 2158, 376, 18571, 8194, 2309, 29908, 13, 12, 12, 12, 2371, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 1822, 1542, 353, 4337, 29889, 14032, 8194, 29889, 1542, 13, 12, 12, 2371, 29961, 29916, 29918, 517, 3816, 29891, 29918, 517, 1822, 29924, 8238, 29922, 5574, 13, 12, 12, 12, 12, 13, 12, 8897, 16619, 353, 4337, 29936, 9208, 16619, 29889, 3166, 29918, 29916, 29922, 29916, 29918, 3166, 29936, 9208, 16619, 29889, 3166, 29918, 29891, 29922, 29891, 29918, 3166, 13, 29937, 12, 2158, 376, 4373, 9208, 25249, 543, 29892, 8897, 16619, 29889, 7711, 580, 13, 13, 29937, 12, 19499, 8960, 408, 832, 29901, 13, 29937, 12, 12, 2158, 832, 13, 29937, 12, 12, 22692, 832, 13, 29937, 12, 12, 3364, 13, 13, 12, 13, 29937, 6230, 2847, 1591, 13, 2371, 353, 5159, 13, 8897, 16619, 353, 6213, 13, 1753, 3789, 786, 3562, 7295, 13, 13, 12, 10945, 1591, 13, 12, 13, 12, 6310, 29918, 17619, 29922, 8516, 13, 12, 1220, 11759, 6310, 29918, 17619, 29892, 6310, 29918, 17619, 29892, 6310, 29918, 17619, 29892, 6310, 29918, 17619, 29892, 6310, 29918, 17619, 29892, 6310, 29918, 17619, 29892, 6310, 29918, 17619, 29892, 6310, 29918, 17619, 29962, 13, 12, 2371, 11759, 1220, 7503, 1402, 1220, 7503, 1402, 1220, 7503, 1402, 1220, 7503, 1402, 1220, 7503, 1402, 1220, 7503, 1402, 1220, 7503, 1402, 1220, 7503, 5262, 13, 13, 12, 2371, 29961, 29900, 3816, 29900, 13192, 29925, 347, 346, 877, 29893, 3788, 29934, 2157, 2371, 29961, 29955, 3816, 29900, 13192, 29925, 347, 346, 877, 29893, 3788, 29934, 1495, 13, 12, 2371, 29961, 29896, 3816, 29900, 13192, 29925, 347, 346, 877, 29893, 3788, 29940, 2157, 2371, 29961, 29953, 3816, 29900, 13192, 29925, 347, 346, 877, 29893, 3788, 29940, 1495, 13, 12, 2371, 29961, 29906, 3816, 29900, 13192, 29925, 347, 346, 877, 29893, 3788, 29933, 2157, 2371, 29961, 29945, 3816, 29900, 13192, 29925, 347, 346, 877, 29893, 3788, 29933, 1495, 13, 12, 2371, 29961, 29941, 3816, 29900, 13192, 29925, 347, 346, 877, 29893, 3788, 29984, 1495, 13, 12, 2371, 29961, 29946, 3816, 29900, 13192, 29925, 347, 346, 877, 29893, 3788, 29968, 1495, 13, 12, 1454, 474, 297, 3464, 29898, 29900, 29892, 29947, 1125, 2371, 29961, 29875, 3816, 29896, 13192, 29925, 347, 346, 877, 29893, 3788, 29925, 2157, 2371, 29961, 29875, 3816, 29953, 13192, 29925, 347, 346, 877, 29890, 3788, 29925, 2157, 2371, 29961, 29875, 3816, 29955, 13192, 8516, 565, 1591, 29961, 29875, 3816, 29900, 29962, 1360, 8516, 1683, 26005, 346, 877, 29890, 742, 2371, 29961, 29875, 3816, 29900, 1822, 1542, 29897, 13, 13, 1753, 13905, 3562, 7295, 13, 12, 2457, 13, 12, 2158, 376, 25638, 1753, 12443, 29908, 13, 12, 1454, 343, 297, 3464, 29898, 29955, 6653, 29896, 6653, 29896, 1125, 13, 12, 12, 1220, 29918, 1807, 29922, 710, 29898, 29891, 29974, 29896, 29897, 13, 12, 12, 1454, 921, 297, 3464, 29898, 29900, 29892, 29947, 1125, 13, 12, 12, 12, 1220, 29918, 1807, 4619, 2927, 3304, 29889, 5841, 29889, 29979, 29923, 2208, 9806, 565, 313, 29916, 29974, 29891, 29897, 1273, 29871, 29906, 1275, 29871, 29896, 1683, 2927, 3304, 29889, 5841, 29889, 13367, 4462, 13, 12, 12, 12, 2671, 29922, 2371, 29961, 29916, 3816, 29891, 29962, 13, 12, 12, 12, 361, 1746, 1275, 6213, 29901, 13, 12, 12, 12, 12, 1220, 29918, 1807, 4619, 376, 376, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 361, 1746, 29889, 3306, 26359, 29893, 1115, 13, 12, 12, 12, 12, 12, 1220, 29918, 1807, 4619, 2927, 3304, 29889, 29943, 487, 29889, 25039, 9094, 29871, 13, 12, 12, 12, 12, 2870, 29901, 29871, 13, 12, 12, 12, 12, 12, 1220, 29918, 1807, 4619, 2927, 3304, 29889, 29943, 487, 29889, 13367, 11375, 13, 12, 12, 12, 12, 1220, 29918, 1807, 4619, 1746, 29889, 1542, 13, 12, 12, 12, 12, 13, 12, 12, 2158, 1196, 29918, 1807, 29974, 2780, 3304, 29889, 5568, 29889, 1525, 10490, 29918, 9818, 13, 13, 1753, 4522, 3562, 29898, 10568, 1125, 13, 12, 1807, 29922, 710, 29898, 10568, 7240, 1642, 29905, 29876, 29908, 13, 12, 1807, 29974, 543, 25638, 1753, 12443, 29905, 29876, 29908, 13, 12, 1454, 343, 297, 3464, 29898, 29955, 6653, 29896, 6653, 29896, 1125, 13, 12, 12, 1807, 23661, 710, 29898, 29891, 29974, 29896, 29897, 13, 12, 12, 1454, 921, 297, 3464, 29898, 29900, 29892, 29947, 1125, 13, 12, 12, 12, 2671, 29922, 2371, 29961, 29916, 3816, 29891, 29962, 13, 12, 12, 12, 361, 1746, 1275, 6213, 29901, 13, 12, 12, 12, 12, 1807, 4619, 376, 376, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 1807, 4619, 1746, 29889, 1542, 565, 1746, 29889, 3306, 353, 543, 29893, 29908, 1683, 1746, 29889, 1542, 29889, 13609, 580, 13, 12, 12, 1807, 29974, 543, 29905, 29876, 29908, 13, 12, 12, 13, 12, 1807, 29974, 543, 29905, 29876, 29908, 13, 12, 2457, 1347, 12, 12, 12, 13, 12, 13, 13383, 7346, 4136, 29937, 1303, 349, 20728, 934, 835, 13383, 7346, 2277, 13, 13, 1990, 25159, 2283, 29901, 13, 12, 13, 12, 1990, 2796, 2776, 2283, 29901, 13, 12, 12, 1753, 4770, 2344, 12035, 1311, 1125, 13, 12, 12, 12, 3364, 13, 13, 12, 1753, 4770, 2344, 12035, 1311, 29892, 9507, 1125, 13, 12, 12, 2158, 376, 3150, 292, 9162, 9507, 29892, 13, 12, 12, 1357, 29918, 1445, 29922, 3150, 29898, 9507, 29897, 13, 12, 12, 1311, 29889, 1807, 353, 590, 29918, 1445, 29889, 949, 580, 13, 12, 12, 1311, 29889, 1066, 29922, 29900, 13, 12, 12, 1311, 29889, 2435, 29922, 2435, 29898, 1311, 29889, 1807, 29897, 13, 12, 12, 1357, 29918, 1445, 29889, 5358, 580, 13, 12, 12, 2158, 1583, 29889, 2435, 1699, 305, 1503, 29908, 13, 12, 12, 13, 12, 1753, 338, 21823, 14936, 5914, 29898, 1311, 29892, 3090, 1125, 13, 12, 12, 2457, 1373, 297, 376, 320, 29873, 29905, 29876, 29908, 13, 12, 12, 12, 12, 13, 12, 1753, 14383, 29918, 1332, 3246, 22459, 29898, 1311, 1125, 13, 12, 12, 8000, 5852, 29901, 13, 12, 12, 12, 29883, 353, 1583, 29889, 657, 5914, 580, 13, 12, 12, 12, 361, 451, 1583, 29889, 275, 21823, 14936, 5914, 29898, 29883, 1125, 13, 12, 12, 12, 12, 2457, 274, 13, 12, 12, 12, 1311, 29889, 4622, 5914, 580, 13, 12, 12, 12, 12, 13, 12, 1753, 679, 5914, 29898, 1311, 1125, 13, 12, 12, 361, 1583, 29889, 1066, 18572, 1311, 29889, 2435, 29901, 13, 12, 12, 12, 2158, 376, 6066, 2283, 29889, 5044, 2776, 2283, 29908, 13, 12, 12, 12, 22692, 25159, 2283, 29889, 5044, 2776, 2283, 580, 13, 12, 12, 2457, 1583, 29889, 1807, 29961, 1311, 29889, 1066, 29962, 13, 13, 12, 1753, 1303, 3542, 29898, 1311, 1125, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 1220, 355, 29918, 1066, 29922, 1583, 29889, 1807, 29889, 2248, 14182, 29876, 613, 1311, 29889, 1066, 29897, 13, 12, 12, 19499, 7865, 2392, 29901, 13, 12, 12, 12, 1220, 355, 29918, 1066, 353, 1583, 29889, 2435, 13, 12, 12, 16304, 29918, 1066, 29892, 1311, 29889, 1066, 353, 1583, 29889, 1066, 29892, 1196, 355, 29918, 1066, 29974, 29896, 13, 12, 12, 2457, 1583, 29889, 1807, 29961, 16304, 29918, 1066, 29901, 1220, 355, 29918, 1066, 29962, 13, 12, 12, 13, 12, 1753, 338, 8809, 3246, 3535, 29898, 1311, 1125, 13, 12, 12, 2457, 7700, 565, 1583, 29889, 1066, 18572, 1311, 29889, 2435, 1683, 1583, 29889, 275, 21823, 14936, 5914, 29898, 1311, 29889, 1807, 29961, 1311, 29889, 1066, 2314, 13, 12, 12, 13, 12, 1753, 2446, 5914, 29898, 1311, 29892, 10568, 29922, 29896, 1125, 13, 12, 12, 29937, 2158, 29898, 1311, 29889, 1807, 29961, 1311, 29889, 1066, 29901, 1311, 29889, 1066, 29974, 10568, 2314, 13, 12, 12, 1311, 29889, 1066, 353, 1583, 29889, 1066, 29974, 10568, 13, 12, 12, 13, 12, 1753, 1303, 1451, 1503, 29898, 1311, 29892, 2311, 29922, 29896, 1125, 13, 12, 12, 1807, 29922, 1311, 29889, 1807, 29961, 1311, 29889, 1066, 29901, 1311, 29889, 1066, 29974, 2311, 29962, 13, 12, 12, 1311, 29889, 1066, 353, 1583, 29889, 1066, 29974, 10568, 13, 12, 13, 12, 1753, 1303, 4557, 29898, 1311, 1125, 13, 12, 12, 1311, 29889, 11014, 29918, 1332, 3246, 22459, 580, 13, 12, 12, 1807, 29918, 4537, 13776, 13, 12, 12, 8000, 1583, 29889, 1066, 29966, 1311, 29889, 2435, 29901, 13, 12, 12, 12, 29883, 29922, 1311, 29889, 657, 5914, 580, 13, 12, 12, 12, 361, 274, 297, 376, 29900, 29896, 29906, 29941, 29946, 29945, 29953, 29955, 29947, 29929, 1115, 13, 12, 12, 12, 12, 1807, 29918, 4537, 23661, 29883, 13, 12, 12, 12, 12, 1311, 29889, 4622, 5914, 580, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 2457, 938, 29898, 1807, 29918, 4537, 29897, 13, 12, 12, 13, 12, 1753, 1303, 6066, 29898, 1311, 1125, 13, 12, 12, 1807, 13776, 13, 12, 12, 8000, 451, 1583, 29889, 275, 8809, 3246, 3535, 580, 322, 1583, 29889, 1066, 29966, 1311, 29889, 2435, 29901, 13, 12, 12, 12, 1807, 4619, 1583, 29889, 657, 5914, 580, 13, 12, 12, 12, 1311, 29889, 4622, 5914, 580, 13, 12, 12, 29937, 2158, 1347, 13, 12, 12, 2457, 1347, 13, 13, 12, 1753, 2149, 1231, 29898, 1311, 29892, 1807, 1125, 13, 12, 12, 361, 1583, 29889, 1807, 29961, 1311, 29889, 1066, 29901, 1311, 29889, 1066, 29974, 2435, 29898, 1807, 4638, 19216, 1807, 29901, 13, 12, 12, 12, 22692, 8960, 703, 1445, 5877, 1059, 1159, 13, 12, 12, 1311, 29889, 4622, 5914, 29898, 2435, 29898, 1807, 876, 13, 13, 12, 1753, 3544, 1231, 29898, 1311, 29892, 1807, 1125, 13, 12, 12, 361, 1583, 29889, 1807, 29961, 1311, 29889, 1066, 29901, 1311, 29889, 1066, 29974, 2435, 29898, 1807, 4638, 1360, 1807, 29901, 13, 12, 12, 12, 1311, 29889, 4622, 5914, 29898, 2435, 29898, 1807, 876, 13, 12, 12, 12, 2457, 5852, 13, 12, 12, 2457, 7700, 13, 13, 12, 1753, 338, 1231, 29898, 1311, 29892, 1807, 29892, 4878, 29918, 23149, 3321, 29922, 5574, 1125, 13, 12, 12, 2457, 1583, 29889, 1807, 29961, 1311, 29889, 1066, 29901, 1311, 29889, 1066, 29974, 2435, 29898, 1807, 4638, 1360, 1807, 565, 1206, 29918, 23149, 3321, 1683, 1583, 29889, 1807, 29961, 1311, 29889, 1066, 29901, 1311, 29889, 1066, 29974, 2435, 29898, 1807, 29897, 1822, 13609, 580, 1360, 1807, 29889, 13609, 580, 13, 12, 12, 13, 12, 12, 13, 1990, 16696, 29901, 13, 12, 1753, 4770, 2344, 12035, 1311, 29892, 1853, 29892, 517, 29918, 29916, 29892, 517, 29918, 29891, 29892, 3166, 29918, 29916, 29922, 8516, 29892, 3166, 29918, 29891, 29922, 8516, 29892, 17885, 545, 29922, 8516, 1125, 13, 12, 12, 3364, 13, 13, 29937, 2780, 29901, 376, 29893, 29908, 12975, 29890, 29908, 13, 1753, 1303, 14448, 29898, 2080, 29918, 1445, 29892, 2780, 1125, 13, 12, 29937, 949, 4331, 12640, 13, 12, 1853, 2433, 29925, 29915, 13, 12, 2080, 29918, 1445, 29889, 11014, 29918, 1332, 3246, 22459, 580, 13, 12, 29937, 949, 12640, 1347, 448, 2745, 2446, 24358, 13, 12, 17885, 545, 353, 7700, 13, 12, 2218, 29918, 1445, 29922, 8516, 13, 12, 2218, 29918, 10003, 29922, 8516, 13, 12, 509, 29887, 29918, 1445, 29922, 8516, 13, 12, 509, 29887, 29918, 10003, 29922, 8516, 13, 12, 14032, 8194, 29918, 1853, 29922, 8516, 13, 12, 9292, 29918, 4384, 1847, 29922, 8824, 29936, 13, 12, 802, 264, 29918, 4384, 1847, 29922, 8824, 29936, 13, 12, 6979, 353, 1881, 29918, 1445, 29889, 949, 6066, 580, 13, 12, 29937, 17885, 545, 448, 451, 8031, 13, 12, 361, 525, 29916, 29915, 297, 5993, 470, 376, 6160, 297, 5993, 584, 13, 12, 12, 17885, 545, 353, 5852, 13, 12, 12, 6979, 29922, 6979, 29889, 6506, 703, 29916, 3284, 1159, 13, 12, 12, 6979, 29922, 6979, 29889, 6506, 703, 29901, 3284, 1159, 13, 12, 29937, 3198, 470, 1423, 25046, 448, 451, 8031, 13, 12, 361, 525, 23097, 297, 5993, 470, 12305, 29908, 297, 5993, 29901, 13, 12, 12, 6979, 29922, 6979, 29889, 6506, 703, 29974, 3284, 1159, 13, 12, 12, 6979, 29922, 6979, 29889, 6506, 14822, 3284, 1159, 13, 12, 361, 525, 2433, 297, 5993, 584, 13, 12, 12, 2158, 5993, 14352, 29906, 13018, 29896, 1402, 6979, 14352, 29896, 17531, 13, 12, 12, 9294, 5993, 14352, 29906, 13018, 29896, 13192, 543, 543, 13, 12, 12, 14032, 8194, 29918, 1853, 353, 5993, 14352, 29896, 17531, 13, 12, 12, 6979, 29922, 6979, 7503, 29899, 29906, 29962, 13, 12, 361, 5993, 1275, 376, 29949, 29899, 29949, 1115, 13, 12, 12, 9292, 29918, 4384, 1847, 29922, 5574, 29936, 13, 12, 12, 1853, 2433, 29968, 29915, 13, 12, 23681, 5993, 1275, 376, 29949, 29899, 29949, 29899, 29949, 1115, 13, 12, 12, 802, 264, 29918, 4384, 1847, 29922, 5574, 29936, 13, 12, 12, 1853, 2433, 29968, 29915, 13, 12, 2870, 29901, 13, 12, 12, 29937, 8945, 4337, 13, 12, 12, 361, 5993, 14352, 29946, 29901, 13192, 543, 29872, 29889, 29886, 29889, 1115, 13, 12, 12, 12, 29937, 264, 13382, 448, 451, 6969, 3447, 13, 12, 12, 12, 22692, 8960, 703, 264, 13382, 448, 451, 6969, 3447, 1159, 13, 12, 12, 29937, 4230, 29871, 29906, 22524, 29901, 3646, 934, 29892, 7115, 29871, 13, 12, 12, 509, 29887, 29918, 1445, 29922, 6979, 14352, 29906, 29962, 13, 12, 12, 509, 29887, 29918, 10003, 29922, 6979, 14352, 29896, 29962, 13, 12, 12, 6979, 29922, 6979, 7503, 29899, 29906, 29962, 396, 7582, 3646, 1746, 13, 12, 12, 13, 12, 12, 29937, 4102, 1373, 29901, 1134, 313, 272, 25811, 565, 3300, 1233, 29897, 13, 12, 12, 361, 7431, 29898, 6979, 15410, 29900, 29901, 13, 12, 12, 12, 29883, 29896, 29922, 6979, 29961, 29900, 29962, 13, 12, 12, 12, 361, 274, 29896, 297, 376, 29984, 29968, 29940, 15176, 1115, 13, 12, 12, 12, 12, 29937, 1228, 4337, 13, 12, 12, 12, 12, 1853, 29922, 29883, 29896, 13, 12, 12, 12, 12, 6979, 353, 5993, 29961, 29896, 17531, 396, 7582, 8424, 29769, 13, 13, 12, 12, 29937, 1745, 17225, 22524, 29901, 766, 18065, 13, 12, 12, 361, 7431, 29898, 6979, 29897, 1360, 29896, 29901, 13, 12, 12, 12, 361, 5993, 29961, 29900, 29962, 297, 1347, 29889, 7501, 1169, 29901, 13, 12, 12, 12, 12, 2218, 29918, 10003, 29922, 6979, 29961, 29900, 29962, 13, 12, 12, 12, 23681, 5993, 29961, 29900, 29962, 297, 1347, 29889, 294, 18869, 29918, 13609, 4878, 29901, 13, 12, 12, 12, 12, 2218, 29918, 1445, 29922, 6979, 29961, 29900, 29962, 13, 12, 12, 23681, 7431, 29898, 6979, 29897, 1360, 29906, 29901, 13, 12, 12, 12, 2218, 29918, 1445, 29922, 6979, 29961, 29900, 29962, 13, 12, 12, 12, 2218, 29918, 10003, 29922, 6979, 29961, 29896, 29962, 13, 12, 12, 23681, 7431, 29898, 6979, 29897, 19216, 29900, 29901, 13, 12, 12, 12, 22692, 8960, 703, 6979, 1059, 1159, 13, 12, 13, 12, 361, 26624, 29918, 4384, 1847, 29901, 13, 12, 12, 509, 29887, 29918, 1445, 353, 376, 29883, 29908, 13, 12, 12, 509, 29887, 29918, 10003, 1275, 29871, 29900, 565, 2927, 1275, 376, 29893, 29908, 1683, 29871, 29955, 13, 12, 23681, 6989, 29918, 4384, 1847, 29901, 13, 12, 12, 509, 29887, 29918, 1445, 353, 376, 29887, 29908, 13, 12, 12, 509, 29887, 29918, 10003, 1275, 29871, 29900, 565, 2927, 353, 543, 29893, 29908, 1683, 29871, 29955, 13, 13, 29937, 12, 2158, 1134, 29892, 509, 29887, 29918, 1445, 29892, 509, 29887, 29918, 10003, 29892, 2218, 29918, 1445, 29892, 2218, 29918, 10003, 29892, 17885, 545, 13, 12, 29937, 4327, 263, 636, 29882, 29892, 29896, 636, 29947, 304, 29871, 29900, 636, 29955, 29892, 29900, 636, 29955, 13, 12, 5325, 353, 6796, 29874, 3284, 29890, 3284, 29883, 3284, 29881, 3284, 29872, 3284, 29888, 3284, 29887, 3284, 29882, 3108, 13, 13, 12, 361, 534, 29887, 29918, 1445, 2804, 6213, 29901, 509, 29887, 29918, 1445, 29922, 5325, 29889, 2248, 29898, 509, 29887, 29918, 1445, 29897, 13, 12, 361, 534, 29887, 29918, 10003, 2804, 6213, 29901, 509, 29887, 29918, 10003, 353, 938, 29898, 509, 29887, 29918, 10003, 6817, 29896, 13, 12, 361, 766, 29918, 1445, 19216, 8516, 29901, 2218, 29918, 1445, 29922, 5325, 29889, 2248, 29898, 2218, 29918, 1445, 29897, 13, 12, 361, 766, 29918, 10003, 19216, 8516, 29901, 2218, 29918, 10003, 353, 938, 29898, 2218, 29918, 10003, 6817, 29896, 13, 12, 361, 10446, 1275, 6213, 29901, 17885, 545, 353, 7700, 13, 13, 12, 361, 26624, 29918, 4384, 1847, 470, 6989, 29918, 4384, 1847, 29901, 13, 12, 12, 11631, 353, 4834, 1847, 29898, 29925, 347, 346, 29898, 2780, 29892, 1853, 511, 534, 29887, 29918, 1445, 29892, 534, 29887, 29918, 10003, 29897, 13, 12, 2870, 29901, 13, 12, 12, 11631, 353, 25249, 29898, 29925, 347, 346, 29898, 2780, 29892, 1853, 511, 534, 29887, 29918, 1445, 29892, 534, 29887, 29918, 10003, 29892, 10446, 29897, 13, 12, 11631, 29889, 3166, 29918, 29916, 353, 766, 29918, 1445, 13, 12, 11631, 29889, 3166, 29918, 29891, 353, 766, 29918, 10003, 13, 12, 13, 12, 361, 22360, 29918, 1853, 19216, 8516, 29901, 13, 12, 12, 9294, 22360, 29918, 1853, 297, 376, 29984, 29940, 15176, 29908, 13, 12, 12, 11631, 29889, 14032, 8194, 29922, 29925, 347, 346, 29898, 2780, 29892, 14032, 8194, 29918, 1853, 29897, 13, 12, 13, 12, 2457, 4337, 13, 12, 13, 1990, 349, 20728, 2283, 29901, 13, 13, 12, 1990, 2796, 29901, 13, 12, 12, 1753, 4770, 2344, 12035, 1311, 1125, 13, 12, 12, 12, 3364, 13, 12, 12, 12, 13, 12, 1753, 4770, 2344, 12035, 1311, 29892, 10422, 1125, 13, 12, 12, 1311, 29889, 2080, 29918, 1445, 353, 25159, 2283, 29898, 9507, 29897, 13, 12, 13, 12, 1753, 4321, 5044, 29898, 1311, 1125, 13, 12, 12, 1311, 29889, 2080, 29918, 1445, 29889, 11014, 29918, 1332, 3246, 22459, 580, 13, 12, 12, 361, 1583, 29889, 2080, 29918, 1445, 29889, 16044, 1231, 703, 29896, 29899, 29900, 29908, 1125, 13, 12, 12, 12, 2457, 376, 29893, 29908, 13, 12, 12, 361, 1583, 29889, 2080, 29918, 1445, 29889, 16044, 1231, 703, 29900, 29899, 29896, 29908, 1125, 13, 12, 12, 12, 2457, 376, 29890, 29908, 13, 12, 12, 361, 1583, 29889, 2080, 29918, 1445, 29889, 16044, 1231, 703, 29896, 29914, 29906, 29899, 29896, 29914, 29906, 29908, 1125, 13, 12, 12, 12, 2457, 376, 29881, 29908, 13, 12, 12, 2457, 6213, 13, 12, 13, 12, 13, 12, 1753, 7523, 14199, 29898, 1311, 1125, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 10568, 29918, 735, 29922, 29900, 13, 12, 12, 12, 13529, 267, 353, 5159, 13, 12, 12, 12, 1311, 29889, 2080, 29918, 1445, 29889, 11014, 29918, 1332, 3246, 22459, 580, 13, 12, 12, 12, 29937, 11014, 8282, 13, 12, 12, 12, 8000, 1583, 29889, 2080, 29918, 1445, 29889, 657, 5914, 580, 26359, 29961, 1115, 13, 12, 12, 12, 12, 2158, 1583, 29889, 2080, 29918, 1445, 29889, 949, 3542, 580, 13, 12, 12, 12, 12, 1311, 29889, 2080, 29918, 1445, 29889, 11014, 29918, 1332, 3246, 22459, 580, 13, 12, 12, 12, 8000, 5852, 29901, 13, 12, 12, 12, 12, 29937, 949, 4331, 13, 12, 12, 12, 12, 361, 1583, 29889, 3057, 5044, 580, 19216, 8516, 29901, 8690, 13, 12, 12, 12, 12, 10568, 29922, 1311, 29889, 2080, 29918, 1445, 29889, 949, 4557, 580, 13, 12, 12, 12, 12, 361, 4331, 1360, 8516, 29901, 13, 12, 12, 12, 12, 12, 8690, 13, 12, 12, 12, 12, 10568, 29918, 735, 353, 4331, 29918, 735, 29974, 29896, 13, 12, 12, 12, 12, 361, 4331, 19216, 10568, 29918, 735, 29901, 13, 12, 12, 12, 12, 12, 22692, 8960, 703, 1445, 4331, 29635, 732, 4331, 17969, 10568, 29918, 735, 29974, 29896, 29897, 13, 12, 12, 12, 12, 29937, 949, 869, 313, 6333, 29897, 13, 12, 12, 12, 12, 1311, 29889, 2080, 29918, 1445, 29889, 17854, 1231, 17350, 1159, 13, 12, 12, 12, 12, 29937, 2158, 851, 29898, 10568, 29918, 735, 511, 1115, 613, 13, 12, 12, 12, 12, 13529, 267, 29889, 4397, 29898, 949, 14448, 29898, 1311, 29889, 2080, 29918, 1445, 1699, 29893, 5783, 13, 12, 12, 12, 12, 29937, 2158, 16229, 14352, 29896, 1822, 7711, 3285, 13, 12, 12, 12, 12, 361, 1583, 29889, 3057, 5044, 580, 19216, 8516, 29901, 8690, 13, 12, 12, 12, 12, 13529, 267, 29889, 4397, 29898, 949, 14448, 29898, 1311, 29889, 2080, 29918, 1445, 1699, 29890, 5783, 13, 12, 12, 12, 12, 29937, 2158, 16229, 14352, 29896, 1822, 7711, 3285, 13, 12, 12, 12, 13, 12, 12, 19499, 25159, 2283, 29889, 5044, 2776, 2283, 29901, 13, 12, 12, 12, 2158, 376, 16903, 29940, 2283, 29889, 5044, 29908, 13, 12, 12, 12, 22692, 349, 20728, 2283, 29889, 5044, 580, 13, 12, 12, 12, 3364, 13, 13, 12, 12, 2158, 376, 949, 613, 10568, 29918, 735, 1699, 24530, 29908, 13, 12, 12, 12, 13, 12, 12, 2457, 16229, 13, 12, 12, 13, 12, 12, 13, 12, 12, 13, 12, 12, 13, 12, 12, 29937, 1688, 29901, 6314, 599, 2854, 16229, 13, 12, 12, 13, 1753, 8561, 3399, 29898, 11802, 29918, 24530, 1125, 13, 12, 29937, 17158, 775, 13, 12, 2083, 29918, 14836, 29922, 29900, 13, 12, 29876, 29922, 23307, 29898, 29900, 29897, 13, 12, 1454, 313, 3881, 29892, 2248, 29897, 297, 18764, 287, 29898, 11802, 29918, 24530, 1125, 13, 12, 12, 9294, 3464, 29958, 2248, 13, 12, 12, 29876, 29922, 29876, 29930, 3881, 13, 12, 12, 29876, 29922, 29876, 29974, 2248, 13, 12, 12, 2083, 29918, 14836, 353, 2533, 29918, 14836, 718, 5844, 29889, 1188, 29898, 3881, 29892, 29906, 29897, 13, 12, 29937, 2158, 408, 7581, 13, 12, 2158, 376, 401, 543, 29892, 29876, 13, 12, 14836, 13776, 13, 13, 12, 13073, 353, 679, 4703, 580, 13, 12, 9294, 12893, 29889, 17990, 1405, 7431, 29898, 29876, 29889, 294, 29918, 23583, 2141, 7501, 1169, 29897, 718, 29871, 29906, 13, 13, 12, 8000, 302, 29958, 29900, 29901, 13, 12, 12, 361, 302, 1273, 3826, 3039, 29898, 29906, 29897, 1360, 29896, 29901, 13, 12, 12, 12, 14836, 543, 29896, 17969, 14836, 13, 12, 12, 12, 29876, 353, 302, 448, 29871, 29896, 13, 12, 12, 2870, 29901, 13, 12, 12, 12, 14836, 543, 29900, 17969, 14836, 13, 12, 12, 29876, 353, 302, 847, 29871, 29906, 13, 13, 12, 2158, 376, 14836, 543, 29892, 2435, 29898, 14836, 511, 29908, 1552, 12116, 936, 543, 29892, 2083, 29918, 14836, 1699, 485, 29887, 2586, 29914, 11631, 613, 7411, 29898, 2435, 29898, 14836, 876, 29914, 2435, 29898, 11802, 29918, 24530, 29897, 13, 13, 12, 2457, 9978, 13, 13, 1753, 5399, 29968, 292, 21133, 545, 29924, 586, 267, 13555, 16619, 29898, 29916, 29918, 3166, 29892, 29891, 29918, 3166, 29892, 11631, 29892, 2780, 1125, 13, 12, 10945, 1591, 29892, 8897, 16619, 13, 12, 29937, 2158, 4337, 29889, 7711, 580, 13, 12, 5349, 29918, 3198, 292, 353, 7700, 13, 12, 17314, 29918, 2371, 29922, 8552, 29889, 24535, 8552, 29898, 2371, 29897, 13, 12, 17314, 29918, 8897, 16619, 29922, 8552, 29889, 24535, 8552, 29898, 8897, 16619, 29897, 13, 12, 6132, 16619, 29898, 29916, 29918, 3166, 29892, 29891, 29918, 3166, 29892, 11631, 29897, 13, 12, 29937, 2886, 12785, 373, 1591, 13, 12, 1454, 343, 297, 3464, 29898, 29900, 29892, 29947, 1125, 13, 12, 12, 1454, 921, 297, 3464, 29898, 29900, 29892, 29947, 1125, 13, 12, 12, 12, 361, 1591, 29961, 29916, 3816, 29891, 29962, 19216, 8516, 322, 1591, 29961, 29916, 3816, 29891, 1822, 3306, 1275, 2927, 29901, 13, 12, 12, 12, 12, 1454, 282, 11631, 297, 4593, 16619, 29898, 29916, 29892, 29891, 1125, 13, 12, 12, 12, 12, 12, 29937, 2158, 376, 29871, 9162, 3358, 994, 29889, 7711, 580, 13, 12, 12, 12, 12, 12, 5349, 29918, 3198, 292, 891, 29922, 282, 11631, 29889, 275, 29968, 292, 21133, 545, 580, 13, 12, 13, 12, 2371, 29922, 17314, 29918, 2371, 13, 12, 8897, 16619, 29922, 17314, 29918, 8897, 16619, 13, 12, 2457, 756, 29918, 3198, 292, 13, 12, 13, 1753, 4522, 2392, 29898, 11802, 29892, 1445, 29918, 978, 29892, 1188, 29918, 1807, 29892, 10568, 29892, 27338, 29918, 13529, 267, 29892, 4352, 292, 29918, 13529, 267, 29892, 9106, 29918, 11631, 1125, 13, 12, 11816, 3562, 580, 13, 12, 2158, 376, 9135, 1687, 16229, 29901, 613, 2435, 29898, 27338, 29918, 13529, 267, 29897, 13, 12, 1454, 518, 29916, 29892, 29891, 29892, 3358, 994, 29962, 297, 1950, 29918, 13529, 267, 29901, 2158, 282, 11631, 29889, 7711, 3285, 13, 12, 2158, 13, 12, 2158, 376, 9652, 292, 1661, 3198, 292, 16229, 6160, 13, 12, 1454, 518, 29916, 29892, 29891, 29892, 3358, 994, 29962, 297, 9686, 29918, 13529, 267, 29901, 2158, 282, 11631, 29889, 7711, 3285, 13, 12, 2158, 13, 12, 13, 12, 1188, 1445, 29922, 3150, 29898, 1445, 29918, 978, 13578, 1213, 29974, 710, 29898, 11802, 7240, 1642, 16400, 3284, 29893, 1159, 13, 12, 1188, 1445, 29889, 3539, 29898, 1188, 29918, 1807, 29897, 13, 12, 1188, 1445, 29889, 5358, 580, 13, 13, 12, 22692, 8960, 703, 22050, 4337, 297, 4331, 613, 10568, 29914, 29906, 29892, 9106, 29918, 11631, 29889, 7711, 3101, 13, 12, 13, 1753, 10554, 16903, 29940, 29898, 1445, 29918, 978, 1125, 13, 12, 4061, 29876, 29918, 1445, 353, 349, 20728, 2283, 29898, 1445, 29918, 978, 29897, 13, 12, 11802, 353, 29871, 29896, 13, 12, 8000, 5852, 29901, 13, 12, 12, 11802, 29918, 14273, 29922, 2636, 396, 1051, 310, 5291, 2701, 29898, 4537, 310, 1950, 6576, 29892, 10769, 4331, 2380, 297, 1950, 4331, 1051, 29897, 13, 12, 12, 1188, 29918, 1807, 13776, 13, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 13529, 267, 353, 282, 5138, 29918, 1445, 29889, 6359, 14199, 580, 13, 12, 12, 19499, 349, 20728, 2283, 29889, 5044, 29901, 13, 12, 12, 12, 8690, 13, 13, 12, 12, 2158, 376, 12739, 2303, 9162, 11802, 29892, 13, 12, 12, 26947, 3562, 580, 13, 12, 12, 13, 12, 12, 11816, 3562, 580, 13, 12, 12, 1188, 29918, 1807, 23661, 3403, 3562, 29898, 29900, 29897, 13, 12, 12, 29937, 1454, 1269, 4337, 29901, 1106, 363, 1950, 16229, 29892, 1207, 278, 4337, 13, 12, 12, 2975, 353, 5852, 396, 5574, 29901, 10921, 7700, 29901, 8517, 13, 12, 12, 1285, 262, 681, 353, 5852, 13, 12, 12, 369, 15828, 353, 7700, 13, 12, 12, 10568, 29922, 29900, 13, 12, 12, 1454, 4337, 297, 16229, 29901, 13, 12, 12, 12, 1188, 29918, 1807, 23661, 11631, 29889, 7711, 580, 13, 12, 12, 12, 1188, 29918, 1807, 29974, 543, 29905, 29876, 29908, 13, 12, 12, 12, 10568, 353, 4331, 718, 29871, 29896, 13, 12, 12, 12, 2780, 353, 376, 29893, 29908, 565, 2625, 1683, 376, 29890, 29908, 13, 12, 12, 12, 12343, 346, 353, 4337, 29889, 12343, 346, 13, 12, 12, 12, 27338, 29918, 13529, 267, 353, 5159, 13, 12, 12, 12, 29937, 2886, 12785, 373, 1591, 13, 12, 12, 12, 1454, 343, 297, 3464, 29898, 29900, 29892, 29947, 1125, 13, 12, 12, 12, 12, 1454, 921, 297, 3464, 29898, 29900, 29892, 29947, 1125, 13, 12, 12, 12, 12, 12, 361, 1591, 29961, 29916, 3816, 29891, 29962, 19216, 8516, 322, 1591, 29961, 29916, 3816, 29891, 1822, 3306, 1275, 2927, 29901, 13, 12, 12, 12, 12, 12, 12, 1454, 282, 11631, 297, 4593, 16619, 29898, 29916, 29892, 29891, 1125, 13, 12, 12, 12, 12, 12, 12, 12, 27338, 29918, 13529, 267, 29889, 4397, 4197, 29916, 29892, 29891, 29892, 3358, 994, 2314, 13, 12, 12, 12, 12, 12, 12, 13, 12, 12, 12, 13, 12, 12, 12, 361, 26952, 29901, 2158, 376, 10568, 613, 10568, 1699, 1456, 414, 4337, 29901, 9162, 11631, 29889, 7711, 3285, 29908, 27338, 16229, 613, 2435, 29898, 27338, 29918, 13529, 267, 29897, 13, 13, 12, 12, 12, 4352, 292, 29918, 13529, 267, 29922, 2636, 13, 12, 12, 12, 1454, 518, 29916, 29892, 29891, 29892, 3358, 994, 29962, 297, 1950, 29918, 13529, 267, 29901, 13, 12, 12, 12, 12, 361, 4337, 29889, 9652, 29898, 3358, 994, 29897, 322, 313, 11631, 29889, 3166, 29918, 29916, 1360, 8516, 470, 4337, 29889, 3166, 29918, 29916, 1360, 29916, 29897, 322, 313, 11631, 29889, 3166, 29918, 29891, 1360, 8516, 470, 4337, 29889, 3166, 29918, 29891, 1360, 29891, 1125, 13, 12, 12, 12, 12, 12, 361, 26952, 29901, 2158, 376, 11940, 4337, 613, 3358, 994, 29889, 12343, 346, 29889, 7711, 580, 23097, 10736, 1753, 12443, 29915, 29961, 29916, 10062, 710, 29898, 29891, 29974, 29896, 511, 3358, 994, 29889, 7711, 580, 13, 12, 12, 12, 12, 12, 4352, 292, 29918, 13529, 267, 29889, 4397, 4197, 29916, 29892, 29891, 29892, 3358, 994, 2314, 13, 12, 12, 12, 13, 12, 12, 12, 4352, 292, 29918, 11631, 353, 6213, 13, 12, 12, 12, 13, 29937, 12, 12, 12, 2158, 376, 4557, 310, 9686, 16229, 29901, 613, 2435, 29898, 4352, 292, 29918, 13529, 267, 29897, 13, 12, 12, 12, 361, 7431, 29898, 4352, 292, 29918, 13529, 267, 29897, 1405, 29871, 29896, 29901, 13, 12, 12, 12, 12, 29937, 4149, 565, 777, 16229, 674, 1925, 278, 4088, 297, 263, 8454, 2602, 29889, 10987, 278, 697, 393, 20668, 13, 12, 12, 12, 12, 1217, 3198, 292, 29918, 13529, 267, 29922, 2636, 13, 12, 12, 12, 12, 1454, 518, 29916, 29892, 29891, 29892, 3358, 994, 29962, 297, 9686, 29918, 13529, 267, 29901, 13, 12, 12, 12, 12, 12, 9292, 17885, 545, 353, 5399, 29968, 292, 21133, 545, 29924, 586, 267, 13555, 16619, 29898, 29916, 29892, 29891, 29892, 3358, 994, 1699, 29890, 29908, 565, 2625, 1683, 376, 29893, 1159, 13, 12, 12, 12, 12, 12, 29937, 2158, 6989, 17885, 545, 13, 12, 12, 12, 12, 12, 361, 451, 6989, 17885, 545, 29901, 13, 12, 12, 12, 12, 12, 12, 1217, 3198, 292, 29918, 13529, 267, 29889, 4397, 4197, 29916, 29892, 29891, 29892, 3358, 994, 2314, 13, 12, 12, 12, 12, 12, 13, 12, 12, 12, 12, 29937, 2158, 376, 3782, 29899, 3198, 292, 16229, 29901, 613, 2435, 29898, 1217, 3198, 292, 29918, 13529, 267, 29897, 13, 12, 12, 12, 12, 361, 7431, 29898, 1217, 3198, 292, 29918, 13529, 267, 29897, 2804, 29871, 29896, 29901, 13, 12, 12, 12, 12, 12, 3403, 2392, 29898, 11802, 29892, 1445, 29918, 978, 29892, 1188, 29918, 1807, 29892, 10568, 29892, 27338, 29918, 13529, 267, 29892, 1217, 3198, 292, 29918, 13529, 267, 29892, 11631, 29897, 13, 12, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 12, 4352, 292, 29918, 11631, 29922, 1217, 3198, 292, 29918, 13529, 267, 29961, 29900, 29962, 13, 12, 12, 12, 12, 12, 13, 12, 12, 12, 23681, 7431, 29898, 4352, 292, 29918, 13529, 267, 29897, 1275, 29871, 29896, 29901, 13, 12, 12, 12, 12, 4352, 292, 29918, 11631, 29922, 4352, 292, 29918, 13529, 267, 29961, 29900, 29962, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 3403, 2392, 29898, 11802, 29892, 1445, 29918, 978, 29892, 1188, 29918, 1807, 29892, 10568, 29892, 27338, 29918, 13529, 267, 29892, 4352, 292, 29918, 13529, 267, 29892, 11631, 29897, 13, 12, 12, 12, 13, 12, 12, 12, 6132, 16619, 29898, 4352, 292, 29918, 11631, 29961, 29900, 1402, 4352, 292, 29918, 11631, 29961, 29896, 1402, 4352, 292, 29918, 11631, 29961, 29906, 2314, 13, 12, 12, 12, 12, 13, 12, 12, 12, 361, 7700, 322, 26952, 29901, 13, 12, 12, 12, 12, 11816, 3562, 580, 13, 12, 12, 12, 12, 13, 12, 12, 12, 11802, 29918, 14273, 29889, 4397, 3552, 2435, 29898, 27338, 29918, 13529, 267, 511, 27338, 29918, 13529, 267, 29889, 2248, 29898, 4352, 292, 29918, 11631, 4961, 13, 12, 12, 12, 12, 12, 13, 12, 12, 12, 1188, 29918, 1807, 23661, 3403, 3562, 29898, 10568, 29897, 13, 12, 12, 12, 13, 12, 12, 12, 2202, 29901, 13, 12, 12, 12, 12, 361, 451, 2145, 681, 29901, 13, 12, 12, 12, 12, 12, 1285, 353, 10650, 29918, 2080, 703, 1323, 14150, 29973, 16521, 13, 12, 12, 12, 12, 12, 361, 640, 26359, 29876, 1115, 8690, 13, 12, 12, 12, 12, 12, 361, 640, 1360, 376, 29874, 1115, 13, 12, 12, 12, 12, 12, 12, 1285, 262, 681, 353, 5852, 13, 12, 12, 12, 19499, 29901, 13, 12, 12, 12, 12, 3364, 13, 12, 12, 12, 2975, 353, 451, 2625, 13, 12, 12, 13, 12, 12, 29937, 497, 16229, 19356, 13, 12, 12, 361, 26952, 29901, 13, 12, 12, 12, 11816, 3562, 580, 13, 12, 12, 13, 12, 12, 1188, 1445, 29922, 3150, 29898, 1445, 29918, 978, 13578, 1213, 29974, 710, 29898, 11802, 7240, 1642, 16400, 3284, 29893, 1159, 13, 12, 12, 1188, 1445, 29889, 3539, 29898, 1188, 29918, 1807, 29897, 13, 12, 12, 1188, 1445, 29889, 5358, 580, 13, 13, 12, 12, 2158, 3748, 29918, 14273, 13, 12, 12, 19541, 353, 8561, 3399, 29898, 11802, 29918, 14273, 29897, 13, 13, 12, 12, 2109, 29918, 1445, 29922, 3150, 29898, 1445, 29918, 978, 13578, 1213, 29974, 710, 29898, 11802, 7240, 1642, 2109, 3284, 29893, 1159, 13, 12, 12, 2109, 29918, 1445, 29889, 3539, 29898, 19541, 29897, 13, 12, 12, 2109, 29918, 1445, 29889, 5358, 580, 13, 12, 12, 2158, 7581, 13, 12, 12, 11802, 353, 3748, 718, 29871, 29896, 13, 13, 12, 29937, 497, 8090, 19356, 13, 13, 1753, 10554, 29933, 1177, 29898, 1445, 29918, 978, 1125, 13, 12, 19541, 29918, 710, 29922, 6066, 2283, 29898, 1445, 29918, 978, 467, 949, 3542, 580, 13, 12, 1066, 29918, 1767, 353, 3826, 3039, 29898, 29896, 29897, 13, 12, 1767, 353, 3826, 3039, 29898, 29900, 29897, 13, 12, 1454, 926, 297, 3464, 29898, 2435, 29898, 19541, 29918, 710, 6817, 29896, 6653, 29896, 6653, 29896, 1125, 13, 12, 12, 1767, 4619, 926, 29918, 1767, 565, 7581, 29918, 710, 29961, 1066, 13192, 543, 29896, 29908, 1683, 3826, 3039, 29898, 29900, 29897, 13, 12, 12, 1066, 29918, 1767, 334, 29922, 3826, 3039, 29898, 29906, 29897, 13, 12, 13, 12, 26947, 3562, 890, 13, 12, 11802, 29918, 14273, 353, 5159, 13, 12, 13, 12, 2158, 376, 401, 543, 29892, 1767, 13, 12, 1188, 29918, 1807, 13776, 13, 12, 10568, 353, 29871, 29900, 13, 12, 1188, 29918, 1807, 23661, 3403, 3562, 29898, 10568, 416, 13, 12, 13, 12, 2780, 29465, 29890, 29908, 13, 12, 8000, 995, 2804, 29871, 29900, 29901, 13, 12, 12, 2780, 353, 376, 29893, 29908, 565, 2927, 353, 543, 29890, 29908, 1683, 376, 29890, 29908, 13, 12, 12, 27338, 29918, 13529, 267, 353, 5159, 13, 12, 12, 29937, 2886, 12785, 373, 1591, 13, 12, 12, 1454, 343, 297, 3464, 29898, 29900, 29892, 29947, 1125, 13, 12, 12, 12, 1454, 921, 297, 3464, 29898, 29900, 29892, 29947, 1125, 13, 12, 12, 12, 12, 361, 1591, 29961, 29916, 3816, 29891, 29962, 19216, 8516, 322, 1591, 29961, 29916, 3816, 29891, 1822, 3306, 1275, 2927, 29901, 13, 12, 12, 12, 12, 12, 1454, 282, 11631, 297, 4593, 16619, 29898, 29916, 29892, 29891, 1125, 13, 12, 12, 12, 12, 12, 12, 27338, 29918, 13529, 267, 29889, 4397, 4197, 29916, 29892, 29891, 29892, 3358, 994, 2314, 13, 13, 12, 12, 10568, 29918, 3881, 353, 7431, 29898, 27338, 29918, 13529, 267, 29897, 13, 12, 12, 2248, 353, 995, 1273, 4331, 29918, 3881, 13, 12, 12, 11802, 29918, 14273, 29889, 4397, 3552, 524, 29898, 10568, 29918, 3881, 511, 524, 29898, 2248, 4961, 13, 12, 12, 1767, 22361, 2380, 13, 12, 12, 1767, 353, 995, 847, 4331, 29918, 3881, 13, 12, 12, 13, 12, 12, 524, 29918, 2248, 353, 938, 29898, 2248, 29897, 13, 12, 12, 9294, 3826, 3039, 29898, 524, 29918, 2248, 29897, 1275, 2380, 13, 12, 12, 6132, 16619, 29898, 27338, 29918, 13529, 267, 29961, 524, 29918, 2248, 3816, 29900, 1402, 27338, 29918, 13529, 267, 29961, 524, 29918, 2248, 3816, 29896, 1402, 27338, 29918, 13529, 267, 29961, 524, 29918, 2248, 3816, 29906, 2314, 13, 12, 12, 10568, 4619, 29871, 29896, 13, 12, 12, 1188, 29918, 1807, 23661, 3403, 3562, 29898, 10568, 416, 13, 12, 2158, 3748, 29918, 14273, 13, 13, 12, 11802, 353, 29871, 29896, 13, 12, 1188, 1445, 29922, 3150, 29898, 1445, 29918, 978, 13578, 1213, 29974, 710, 29898, 11802, 7240, 1642, 16400, 3284, 29893, 1159, 13, 12, 1188, 1445, 29889, 3539, 29898, 1188, 29918, 1807, 29897, 13, 12, 1188, 1445, 29889, 5358, 580, 13, 12, 13, 12, 13, 361, 7700, 29901, 13, 12, 1688, 29918, 13529, 267, 29922, 2636, 13, 12, 1688, 29918, 13529, 267, 23661, 15263, 16619, 29898, 29946, 29892, 29900, 29897, 13, 12, 1688, 29918, 13529, 267, 23661, 15263, 16619, 29898, 29946, 29892, 29955, 29897, 13, 12, 12, 12, 12, 13, 12, 1454, 4337, 297, 1243, 29918, 13529, 267, 29901, 2158, 4337, 29889, 7711, 3285, 13, 12, 2158, 13, 12, 13, 12, 6132, 16619, 29898, 29946, 29892, 29900, 29892, 1688, 29918, 13529, 267, 29961, 29896, 2314, 13, 12, 11816, 3562, 580, 13, 13, 842, 4703, 29898, 2677, 29898, 17990, 29922, 29941, 29900, 29900, 876, 13, 13, 9507, 353, 10876, 29889, 19218, 29961, 29896, 1822, 17010, 2141, 6506, 703, 1966, 3284, 29914, 1159, 13, 361, 10422, 14352, 29946, 29901, 13192, 29569, 4061, 29876, 1115, 13, 12, 7032, 16903, 29940, 29898, 9507, 29897, 13, 23681, 10876, 29889, 19218, 29961, 29896, 3816, 29899, 29946, 29901, 13192, 29569, 2109, 1115, 13, 12, 7032, 29933, 1177, 29898, 9507, 29897, 13, 13, 2 ]
Lectures/UAV_control/message_types/msg_map.py
donnel2-cooper/drone_control
0
182597
""" msg_map - messages type for map of the world part of mavsim_python - Beard & McLain, PUP, 2012 - Last update: 4/10/2019 - RWB """ import numpy as np import parameters.planner_parameters as PLAN class msgMap: def __init__(self): # flag to indicate if the map has changed self.flag_map_changed = 0 # the city is of size (width)x(width) self.city_width = PLAN.city_width # number of blocks in city self.num_city_blocks = PLAN.num_blocks # percent of block that is street. self.street_width = PLAN.city_width / PLAN.num_blocks * PLAN.street_width # maximum height of buildings self.building_max_height = PLAN.building_height # an array of building heights self.building_height = PLAN.building_height * np.random.rand(PLAN.num_blocks, PLAN.num_blocks) # the width of the buildings (all the same) self.building_width = PLAN.city_width / PLAN.num_blocks * (1 - PLAN.street_width) # north coordinate of center of buildings self.building_north = np.zeros((1,PLAN.num_blocks)) for i in range(PLAN.num_blocks): self.building_north[0, i] = 0.5 * (PLAN.city_width / PLAN.num_blocks) * (2 * i + 1) # east coordinate of center of buildings self.building_east = np.copy(self.building_north)
[ 1, 9995, 13, 7645, 29918, 1958, 13, 1678, 448, 7191, 1134, 363, 2910, 310, 278, 3186, 13, 268, 13, 1595, 310, 286, 485, 3601, 29918, 4691, 13, 1678, 448, 1522, 538, 669, 4052, 29931, 475, 29892, 349, 4897, 29892, 29871, 29906, 29900, 29896, 29906, 13, 1678, 448, 9208, 2767, 29901, 13, 308, 29946, 29914, 29896, 29900, 29914, 29906, 29900, 29896, 29929, 448, 390, 29956, 29933, 13, 15945, 29908, 13, 5215, 12655, 408, 7442, 13, 5215, 4128, 29889, 572, 7310, 29918, 16744, 408, 16507, 2190, 13, 13, 1990, 10191, 3388, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 396, 7353, 304, 12266, 565, 278, 2910, 756, 3939, 13, 4706, 1583, 29889, 15581, 29918, 1958, 29918, 15033, 353, 29871, 29900, 13, 4706, 396, 278, 4272, 338, 310, 2159, 313, 2103, 29897, 29916, 29898, 2103, 29897, 13, 4706, 1583, 29889, 12690, 29918, 2103, 353, 16507, 2190, 29889, 12690, 29918, 2103, 13, 4706, 396, 1353, 310, 10930, 297, 4272, 13, 4706, 1583, 29889, 1949, 29918, 12690, 29918, 1271, 29879, 353, 16507, 2190, 29889, 1949, 29918, 1271, 29879, 13, 4706, 396, 10151, 310, 2908, 393, 338, 11952, 29889, 13, 4706, 1583, 29889, 29352, 29918, 2103, 353, 16507, 2190, 29889, 12690, 29918, 2103, 847, 16507, 2190, 29889, 1949, 29918, 1271, 29879, 334, 16507, 2190, 29889, 29352, 29918, 2103, 13, 4706, 396, 7472, 3171, 310, 13814, 13, 4706, 1583, 29889, 25237, 29918, 3317, 29918, 3545, 353, 16507, 2190, 29889, 25237, 29918, 3545, 13, 4706, 396, 385, 1409, 310, 5214, 3171, 29879, 13, 4706, 1583, 29889, 25237, 29918, 3545, 353, 16507, 2190, 29889, 25237, 29918, 3545, 334, 7442, 29889, 8172, 29889, 9502, 29898, 7390, 2190, 29889, 1949, 29918, 1271, 29879, 29892, 16507, 2190, 29889, 1949, 29918, 1271, 29879, 29897, 13, 4706, 396, 278, 2920, 310, 278, 13814, 313, 497, 278, 1021, 29897, 13, 4706, 1583, 29889, 25237, 29918, 2103, 353, 16507, 2190, 29889, 12690, 29918, 2103, 847, 16507, 2190, 29889, 1949, 29918, 1271, 29879, 334, 313, 29896, 448, 16507, 2190, 29889, 29352, 29918, 2103, 29897, 13, 4706, 396, 6641, 14821, 310, 4818, 310, 13814, 13, 4706, 1583, 29889, 25237, 29918, 29876, 2072, 353, 7442, 29889, 3298, 359, 3552, 29896, 29892, 7390, 2190, 29889, 1949, 29918, 1271, 29879, 876, 13, 4706, 363, 474, 297, 3464, 29898, 7390, 2190, 29889, 1949, 29918, 1271, 29879, 1125, 13, 9651, 1583, 29889, 25237, 29918, 29876, 2072, 29961, 29900, 29892, 474, 29962, 353, 29871, 29900, 29889, 29945, 334, 313, 7390, 2190, 29889, 12690, 29918, 2103, 847, 16507, 2190, 29889, 1949, 29918, 1271, 29879, 29897, 334, 313, 29906, 334, 474, 718, 29871, 29896, 29897, 13, 4706, 396, 9755, 14821, 310, 4818, 310, 13814, 13, 4706, 1583, 29889, 25237, 29918, 23027, 353, 7442, 29889, 8552, 29898, 1311, 29889, 25237, 29918, 29876, 2072, 29897, 13, 2 ]
blog/services/main.py
JohannSuarez/fastapi_backend
0
90921
''' Services are defined in the services package. Each service is a subclass of AppService. The database session is passed down from the request dependency via an "interface-like" mixin utility class (other mixin classes may be added via multiple inheritance in order to extend available attributes) ''' from sqlalchemy.orm import Session class DBSessionMixin: def __init__(self, db: Session): self.db = db class AppService(DBSessionMixin): pass class AppCRUD(DBSessionMixin): pass
[ 1, 14550, 13, 13779, 526, 3342, 297, 278, 5786, 3577, 29889, 7806, 2669, 13, 275, 263, 19481, 310, 2401, 3170, 29889, 450, 2566, 4867, 338, 4502, 1623, 13, 3166, 278, 2009, 10609, 3025, 385, 376, 13248, 29899, 4561, 29908, 6837, 262, 19725, 770, 13, 29898, 1228, 6837, 262, 4413, 1122, 367, 2715, 3025, 2999, 20328, 297, 1797, 304, 13, 21843, 3625, 8393, 29897, 13, 12008, 13, 13, 3166, 4576, 284, 305, 6764, 29889, 555, 1053, 16441, 13, 13, 1990, 6535, 7317, 29924, 861, 262, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 4833, 29901, 16441, 1125, 13, 4706, 1583, 29889, 2585, 353, 4833, 13, 13, 1990, 2401, 3170, 29898, 4051, 7317, 29924, 861, 262, 1125, 13, 1678, 1209, 13, 13, 1990, 2401, 11341, 15789, 29898, 4051, 7317, 29924, 861, 262, 1125, 13, 1678, 1209, 13, 2 ]
poezio/poezio.py
David96/poezio_lima-gold
0
147598
# Copyright 2010-2011 <NAME> <<EMAIL>> # # This file is part of Poezio. # # Poezio is free software: you can redistribute it and/or modify # it under the terms of the zlib license. See the COPYING file. """ Starting point of poezio. Launches both the Connection and Gui """ import sys import os import signal import logging sys.path.append(os.path.dirname(os.path.abspath(__file__))) def test_curses(): """ Check if the system ncurses linked with python has unicode capabilities. """ import curses if hasattr(curses, 'unget_wch'): return True print("""\ ERROR: The current python executable is linked with a ncurses version that \ has no unicode capabilities. This could mean that: - python was built on a system where readline is linked against \ libncurses and not libncursesw - python was built without ncursesw headers available Please file a bug for your distribution or fix that on your system and then \ recompile python. Poezio is currently unable to read your input or draw its interface properly,\ so it will now exit.""") return False def main(): """ Entry point. """ sys.stdout.write("\x1b]0;poezio\x07") sys.stdout.flush() from poezio import config config_path = config.check_create_config_dir() config.run_cmdline_args(config_path) config.create_global_config() config.check_create_log_dir() config.check_create_cache_dir() config.setup_logging() config.post_logging_setup() from poezio.config import options if options.check_config: config.check_config() sys.exit(0) from poezio import theming theming.update_themes_dir() from poezio import logger logger.create_logger() from poezio import roster roster.create_roster() from poezio import core log = logging.getLogger('') signal.signal(signal.SIGINT, signal.SIG_IGN) # ignore ctrl-c cocore = core.Core() signal.signal(signal.SIGUSR1, cocore.sigusr_handler) # reload the config signal.signal(signal.SIGHUP, cocore.exit_from_signal) signal.signal(signal.SIGTERM, cocore.exit_from_signal) if options.debug: cocore.debug = True cocore.start() from slixmpp.exceptions import IqError, IqTimeout def swallow_iqerrors(loop, context): """Do not log unhandled iq errors and timeouts""" if not isinstance(context['exception'], (IqError, IqTimeout)): loop.default_exception_handler(context) # Warning: asyncio must always be imported after the config. Otherwise # the asyncio logger will not follow our configuration and won't write # the tracebacks in the correct file, etc import asyncio loop = asyncio.get_event_loop() loop.set_exception_handler(swallow_iqerrors) loop.add_reader(sys.stdin, cocore.on_input_readable) loop.add_signal_handler(signal.SIGWINCH, cocore.sigwinch_handler) cocore.xmpp.start() loop.run_forever() # We reach this point only when loop.stop() is called try: cocore.reset_curses() except: pass
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29896, 29900, 29899, 29906, 29900, 29896, 29896, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 29937, 13, 29937, 910, 934, 338, 760, 310, 3929, 6096, 601, 29889, 13, 29937, 13, 29937, 3929, 6096, 601, 338, 3889, 7047, 29901, 366, 508, 2654, 391, 2666, 372, 322, 29914, 272, 6623, 13, 29937, 372, 1090, 278, 4958, 310, 278, 503, 1982, 19405, 29889, 2823, 278, 315, 4590, 29979, 4214, 934, 29889, 13, 13, 13, 15945, 29908, 13, 4763, 292, 1298, 310, 772, 6096, 601, 29889, 997, 3322, 267, 1716, 278, 15160, 322, 402, 1481, 13, 15945, 29908, 13, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 7182, 13, 5215, 12183, 13, 13, 9675, 29889, 2084, 29889, 4397, 29898, 359, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 22168, 1445, 1649, 4961, 13, 13, 1753, 1243, 29918, 29883, 1295, 267, 7295, 13, 1678, 9995, 13, 1678, 5399, 565, 278, 1788, 302, 29883, 1295, 267, 9024, 411, 3017, 756, 29104, 27108, 29889, 13, 1678, 9995, 13, 1678, 1053, 18580, 267, 13, 1678, 565, 756, 5552, 29898, 29883, 1295, 267, 29892, 525, 348, 657, 29918, 29893, 305, 29374, 13, 4706, 736, 5852, 13, 1678, 1596, 703, 15945, 29905, 13, 11432, 29901, 450, 1857, 3017, 16813, 338, 9024, 411, 263, 302, 29883, 1295, 267, 1873, 393, 320, 13, 5349, 694, 29104, 27108, 29889, 13, 13, 4013, 1033, 2099, 393, 29901, 13, 1678, 448, 3017, 471, 4240, 373, 263, 1788, 988, 1303, 1220, 338, 9024, 2750, 320, 13, 1982, 17608, 1295, 267, 322, 451, 4303, 17608, 1295, 267, 29893, 13, 1678, 448, 3017, 471, 4240, 1728, 302, 29883, 1295, 267, 29893, 9066, 3625, 13, 13, 12148, 934, 263, 6494, 363, 596, 4978, 470, 2329, 393, 373, 596, 1788, 322, 769, 320, 13, 276, 12198, 3017, 29889, 13, 9837, 6096, 601, 338, 5279, 9368, 304, 1303, 596, 1881, 470, 4216, 967, 5067, 6284, 2053, 13, 577, 372, 674, 1286, 6876, 1213, 29908, 1159, 13, 1678, 736, 7700, 13, 13, 13, 1753, 1667, 7295, 13, 1678, 9995, 13, 1678, 28236, 1298, 29889, 13, 1678, 9995, 13, 1678, 10876, 29889, 25393, 29889, 3539, 14182, 29916, 29896, 29890, 29962, 29900, 29936, 1129, 6096, 601, 29905, 29916, 29900, 29955, 1159, 13, 1678, 10876, 29889, 25393, 29889, 23126, 580, 13, 1678, 515, 772, 6096, 601, 1053, 2295, 13, 1678, 2295, 29918, 2084, 353, 2295, 29889, 3198, 29918, 3258, 29918, 2917, 29918, 3972, 580, 13, 1678, 2295, 29889, 3389, 29918, 9006, 1220, 29918, 5085, 29898, 2917, 29918, 2084, 29897, 13, 1678, 2295, 29889, 3258, 29918, 10945, 29918, 2917, 580, 13, 1678, 2295, 29889, 3198, 29918, 3258, 29918, 1188, 29918, 3972, 580, 13, 1678, 2295, 29889, 3198, 29918, 3258, 29918, 8173, 29918, 3972, 580, 13, 1678, 2295, 29889, 14669, 29918, 21027, 580, 13, 1678, 2295, 29889, 2490, 29918, 21027, 29918, 14669, 580, 13, 13, 1678, 515, 772, 6096, 601, 29889, 2917, 1053, 3987, 13, 13, 1678, 565, 3987, 29889, 3198, 29918, 2917, 29901, 13, 4706, 2295, 29889, 3198, 29918, 2917, 580, 13, 4706, 10876, 29889, 13322, 29898, 29900, 29897, 13, 13, 1678, 515, 772, 6096, 601, 1053, 963, 292, 13, 1678, 963, 292, 29889, 5504, 29918, 386, 13826, 29918, 3972, 580, 13, 13, 1678, 515, 772, 6096, 601, 1053, 17927, 13, 1678, 17927, 29889, 3258, 29918, 21707, 580, 13, 13, 1678, 515, 772, 6096, 601, 1053, 696, 2475, 13, 1678, 696, 2475, 29889, 3258, 29918, 307, 2475, 580, 13, 13, 1678, 515, 772, 6096, 601, 1053, 7136, 13, 13, 1678, 1480, 353, 12183, 29889, 657, 16363, 877, 1495, 13, 13, 1678, 7182, 29889, 25436, 29898, 25436, 29889, 5425, 29954, 10192, 29892, 7182, 29889, 5425, 29954, 29918, 17298, 29897, 396, 11455, 274, 11742, 29899, 29883, 13, 1678, 274, 542, 487, 353, 7136, 29889, 9203, 580, 13, 1678, 7182, 29889, 25436, 29898, 25436, 29889, 5425, 29954, 3308, 29934, 29896, 29892, 274, 542, 487, 29889, 18816, 4855, 29918, 13789, 29897, 396, 19763, 278, 2295, 13, 1678, 7182, 29889, 25436, 29898, 25436, 29889, 5425, 29954, 29950, 4897, 29892, 274, 542, 487, 29889, 13322, 29918, 3166, 29918, 25436, 29897, 13, 1678, 7182, 29889, 25436, 29898, 25436, 29889, 5425, 29954, 4945, 29924, 29892, 274, 542, 487, 29889, 13322, 29918, 3166, 29918, 25436, 29897, 13, 1678, 565, 3987, 29889, 8382, 29901, 13, 4706, 274, 542, 487, 29889, 8382, 353, 5852, 13, 1678, 274, 542, 487, 29889, 2962, 580, 13, 13, 1678, 515, 20662, 29916, 29885, 407, 29889, 11739, 29879, 1053, 306, 29939, 2392, 29892, 306, 29939, 10851, 13, 1678, 822, 2381, 9536, 29918, 29875, 29939, 12523, 29898, 7888, 29892, 3030, 1125, 13, 4706, 9995, 6132, 451, 1480, 443, 3179, 839, 474, 29939, 4436, 322, 11815, 29879, 15945, 29908, 13, 4706, 565, 451, 338, 8758, 29898, 4703, 1839, 11739, 7464, 313, 29902, 29939, 2392, 29892, 306, 29939, 10851, 22164, 13, 9651, 2425, 29889, 4381, 29918, 11739, 29918, 13789, 29898, 4703, 29897, 13, 13, 1678, 396, 24412, 29901, 408, 948, 3934, 1818, 2337, 367, 19673, 1156, 278, 2295, 29889, 13466, 13, 1678, 396, 278, 408, 948, 3934, 17927, 674, 451, 1101, 1749, 5285, 322, 2113, 29915, 29873, 2436, 13, 1678, 396, 278, 9637, 1627, 29879, 297, 278, 1959, 934, 29892, 2992, 13, 1678, 1053, 408, 948, 3934, 13, 1678, 2425, 353, 408, 948, 3934, 29889, 657, 29918, 3696, 29918, 7888, 580, 13, 1678, 2425, 29889, 842, 29918, 11739, 29918, 13789, 29898, 2774, 9536, 29918, 29875, 29939, 12523, 29897, 13, 13, 1678, 2425, 29889, 1202, 29918, 16950, 29898, 9675, 29889, 4172, 262, 29892, 274, 542, 487, 29889, 265, 29918, 2080, 29918, 949, 519, 29897, 13, 1678, 2425, 29889, 1202, 29918, 25436, 29918, 13789, 29898, 25436, 29889, 5425, 29954, 25152, 3210, 29892, 274, 542, 487, 29889, 18816, 5080, 305, 29918, 13789, 29897, 13, 1678, 274, 542, 487, 29889, 29916, 29885, 407, 29889, 2962, 580, 13, 1678, 2425, 29889, 3389, 29918, 1079, 369, 580, 13, 1678, 396, 1334, 6159, 445, 1298, 871, 746, 2425, 29889, 9847, 580, 338, 2000, 13, 1678, 1018, 29901, 13, 4706, 274, 542, 487, 29889, 12071, 29918, 29883, 1295, 267, 580, 13, 1678, 5174, 29901, 13, 4706, 1209, 13, 2 ]
config.py
DeflatedPickle/1984-chan
1
135112
import json from json import JSONDecodeError import simplejson def read_id(): with open("token.txt") as f: return f.readline().strip() def read_config(): with open("config.json", 'r+') as f: try: pre = json.load(f) except JSONDecodeError: write_config({}) pre = json.loads('{}') return dict([(int(k), v) for k, v in pre.items()]) def write_config(config): with open("config.json", 'w+') as f: f.write(simplejson.dumps(config, indent=4, sort_keys=True))
[ 1, 1053, 4390, 13, 3166, 4390, 1053, 4663, 2772, 401, 2392, 13, 13, 5215, 2560, 3126, 13, 13, 13, 1753, 1303, 29918, 333, 7295, 13, 1678, 411, 1722, 703, 6979, 29889, 3945, 1159, 408, 285, 29901, 13, 4706, 736, 285, 29889, 949, 1220, 2141, 17010, 580, 13, 13, 13, 1753, 1303, 29918, 2917, 7295, 13, 1678, 411, 1722, 703, 2917, 29889, 3126, 613, 525, 29878, 29974, 1495, 408, 285, 29901, 13, 4706, 1018, 29901, 13, 9651, 758, 353, 4390, 29889, 1359, 29898, 29888, 29897, 13, 4706, 5174, 4663, 2772, 401, 2392, 29901, 13, 9651, 2436, 29918, 2917, 3319, 1800, 13, 9651, 758, 353, 4390, 29889, 18132, 877, 8875, 1495, 13, 13, 4706, 736, 9657, 4197, 29898, 524, 29898, 29895, 511, 325, 29897, 363, 413, 29892, 325, 297, 758, 29889, 7076, 580, 2314, 13, 13, 13, 1753, 2436, 29918, 2917, 29898, 2917, 1125, 13, 1678, 411, 1722, 703, 2917, 29889, 3126, 613, 525, 29893, 29974, 1495, 408, 285, 29901, 13, 4706, 285, 29889, 3539, 29898, 12857, 3126, 29889, 29881, 17204, 29898, 2917, 29892, 29536, 29922, 29946, 29892, 2656, 29918, 8149, 29922, 5574, 876, 13, 2 ]
scripts/generate_specializations.py
cxwx/VecGeom
1
162865
<filename>scripts/generate_specializations.py # Script to generate translation and rotation specializations of placed volumes, rotation = [0x1B1, 0x18E, 0x076, 0x16A, 0x155, 0x0AD, 0x0DC, 0x0E3, 0x11B, 0x0A1, 0x10A, 0x046, 0x062, 0x054, 0x111, 0x200] translation = ["translation::kGeneric", "translation::kIdentity"] header_string = """\ /// @file TransformationSpecializations.icc /// @author Script generated. #ifndef VECGEOM_NO_SPECIALIZATION """ specialization_string = """\ if (trans_code == {:s} && rot_code == {:#05x}) {{ return VolumeType::template Create<{:s}, {:#05x}>( logical_volume, transformation, #ifdef VECCORE_CUDA id, copy_no, child_id, #endif placement); }} """ generic_string = """\ #endif // No specialization return VolumeType::template Create<translation::kGeneric, rotation::kGeneric>( logical_volume, transformation, #ifdef VECCORE_CUDA id, copy_no, child_id, #endif placement);\ """ output_file = open("../VecGeom/management/TransformationSpecializations.icc", "w") output_file.write(header_string) for r in rotation: for t in translation: output_file.write(specialization_string.format(t, r, t, r)) output_file.write(generic_string) output_file.close()
[ 1, 529, 9507, 29958, 16713, 29914, 17158, 29918, 18732, 17063, 29889, 2272, 13, 29937, 14415, 304, 5706, 13962, 322, 13733, 4266, 17063, 310, 7180, 18167, 29892, 13, 13, 5450, 362, 353, 518, 29900, 29916, 29896, 29933, 29896, 29892, 29871, 29900, 29916, 29896, 29947, 29923, 29892, 29871, 29900, 29916, 29900, 29955, 29953, 29892, 29871, 29900, 29916, 29896, 29953, 29909, 29892, 29871, 29900, 29916, 29896, 29945, 29945, 29892, 29871, 29900, 29916, 29900, 3035, 29892, 29871, 29900, 29916, 29900, 12696, 29892, 29871, 29900, 29916, 29900, 29923, 29941, 29892, 29871, 29900, 29916, 29896, 29896, 29933, 29892, 13, 632, 29900, 29916, 29900, 29909, 29896, 29892, 29871, 29900, 29916, 29896, 29900, 29909, 29892, 29871, 29900, 29916, 29900, 29946, 29953, 29892, 29871, 29900, 29916, 29900, 29953, 29906, 29892, 29871, 29900, 29916, 29900, 29945, 29946, 29892, 29871, 29900, 29916, 29896, 29896, 29896, 29892, 29871, 29900, 29916, 29906, 29900, 29900, 29962, 13, 3286, 18411, 353, 6796, 3286, 18411, 1057, 29895, 15809, 613, 376, 3286, 18411, 1057, 29895, 18415, 3108, 13, 13, 6672, 29918, 1807, 353, 9995, 29905, 13, 6658, 732, 1445, 4103, 5404, 24780, 17063, 29889, 293, 29883, 13, 6658, 732, 8921, 14415, 5759, 29889, 13, 13, 29937, 361, 299, 1389, 478, 11206, 1692, 6488, 29918, 6632, 29918, 29903, 4162, 8426, 1964, 26664, 8098, 13, 15945, 29908, 13, 13, 18732, 2133, 29918, 1807, 353, 9995, 29905, 13, 29871, 565, 313, 3286, 29918, 401, 1275, 12365, 29879, 29913, 2607, 5731, 29918, 401, 1275, 12365, 29937, 29900, 29945, 29916, 1800, 8620, 13, 1678, 736, 16934, 1542, 1057, 6886, 6204, 29966, 25641, 29879, 1118, 12365, 29937, 29900, 29945, 29916, 29913, 5961, 13, 418, 16667, 29918, 24623, 29892, 13852, 29892, 13, 29937, 361, 1753, 478, 11206, 3217, 1525, 29918, 29907, 29965, 7698, 13, 965, 1178, 29892, 3509, 29918, 1217, 29892, 2278, 29918, 333, 29892, 13, 29937, 15224, 13, 418, 2174, 13561, 416, 13, 29871, 9156, 13, 15945, 29908, 13, 13, 19206, 29918, 1807, 353, 9995, 29905, 13, 29937, 15224, 849, 1939, 4266, 2133, 13, 13, 29871, 736, 16934, 1542, 1057, 6886, 6204, 29966, 3286, 18411, 1057, 29895, 15809, 29892, 13733, 1057, 29895, 15809, 5961, 13, 418, 16667, 29918, 24623, 29892, 13852, 29892, 13, 29937, 361, 1753, 478, 11206, 3217, 1525, 29918, 29907, 29965, 7698, 13, 965, 1178, 29892, 3509, 29918, 1217, 29892, 2278, 29918, 333, 29892, 13, 29937, 15224, 13, 418, 2174, 13561, 416, 29905, 13, 15945, 29908, 13, 13, 4905, 29918, 1445, 353, 1722, 703, 6995, 25987, 7999, 290, 29914, 21895, 29914, 4300, 5404, 24780, 17063, 29889, 293, 29883, 613, 376, 29893, 1159, 13, 13, 4905, 29918, 1445, 29889, 3539, 29898, 6672, 29918, 1807, 29897, 13, 1454, 364, 297, 13733, 29901, 13, 29871, 363, 260, 297, 13962, 29901, 13, 1678, 1962, 29918, 1445, 29889, 3539, 29898, 18732, 2133, 29918, 1807, 29889, 4830, 29898, 29873, 29892, 364, 29892, 260, 29892, 364, 876, 13, 4905, 29918, 1445, 29889, 3539, 29898, 19206, 29918, 1807, 29897, 13, 4905, 29918, 1445, 29889, 5358, 580, 13, 2 ]
alipay/aop/api/domain/ReduceInfo.py
snowxmas/alipay-sdk-python-all
213
33975
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class ReduceInfo(object): def __init__(self): self._brand_name = None self._consume_amt = None self._consume_store_name = None self._payment_time = None self._promo_amt = None self._user_name = None @property def brand_name(self): return self._brand_name @brand_name.setter def brand_name(self, value): self._brand_name = value @property def consume_amt(self): return self._consume_amt @consume_amt.setter def consume_amt(self, value): self._consume_amt = value @property def consume_store_name(self): return self._consume_store_name @consume_store_name.setter def consume_store_name(self, value): self._consume_store_name = value @property def payment_time(self): return self._payment_time @payment_time.setter def payment_time(self, value): self._payment_time = value @property def promo_amt(self): return self._promo_amt @promo_amt.setter def promo_amt(self, value): self._promo_amt = value @property def user_name(self): return self._user_name @user_name.setter def user_name(self, value): self._user_name = value def to_alipay_dict(self): params = dict() if self.brand_name: if hasattr(self.brand_name, 'to_alipay_dict'): params['brand_name'] = self.brand_name.to_alipay_dict() else: params['brand_name'] = self.brand_name if self.consume_amt: if hasattr(self.consume_amt, 'to_alipay_dict'): params['consume_amt'] = self.consume_amt.to_alipay_dict() else: params['consume_amt'] = self.consume_amt if self.consume_store_name: if hasattr(self.consume_store_name, 'to_alipay_dict'): params['consume_store_name'] = self.consume_store_name.to_alipay_dict() else: params['consume_store_name'] = self.consume_store_name if self.payment_time: if hasattr(self.payment_time, 'to_alipay_dict'): params['payment_time'] = self.payment_time.to_alipay_dict() else: params['payment_time'] = self.payment_time if self.promo_amt: if hasattr(self.promo_amt, 'to_alipay_dict'): params['promo_amt'] = self.promo_amt.to_alipay_dict() else: params['promo_amt'] = self.promo_amt if self.user_name: if hasattr(self.user_name, 'to_alipay_dict'): params['user_name'] = self.user_name.to_alipay_dict() else: params['user_name'] = self.user_name return params @staticmethod def from_alipay_dict(d): if not d: return None o = ReduceInfo() if 'brand_name' in d: o.brand_name = d['brand_name'] if 'consume_amt' in d: o.consume_amt = d['consume_amt'] if 'consume_store_name' in d: o.consume_store_name = d['consume_store_name'] if 'payment_time' in d: o.payment_time = d['payment_time'] if 'promo_amt' in d: o.promo_amt = d['promo_amt'] if 'user_name' in d: o.user_name = d['user_name'] return o
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, 29900, 29900, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 4390, 13, 13, 3166, 394, 666, 388, 29889, 29874, 459, 29889, 2754, 29889, 23362, 29889, 4736, 26570, 1053, 334, 13, 13, 13, 1990, 4367, 24551, 3401, 29898, 3318, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 3032, 16472, 29918, 978, 353, 6213, 13, 4706, 1583, 3032, 3200, 2017, 29918, 8035, 353, 6213, 13, 4706, 1583, 3032, 3200, 2017, 29918, 8899, 29918, 978, 353, 6213, 13, 4706, 1583, 3032, 27825, 29918, 2230, 353, 6213, 13, 4706, 1583, 3032, 14032, 29877, 29918, 8035, 353, 6213, 13, 4706, 1583, 3032, 1792, 29918, 978, 353, 6213, 13, 13, 1678, 732, 6799, 13, 1678, 822, 14982, 29918, 978, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 16472, 29918, 978, 13, 13, 1678, 732, 16472, 29918, 978, 29889, 842, 357, 13, 1678, 822, 14982, 29918, 978, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 16472, 29918, 978, 353, 995, 13, 1678, 732, 6799, 13, 1678, 822, 29151, 29918, 8035, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 3200, 2017, 29918, 8035, 13, 13, 1678, 732, 3200, 2017, 29918, 8035, 29889, 842, 357, 13, 1678, 822, 29151, 29918, 8035, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 3200, 2017, 29918, 8035, 353, 995, 13, 1678, 732, 6799, 13, 1678, 822, 29151, 29918, 8899, 29918, 978, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 3200, 2017, 29918, 8899, 29918, 978, 13, 13, 1678, 732, 3200, 2017, 29918, 8899, 29918, 978, 29889, 842, 357, 13, 1678, 822, 29151, 29918, 8899, 29918, 978, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 3200, 2017, 29918, 8899, 29918, 978, 353, 995, 13, 1678, 732, 6799, 13, 1678, 822, 19179, 29918, 2230, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 27825, 29918, 2230, 13, 13, 1678, 732, 27825, 29918, 2230, 29889, 842, 357, 13, 1678, 822, 19179, 29918, 2230, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 27825, 29918, 2230, 353, 995, 13, 1678, 732, 6799, 13, 1678, 822, 2504, 29877, 29918, 8035, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 14032, 29877, 29918, 8035, 13, 13, 1678, 732, 14032, 29877, 29918, 8035, 29889, 842, 357, 13, 1678, 822, 2504, 29877, 29918, 8035, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 14032, 29877, 29918, 8035, 353, 995, 13, 1678, 732, 6799, 13, 1678, 822, 1404, 29918, 978, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 1792, 29918, 978, 13, 13, 1678, 732, 1792, 29918, 978, 29889, 842, 357, 13, 1678, 822, 1404, 29918, 978, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 1792, 29918, 978, 353, 995, 13, 13, 13, 1678, 822, 304, 29918, 284, 666, 388, 29918, 8977, 29898, 1311, 1125, 13, 4706, 8636, 353, 9657, 580, 13, 4706, 565, 1583, 29889, 16472, 29918, 978, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 16472, 29918, 978, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 16472, 29918, 978, 2033, 353, 1583, 29889, 16472, 29918, 978, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 16472, 29918, 978, 2033, 353, 1583, 29889, 16472, 29918, 978, 13, 4706, 565, 1583, 29889, 3200, 2017, 29918, 8035, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 3200, 2017, 29918, 8035, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 3200, 2017, 29918, 8035, 2033, 353, 1583, 29889, 3200, 2017, 29918, 8035, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 3200, 2017, 29918, 8035, 2033, 353, 1583, 29889, 3200, 2017, 29918, 8035, 13, 4706, 565, 1583, 29889, 3200, 2017, 29918, 8899, 29918, 978, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 3200, 2017, 29918, 8899, 29918, 978, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 3200, 2017, 29918, 8899, 29918, 978, 2033, 353, 1583, 29889, 3200, 2017, 29918, 8899, 29918, 978, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 3200, 2017, 29918, 8899, 29918, 978, 2033, 353, 1583, 29889, 3200, 2017, 29918, 8899, 29918, 978, 13, 4706, 565, 1583, 29889, 27825, 29918, 2230, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 27825, 29918, 2230, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 27825, 29918, 2230, 2033, 353, 1583, 29889, 27825, 29918, 2230, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 27825, 29918, 2230, 2033, 353, 1583, 29889, 27825, 29918, 2230, 13, 4706, 565, 1583, 29889, 14032, 29877, 29918, 8035, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 14032, 29877, 29918, 8035, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 14032, 29877, 29918, 8035, 2033, 353, 1583, 29889, 14032, 29877, 29918, 8035, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 14032, 29877, 29918, 8035, 2033, 353, 1583, 29889, 14032, 29877, 29918, 8035, 13, 4706, 565, 1583, 29889, 1792, 29918, 978, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 1792, 29918, 978, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 1792, 29918, 978, 2033, 353, 1583, 29889, 1792, 29918, 978, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 1792, 29918, 978, 2033, 353, 1583, 29889, 1792, 29918, 978, 13, 4706, 736, 8636, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 515, 29918, 284, 666, 388, 29918, 8977, 29898, 29881, 1125, 13, 4706, 565, 451, 270, 29901, 13, 9651, 736, 6213, 13, 4706, 288, 353, 4367, 24551, 3401, 580, 13, 4706, 565, 525, 16472, 29918, 978, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 16472, 29918, 978, 353, 270, 1839, 16472, 29918, 978, 2033, 13, 4706, 565, 525, 3200, 2017, 29918, 8035, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 3200, 2017, 29918, 8035, 353, 270, 1839, 3200, 2017, 29918, 8035, 2033, 13, 4706, 565, 525, 3200, 2017, 29918, 8899, 29918, 978, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 3200, 2017, 29918, 8899, 29918, 978, 353, 270, 1839, 3200, 2017, 29918, 8899, 29918, 978, 2033, 13, 4706, 565, 525, 27825, 29918, 2230, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 27825, 29918, 2230, 353, 270, 1839, 27825, 29918, 2230, 2033, 13, 4706, 565, 525, 14032, 29877, 29918, 8035, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 14032, 29877, 29918, 8035, 353, 270, 1839, 14032, 29877, 29918, 8035, 2033, 13, 4706, 565, 525, 1792, 29918, 978, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 1792, 29918, 978, 353, 270, 1839, 1792, 29918, 978, 2033, 13, 4706, 736, 288, 13, 13, 13, 2 ]
pyning/tail_recursion/fibonacci_test.py
rkoyanagui/pyning
0
39189
<gh_stars>0 import unittest from pyning.tail_recursion.fibonacci import naive_fib from pyning.utils.testutils import BaseTest class FibonacciTailRecursionTest(BaseTest): def test_zero(self): self.check(f=naive_fib, xr=0, n=0) def test_one(self): self.check(f=naive_fib, xr=1, n=1) def test_two(self): self.check(f=naive_fib, xr=1, n=2) def test_three(self): self.check(f=naive_fib, xr=2, n=3) def test_four(self): self.check(f=naive_fib, xr=3, n=4) def test_five(self): self.check(f=naive_fib, xr=5, n=5) def test_six(self): self.check(f=naive_fib, xr=8, n=6) if __name__ == '__main__': unittest.main()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 443, 27958, 13, 13, 3166, 282, 948, 292, 29889, 18237, 29918, 3757, 1295, 291, 29889, 29888, 747, 265, 21566, 1053, 1055, 573, 29918, 29888, 747, 13, 3166, 282, 948, 292, 29889, 13239, 29889, 1688, 13239, 1053, 7399, 3057, 13, 13, 13, 1990, 383, 747, 265, 21566, 29911, 737, 4789, 1295, 291, 3057, 29898, 5160, 3057, 1125, 13, 13, 1678, 822, 1243, 29918, 9171, 29898, 1311, 1125, 13, 4706, 1583, 29889, 3198, 29898, 29888, 29922, 1056, 573, 29918, 29888, 747, 29892, 921, 29878, 29922, 29900, 29892, 302, 29922, 29900, 29897, 13, 13, 1678, 822, 1243, 29918, 650, 29898, 1311, 1125, 13, 4706, 1583, 29889, 3198, 29898, 29888, 29922, 1056, 573, 29918, 29888, 747, 29892, 921, 29878, 29922, 29896, 29892, 302, 29922, 29896, 29897, 13, 13, 1678, 822, 1243, 29918, 10184, 29898, 1311, 1125, 13, 4706, 1583, 29889, 3198, 29898, 29888, 29922, 1056, 573, 29918, 29888, 747, 29892, 921, 29878, 29922, 29896, 29892, 302, 29922, 29906, 29897, 13, 13, 1678, 822, 1243, 29918, 17536, 29898, 1311, 1125, 13, 4706, 1583, 29889, 3198, 29898, 29888, 29922, 1056, 573, 29918, 29888, 747, 29892, 921, 29878, 29922, 29906, 29892, 302, 29922, 29941, 29897, 13, 13, 1678, 822, 1243, 29918, 17823, 29898, 1311, 1125, 13, 4706, 1583, 29889, 3198, 29898, 29888, 29922, 1056, 573, 29918, 29888, 747, 29892, 921, 29878, 29922, 29941, 29892, 302, 29922, 29946, 29897, 13, 13, 1678, 822, 1243, 29918, 20818, 29898, 1311, 1125, 13, 4706, 1583, 29889, 3198, 29898, 29888, 29922, 1056, 573, 29918, 29888, 747, 29892, 921, 29878, 29922, 29945, 29892, 302, 29922, 29945, 29897, 13, 13, 1678, 822, 1243, 29918, 28319, 29898, 1311, 1125, 13, 4706, 1583, 29889, 3198, 29898, 29888, 29922, 1056, 573, 29918, 29888, 747, 29892, 921, 29878, 29922, 29947, 29892, 302, 29922, 29953, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 2 ]
python/tests/test_auxdata.py
clayne/gtirb
230
123523
<gh_stars>100-1000 import unittest from unittest import mock import gtirb class AuxDataTest(unittest.TestCase): def setUp(self): self.fake_ir = mock.MagicMock() self.fake_ir.get_by_uuid = None def test_lazy(self): ad1 = gtirb.AuxData("test1", "string") self.assertEqual(ad1.data, "test1") serialized = ad1._to_protobuf() ad2 = gtirb.AuxData._from_protobuf(serialized, self.fake_ir) # Peek inside: the data is not yet deserialized self.assertTrue(ad2._data is None) # Accessing the data should deserialize self.assertEqual(ad1.data, ad2.data) self.assertTrue(ad2._data is not None) # Just exercise repr self.assertEqual( repr(ad2), "AuxData(type_name='string', data='test1', )" ) def test_lazy_never_deserialized(self): serialized = gtirb.AuxData("testing 123", "string")._to_protobuf() ad1 = gtirb.AuxData._from_protobuf(serialized, self.fake_ir) # Peek inside: the data is not yet deserialized self.assertTrue(ad1._data is None) serialized2 = ad1._to_protobuf() self.assertTrue(ad1._data is None) self.assertEqual(serialized, serialized2) if __name__ == "__main__": unittest.main()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, 29900, 29900, 29900, 13, 5215, 443, 27958, 13, 3166, 443, 27958, 1053, 11187, 13, 13, 5215, 330, 29873, 381, 29890, 13, 13, 13, 1990, 319, 1314, 1469, 3057, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29888, 1296, 29918, 381, 353, 11187, 29889, 19095, 293, 18680, 580, 13, 4706, 1583, 29889, 29888, 1296, 29918, 381, 29889, 657, 29918, 1609, 29918, 25118, 353, 6213, 13, 13, 1678, 822, 1243, 29918, 433, 1537, 29898, 1311, 1125, 13, 4706, 594, 29896, 353, 330, 29873, 381, 29890, 29889, 29909, 1314, 1469, 703, 1688, 29896, 613, 376, 1807, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 328, 29896, 29889, 1272, 29892, 376, 1688, 29896, 1159, 13, 13, 4706, 7797, 1891, 353, 594, 29896, 3032, 517, 29918, 17529, 9721, 580, 13, 4706, 594, 29906, 353, 330, 29873, 381, 29890, 29889, 29909, 1314, 1469, 3032, 3166, 29918, 17529, 9721, 29898, 15550, 1891, 29892, 1583, 29889, 29888, 1296, 29918, 381, 29897, 13, 4706, 396, 3938, 1416, 2768, 29901, 278, 848, 338, 451, 3447, 16964, 616, 1891, 13, 4706, 1583, 29889, 9294, 5574, 29898, 328, 29906, 3032, 1272, 338, 6213, 29897, 13, 13, 4706, 396, 11028, 292, 278, 848, 881, 16964, 6646, 13, 4706, 1583, 29889, 9294, 9843, 29898, 328, 29896, 29889, 1272, 29892, 594, 29906, 29889, 1272, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 328, 29906, 3032, 1272, 338, 451, 6213, 29897, 13, 13, 4706, 396, 3387, 15058, 2062, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13, 9651, 2062, 29898, 328, 29906, 511, 376, 29909, 1314, 1469, 29898, 1853, 29918, 978, 2433, 1807, 742, 848, 2433, 1688, 29896, 742, 1723, 29908, 13, 4706, 1723, 13, 13, 1678, 822, 1243, 29918, 433, 1537, 29918, 484, 369, 29918, 2783, 261, 616, 1891, 29898, 1311, 1125, 13, 4706, 7797, 1891, 353, 330, 29873, 381, 29890, 29889, 29909, 1314, 1469, 703, 13424, 29871, 29896, 29906, 29941, 613, 376, 1807, 2564, 29918, 517, 29918, 17529, 9721, 580, 13, 13, 4706, 594, 29896, 353, 330, 29873, 381, 29890, 29889, 29909, 1314, 1469, 3032, 3166, 29918, 17529, 9721, 29898, 15550, 1891, 29892, 1583, 29889, 29888, 1296, 29918, 381, 29897, 13, 4706, 396, 3938, 1416, 2768, 29901, 278, 848, 338, 451, 3447, 16964, 616, 1891, 13, 4706, 1583, 29889, 9294, 5574, 29898, 328, 29896, 3032, 1272, 338, 6213, 29897, 13, 13, 4706, 7797, 1891, 29906, 353, 594, 29896, 3032, 517, 29918, 17529, 9721, 580, 13, 4706, 1583, 29889, 9294, 5574, 29898, 328, 29896, 3032, 1272, 338, 6213, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 15550, 1891, 29892, 7797, 1891, 29906, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 2 ]
tool/pypoc/kubecfg/commands/jsonnet.py
ant31/kubecfg
0
147767
import os import json from kubecfg.render_jsonnet import RenderJsonnet from kubecfg.commands.command_base import CommandBase, LoadVariables class JsonnetCmd(CommandBase): name = 'jsonnet' help_message = "Resolve a jsonnet file with the kubecfgstd available" def __init__(self, options): super(JsonnetCmd, self).__init__(options) self.namespace = options.namespace self.variables = options.variables if isinstance(options.filepath, list): self.filepath = options.filepath[0] else: self.filepath = options.filepath self.result = None self.action = "package" @classmethod def _add_arguments(cls, parser): parser.add_argument("--namespace", help="kubernetes namespace", default='default') parser.add_argument("-x", "--variables", help="variables", default={}, action=LoadVariables) parser.add_argument('filepath', nargs=1, help="jsonnet file to render") def _call(self): r = RenderJsonnet(manifestpath=self.filepath) if os.path.basename(self.filepath) == "manifest.jsonnet": namespace = self.namespace self.variables['namespace'] = namespace tla_codes = {"params": json.dumps({"variables": self.variables, "action": self.action})} else: tla_codes = self.variables p = open(self.filepath).read() self.result = r.render_jsonnet(p, tla_codes=tla_codes) def _render_dict(self): return self.result def _render_console(self): return json.dumps(self._render_dict(), indent=2, separators=(',', ': '))
[ 1, 1053, 2897, 13, 5215, 4390, 13, 3166, 413, 431, 687, 16434, 29889, 9482, 29918, 3126, 1212, 1053, 26000, 8148, 1212, 13, 3166, 413, 431, 687, 16434, 29889, 26381, 29889, 6519, 29918, 3188, 1053, 10516, 5160, 29892, 16012, 10444, 1849, 13, 13, 13, 1990, 14355, 1212, 23651, 29898, 6255, 5160, 1125, 13, 1678, 1024, 353, 525, 3126, 1212, 29915, 13, 1678, 1371, 29918, 4906, 353, 376, 12375, 345, 263, 4390, 1212, 934, 411, 278, 413, 431, 687, 16434, 4172, 3625, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3987, 1125, 13, 4706, 2428, 29898, 8148, 1212, 23651, 29892, 1583, 467, 1649, 2344, 12035, 6768, 29897, 13, 4706, 1583, 29889, 22377, 353, 3987, 29889, 22377, 13, 4706, 1583, 29889, 20897, 353, 3987, 29889, 20897, 13, 4706, 565, 338, 8758, 29898, 6768, 29889, 1445, 2084, 29892, 1051, 1125, 13, 9651, 1583, 29889, 1445, 2084, 353, 3987, 29889, 1445, 2084, 29961, 29900, 29962, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 1445, 2084, 353, 3987, 29889, 1445, 2084, 13, 4706, 1583, 29889, 2914, 353, 6213, 13, 4706, 1583, 29889, 2467, 353, 376, 5113, 29908, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 903, 1202, 29918, 25699, 29898, 25932, 29892, 13812, 1125, 13, 4706, 13812, 29889, 1202, 29918, 23516, 703, 489, 22377, 613, 1371, 543, 29895, 17547, 7397, 613, 2322, 2433, 4381, 1495, 13, 4706, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29916, 613, 376, 489, 20897, 613, 1371, 543, 20897, 613, 2322, 3790, 1118, 3158, 29922, 5896, 10444, 1849, 29897, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 1445, 2084, 742, 302, 5085, 29922, 29896, 29892, 1371, 543, 3126, 1212, 934, 304, 4050, 1159, 13, 13, 1678, 822, 903, 4804, 29898, 1311, 1125, 13, 4706, 364, 353, 26000, 8148, 1212, 29898, 29135, 2084, 29922, 1311, 29889, 1445, 2084, 29897, 13, 4706, 565, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 1311, 29889, 1445, 2084, 29897, 1275, 376, 29135, 29889, 3126, 1212, 1115, 13, 9651, 7397, 353, 1583, 29889, 22377, 13, 9651, 1583, 29889, 20897, 1839, 22377, 2033, 353, 7397, 13, 9651, 260, 433, 29918, 18137, 353, 8853, 7529, 1115, 4390, 29889, 29881, 17204, 3319, 29908, 20897, 1115, 1583, 29889, 20897, 29892, 376, 2467, 1115, 1583, 29889, 2467, 1800, 29913, 13, 4706, 1683, 29901, 13, 9651, 260, 433, 29918, 18137, 353, 1583, 29889, 20897, 13, 4706, 282, 353, 1722, 29898, 1311, 29889, 1445, 2084, 467, 949, 580, 13, 4706, 1583, 29889, 2914, 353, 364, 29889, 9482, 29918, 3126, 1212, 29898, 29886, 29892, 260, 433, 29918, 18137, 29922, 29873, 433, 29918, 18137, 29897, 13, 13, 1678, 822, 903, 9482, 29918, 8977, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 2914, 13, 13, 1678, 822, 903, 9482, 29918, 11058, 29898, 1311, 1125, 13, 4706, 736, 4390, 29889, 29881, 17204, 29898, 1311, 3032, 9482, 29918, 8977, 3285, 29536, 29922, 29906, 29892, 2903, 4097, 7607, 742, 742, 525, 29901, 525, 876, 13, 2 ]
tests/test_connections.py
iparaskev/py_connect
5
29380
<filename>tests/test_connections.py """test_connections.py""" import unittest import os from py_connect import ConnectionsHandler from py_connect import Board, Peripheral, SensorTypes cons_path = \ "/".join(os.path.abspath(__file__).split("/")[:-2]) + "/test_connections/" class TestConnection(unittest.TestCase): def test_gpio_connection(self): connections = ConnectionsHandler(cons_path + "debug_connection.cd") gpio_con = connections.connections["rpi_sonar"] gpio_con_2 = connections.connections["rpi_sonar_2"] # Good connection # Just check args self.assertEqual(gpio_con.name, "rpi_sonar", "Wrong connection name.") self.assertIsInstance(gpio_con.board, Board, "Should be board.") self.assertIsInstance(gpio_con.peripheral, Peripheral, "Should be peripheral.") self.assertEqual(gpio_con.board.name, "rpi_3b_plus", "Should be rpi_3b_plus") self.assertEqual(gpio_con.peripheral.name, "hc_sr04", "Should be hc_sr04") # Check right power connections. self.assertEqual(gpio_con.power_connections[0].pin_1, self.target(gpio_con.board.pins, "gnd_1"), "Should be gnd_1.") self.assertEqual(gpio_con.power_connections[0].pin_2, self.target(gpio_con.peripheral.pins, "gnd"), "Should be gnd.") self.assertEqual(gpio_con.power_connections[1].pin_1, self.target(gpio_con.board.pins, "power_5v_1"), "Should be power_5v_1.") self.assertEqual(gpio_con.power_connections[1].pin_2, self.target(gpio_con.peripheral.pins, "vcc"), "Should be vcc.") # Check right hw_connections self.assertEqual(gpio_con.hw_connections[0].hwint_1, self.target(gpio_con.board.hw_interfaces, "bcm_7"), "Should be bcm_23") self.assertEqual(gpio_con.hw_connections[0].hwint_2, self.target(gpio_con.peripheral.hw_interfaces, "echo"), "Should be echo") self.assertEqual(gpio_con.hw_connections[1].hwint_1, self.target(gpio_con.board.hw_interfaces, "bcm_24"), "Should be bcm_24") self.assertEqual(gpio_con.hw_connections[1].hwint_2, self.target(gpio_con.peripheral.hw_interfaces, "trigger"), "Should be trigger.") # Different objects of same device self.assertNotEqual(gpio_con.peripheral, gpio_con_2.peripheral, "Should be different.") def target(self, ls, name): for p in ls: if p.name == name: return p def test_i2c(self): connections = ConnectionsHandler(cons_path + "debug_connection.cd") i2c_con = connections.connections["rpi_bme680"] self.assertEqual(i2c_con.hw_connections[0].hwint_1, self.target(i2c_con.board.hw_interfaces, "i2c_1"), "Should be i2c_1 of rpi.") self.assertEqual(i2c_con.hw_connections[0].hwint_2, self.target(i2c_con.peripheral.hw_interfaces, "i2c_0"), "Should be i2c_0 of bme.") self.assertEqual(i2c_con.hw_connections[0].slave_address, int(0x77), "Should be 0x77.") def test_spi(self): connections = ConnectionsHandler(cons_path + "debug_connection.cd") spi_con = connections.connections["rpi_icm"] self.assertEqual(spi_con.hw_connections[0].hwint_1, self.target(spi_con.board.hw_interfaces, "spi_0"), "Should be spi_0 of rpi.") self.assertEqual(spi_con.hw_connections[0].hwint_2, self.target(spi_con.peripheral.hw_interfaces, "spi_0"), "Should be spi_0 of bme.") ce_index = spi_con.hw_connections[0].ce_index ce_pin = spi_con.hw_connections[0].hwint_1.ce[ce_index] self.assertEqual(ce_pin.name, "bcm_8", "Should be bcm_8.") def test_comm_endpoint(self): connections = ConnectionsHandler(cons_path + "debug_connection.cd") con = connections.connections["rpi_sonar"] # Simple communication checks self.assertEqual(con.com_endpoint.topic_name, "sonar_1.distance") self.assertEqual(con.com_endpoint.conn_params.username, "testuser", "Should be testuser.") self.assertEqual(con.com_endpoint.conn_params.password, "testuser", "Should be <PASSWORD>user.") self.assertEqual(con.com_endpoint.conn_params.host, "r4a-platform.ddns.net", "Should be ...") self.assertEqual(con.com_endpoint.conn_params.port, 5782, "Should be 5782") self.assertEqual(con.com_endpoint.msg.msg_entries[0].type, SensorTypes.DISTANCE) self.assertEqual(con.com_endpoint.msg.msg_entries[0].frequency, 10) con = connections.connections["rpi_bme680"] self.assertEqual(con.com_endpoint.msg.msg_entries[0].type, SensorTypes.ENV) #self.assertEqual(con.com_endpoint.msg.msg_entries[1].type, # SensorTypes.HUMIDITY) #self.assertEqual(con.com_endpoint.msg.msg_entries[2].type, # SensorTypes.GAS) if __name__ == "__main__": unittest.main()
[ 1, 529, 9507, 29958, 21150, 29914, 1688, 29918, 11958, 1953, 29889, 2272, 13, 15945, 29908, 1688, 29918, 11958, 1953, 29889, 2272, 15945, 29908, 13, 13, 5215, 443, 27958, 13, 5215, 2897, 13, 3166, 11451, 29918, 6915, 1053, 1281, 484, 1953, 4598, 13, 3166, 11451, 29918, 6915, 1053, 12590, 29892, 2431, 29875, 8096, 284, 29892, 317, 6073, 10562, 13, 13, 13, 3200, 29918, 2084, 353, 320, 13, 1678, 5591, 1642, 7122, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 22168, 1445, 1649, 467, 5451, 11974, 1159, 7503, 29899, 29906, 2314, 718, 5591, 1688, 29918, 11958, 1953, 12975, 13, 13, 13, 1990, 4321, 5350, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 13, 1678, 822, 1243, 29918, 29887, 16168, 29918, 9965, 29898, 1311, 1125, 13, 4706, 12368, 353, 1281, 484, 1953, 4598, 29898, 3200, 29918, 2084, 718, 376, 8382, 29918, 9965, 29889, 2252, 1159, 13, 4706, 330, 16168, 29918, 535, 353, 12368, 29889, 11958, 1953, 3366, 29878, 1631, 29918, 1100, 279, 3108, 13, 4706, 330, 16168, 29918, 535, 29918, 29906, 353, 12368, 29889, 11958, 1953, 3366, 29878, 1631, 29918, 1100, 279, 29918, 29906, 3108, 13, 13, 4706, 396, 7197, 3957, 13, 4706, 396, 3387, 1423, 6389, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29887, 16168, 29918, 535, 29889, 978, 29892, 376, 29878, 1631, 29918, 1100, 279, 613, 376, 29956, 29373, 3957, 1024, 23157, 13, 4706, 1583, 29889, 9294, 3624, 4998, 29898, 29887, 16168, 29918, 535, 29889, 3377, 29892, 12590, 29892, 376, 26857, 367, 7613, 23157, 13, 4706, 1583, 29889, 9294, 3624, 4998, 29898, 29887, 16168, 29918, 535, 29889, 546, 29875, 8096, 284, 29892, 2431, 29875, 8096, 284, 29892, 13, 462, 795, 376, 26857, 367, 23603, 8096, 284, 23157, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29887, 16168, 29918, 535, 29889, 3377, 29889, 978, 29892, 376, 29878, 1631, 29918, 29941, 29890, 29918, 11242, 613, 13, 462, 308, 376, 26857, 367, 364, 1631, 29918, 29941, 29890, 29918, 11242, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29887, 16168, 29918, 535, 29889, 546, 29875, 8096, 284, 29889, 978, 29892, 376, 29882, 29883, 29918, 21935, 29900, 29946, 613, 13, 462, 308, 376, 26857, 367, 298, 29883, 29918, 21935, 29900, 29946, 1159, 13, 4706, 396, 5399, 1492, 3081, 12368, 29889, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29887, 16168, 29918, 535, 29889, 13519, 29918, 11958, 1953, 29961, 29900, 1822, 12687, 29918, 29896, 29892, 13, 462, 308, 1583, 29889, 5182, 29898, 29887, 16168, 29918, 535, 29889, 3377, 29889, 29886, 1144, 29892, 376, 29887, 299, 29918, 29896, 4968, 13, 462, 308, 376, 26857, 367, 330, 299, 29918, 29896, 23157, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29887, 16168, 29918, 535, 29889, 13519, 29918, 11958, 1953, 29961, 29900, 1822, 12687, 29918, 29906, 29892, 13, 462, 308, 1583, 29889, 5182, 29898, 29887, 16168, 29918, 535, 29889, 546, 29875, 8096, 284, 29889, 29886, 1144, 29892, 376, 29887, 299, 4968, 13, 462, 308, 376, 26857, 367, 330, 299, 23157, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29887, 16168, 29918, 535, 29889, 13519, 29918, 11958, 1953, 29961, 29896, 1822, 12687, 29918, 29896, 29892, 13, 462, 308, 1583, 29889, 5182, 29898, 29887, 16168, 29918, 535, 29889, 3377, 29889, 29886, 1144, 29892, 376, 13519, 29918, 29945, 29894, 29918, 29896, 4968, 13, 462, 308, 376, 26857, 367, 3081, 29918, 29945, 29894, 29918, 29896, 23157, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29887, 16168, 29918, 535, 29889, 13519, 29918, 11958, 1953, 29961, 29896, 1822, 12687, 29918, 29906, 29892, 13, 462, 308, 1583, 29889, 5182, 29898, 29887, 16168, 29918, 535, 29889, 546, 29875, 8096, 284, 29889, 29886, 1144, 29892, 376, 29894, 617, 4968, 13, 462, 308, 376, 26857, 367, 325, 617, 23157, 13, 13, 4706, 396, 5399, 1492, 298, 29893, 29918, 11958, 1953, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29887, 16168, 29918, 535, 29889, 26828, 29918, 11958, 1953, 29961, 29900, 1822, 26828, 524, 29918, 29896, 29892, 13, 462, 308, 1583, 29889, 5182, 29898, 29887, 16168, 29918, 535, 29889, 3377, 29889, 26828, 29918, 1639, 8726, 29892, 376, 29890, 4912, 29918, 29955, 4968, 13, 462, 308, 376, 26857, 367, 289, 4912, 29918, 29906, 29941, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29887, 16168, 29918, 535, 29889, 26828, 29918, 11958, 1953, 29961, 29900, 1822, 26828, 524, 29918, 29906, 29892, 13, 462, 308, 1583, 29889, 5182, 29898, 29887, 16168, 29918, 535, 29889, 546, 29875, 8096, 284, 29889, 26828, 29918, 1639, 8726, 29892, 376, 8057, 4968, 13, 462, 308, 376, 26857, 367, 2916, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29887, 16168, 29918, 535, 29889, 26828, 29918, 11958, 1953, 29961, 29896, 1822, 26828, 524, 29918, 29896, 29892, 13, 462, 308, 1583, 29889, 5182, 29898, 29887, 16168, 29918, 535, 29889, 3377, 29889, 26828, 29918, 1639, 8726, 29892, 376, 29890, 4912, 29918, 29906, 29946, 4968, 13, 462, 308, 376, 26857, 367, 289, 4912, 29918, 29906, 29946, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29887, 16168, 29918, 535, 29889, 26828, 29918, 11958, 1953, 29961, 29896, 1822, 26828, 524, 29918, 29906, 29892, 13, 462, 308, 1583, 29889, 5182, 29898, 29887, 16168, 29918, 535, 29889, 546, 29875, 8096, 284, 29889, 26828, 29918, 1639, 8726, 29892, 376, 21001, 4968, 13, 462, 308, 376, 26857, 367, 7135, 23157, 13, 13, 4706, 396, 360, 15622, 3618, 310, 1021, 4742, 13, 4706, 1583, 29889, 9294, 3664, 9843, 29898, 29887, 16168, 29918, 535, 29889, 546, 29875, 8096, 284, 29892, 330, 16168, 29918, 535, 29918, 29906, 29889, 546, 29875, 8096, 284, 29892, 13, 462, 9651, 376, 26857, 367, 1422, 23157, 13, 13, 1678, 822, 3646, 29898, 1311, 29892, 19375, 29892, 1024, 1125, 13, 4706, 363, 282, 297, 19375, 29901, 13, 9651, 565, 282, 29889, 978, 1275, 1024, 29901, 13, 18884, 736, 282, 13, 13, 1678, 822, 1243, 29918, 29875, 29906, 29883, 29898, 1311, 1125, 13, 4706, 12368, 353, 1281, 484, 1953, 4598, 29898, 3200, 29918, 2084, 718, 376, 8382, 29918, 9965, 29889, 2252, 1159, 13, 4706, 474, 29906, 29883, 29918, 535, 353, 12368, 29889, 11958, 1953, 3366, 29878, 1631, 29918, 29890, 1004, 29953, 29947, 29900, 3108, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29875, 29906, 29883, 29918, 535, 29889, 26828, 29918, 11958, 1953, 29961, 29900, 1822, 26828, 524, 29918, 29896, 29892, 13, 462, 308, 1583, 29889, 5182, 29898, 29875, 29906, 29883, 29918, 535, 29889, 3377, 29889, 26828, 29918, 1639, 8726, 29892, 376, 29875, 29906, 29883, 29918, 29896, 4968, 13, 462, 308, 376, 26857, 367, 474, 29906, 29883, 29918, 29896, 310, 364, 1631, 23157, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29875, 29906, 29883, 29918, 535, 29889, 26828, 29918, 11958, 1953, 29961, 29900, 1822, 26828, 524, 29918, 29906, 29892, 13, 462, 308, 1583, 29889, 5182, 29898, 29875, 29906, 29883, 29918, 535, 29889, 546, 29875, 8096, 284, 29889, 26828, 29918, 1639, 8726, 29892, 376, 29875, 29906, 29883, 29918, 29900, 4968, 13, 462, 308, 376, 26857, 367, 474, 29906, 29883, 29918, 29900, 310, 289, 1004, 23157, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29875, 29906, 29883, 29918, 535, 29889, 26828, 29918, 11958, 1953, 29961, 29900, 1822, 29879, 18398, 29918, 7328, 29892, 938, 29898, 29900, 29916, 29955, 29955, 511, 13, 462, 308, 376, 26857, 367, 29871, 29900, 29916, 29955, 29955, 23157, 13, 13, 1678, 822, 1243, 29918, 1028, 29875, 29898, 1311, 1125, 13, 4706, 12368, 353, 1281, 484, 1953, 4598, 29898, 3200, 29918, 2084, 718, 376, 8382, 29918, 9965, 29889, 2252, 1159, 13, 4706, 805, 29875, 29918, 535, 353, 12368, 29889, 11958, 1953, 3366, 29878, 1631, 29918, 293, 29885, 3108, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1028, 29875, 29918, 535, 29889, 26828, 29918, 11958, 1953, 29961, 29900, 1822, 26828, 524, 29918, 29896, 29892, 13, 462, 308, 1583, 29889, 5182, 29898, 1028, 29875, 29918, 535, 29889, 3377, 29889, 26828, 29918, 1639, 8726, 29892, 376, 1028, 29875, 29918, 29900, 4968, 13, 462, 308, 376, 26857, 367, 805, 29875, 29918, 29900, 310, 364, 1631, 23157, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1028, 29875, 29918, 535, 29889, 26828, 29918, 11958, 1953, 29961, 29900, 1822, 26828, 524, 29918, 29906, 29892, 13, 462, 308, 1583, 29889, 5182, 29898, 1028, 29875, 29918, 535, 29889, 546, 29875, 8096, 284, 29889, 26828, 29918, 1639, 8726, 29892, 376, 1028, 29875, 29918, 29900, 4968, 13, 462, 308, 376, 26857, 367, 805, 29875, 29918, 29900, 310, 289, 1004, 23157, 13, 4706, 2257, 29918, 2248, 353, 805, 29875, 29918, 535, 29889, 26828, 29918, 11958, 1953, 29961, 29900, 1822, 346, 29918, 2248, 13, 4706, 2257, 29918, 12687, 353, 805, 29875, 29918, 535, 29889, 26828, 29918, 11958, 1953, 29961, 29900, 1822, 26828, 524, 29918, 29896, 29889, 346, 29961, 346, 29918, 2248, 29962, 13, 4706, 1583, 29889, 9294, 9843, 29898, 346, 29918, 12687, 29889, 978, 29892, 376, 29890, 4912, 29918, 29947, 613, 376, 26857, 367, 289, 4912, 29918, 29947, 23157, 13, 13, 1678, 822, 1243, 29918, 2055, 29918, 29734, 29898, 1311, 1125, 13, 4706, 12368, 353, 1281, 484, 1953, 4598, 29898, 3200, 29918, 2084, 718, 376, 8382, 29918, 9965, 29889, 2252, 1159, 13, 4706, 378, 353, 12368, 29889, 11958, 1953, 3366, 29878, 1631, 29918, 1100, 279, 3108, 13, 13, 4706, 396, 12545, 12084, 12747, 13, 4706, 1583, 29889, 9294, 9843, 29898, 535, 29889, 510, 29918, 29734, 29889, 13010, 29918, 978, 29892, 376, 1100, 279, 29918, 29896, 29889, 19244, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 535, 29889, 510, 29918, 29734, 29889, 13082, 29918, 7529, 29889, 6786, 29892, 13, 462, 308, 376, 1688, 1792, 613, 376, 26857, 367, 1243, 1792, 23157, 13, 4706, 1583, 29889, 9294, 9843, 29898, 535, 29889, 510, 29918, 29734, 29889, 13082, 29918, 7529, 29889, 5630, 29892, 13, 462, 308, 376, 1688, 1792, 613, 376, 26857, 367, 529, 25711, 17013, 29958, 1792, 23157, 13, 4706, 1583, 29889, 9294, 9843, 29898, 535, 29889, 510, 29918, 29734, 29889, 13082, 29918, 7529, 29889, 3069, 29892, 13, 462, 308, 376, 29878, 29946, 29874, 29899, 12120, 29889, 1289, 1983, 29889, 1212, 613, 376, 26857, 367, 2023, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 535, 29889, 510, 29918, 29734, 29889, 13082, 29918, 7529, 29889, 637, 29892, 13, 462, 3986, 29945, 29955, 29947, 29906, 29892, 376, 26857, 367, 29871, 29945, 29955, 29947, 29906, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 535, 29889, 510, 29918, 29734, 29889, 7645, 29889, 7645, 29918, 26586, 29961, 29900, 1822, 1853, 29892, 13, 462, 308, 317, 6073, 10562, 29889, 4571, 1254, 23219, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 535, 29889, 510, 29918, 29734, 29889, 7645, 29889, 7645, 29918, 26586, 29961, 29900, 1822, 10745, 23860, 29892, 29871, 29896, 29900, 29897, 13, 13, 4706, 378, 353, 12368, 29889, 11958, 1953, 3366, 29878, 1631, 29918, 29890, 1004, 29953, 29947, 29900, 3108, 13, 4706, 1583, 29889, 9294, 9843, 29898, 535, 29889, 510, 29918, 29734, 29889, 7645, 29889, 7645, 29918, 26586, 29961, 29900, 1822, 1853, 29892, 13, 462, 308, 317, 6073, 10562, 29889, 25838, 29897, 13, 4706, 396, 1311, 29889, 9294, 9843, 29898, 535, 29889, 510, 29918, 29734, 29889, 7645, 29889, 7645, 29918, 26586, 29961, 29896, 1822, 1853, 29892, 13, 4706, 396, 462, 317, 6073, 10562, 29889, 29950, 5005, 1367, 11937, 29897, 13, 4706, 396, 1311, 29889, 9294, 9843, 29898, 535, 29889, 510, 29918, 29734, 29889, 7645, 29889, 7645, 29918, 26586, 29961, 29906, 1822, 1853, 29892, 13, 4706, 396, 462, 317, 6073, 10562, 29889, 29954, 3289, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 2 ]
tests/v1/test_logs_status_remapper.py
MichaelTROEHLER/datadog-api-client-python
0
143221
<reponame>MichaelTROEHLER/datadog-api-client-python # coding: utf-8 # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2019-Present Datadog, Inc. from __future__ import absolute_import import sys import unittest import datadog_api_client.v1 try: from datadog_api_client.v1.model import logs_status_remapper_type except ImportError: logs_status_remapper_type = sys.modules[ 'datadog_api_client.v1.model.logs_status_remapper_type'] from datadog_api_client.v1.model.logs_status_remapper import LogsStatusRemapper class TestLogsStatusRemapper(unittest.TestCase): """LogsStatusRemapper unit test stubs""" def setUp(self): pass def tearDown(self): pass def testLogsStatusRemapper(self): """Test LogsStatusRemapper""" # FIXME: construct object with mandatory attributes with example values # model = LogsStatusRemapper() # noqa: E501 pass if __name__ == '__main__': unittest.main()
[ 1, 529, 276, 1112, 420, 29958, 24083, 29911, 1672, 29923, 15444, 1001, 29914, 4130, 328, 468, 29899, 2754, 29899, 4645, 29899, 4691, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 13, 29937, 25870, 9479, 8703, 6467, 599, 2066, 297, 445, 9810, 526, 7794, 21144, 1090, 278, 13380, 29899, 29906, 29889, 29900, 19245, 29889, 13, 29937, 910, 3234, 7805, 7047, 8906, 472, 13373, 328, 468, 313, 991, 597, 1636, 29889, 4130, 328, 468, 29882, 29939, 29889, 510, 12495, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29929, 29899, 13504, 296, 13373, 328, 468, 29892, 9266, 29889, 13, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 5215, 10876, 13, 5215, 443, 27958, 13, 13, 5215, 1418, 328, 468, 29918, 2754, 29918, 4645, 29889, 29894, 29896, 13, 2202, 29901, 13, 1678, 515, 1418, 328, 468, 29918, 2754, 29918, 4645, 29889, 29894, 29896, 29889, 4299, 1053, 10748, 29918, 4882, 29918, 276, 655, 2496, 29918, 1853, 13, 19499, 16032, 2392, 29901, 13, 1678, 10748, 29918, 4882, 29918, 276, 655, 2496, 29918, 1853, 353, 10876, 29889, 7576, 29961, 13, 4706, 525, 4130, 328, 468, 29918, 2754, 29918, 4645, 29889, 29894, 29896, 29889, 4299, 29889, 20756, 29918, 4882, 29918, 276, 655, 2496, 29918, 1853, 2033, 13, 3166, 1418, 328, 468, 29918, 2754, 29918, 4645, 29889, 29894, 29896, 29889, 4299, 29889, 20756, 29918, 4882, 29918, 276, 655, 2496, 1053, 4522, 29879, 5709, 7301, 23239, 13, 13, 13, 1990, 4321, 3403, 29879, 5709, 7301, 23239, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 9995, 3403, 29879, 5709, 7301, 23239, 5190, 1243, 19281, 29879, 15945, 29908, 13, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 1243, 3403, 29879, 5709, 7301, 23239, 29898, 1311, 1125, 13, 4706, 9995, 3057, 4522, 29879, 5709, 7301, 23239, 15945, 29908, 13, 4706, 396, 383, 6415, 2303, 29901, 3386, 1203, 411, 9619, 7606, 8393, 411, 1342, 1819, 13, 4706, 396, 1904, 353, 4522, 29879, 5709, 7301, 23239, 580, 29871, 396, 694, 25621, 29901, 382, 29945, 29900, 29896, 13, 4706, 1209, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 2 ]
yatube/posts/migrations/0011_auto_20220127_2115.py
Andr3w-k/yatube_final
0
183154
<reponame>Andr3w-k/yatube_final # Generated by Django 2.2.16 on 2022-01-27 21:15 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('posts', '0010_follow'), ] operations = [ migrations.AlterModelOptions( name='comment', options={'ordering': ('-created',), 'verbose_name': 'Комментарий', 'verbose_name_plural': 'Комментарии'}, ), migrations.AlterModelOptions( name='follow', options={'verbose_name': 'Подписка', 'verbose_name_plural': 'Подписки'}, ), migrations.AlterModelOptions( name='group', options={'verbose_name': 'Группа', 'verbose_name_plural': 'Группы'}, ), migrations.AlterField( model_name='comment', name='post', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='posts.Post', verbose_name='Пост'), ), migrations.AddConstraint( model_name='follow', constraint=models.UniqueConstraint(fields=('user', 'author'), name='unique subscription'), ), ]
[ 1, 529, 276, 1112, 420, 29958, 2855, 29878, 29941, 29893, 29899, 29895, 29914, 29891, 271, 4003, 29918, 8394, 13, 29937, 3251, 630, 491, 15337, 29871, 29906, 29889, 29906, 29889, 29896, 29953, 373, 29871, 29906, 29900, 29906, 29906, 29899, 29900, 29896, 29899, 29906, 29955, 29871, 29906, 29896, 29901, 29896, 29945, 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, 14080, 742, 525, 29900, 29900, 29896, 29900, 29918, 23031, 5477, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 2499, 357, 3195, 5856, 29898, 13, 9651, 1024, 2433, 9342, 742, 13, 9651, 3987, 3790, 29915, 2098, 292, 2396, 6702, 29899, 11600, 742, 511, 525, 369, 15828, 29918, 978, 2396, 525, 30014, 9530, 19900, 10598, 742, 525, 369, 15828, 29918, 978, 29918, 572, 3631, 2396, 525, 30014, 9530, 19900, 5887, 16675, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2499, 357, 3195, 5856, 29898, 13, 9651, 1024, 2433, 23031, 742, 13, 9651, 3987, 3790, 29915, 369, 15828, 29918, 978, 2396, 525, 30013, 10285, 1668, 2494, 742, 525, 369, 15828, 29918, 978, 29918, 572, 3631, 2396, 525, 30013, 10285, 1668, 1305, 16675, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2499, 357, 3195, 5856, 29898, 13, 9651, 1024, 2433, 2972, 742, 13, 9651, 3987, 3790, 29915, 369, 15828, 29918, 978, 2396, 525, 30040, 13379, 1843, 742, 525, 369, 15828, 29918, 978, 29918, 572, 3631, 2396, 525, 30040, 13379, 8384, 16675, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2499, 357, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 9342, 742, 13, 9651, 1024, 2433, 2490, 742, 13, 9651, 1746, 29922, 9794, 29889, 27755, 2558, 29898, 265, 29918, 8143, 29922, 14095, 29889, 2585, 29889, 9794, 29889, 311, 1026, 291, 29889, 29907, 3289, 5454, 2287, 29892, 4475, 29918, 978, 2433, 21032, 742, 304, 2433, 14080, 29889, 6747, 742, 26952, 29918, 978, 2433, 20093, 464, 5477, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2528, 21529, 29898, 13, 9651, 1904, 29918, 978, 2433, 23031, 742, 13, 9651, 7276, 29922, 9794, 29889, 8110, 802, 21529, 29898, 9621, 29922, 877, 1792, 742, 525, 8921, 5477, 1024, 2433, 13092, 25691, 5477, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
Session_01/koch.py
UP-RS-ESP/GEW-DAP05-2018
2
13614
<gh_stars>1-10 import sys import numpy as np from matplotlib import pyplot as pl def koch(x0, y0, rho, phi, order): global xr, yr x1, y1 = x0 + rho * np.cos(phi), y0 + rho * np.sin(phi) if order: x, y = x0, y0 for angle in [0, np.pi/3, 5*np.pi/3, 0]: x, y = koch(x, y, rho / 3.0, phi + angle, order - 1) else: xr.append(x1) yr.append(y1) return (x1, y1) xr = [1,] yr = [1,] koch(xr[0], yr[0], 1, 0, 5) pl.plot(xr, yr, 'r.-', lw = 0.5) ax = pl.gca() ax.set_aspect('equal') pl.grid() pl.show()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 10876, 13, 5215, 12655, 408, 7442, 13, 3166, 22889, 1053, 11451, 5317, 408, 715, 13, 13, 1753, 413, 2878, 29898, 29916, 29900, 29892, 343, 29900, 29892, 364, 1251, 29892, 1374, 29875, 29892, 1797, 1125, 13, 1678, 5534, 921, 29878, 29892, 343, 29878, 13, 13, 1678, 921, 29896, 29892, 343, 29896, 353, 921, 29900, 718, 364, 1251, 334, 7442, 29889, 3944, 29898, 2876, 511, 343, 29900, 718, 364, 1251, 334, 7442, 29889, 5223, 29898, 2876, 29897, 13, 1678, 565, 1797, 29901, 13, 4706, 921, 29892, 343, 353, 921, 29900, 29892, 343, 29900, 13, 4706, 363, 10696, 297, 518, 29900, 29892, 7442, 29889, 1631, 29914, 29941, 29892, 29871, 29945, 29930, 9302, 29889, 1631, 29914, 29941, 29892, 29871, 29900, 5387, 13, 9651, 921, 29892, 343, 353, 413, 2878, 29898, 29916, 29892, 343, 29892, 364, 1251, 847, 29871, 29941, 29889, 29900, 29892, 1374, 29875, 718, 10696, 29892, 1797, 448, 29871, 29896, 29897, 13, 1678, 1683, 29901, 13, 4706, 921, 29878, 29889, 4397, 29898, 29916, 29896, 29897, 13, 4706, 343, 29878, 29889, 4397, 29898, 29891, 29896, 29897, 13, 13, 1678, 736, 313, 29916, 29896, 29892, 343, 29896, 29897, 13, 13, 29916, 29878, 353, 518, 29896, 26073, 13, 4316, 353, 518, 29896, 26073, 13, 29895, 2878, 29898, 29916, 29878, 29961, 29900, 1402, 343, 29878, 29961, 29900, 1402, 29871, 29896, 29892, 29871, 29900, 29892, 29871, 29945, 29897, 13, 572, 29889, 5317, 29898, 29916, 29878, 29892, 343, 29878, 29892, 525, 29878, 9229, 742, 301, 29893, 353, 29871, 29900, 29889, 29945, 29897, 13, 1165, 353, 715, 29889, 29887, 1113, 580, 13, 1165, 29889, 842, 29918, 294, 1103, 877, 11745, 1495, 13, 572, 29889, 7720, 580, 13, 572, 29889, 4294, 580, 13, 2 ]
Codes/Liam/001_two_sum.py
liuxiaohui1221/algorithm
256
28809
<reponame>liuxiaohui1221/algorithm # 执行用时 : 348 ms # 内存消耗 : 13 MB # 方案:哈希表 class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ # 创建哈希表{value:idx} record = {} # 遍数组 for idx, value in enumerate(nums): # 如果差值在哈希表中,返回对应索引 以及 循环中本次idx # 如果差值不在,则在哈希表中插入该value:idx if (target - value) in record.keys(): return [record[target - value], idx] else: record[value] = idx
[ 1, 529, 276, 1112, 420, 29958, 492, 1314, 423, 1148, 1481, 29896, 29906, 29906, 29896, 29914, 20567, 13, 29937, 29871, 233, 140, 170, 30448, 30406, 30594, 584, 29871, 29941, 29946, 29947, 10887, 13, 29937, 29871, 30728, 30946, 31276, 235, 131, 154, 584, 29871, 29896, 29941, 13232, 13, 13, 29937, 29871, 30525, 233, 164, 139, 30383, 232, 150, 139, 31841, 30746, 13, 13, 13, 1990, 24380, 29898, 3318, 1125, 13, 1678, 822, 1023, 11139, 29898, 1311, 29892, 954, 29879, 29892, 3646, 1125, 13, 4706, 9995, 13, 4706, 584, 1853, 954, 29879, 29901, 2391, 29961, 524, 29962, 13, 4706, 584, 1853, 3646, 29901, 938, 13, 4706, 584, 29878, 1853, 29901, 2391, 29961, 524, 29962, 13, 4706, 9995, 13, 4706, 396, 29871, 31441, 30886, 232, 150, 139, 31841, 30746, 29912, 1767, 29901, 13140, 29913, 13, 4706, 2407, 353, 6571, 13, 4706, 396, 29871, 236, 132, 144, 30354, 31263, 13, 4706, 363, 22645, 29892, 995, 297, 26985, 29898, 1949, 29879, 1125, 13, 9651, 396, 29871, 30847, 30801, 232, 186, 177, 30959, 30505, 232, 150, 139, 31841, 30746, 30275, 29892, 31086, 30742, 30783, 31370, 31836, 31674, 29871, 30651, 31436, 29871, 232, 193, 173, 234, 145, 178, 30275, 30346, 30936, 13140, 13, 9651, 396, 29871, 30847, 30801, 232, 186, 177, 30959, 30413, 30505, 30214, 31403, 30505, 232, 150, 139, 31841, 30746, 30275, 233, 146, 149, 30752, 31751, 1767, 29901, 13140, 13, 9651, 565, 313, 5182, 448, 995, 29897, 297, 2407, 29889, 8149, 7295, 13, 18884, 736, 518, 11651, 29961, 5182, 448, 995, 1402, 22645, 29962, 13, 9651, 1683, 29901, 13, 18884, 2407, 29961, 1767, 29962, 353, 22645, 13, 2 ]
pysan/multi/attributes.py
pysan-dev/pysan
4
147695
<gh_stars>1-10 # AUTOGENERATED! DO NOT EDIT! File to edit: 21_multi_attributes.ipynb (unless otherwise specified). __all__ = ['are_recurrent', 'get_summary_statistic', 'get_routine_scores', 'get_synchrony', 'get_sequence_frequencies'] # Cell def are_recurrent(sequences): "Returns true if any of the sequences in a given collection are recurrant, false otherwise." for sequence in sequences: if pysan_core.is_recurrent(sequence): return True return False # Cell def get_summary_statistic(sequence, function): "Computes a summary statistic (e.g. entropy, complexity, or turbulence) for each sequence in a collection, returning the results as a list." pass # Cell def get_routine_scores(sequences, duration): "Returns a list containing the routine scores for each sequence in a collection using :meth:`get_routine() <pysan.core.get_routine>`." pass # Cell def get_synchrony(sequences): "Computes the normalised synchrony between a two or more sequences. Synchrony here refers to positions with identical elements, e.g. two identical sequences have a synchrony of 1, two completely different sequences have a synchrony of 0. The value is normalised by dividing by the number of positions compared. This computation is defined in Cornwell's 2015 book on social sequence analysis, page 230." shortest_sequence = min([len(s) for s in sequences]) same_elements = [] for position in range(shortest_sequence): elements_at_this_position = [] for sequence in sequences: elements_at_this_position.append(sequence[position]) same_elements.append(elements_at_this_position.count(elements_at_this_position[0]) == len(elements_at_this_position)) return same_elements.count(True) / shortest_sequence # Cell def get_sequence_frequencies(sequences): "Computes the frequencies of different sequences in a collection, returning a dictionary of their string representations and counts." # converting to strings makes comparison easy sequences_as_strings = [str(s) for s in sequences] sequence_frequencies = {} for sequence in set(sequences_as_strings): sequence_frequencies[sequence] = sequences_as_strings.count(sequence) sequence_frequencies = {k: v for k, v in sorted(sequence_frequencies.items(), key=lambda item: item[1], reverse=True)} return sequence_frequencies
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 26524, 29949, 24647, 1001, 3040, 29928, 29991, 11662, 6058, 11488, 29991, 3497, 304, 3863, 29901, 29871, 29906, 29896, 29918, 9910, 29918, 15697, 29889, 666, 948, 29890, 313, 28952, 6467, 6790, 467, 13, 13, 1649, 497, 1649, 353, 6024, 598, 29918, 3757, 1264, 742, 525, 657, 29918, 7727, 29918, 6112, 4695, 742, 525, 657, 29918, 14608, 457, 29918, 1557, 2361, 742, 525, 657, 29918, 29879, 9524, 29891, 742, 525, 657, 29918, 16506, 29918, 10745, 339, 15942, 2033, 13, 13, 29937, 19413, 13, 1753, 526, 29918, 3757, 1264, 29898, 6831, 2063, 1125, 13, 1678, 376, 11609, 29879, 1565, 565, 738, 310, 278, 15602, 297, 263, 2183, 4333, 526, 1162, 1038, 424, 29892, 2089, 6467, 1213, 13, 13, 1678, 363, 5665, 297, 15602, 29901, 13, 4706, 565, 282, 952, 273, 29918, 3221, 29889, 275, 29918, 3757, 1264, 29898, 16506, 1125, 13, 9651, 736, 5852, 13, 13, 1678, 736, 7700, 13, 13, 29937, 19413, 13, 1753, 679, 29918, 7727, 29918, 6112, 4695, 29898, 16506, 29892, 740, 1125, 13, 1678, 376, 20606, 267, 263, 15837, 1002, 4695, 313, 29872, 29889, 29887, 29889, 24687, 29892, 13644, 29892, 470, 7013, 8645, 663, 29897, 363, 1269, 5665, 297, 263, 4333, 29892, 7863, 278, 2582, 408, 263, 1051, 1213, 13, 13, 1678, 1209, 13, 13, 29937, 19413, 13, 1753, 679, 29918, 14608, 457, 29918, 1557, 2361, 29898, 6831, 2063, 29892, 14385, 1125, 13, 1678, 376, 11609, 29879, 263, 1051, 6943, 278, 26529, 19435, 363, 1269, 5665, 297, 263, 4333, 773, 584, 29885, 621, 18078, 657, 29918, 14608, 457, 580, 529, 29886, 952, 273, 29889, 3221, 29889, 657, 29918, 14608, 457, 13885, 1213, 13, 13, 1678, 1209, 13, 13, 29937, 19413, 13, 1753, 679, 29918, 29879, 9524, 29891, 29898, 6831, 2063, 1125, 13, 1678, 376, 20606, 267, 278, 4226, 3368, 12231, 29891, 1546, 263, 1023, 470, 901, 15602, 29889, 317, 9524, 29891, 1244, 14637, 304, 11909, 411, 13557, 3161, 29892, 321, 29889, 29887, 29889, 1023, 13557, 15602, 505, 263, 12231, 29891, 310, 29871, 29896, 29892, 1023, 6446, 1422, 15602, 505, 263, 12231, 29891, 310, 29871, 29900, 29889, 450, 995, 338, 4226, 3368, 491, 1933, 4821, 491, 278, 1353, 310, 11909, 9401, 29889, 910, 16287, 338, 3342, 297, 11655, 5872, 29915, 29879, 29871, 29906, 29900, 29896, 29945, 3143, 373, 5264, 5665, 7418, 29892, 1813, 29871, 29906, 29941, 29900, 1213, 13, 13, 1678, 3273, 342, 29918, 16506, 353, 1375, 4197, 2435, 29898, 29879, 29897, 363, 269, 297, 15602, 2314, 13, 13, 1678, 1021, 29918, 17664, 353, 5159, 13, 1678, 363, 2602, 297, 3464, 29898, 12759, 342, 29918, 16506, 1125, 13, 13, 4706, 3161, 29918, 271, 29918, 1366, 29918, 3283, 353, 5159, 13, 4706, 363, 5665, 297, 15602, 29901, 13, 9651, 3161, 29918, 271, 29918, 1366, 29918, 3283, 29889, 4397, 29898, 16506, 29961, 3283, 2314, 13, 13, 4706, 1021, 29918, 17664, 29889, 4397, 29898, 17664, 29918, 271, 29918, 1366, 29918, 3283, 29889, 2798, 29898, 17664, 29918, 271, 29918, 1366, 29918, 3283, 29961, 29900, 2314, 1275, 7431, 29898, 17664, 29918, 271, 29918, 1366, 29918, 3283, 876, 13, 13, 1678, 736, 1021, 29918, 17664, 29889, 2798, 29898, 5574, 29897, 847, 3273, 342, 29918, 16506, 13, 13, 29937, 19413, 13, 1753, 679, 29918, 16506, 29918, 10745, 339, 15942, 29898, 6831, 2063, 1125, 13, 1678, 376, 20606, 267, 278, 29511, 310, 1422, 15602, 297, 263, 4333, 29892, 7863, 263, 8600, 310, 1009, 1347, 22540, 322, 18139, 1213, 13, 13, 1678, 396, 17415, 304, 6031, 3732, 10230, 4780, 13, 1678, 15602, 29918, 294, 29918, 19651, 353, 518, 710, 29898, 29879, 29897, 363, 269, 297, 15602, 29962, 13, 13, 1678, 5665, 29918, 10745, 339, 15942, 353, 6571, 13, 1678, 363, 5665, 297, 731, 29898, 6831, 2063, 29918, 294, 29918, 19651, 1125, 13, 4706, 5665, 29918, 10745, 339, 15942, 29961, 16506, 29962, 353, 15602, 29918, 294, 29918, 19651, 29889, 2798, 29898, 16506, 29897, 13, 13, 1678, 5665, 29918, 10745, 339, 15942, 353, 426, 29895, 29901, 325, 363, 413, 29892, 325, 297, 12705, 29898, 16506, 29918, 10745, 339, 15942, 29889, 7076, 3285, 1820, 29922, 2892, 2944, 29901, 2944, 29961, 29896, 1402, 11837, 29922, 5574, 2915, 13, 13, 1678, 736, 5665, 29918, 10745, 339, 15942, 2 ]
tirelire-account/app/views/__init__.py
AgRenaud/tirelire
0
172999
from app.views import account from app.views import holder
[ 1, 515, 623, 29889, 7406, 1053, 3633, 13, 3166, 623, 29889, 7406, 1053, 19464, 13, 2 ]
clip_finder_camera.py
leventerevesz/tomato-clips
0
74868
<reponame>leventerevesz/tomato-clips import cv2 as cv import numpy as np import matplotlib.pyplot as plt def clip_finder_camera(): cap = cv.VideoCapture(1) i=0 while True: # Read the camera in color mode. _, img = cap.read() #img = cv.imread('images/tomato1.jpg', cv.IMREAD_COLOR) blur = cv.GaussianBlur(img,(7,7),0) # blur for filtering out little blue pixels # Get image width and height width, height, channels = img.shape hsv_img = cv.cvtColor(blur, cv.COLOR_BGR2HSV) # HSV to segment # Segment blue regions lower_bound = (40, 40, 30) # Hue is between 50 and 110 upper_bound = (105, 255, 255) rgb_lower_bound = (0, 0, 0) # RGB limits rgb_upper_bound = (30, 255, 255) mask_rgb = cv.inRange(blur, rgb_lower_bound, rgb_upper_bound) mask_hsv = cv.inRange(hsv_img, lower_bound, upper_bound) result_rgb = cv.bitwise_and(img, img, mask=mask_rgb) result_hsv = cv.bitwise_and(hsv_img, hsv_img, mask=mask_hsv) reversemask=255-mask_hsv rmask=reversemask # Dilate (white ^) and Erode (black ^) dkernel = np.ones((3,3),np.uint8) ekernel = np.ones((5,5),np.uint8) dilate = cv.dilate(reversemask,dkernel,iterations = 1) erosion = cv.erode(dilate,ekernel,iterations = 1) # Contuors with bounding rectangle _, contours, _=cv.findContours(erosion, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE) rectlist=[] mode=2 # 1: perfect contour, 2: straight rectangle, 3: rotated rectangle for cnt in contours: if mode==1: cv.drawContours(erosion, [cnt], 0, (100,100,100), 5) if mode==2: x,y,w,h = cv.boundingRect(cnt) if w > width-20 or h > height-20: continue else: rectlist.append((x,y,w,h)) #cv.rectangle(img,(x,y),(x+w,y+h),(255,0,0),5) if mode==3: rect = cv.minAreaRect(cnt) box = cv.boxPoints(rect) box = np.int0(box) cv.drawContours(img,[box],0,(255,0,0),5) # Filtering out smaller rectangles if len(rectlist) != 0: for i in range (8): avgw=0 avgh=0 maxw=0 maxh=0 for rect in rectlist: # average rectangle size for filtering avgw+=rect[2] avgh+=rect[3] if maxw<rect[2]: maxw=rect[2] if maxh<rect[3]: maxh=rect[3] avgw=avgw/len(rectlist) avgh=avgh/len(rectlist) for rect in rectlist: # filter out too small rectangles w, h = rect[2], rect[3] if w<maxw-avgw or h<maxh-avgh: rectlist.remove(rect) final=[] for i in range(len(rectlist)): #bounding rectangles for every pair of object for j in range(i + 1, len(rectlist)): x1,y1,w1,h1=rectlist[i] x2,y2,w2,h2=rectlist[j] if abs(y1-y2)<avgh*4 and abs(x1-x2)<avgw*2: if x1==x2 and y1==y2: continue else: if x1<x2: x=x1 else: x=x2 if y1<y2: y=y1 else: y=y2 if x1+w1<x2+w2: w=x2+w2-x else: w=x1+w1-x if y1+h1<y2+h2: w=y2+h2-y else: h=y1+h1-y if (x,y,w,h) not in final: final.append((x,y,w,h)) for rect in final: x,y,w,h=rect cv.rectangle(img,(x,y),(x+w,y+h),(0,0,255),3) cv.imshow('rectangles',img) k=cv.waitKey(1) if k==27: break elif k==ord('s'): i+=1 cv.imwrite('results/rect_res_'+str(i)+'.jpg',img) continue cap.release() cv.destroyAllWindows() return 0 if __name__=="__main__": clip_finder_camera()
[ 1, 529, 276, 1112, 420, 29958, 280, 794, 406, 1960, 29920, 29914, 15135, 1219, 29899, 11303, 567, 13, 5215, 13850, 29906, 408, 13850, 13, 5215, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 13, 1753, 20102, 29918, 2886, 261, 29918, 26065, 7295, 13, 1678, 2117, 353, 13850, 29889, 15167, 21133, 545, 29898, 29896, 29897, 13, 13, 1678, 474, 29922, 29900, 13, 1678, 1550, 5852, 29901, 13, 4706, 396, 7523, 278, 10656, 297, 2927, 4464, 29889, 13, 4706, 17117, 10153, 353, 2117, 29889, 949, 580, 13, 4706, 396, 2492, 353, 13850, 29889, 326, 949, 877, 8346, 29914, 15135, 1219, 29896, 29889, 6173, 742, 13850, 29889, 7833, 16310, 29918, 15032, 1955, 29897, 13, 4706, 1999, 332, 353, 13850, 29889, 29954, 17019, 10358, 332, 29898, 2492, 22657, 29955, 29892, 29955, 511, 29900, 29897, 396, 1999, 332, 363, 21166, 714, 2217, 7254, 17036, 13, 13, 4706, 396, 3617, 1967, 2920, 322, 3171, 13, 4706, 2920, 29892, 3171, 29892, 18196, 353, 10153, 29889, 12181, 13, 13, 4706, 298, 4501, 29918, 2492, 353, 13850, 29889, 11023, 29873, 3306, 29898, 2204, 332, 29892, 13850, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29950, 7597, 29897, 29871, 396, 379, 7597, 304, 10768, 13, 13, 4706, 396, 6667, 358, 7254, 12786, 13, 4706, 5224, 29918, 9917, 353, 313, 29946, 29900, 29892, 29871, 29946, 29900, 29892, 29871, 29941, 29900, 29897, 1678, 396, 379, 434, 338, 1546, 29871, 29945, 29900, 322, 29871, 29896, 29896, 29900, 13, 4706, 7568, 29918, 9917, 353, 313, 29896, 29900, 29945, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 29897, 13, 4706, 15552, 29890, 29918, 13609, 29918, 9917, 353, 313, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29897, 1678, 396, 390, 7210, 13071, 13, 4706, 15552, 29890, 29918, 21064, 29918, 9917, 353, 313, 29941, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 29897, 13, 4706, 11105, 29918, 23973, 353, 13850, 29889, 262, 6069, 29898, 2204, 332, 29892, 15552, 29890, 29918, 13609, 29918, 9917, 29892, 15552, 29890, 29918, 21064, 29918, 9917, 29897, 13, 4706, 11105, 29918, 29882, 4501, 353, 13850, 29889, 262, 6069, 29898, 29882, 4501, 29918, 2492, 29892, 5224, 29918, 9917, 29892, 7568, 29918, 9917, 29897, 13, 4706, 1121, 29918, 23973, 353, 13850, 29889, 2966, 3538, 29918, 392, 29898, 2492, 29892, 10153, 29892, 11105, 29922, 13168, 29918, 23973, 29897, 13, 4706, 1121, 29918, 29882, 4501, 353, 13850, 29889, 2966, 3538, 29918, 392, 29898, 29882, 4501, 29918, 2492, 29892, 298, 4501, 29918, 2492, 29892, 11105, 29922, 13168, 29918, 29882, 4501, 29897, 13, 13, 4706, 18764, 331, 1278, 29922, 29906, 29945, 29945, 29899, 13168, 29918, 29882, 4501, 13, 4706, 364, 13168, 29922, 276, 874, 331, 1278, 13, 13, 4706, 396, 360, 309, 403, 313, 10921, 6228, 29897, 322, 382, 307, 311, 313, 8517, 6228, 29897, 13, 4706, 270, 17460, 353, 7442, 29889, 2873, 3552, 29941, 29892, 29941, 511, 9302, 29889, 13470, 29947, 29897, 13, 4706, 14921, 5851, 353, 7442, 29889, 2873, 3552, 29945, 29892, 29945, 511, 9302, 29889, 13470, 29947, 29897, 13, 4706, 21749, 403, 353, 13850, 29889, 29881, 309, 403, 29898, 276, 874, 331, 1278, 29892, 8181, 5851, 29892, 1524, 800, 353, 29871, 29896, 29897, 13, 4706, 604, 359, 291, 353, 13850, 29889, 261, 356, 29898, 29881, 309, 403, 29892, 1416, 5851, 29892, 1524, 800, 353, 29871, 29896, 29897, 13, 13, 4706, 396, 2866, 29884, 943, 411, 3216, 292, 16701, 13, 4706, 17117, 640, 2470, 29892, 903, 29922, 11023, 29889, 2886, 1323, 2470, 29898, 9672, 291, 29892, 13850, 29889, 1525, 5659, 29918, 29911, 21661, 29892, 13850, 29889, 3210, 29909, 1177, 29918, 3301, 8618, 29990, 29918, 5425, 3580, 1307, 29897, 13, 13, 4706, 7705, 1761, 29922, 2636, 13, 4706, 4464, 29922, 29906, 396, 29871, 29896, 29901, 4922, 640, 473, 29892, 29871, 29906, 29901, 7812, 16701, 29892, 29871, 29941, 29901, 5731, 630, 16701, 13, 4706, 363, 274, 593, 297, 640, 2470, 29901, 13, 9651, 565, 4464, 1360, 29896, 29901, 13, 18884, 13850, 29889, 4012, 1323, 2470, 29898, 9672, 291, 29892, 518, 20047, 1402, 29871, 29900, 29892, 313, 29896, 29900, 29900, 29892, 29896, 29900, 29900, 29892, 29896, 29900, 29900, 511, 29871, 29945, 29897, 13, 9651, 565, 4464, 1360, 29906, 29901, 13, 18884, 921, 29892, 29891, 29892, 29893, 29892, 29882, 353, 13850, 29889, 9917, 292, 7364, 29898, 20047, 29897, 13, 18884, 565, 281, 1405, 2920, 29899, 29906, 29900, 470, 298, 1405, 3171, 29899, 29906, 29900, 29901, 13, 462, 1678, 6773, 13, 18884, 1683, 29901, 13, 462, 1678, 7705, 1761, 29889, 4397, 3552, 29916, 29892, 29891, 29892, 29893, 29892, 29882, 876, 13, 462, 1678, 396, 11023, 29889, 1621, 2521, 29898, 2492, 22657, 29916, 29892, 29891, 21336, 29916, 29974, 29893, 29892, 29891, 29974, 29882, 21336, 29906, 29945, 29945, 29892, 29900, 29892, 29900, 511, 29945, 29897, 13, 9651, 565, 4464, 1360, 29941, 29901, 13, 18884, 7705, 353, 13850, 29889, 1195, 13799, 7364, 29898, 20047, 29897, 13, 18884, 3800, 353, 13850, 29889, 1884, 20325, 29898, 1621, 29897, 13, 18884, 3800, 353, 7442, 29889, 524, 29900, 29898, 1884, 29897, 13, 18884, 13850, 29889, 4012, 1323, 2470, 29898, 2492, 17094, 1884, 1402, 29900, 22657, 29906, 29945, 29945, 29892, 29900, 29892, 29900, 511, 29945, 29897, 13, 13, 4706, 396, 19916, 292, 714, 7968, 7705, 19536, 13, 4706, 565, 7431, 29898, 1621, 1761, 29897, 2804, 29871, 29900, 29901, 13, 9651, 363, 474, 297, 3464, 313, 29947, 1125, 13, 18884, 1029, 29887, 29893, 29922, 29900, 13, 18884, 1029, 12443, 29922, 29900, 13, 18884, 4236, 29893, 29922, 29900, 13, 18884, 4236, 29882, 29922, 29900, 13, 18884, 363, 7705, 297, 7705, 1761, 29901, 396, 6588, 16701, 2159, 363, 21166, 13, 462, 1678, 1029, 29887, 29893, 23661, 1621, 29961, 29906, 29962, 13, 462, 1678, 1029, 12443, 23661, 1621, 29961, 29941, 29962, 13, 462, 1678, 565, 4236, 29893, 29966, 1621, 29961, 29906, 5387, 4236, 29893, 29922, 1621, 29961, 29906, 29962, 13, 462, 1678, 565, 4236, 29882, 29966, 1621, 29961, 29941, 5387, 4236, 29882, 29922, 1621, 29961, 29941, 29962, 13, 18884, 1029, 29887, 29893, 29922, 485, 29887, 29893, 29914, 2435, 29898, 1621, 1761, 29897, 13, 18884, 1029, 12443, 29922, 485, 12443, 29914, 2435, 29898, 1621, 1761, 29897, 13, 13, 18884, 363, 7705, 297, 7705, 1761, 29901, 396, 4175, 714, 2086, 2319, 7705, 19536, 13, 462, 1678, 281, 29892, 298, 353, 7705, 29961, 29906, 1402, 7705, 29961, 29941, 29962, 13, 462, 1678, 565, 281, 29966, 3317, 29893, 29899, 485, 29887, 29893, 470, 298, 29966, 3317, 29882, 29899, 485, 12443, 29901, 13, 462, 4706, 7705, 1761, 29889, 5992, 29898, 1621, 29897, 13, 13, 9651, 2186, 29922, 2636, 13, 9651, 363, 474, 297, 3464, 29898, 2435, 29898, 1621, 1761, 22164, 396, 9917, 292, 7705, 19536, 363, 1432, 5101, 310, 1203, 13, 18884, 363, 432, 297, 3464, 29898, 29875, 718, 29871, 29896, 29892, 7431, 29898, 1621, 1761, 22164, 13, 462, 1678, 921, 29896, 29892, 29891, 29896, 29892, 29893, 29896, 29892, 29882, 29896, 29922, 1621, 1761, 29961, 29875, 29962, 13, 462, 1678, 921, 29906, 29892, 29891, 29906, 29892, 29893, 29906, 29892, 29882, 29906, 29922, 1621, 1761, 29961, 29926, 29962, 13, 462, 1678, 565, 6425, 29898, 29891, 29896, 29899, 29891, 29906, 29897, 29966, 485, 12443, 29930, 29946, 322, 6425, 29898, 29916, 29896, 29899, 29916, 29906, 29897, 29966, 485, 29887, 29893, 29930, 29906, 29901, 13, 462, 4706, 565, 921, 29896, 1360, 29916, 29906, 322, 343, 29896, 1360, 29891, 29906, 29901, 13, 462, 9651, 6773, 13, 462, 4706, 1683, 29901, 13, 462, 9651, 565, 921, 29896, 29966, 29916, 29906, 29901, 921, 29922, 29916, 29896, 13, 462, 9651, 1683, 29901, 921, 29922, 29916, 29906, 13, 462, 9651, 565, 343, 29896, 29966, 29891, 29906, 29901, 343, 29922, 29891, 29896, 13, 462, 9651, 1683, 29901, 343, 29922, 29891, 29906, 13, 462, 9651, 565, 921, 29896, 29974, 29893, 29896, 29966, 29916, 29906, 29974, 29893, 29906, 29901, 281, 29922, 29916, 29906, 29974, 29893, 29906, 29899, 29916, 13, 462, 9651, 1683, 29901, 281, 29922, 29916, 29896, 29974, 29893, 29896, 29899, 29916, 13, 462, 9651, 565, 343, 29896, 29974, 29882, 29896, 29966, 29891, 29906, 29974, 29882, 29906, 29901, 281, 29922, 29891, 29906, 29974, 29882, 29906, 29899, 29891, 13, 462, 9651, 1683, 29901, 298, 29922, 29891, 29896, 29974, 29882, 29896, 29899, 29891, 13, 462, 632, 13, 462, 9651, 565, 313, 29916, 29892, 29891, 29892, 29893, 29892, 29882, 29897, 451, 297, 2186, 29901, 13, 462, 18884, 2186, 29889, 4397, 3552, 29916, 29892, 29891, 29892, 29893, 29892, 29882, 876, 13, 13, 9651, 363, 7705, 297, 2186, 29901, 13, 18884, 921, 29892, 29891, 29892, 29893, 29892, 29882, 29922, 1621, 13, 18884, 13850, 29889, 1621, 2521, 29898, 2492, 22657, 29916, 29892, 29891, 21336, 29916, 29974, 29893, 29892, 29891, 29974, 29882, 21336, 29900, 29892, 29900, 29892, 29906, 29945, 29945, 511, 29941, 29897, 13, 13, 4706, 13850, 29889, 326, 4294, 877, 1621, 19536, 742, 2492, 29897, 13, 13, 4706, 413, 29922, 11023, 29889, 10685, 2558, 29898, 29896, 29897, 13, 4706, 565, 413, 1360, 29906, 29955, 29901, 13, 9651, 2867, 13, 4706, 25342, 413, 1360, 536, 877, 29879, 29374, 13, 9651, 474, 23661, 29896, 13, 9651, 13850, 29889, 326, 3539, 877, 9902, 29914, 1621, 29918, 690, 29918, 18717, 710, 29898, 29875, 7240, 4286, 6173, 742, 2492, 29897, 13, 9651, 6773, 13, 13, 1678, 2117, 29889, 14096, 580, 13, 1678, 13850, 29889, 20524, 3596, 7685, 580, 13, 13, 1678, 736, 29871, 29900, 13, 13, 361, 4770, 978, 1649, 26359, 1649, 3396, 1649, 1115, 13, 1678, 20102, 29918, 2886, 261, 29918, 26065, 580, 13, 2 ]
make_training_data/fetch_training_data.py
tanhanliang/ml-deviant-subgraph-detection
1
181216
""" This module contains functions to fetch data from the database according to particular rules (e.g. process downloaded a file from the internet, then executed it). Each function corresponds to one rule. """ from data_processing.neo4j_interface_fns import execute_query def get_train_3_node_simple(): """ Gets training data for 3-node patterns. First pattern: process connects to a socket, writes to a file. Second pattern: process connects to a socket, connects to another process. :return: A list of BoltStatementResult objects """ download_file_write = """ MATCH path1=(process:Process)<-[write]-(:File) MATCH path2=(process:Process)<-[]-(:Socket) WHERE (write.state = 'RaW' OR write.state = 'WRITE') RETURN path1, path2 LIMIT 2000 """ proc_proc_soc = """ MATCH p1=(process:Process)<-[]-(sock:Socket) MATCH p2=(process:Process)<-[]-(proc:Process) RETURN p1,p2 LIMIT 2000 """ negative_data = """ MATCH path1=(n1)<-[r1]-(m1) MATCH path2=(n1)<-[r2]-(m2) WHERE m1 <> m2 AND (NOT "File" IN labels(m1) OR NOT "Socket" IN labels(m2)) AND (NOT "Process" IN labels(n1)) AND (r1.state <> 'RaW' AND r1.state <> 'WRITE') RETURN path1, path2 LIMIT 2000 """ return [execute_query(download_file_write), execute_query(proc_proc_soc), execute_query(negative_data)] def get_train_4_node_diff_name(): """ Gets training data where the pattern of nodes in the graph is the same: A process connects to a socket, reads a file and executes another file. The only difference is in the name of the file read. Pattern 1: Name is '/etc/libmap.conf' Pattern 2: Name is '/lib/libc.so.7' Pattern 3: Name is '/lib/libcrypto.so.8' :return: A list of BoltStatementResult objects """ general_pattern = """ MATCH path1=(process:Process)<-[conn]-(sock:Socket) MATCH path2=(process:Process)<-[read]-(file:File) MATCH path3=(process:Process)<-[exec]-(file2:File) WHERE read.state="READ" AND exec.state="BIN" AND file2.name[0] =~ '/usr.*' AND file <> file2 AND file.name[0] = '%s' RETURN path1,path2,path3 LIMIT 1000 """ negative_data = """ MATCH path1=(node1)<-[r1]-(node2) MATCH path2=(node1)<-[r2]-(node3) MATCH path3=(node1)<-[r3]-(node4) WHERE (NOT "Process" in labels(node1) OR NOT "Socket" IN labels(node2) OR NOT "File" IN labels(node3) OR NOT "File" IN labels(node4) OR r2.state <> "READ" OR r3.state <> "BIN" OR NOT node4.name[0] =~ '/usr.*' OR NOT (node3.name[0] = '/etc/libmap.conf' OR node3.name[0] = '/lib/libc.so.7' OR node4.name[0] = '/lib/libcrypto.so.8')) AND node3 <> node4 RETURN path1,path2,path3 LIMIT 1000 """ names = ['/etc/libmap.conf', '/lib/libc.so.7', '/lib/libcrypto.so.8'] results = [] for name in names: results.append(execute_query(general_pattern % name)) results.append(execute_query(negative_data)) return results def get_train_4_node_test_cmdline(): """ Creates training data where the only constant difference between the pattern and the negative data is the presence of the word '-k' somewhere in the cmdline of a particlar node. :return: A list of BoltStatementResults results """ pattern = """ MATCH path1=(node1)<-[]-(node2) MATCH path2=(node1)<-[]-(node3) MATCH path3=(node1)<-[]-(node4) WHERE node2 <> node3 AND node3 <> node4 AND node2 <> node4 AND node1.cmdline =~ '.*-k.*' RETURN path1,path2,path3 LIMIT 1000 """ negative_data = """ MATCH path1=(node1)<-[]-(node2) MATCH path2=(node1)<-[]-(node3) MATCH path3=(node1)<-[]-(node4) WHERE node2 <> node3 AND node3 <> node4 AND node2 <> node4 AND NOT node1.cmdline =~ '.*-k.*' RETURN path1,path2,path3 LIMIT 1000 """ return [execute_query(pattern), execute_query(negative_data)] def get_train_4_node_simple(): """ Queries the db twice for the same simple 4 node pattern. This is used to help me synthesise training data (it is queried twice so the pipeline will partition the data by assigning different labels, so I can edit data in one half of it). :return: A list of BoltStatementResult objects """ pattern = """ MATCH path1=(node1)<-[]-(node2), path2=(node1)<-[]-(node3), path3=(node1)<-[]-(node4) RETURN path1,path2,path3 LIMIT 1000 """ return [execute_query(pattern), execute_query(pattern)] def get_train_6_node_general(): """ Queries the database for a particular 6-node pattern. :return: A list of BoltStatementResult objects. """ pattern = """ MATCH path1=(node1)<-[r1]-(node2), path2=(node1)<-[r2]-(node3), path3=(node1)<-[r3]-(node4), path4=(node3)<-[r4]-(node5), path5=(node3)<-[r5]-(node6) RETURN path1,path2,path3,path4,path5 LIMIT 1000 """ return [execute_query(pattern), execute_query(pattern)] def get_train_8_nodes_general(): pattern = """ MATCH path1=(node1)<-[]-(node2), path2=(node1)<-[]-(node3), path3=(node1)<-[]-(node4), path4=(node3)<-[]-(node5), path5=(node3)<-[]-(node6), path6=(node5)<-[]-(node7), path7=(node6)<-[]-(node8) RETURN path1,path2,path3,path4,path5,path6,path7 LIMIT 1000 """ return [execute_query(pattern), execute_query(pattern)] def get_train_10_nodes_general(): pattern = """ MATCH path1=(node1)<-[]-(node2), path2=(node1)<-[]-(node3), path3=(node1)<-[]-(node4), path4=(node3)<-[]-(node5), path5=(node3)<-[]-(node6), path6=(node5)<-[]-(node7), path7=(node6)<-[]-(node8), path8=(node9)<-[]-(node6), path9=(node10)<-[]-(node9) RETURN path1,path2,path3,path4,path5,path6,path7,path8,path9 LIMIT 1000 """ return [execute_query(pattern), execute_query(pattern)] def get_train_12_nodes_general(): pattern = """ MATCH path1=(node1)<-[]-(node2), path2=(node1)<-[]-(node3), path3=(node1)<-[]-(node4), path4=(node3)<-[]-(node5), path5=(node3)<-[]-(node6), path6=(node5)<-[]-(node7), path7=(node6)<-[]-(node8), path8=(node9)<-[]-(node6), path9=(node10)<-[]-(node9), path10=(node11)<-[]-(node2), path11=(node12)<-[]-(node4) RETURN path1,path2,path3,path4,path5,path6,path7,path8,path9,path10,path11 LIMIT 1000 """ return [execute_query(pattern), execute_query(pattern)] def get_train_16_nodes_general(): pattern = """ MATCH path1=(node1)<-[]-(node2), path2=(node1)<-[]-(node3), path3=(node1)<-[]-(node4), path4=(node3)<-[]-(node5), path5=(node3)<-[]-(node6), path6=(node5)<-[]-(node7), path7=(node6)<-[]-(node8), path8=(node9)<-[]-(node6), path9=(node10)<-[]-(node9), path10=(node6)<-[]-(node11), path11=(node6)<-[]-(node12), path12=(node6)<-[]-(node13), path13=(node6)<-[]-(node14) RETURN path1,path2,path3,path4,path5,path6,path7,path8,path9,path10,path11,path12,path13 LIMIT 1000 """ return [execute_query(pattern), execute_query(pattern)]
[ 1, 9995, 13, 4013, 3883, 3743, 3168, 304, 6699, 848, 515, 278, 2566, 5034, 304, 3153, 6865, 13, 29898, 29872, 29889, 29887, 29889, 1889, 16532, 263, 934, 515, 278, 8986, 29892, 769, 8283, 372, 467, 13, 9760, 740, 16161, 304, 697, 5751, 29889, 13, 15945, 29908, 13, 3166, 848, 29918, 19170, 29889, 11496, 29946, 29926, 29918, 13248, 29918, 29888, 1983, 1053, 6222, 29918, 1972, 13, 13, 13, 1753, 679, 29918, 14968, 29918, 29941, 29918, 3177, 29918, 12857, 7295, 13, 1678, 9995, 13, 1678, 402, 1691, 6694, 848, 363, 29871, 29941, 29899, 3177, 15038, 29889, 13, 1678, 3824, 4766, 29901, 1889, 4511, 29879, 304, 263, 9909, 29892, 15873, 304, 263, 934, 29889, 13, 1678, 6440, 4766, 29901, 1889, 4511, 29879, 304, 263, 9909, 29892, 4511, 29879, 304, 1790, 1889, 29889, 13, 13, 1678, 584, 2457, 29901, 319, 1051, 310, 8922, 29873, 14473, 3591, 3618, 13, 1678, 9995, 13, 13, 1678, 5142, 29918, 1445, 29918, 3539, 353, 9995, 13, 1678, 341, 14789, 2224, 29896, 7607, 5014, 29901, 7032, 29897, 16406, 29961, 3539, 29962, 29899, 8137, 2283, 29897, 13, 1678, 341, 14789, 2224, 29906, 7607, 5014, 29901, 7032, 29897, 16406, 2636, 29899, 8137, 11373, 29897, 13, 1678, 5754, 313, 3539, 29889, 3859, 353, 525, 29934, 29874, 29956, 29915, 6323, 2436, 29889, 3859, 353, 525, 16365, 1495, 13, 1678, 28081, 24015, 2224, 29896, 29892, 2224, 29906, 27848, 29871, 29906, 29900, 29900, 29900, 13, 1678, 9995, 13, 13, 1678, 9580, 29918, 15439, 29918, 29879, 542, 353, 9995, 13, 1678, 341, 14789, 282, 29896, 7607, 5014, 29901, 7032, 29897, 16406, 2636, 17722, 21852, 29901, 11373, 29897, 13, 1678, 341, 14789, 282, 29906, 7607, 5014, 29901, 7032, 29897, 16406, 2636, 17722, 15439, 29901, 7032, 29897, 13, 1678, 28081, 24015, 282, 29896, 29892, 29886, 29906, 27848, 29871, 29906, 29900, 29900, 29900, 13, 1678, 9995, 13, 13, 1678, 8178, 29918, 1272, 353, 9995, 13, 1678, 341, 14789, 2224, 29896, 7607, 29876, 29896, 29897, 16406, 29961, 29878, 29896, 29962, 17722, 29885, 29896, 29897, 13, 1678, 341, 14789, 2224, 29906, 7607, 29876, 29896, 29897, 16406, 29961, 29878, 29906, 29962, 17722, 29885, 29906, 29897, 13, 1678, 5754, 286, 29896, 15271, 286, 29906, 5300, 313, 12256, 376, 2283, 29908, 2672, 11073, 29898, 29885, 29896, 29897, 6323, 6058, 376, 11373, 29908, 2672, 11073, 29898, 29885, 29906, 876, 29871, 13, 1678, 5300, 313, 12256, 376, 7032, 29908, 2672, 11073, 29898, 29876, 29896, 876, 5300, 313, 29878, 29896, 29889, 3859, 15271, 525, 29934, 29874, 29956, 29915, 5300, 364, 29896, 29889, 3859, 15271, 525, 16365, 1495, 13, 1678, 28081, 24015, 2224, 29896, 29892, 2224, 29906, 27848, 29871, 29906, 29900, 29900, 29900, 13, 1678, 9995, 13, 13, 1678, 736, 518, 7978, 29918, 1972, 29898, 10382, 29918, 1445, 29918, 3539, 511, 13, 9651, 6222, 29918, 1972, 29898, 15439, 29918, 15439, 29918, 29879, 542, 511, 13, 9651, 6222, 29918, 1972, 29898, 22198, 29918, 1272, 4638, 13, 13, 13, 1753, 679, 29918, 14968, 29918, 29946, 29918, 3177, 29918, 12765, 29918, 978, 7295, 13, 1678, 9995, 13, 1678, 402, 1691, 6694, 848, 988, 278, 4766, 310, 7573, 297, 278, 3983, 338, 278, 1021, 29901, 319, 1889, 13, 1678, 4511, 29879, 304, 263, 9909, 29892, 13623, 263, 934, 322, 24138, 1790, 934, 29889, 450, 871, 4328, 13, 1678, 338, 297, 278, 1024, 310, 278, 934, 1303, 29889, 13, 13, 1678, 25860, 29871, 29896, 29901, 4408, 338, 8207, 7070, 29914, 1982, 1958, 29889, 5527, 29915, 13, 1678, 25860, 29871, 29906, 29901, 4408, 338, 8207, 1982, 29914, 1982, 29883, 29889, 578, 29889, 29955, 29915, 13, 1678, 25860, 29871, 29941, 29901, 4408, 338, 8207, 1982, 29914, 1982, 29883, 17929, 29889, 578, 29889, 29947, 29915, 13, 13, 1678, 584, 2457, 29901, 319, 1051, 310, 8922, 29873, 14473, 3591, 3618, 13, 1678, 9995, 13, 13, 1678, 2498, 29918, 11037, 353, 9995, 13, 1678, 341, 14789, 2224, 29896, 7607, 5014, 29901, 7032, 29897, 16406, 29961, 13082, 29962, 17722, 21852, 29901, 11373, 29897, 13, 1678, 341, 14789, 2224, 29906, 7607, 5014, 29901, 7032, 29897, 16406, 29961, 949, 29962, 17722, 1445, 29901, 2283, 29897, 13, 1678, 341, 14789, 2224, 29941, 7607, 5014, 29901, 7032, 29897, 16406, 29961, 4258, 29962, 17722, 1445, 29906, 29901, 2283, 29897, 13, 1678, 5754, 1303, 29889, 3859, 543, 16310, 29908, 5300, 2279, 29889, 3859, 543, 29933, 1177, 29908, 5300, 934, 29906, 29889, 978, 29961, 29900, 29962, 16788, 8207, 4855, 5575, 29915, 5300, 934, 15271, 934, 29906, 13, 1678, 5300, 934, 29889, 978, 29961, 29900, 29962, 353, 14210, 29879, 29915, 13, 1678, 28081, 24015, 2224, 29896, 29892, 2084, 29906, 29892, 2084, 29941, 27848, 29871, 29896, 29900, 29900, 29900, 13, 1678, 9995, 13, 13, 1678, 8178, 29918, 1272, 353, 9995, 13, 1678, 341, 14789, 2224, 29896, 7607, 3177, 29896, 29897, 16406, 29961, 29878, 29896, 29962, 17722, 3177, 29906, 29897, 13, 1678, 341, 14789, 2224, 29906, 7607, 3177, 29896, 29897, 16406, 29961, 29878, 29906, 29962, 17722, 3177, 29941, 29897, 13, 1678, 341, 14789, 2224, 29941, 7607, 3177, 29896, 29897, 16406, 29961, 29878, 29941, 29962, 17722, 3177, 29946, 29897, 13, 1678, 5754, 313, 12256, 376, 7032, 29908, 297, 11073, 29898, 3177, 29896, 29897, 6323, 6058, 376, 11373, 29908, 2672, 11073, 29898, 3177, 29906, 29897, 6323, 6058, 376, 2283, 29908, 2672, 11073, 29898, 3177, 29941, 29897, 13, 1678, 6323, 6058, 376, 2283, 29908, 2672, 11073, 29898, 3177, 29946, 29897, 6323, 364, 29906, 29889, 3859, 15271, 376, 16310, 29908, 6323, 364, 29941, 29889, 3859, 15271, 376, 29933, 1177, 29908, 13, 1678, 6323, 6058, 2943, 29946, 29889, 978, 29961, 29900, 29962, 16788, 8207, 4855, 5575, 29915, 6323, 6058, 313, 3177, 29941, 29889, 978, 29961, 29900, 29962, 353, 8207, 7070, 29914, 1982, 1958, 29889, 5527, 29915, 13, 1678, 6323, 2943, 29941, 29889, 978, 29961, 29900, 29962, 353, 8207, 1982, 29914, 1982, 29883, 29889, 578, 29889, 29955, 29915, 6323, 2943, 29946, 29889, 978, 29961, 29900, 29962, 353, 8207, 1982, 29914, 1982, 29883, 17929, 29889, 578, 29889, 29947, 8785, 5300, 2943, 29941, 15271, 2943, 29946, 13, 268, 13, 1678, 28081, 24015, 2224, 29896, 29892, 2084, 29906, 29892, 2084, 29941, 27848, 29871, 29896, 29900, 29900, 29900, 13, 1678, 9995, 13, 13, 1678, 2983, 353, 6024, 29914, 7070, 29914, 1982, 1958, 29889, 5527, 742, 8207, 1982, 29914, 1982, 29883, 29889, 578, 29889, 29955, 742, 8207, 1982, 29914, 1982, 29883, 17929, 29889, 578, 29889, 29947, 2033, 13, 13, 1678, 2582, 353, 5159, 13, 1678, 363, 1024, 297, 2983, 29901, 13, 4706, 2582, 29889, 4397, 29898, 7978, 29918, 1972, 29898, 17492, 29918, 11037, 1273, 1024, 876, 13, 13, 1678, 2582, 29889, 4397, 29898, 7978, 29918, 1972, 29898, 22198, 29918, 1272, 876, 13, 1678, 736, 2582, 13, 13, 13, 1753, 679, 29918, 14968, 29918, 29946, 29918, 3177, 29918, 1688, 29918, 9006, 1220, 7295, 13, 1678, 9995, 13, 1678, 6760, 1078, 6694, 848, 988, 278, 871, 4868, 4328, 1546, 278, 4766, 322, 278, 13, 1678, 8178, 848, 338, 278, 10122, 310, 278, 1734, 17411, 29895, 29915, 9051, 297, 278, 9920, 1220, 310, 263, 1936, 4675, 2943, 29889, 13, 13, 1678, 584, 2457, 29901, 319, 1051, 310, 8922, 29873, 14473, 12191, 2582, 13, 1678, 9995, 13, 13, 1678, 4766, 353, 9995, 13, 1678, 341, 14789, 2224, 29896, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29906, 29897, 13, 1678, 341, 14789, 2224, 29906, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29941, 29897, 13, 1678, 341, 14789, 2224, 29941, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29946, 29897, 13, 1678, 5754, 2943, 29906, 15271, 2943, 29941, 5300, 2943, 29941, 15271, 2943, 29946, 5300, 2943, 29906, 15271, 2943, 29946, 5300, 2943, 29896, 29889, 9006, 1220, 16788, 525, 5575, 29899, 29895, 5575, 29915, 13, 1678, 28081, 24015, 2224, 29896, 29892, 2084, 29906, 29892, 2084, 29941, 27848, 29871, 29896, 29900, 29900, 29900, 13, 1678, 9995, 13, 13, 1678, 8178, 29918, 1272, 353, 9995, 13, 1678, 341, 14789, 2224, 29896, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29906, 29897, 13, 1678, 341, 14789, 2224, 29906, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29941, 29897, 13, 1678, 341, 14789, 2224, 29941, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29946, 29897, 13, 1678, 5754, 2943, 29906, 15271, 2943, 29941, 5300, 2943, 29941, 15271, 2943, 29946, 5300, 2943, 29906, 15271, 2943, 29946, 5300, 6058, 2943, 29896, 29889, 9006, 1220, 16788, 525, 5575, 29899, 29895, 5575, 29915, 13, 1678, 28081, 24015, 2224, 29896, 29892, 2084, 29906, 29892, 2084, 29941, 27848, 29871, 29896, 29900, 29900, 29900, 13, 1678, 9995, 13, 13, 1678, 736, 518, 7978, 29918, 1972, 29898, 11037, 511, 6222, 29918, 1972, 29898, 22198, 29918, 1272, 4638, 13, 13, 13, 1753, 679, 29918, 14968, 29918, 29946, 29918, 3177, 29918, 12857, 7295, 13, 1678, 9995, 13, 1678, 751, 6358, 278, 4833, 8951, 363, 278, 1021, 2560, 29871, 29946, 2943, 4766, 29889, 910, 338, 1304, 304, 1371, 592, 13, 1678, 14710, 267, 895, 6694, 848, 313, 277, 338, 22320, 1000, 8951, 577, 278, 16439, 674, 8877, 278, 848, 13, 1678, 491, 23188, 1422, 11073, 29892, 577, 306, 508, 3863, 848, 297, 697, 4203, 310, 372, 467, 13, 13, 1678, 584, 2457, 29901, 319, 1051, 310, 8922, 29873, 14473, 3591, 3618, 13, 1678, 9995, 13, 13, 1678, 4766, 353, 9995, 13, 1678, 341, 14789, 2224, 29896, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29906, 511, 13, 1678, 2224, 29906, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29941, 511, 13, 1678, 2224, 29941, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29946, 29897, 13, 1678, 28081, 24015, 2224, 29896, 29892, 2084, 29906, 29892, 2084, 29941, 27848, 29871, 29896, 29900, 29900, 29900, 13, 1678, 9995, 13, 13, 1678, 736, 518, 7978, 29918, 1972, 29898, 11037, 511, 6222, 29918, 1972, 29898, 11037, 4638, 13, 13, 13, 1753, 679, 29918, 14968, 29918, 29953, 29918, 3177, 29918, 17492, 7295, 13, 1678, 9995, 13, 1678, 751, 6358, 278, 2566, 363, 263, 3153, 29871, 29953, 29899, 3177, 4766, 29889, 13, 13, 1678, 584, 2457, 29901, 319, 1051, 310, 8922, 29873, 14473, 3591, 3618, 29889, 13, 1678, 9995, 13, 13, 1678, 4766, 353, 9995, 13, 1678, 341, 14789, 2224, 29896, 7607, 3177, 29896, 29897, 16406, 29961, 29878, 29896, 29962, 17722, 3177, 29906, 511, 13, 1678, 2224, 29906, 7607, 3177, 29896, 29897, 16406, 29961, 29878, 29906, 29962, 17722, 3177, 29941, 511, 13, 1678, 2224, 29941, 7607, 3177, 29896, 29897, 16406, 29961, 29878, 29941, 29962, 17722, 3177, 29946, 511, 13, 1678, 2224, 29946, 7607, 3177, 29941, 29897, 16406, 29961, 29878, 29946, 29962, 17722, 3177, 29945, 511, 13, 1678, 2224, 29945, 7607, 3177, 29941, 29897, 16406, 29961, 29878, 29945, 29962, 17722, 3177, 29953, 29897, 13, 1678, 28081, 24015, 2224, 29896, 29892, 2084, 29906, 29892, 2084, 29941, 29892, 2084, 29946, 29892, 2084, 29945, 27848, 29871, 29896, 29900, 29900, 29900, 13, 1678, 9995, 13, 13, 1678, 736, 518, 7978, 29918, 1972, 29898, 11037, 511, 6222, 29918, 1972, 29898, 11037, 4638, 13, 13, 13, 1753, 679, 29918, 14968, 29918, 29947, 29918, 18010, 29918, 17492, 7295, 13, 13, 1678, 4766, 353, 9995, 13, 1678, 341, 14789, 2224, 29896, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29906, 511, 13, 1678, 2224, 29906, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29941, 511, 13, 1678, 2224, 29941, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29946, 511, 13, 1678, 2224, 29946, 7607, 3177, 29941, 29897, 16406, 2636, 17722, 3177, 29945, 511, 13, 1678, 2224, 29945, 7607, 3177, 29941, 29897, 16406, 2636, 17722, 3177, 29953, 511, 13, 1678, 2224, 29953, 7607, 3177, 29945, 29897, 16406, 2636, 17722, 3177, 29955, 511, 13, 1678, 2224, 29955, 7607, 3177, 29953, 29897, 16406, 2636, 17722, 3177, 29947, 29897, 13, 1678, 28081, 24015, 2224, 29896, 29892, 2084, 29906, 29892, 2084, 29941, 29892, 2084, 29946, 29892, 2084, 29945, 29892, 2084, 29953, 29892, 2084, 29955, 27848, 29871, 29896, 29900, 29900, 29900, 13, 1678, 9995, 13, 13, 1678, 736, 518, 7978, 29918, 1972, 29898, 11037, 511, 6222, 29918, 1972, 29898, 11037, 4638, 13, 13, 13, 1753, 679, 29918, 14968, 29918, 29896, 29900, 29918, 18010, 29918, 17492, 7295, 13, 13, 1678, 4766, 353, 9995, 13, 1678, 341, 14789, 2224, 29896, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29906, 511, 13, 1678, 2224, 29906, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29941, 511, 13, 1678, 2224, 29941, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29946, 511, 13, 1678, 2224, 29946, 7607, 3177, 29941, 29897, 16406, 2636, 17722, 3177, 29945, 511, 13, 1678, 2224, 29945, 7607, 3177, 29941, 29897, 16406, 2636, 17722, 3177, 29953, 511, 13, 1678, 2224, 29953, 7607, 3177, 29945, 29897, 16406, 2636, 17722, 3177, 29955, 511, 13, 1678, 2224, 29955, 7607, 3177, 29953, 29897, 16406, 2636, 17722, 3177, 29947, 511, 13, 1678, 2224, 29947, 7607, 3177, 29929, 29897, 16406, 2636, 17722, 3177, 29953, 511, 13, 1678, 2224, 29929, 7607, 3177, 29896, 29900, 29897, 16406, 2636, 17722, 3177, 29929, 29897, 13, 1678, 28081, 24015, 2224, 29896, 29892, 2084, 29906, 29892, 2084, 29941, 29892, 2084, 29946, 29892, 2084, 29945, 29892, 2084, 29953, 29892, 2084, 29955, 29892, 2084, 29947, 29892, 2084, 29929, 27848, 29871, 29896, 29900, 29900, 29900, 13, 1678, 9995, 13, 13, 1678, 736, 518, 7978, 29918, 1972, 29898, 11037, 511, 6222, 29918, 1972, 29898, 11037, 4638, 13, 13, 13, 1753, 679, 29918, 14968, 29918, 29896, 29906, 29918, 18010, 29918, 17492, 7295, 13, 13, 1678, 4766, 353, 9995, 13, 1678, 341, 14789, 2224, 29896, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29906, 511, 13, 1678, 2224, 29906, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29941, 511, 13, 1678, 2224, 29941, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29946, 511, 13, 1678, 2224, 29946, 7607, 3177, 29941, 29897, 16406, 2636, 17722, 3177, 29945, 511, 13, 1678, 2224, 29945, 7607, 3177, 29941, 29897, 16406, 2636, 17722, 3177, 29953, 511, 13, 1678, 2224, 29953, 7607, 3177, 29945, 29897, 16406, 2636, 17722, 3177, 29955, 511, 13, 1678, 2224, 29955, 7607, 3177, 29953, 29897, 16406, 2636, 17722, 3177, 29947, 511, 13, 1678, 2224, 29947, 7607, 3177, 29929, 29897, 16406, 2636, 17722, 3177, 29953, 511, 13, 1678, 2224, 29929, 7607, 3177, 29896, 29900, 29897, 16406, 2636, 17722, 3177, 29929, 511, 13, 1678, 2224, 29896, 29900, 7607, 3177, 29896, 29896, 29897, 16406, 2636, 17722, 3177, 29906, 511, 13, 1678, 2224, 29896, 29896, 7607, 3177, 29896, 29906, 29897, 16406, 2636, 17722, 3177, 29946, 29897, 13, 1678, 28081, 24015, 2224, 29896, 29892, 2084, 29906, 29892, 2084, 29941, 29892, 2084, 29946, 29892, 2084, 29945, 29892, 2084, 29953, 29892, 2084, 29955, 29892, 2084, 29947, 29892, 2084, 29929, 29892, 2084, 29896, 29900, 29892, 2084, 29896, 29896, 27848, 29871, 29896, 29900, 29900, 29900, 13, 1678, 9995, 13, 13, 1678, 736, 518, 7978, 29918, 1972, 29898, 11037, 511, 6222, 29918, 1972, 29898, 11037, 4638, 13, 13, 13, 1753, 679, 29918, 14968, 29918, 29896, 29953, 29918, 18010, 29918, 17492, 7295, 13, 13, 1678, 4766, 353, 9995, 13, 1678, 341, 14789, 2224, 29896, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29906, 511, 13, 1678, 2224, 29906, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29941, 511, 13, 1678, 2224, 29941, 7607, 3177, 29896, 29897, 16406, 2636, 17722, 3177, 29946, 511, 13, 1678, 2224, 29946, 7607, 3177, 29941, 29897, 16406, 2636, 17722, 3177, 29945, 511, 13, 1678, 2224, 29945, 7607, 3177, 29941, 29897, 16406, 2636, 17722, 3177, 29953, 511, 13, 1678, 2224, 29953, 7607, 3177, 29945, 29897, 16406, 2636, 17722, 3177, 29955, 511, 13, 1678, 2224, 29955, 7607, 3177, 29953, 29897, 16406, 2636, 17722, 3177, 29947, 511, 13, 1678, 2224, 29947, 7607, 3177, 29929, 29897, 16406, 2636, 17722, 3177, 29953, 511, 13, 1678, 2224, 29929, 7607, 3177, 29896, 29900, 29897, 16406, 2636, 17722, 3177, 29929, 511, 13, 1678, 2224, 29896, 29900, 7607, 3177, 29953, 29897, 16406, 2636, 17722, 3177, 29896, 29896, 511, 13, 1678, 2224, 29896, 29896, 7607, 3177, 29953, 29897, 16406, 2636, 17722, 3177, 29896, 29906, 511, 13, 1678, 2224, 29896, 29906, 7607, 3177, 29953, 29897, 16406, 2636, 17722, 3177, 29896, 29941, 511, 13, 1678, 2224, 29896, 29941, 7607, 3177, 29953, 29897, 16406, 2636, 17722, 3177, 29896, 29946, 29897, 13, 1678, 28081, 24015, 2224, 29896, 29892, 2084, 29906, 29892, 2084, 29941, 29892, 2084, 29946, 29892, 2084, 29945, 29892, 2084, 29953, 29892, 2084, 29955, 29892, 2084, 29947, 29892, 2084, 29929, 29892, 2084, 29896, 29900, 29892, 2084, 29896, 29896, 29892, 2084, 29896, 29906, 29892, 2084, 29896, 29941, 27848, 29871, 29896, 29900, 29900, 29900, 13, 1678, 9995, 13, 13, 1678, 736, 518, 7978, 29918, 1972, 29898, 11037, 511, 6222, 29918, 1972, 29898, 11037, 4638, 2 ]
make_prg/io_utils.py
mbhall88/make_prg
10
56475
import logging import re import gzip from pathlib import Path from argparse import ArgumentParser from Bio import AlignIO from make_prg.from_msa import MSA from make_prg.prg_encoder import PrgEncoder, PRG_Ints def load_alignment_file(msa_file: str, alignment_format: str) -> MSA: msa_file = str(msa_file) logging.info("Read from MSA file %s", msa_file) if msa_file.endswith(".gz"): logging.debug("MSA is gzipped") handle = gzip.open(msa_file, "rt") alignment = AlignIO.read(handle, alignment_format) handle.close() else: alignment = AlignIO.read(msa_file, alignment_format) for record in alignment: record.seq = record.seq.upper() return alignment # ************/ # GFA code */ # ***********/ class GFA_Output: """ A simple class for converting a PRG string into a GFA file TODO: Update to GFA2 format """ def __init__(self, gfa_string="", gfa_id=0, gfa_site=5): self.gfa_string = gfa_string self.gfa_id = gfa_id self.gfa_site = gfa_site self.delim_char = " " # This mirrors the AlignedSeq class. def split_on_site(self, prg_string, site_num): site_coords = [ (a.start(), a.end()) for a in list( re.finditer( "%s%d%s" % (self.delim_char, site_num, self.delim_char), prg_string ) ) ] last_pos = None split_strings = [] for (start, end) in site_coords: split_strings.append(prg_string[last_pos:start]) last_pos = end split_strings.append(prg_string[last_pos:]) delim = "%s%d%s" % (self.delim_char, site_num, self.delim_char) check_string = delim.join(split_strings) assert check_string == prg_string, ( "Something has gone wrong with the string split for site %d\nsplit_" "strings: %s" % (site_num, split_strings) ) return split_strings def build_gfa_string(self, prg_string, pre_var_id=None): """Takes prg_string and builds a gfa_string with fragments from the prg_string.""" end_ids = [] # iterate through sites present, updating gfa_string with each in turn while str(self.gfa_site) in prg_string: logging.debug("gfa_site: %d", self.gfa_site) prgs = self.split_on_site(prg_string, self.gfa_site) logging.debug("prgs: %s", prgs) assert len(prgs) == 3, "Invalid prg sequence %s for site %d and id %d" % ( prg_string, self.gfa_site, self.gfa_id, ) # add pre-var site string and links from previous seq fragments if prgs[0] != "": self.gfa_string += "S\t%d\t%s\tRC:i:0\n" % (self.gfa_id, prgs[0]) else: # adds an empty node for empty pre var site seqs self.gfa_string += "S\t%d\t%s\tRC:i:0\n" % (self.gfa_id, "*") pre_var_id = self.gfa_id self.gfa_id += 1 for id in end_ids: self.gfa_string += "L\t%d\t+\t%d\t+\t0M\n" % (id, pre_var_id) end_ids = [] # recursively add segments for each of the variant haplotypes at # this site, saving the end id for each haplotype vars = self.split_on_site(prgs[1], self.gfa_site + 1) assert len(vars) > 1, "Invalid prg sequence %s for site %d and id %d" % ( prg_string, self.gfa_site + 1, self.gfa_id, ) logging.debug("vars: %s", vars) self.gfa_site += 2 logging.debug("gfa_site: %d", self.gfa_site) for var_string in vars: if pre_var_id != None: self.gfa_string += "L\t%d\t+\t%d\t+\t0M\n" % ( pre_var_id, self.gfa_id, ) var_end_ids = self.build_gfa_string( prg_string=var_string, pre_var_id=pre_var_id ) end_ids.extend(var_end_ids) prg_string = prgs[2] pre_var_id = None # finally add the final bit of sequence after variant site if prg_string != "": self.gfa_string += "S\t%d\t%s\tRC:i:0\n" % (self.gfa_id, prg_string) else: self.gfa_string += "S\t%d\t%s\tRC:i:0\n" % (self.gfa_id, "*") for id in end_ids: self.gfa_string += "L\t%d\t+\t%d\t+\t0M\n" % (id, self.gfa_id) end_ids = [] return_id = [self.gfa_id] self.gfa_id += 1 return return_id def write_gfa(outfile, prg_string): """ Writes a gfa file from prg string. """ with open(outfile, "w") as f: # initialize gfa_string, id and site, then update string with the prg gfa_string = "H\tVN:Z:1.0\tbn:Z:--linear --singlearr\n" gfa_id = 0 gfa_site = 5 gfa_obj = GFA_Output(gfa_string) gfa_obj.build_gfa_string(prg_string=prg_string) f.write(gfa_obj.gfa_string) # ******************/ # Write PRG code */ # *****************/ def write_prg(prg_fname: Path, prg_string: str, options: ArgumentParser): """ Writes th prg to `output_file`. Writes it as a human readable string, and also as an integer vector """ seqid = options.seqid or options.prg_name if options.output_type.prg: with prg_fname.open("w") as prg: header = f">{seqid} max_nest={options.max_nesting} min_match={options.min_match_length}" print(f"{header}\n{prg_string}", file=prg) if options.output_type.binary: prg_ints_fpath = prg_fname.with_suffix(".bin") prg_encoder = PrgEncoder() prg_ints: PRG_Ints = prg_encoder.encode(prg_string) with prg_ints_fpath.open("wb") as ostream: prg_encoder.write(prg_ints, ostream)
[ 1, 1053, 12183, 13, 5215, 337, 13, 5215, 330, 7554, 13, 3166, 2224, 1982, 1053, 10802, 13, 3166, 1852, 5510, 1053, 23125, 11726, 13, 13, 3166, 21184, 1053, 838, 647, 5971, 13, 13, 3166, 1207, 29918, 558, 29887, 29889, 3166, 29918, 1516, 29874, 1053, 341, 8132, 13, 3166, 1207, 29918, 558, 29887, 29889, 558, 29887, 29918, 3977, 6119, 1053, 1588, 29887, 8566, 6119, 29892, 12089, 29954, 29918, 2928, 29879, 13, 13, 13, 1753, 2254, 29918, 2520, 358, 29918, 1445, 29898, 1516, 29874, 29918, 1445, 29901, 851, 29892, 22239, 29918, 4830, 29901, 851, 29897, 1599, 341, 8132, 29901, 13, 1678, 286, 4977, 29918, 1445, 353, 851, 29898, 1516, 29874, 29918, 1445, 29897, 13, 1678, 12183, 29889, 3888, 703, 6359, 515, 341, 8132, 934, 1273, 29879, 613, 286, 4977, 29918, 1445, 29897, 13, 1678, 565, 286, 4977, 29918, 1445, 29889, 1975, 2541, 17350, 18828, 29908, 1125, 13, 4706, 12183, 29889, 8382, 703, 4345, 29909, 338, 330, 2526, 2986, 1159, 13, 4706, 4386, 353, 330, 7554, 29889, 3150, 29898, 1516, 29874, 29918, 1445, 29892, 376, 2273, 1159, 13, 4706, 22239, 353, 838, 647, 5971, 29889, 949, 29898, 8411, 29892, 22239, 29918, 4830, 29897, 13, 4706, 4386, 29889, 5358, 580, 13, 1678, 1683, 29901, 13, 4706, 22239, 353, 838, 647, 5971, 29889, 949, 29898, 1516, 29874, 29918, 1445, 29892, 22239, 29918, 4830, 29897, 13, 1678, 363, 2407, 297, 22239, 29901, 13, 4706, 2407, 29889, 11762, 353, 2407, 29889, 11762, 29889, 21064, 580, 13, 1678, 736, 22239, 13, 13, 13, 29937, 334, 4189, 1068, 3877, 13, 29937, 402, 4519, 775, 3776, 13, 29937, 334, 4189, 1068, 29914, 13, 1990, 402, 4519, 29918, 6466, 29901, 13, 1678, 9995, 13, 1678, 319, 2560, 770, 363, 17415, 263, 12089, 29954, 1347, 964, 263, 402, 4519, 934, 13, 1678, 14402, 29901, 10318, 304, 402, 4519, 29906, 3402, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 330, 5444, 29918, 1807, 543, 613, 330, 5444, 29918, 333, 29922, 29900, 29892, 330, 5444, 29918, 2746, 29922, 29945, 1125, 13, 4706, 1583, 29889, 29887, 5444, 29918, 1807, 353, 330, 5444, 29918, 1807, 13, 4706, 1583, 29889, 29887, 5444, 29918, 333, 353, 330, 5444, 29918, 333, 13, 4706, 1583, 29889, 29887, 5444, 29918, 2746, 353, 330, 5444, 29918, 2746, 13, 4706, 1583, 29889, 6144, 326, 29918, 3090, 353, 376, 376, 29871, 396, 910, 19571, 29879, 278, 838, 12961, 23718, 770, 29889, 13, 13, 1678, 822, 6219, 29918, 265, 29918, 2746, 29898, 1311, 29892, 544, 29887, 29918, 1807, 29892, 3268, 29918, 1949, 1125, 13, 4706, 3268, 29918, 1111, 4339, 353, 518, 13, 9651, 313, 29874, 29889, 2962, 3285, 263, 29889, 355, 3101, 13, 9651, 363, 263, 297, 1051, 29898, 13, 18884, 337, 29889, 2886, 1524, 29898, 13, 462, 1678, 11860, 29879, 29995, 29881, 29995, 29879, 29908, 1273, 313, 1311, 29889, 6144, 326, 29918, 3090, 29892, 3268, 29918, 1949, 29892, 1583, 29889, 6144, 326, 29918, 3090, 511, 544, 29887, 29918, 1807, 13, 18884, 1723, 13, 9651, 1723, 13, 4706, 4514, 13, 4706, 1833, 29918, 1066, 353, 6213, 13, 4706, 6219, 29918, 19651, 353, 5159, 13, 4706, 363, 313, 2962, 29892, 1095, 29897, 297, 3268, 29918, 1111, 4339, 29901, 13, 9651, 6219, 29918, 19651, 29889, 4397, 29898, 558, 29887, 29918, 1807, 29961, 4230, 29918, 1066, 29901, 2962, 2314, 13, 9651, 1833, 29918, 1066, 353, 1095, 13, 4706, 6219, 29918, 19651, 29889, 4397, 29898, 558, 29887, 29918, 1807, 29961, 4230, 29918, 1066, 29901, 2314, 13, 4706, 628, 326, 353, 11860, 29879, 29995, 29881, 29995, 29879, 29908, 1273, 313, 1311, 29889, 6144, 326, 29918, 3090, 29892, 3268, 29918, 1949, 29892, 1583, 29889, 6144, 326, 29918, 3090, 29897, 13, 4706, 1423, 29918, 1807, 353, 628, 326, 29889, 7122, 29898, 5451, 29918, 19651, 29897, 13, 4706, 4974, 1423, 29918, 1807, 1275, 544, 29887, 29918, 1807, 29892, 313, 13, 9651, 376, 16804, 756, 7695, 2743, 411, 278, 1347, 6219, 363, 3268, 1273, 29881, 29905, 1983, 2830, 27508, 13, 9651, 376, 19651, 29901, 1273, 29879, 29908, 1273, 313, 2746, 29918, 1949, 29892, 6219, 29918, 19651, 29897, 13, 4706, 1723, 13, 4706, 736, 6219, 29918, 19651, 13, 13, 1678, 822, 2048, 29918, 29887, 5444, 29918, 1807, 29898, 1311, 29892, 544, 29887, 29918, 1807, 29892, 758, 29918, 1707, 29918, 333, 29922, 8516, 1125, 13, 4706, 9995, 29911, 6926, 544, 29887, 29918, 1807, 322, 23315, 263, 330, 5444, 29918, 1807, 411, 22370, 13, 4706, 515, 278, 544, 29887, 29918, 1807, 1213, 15945, 13, 4706, 1095, 29918, 4841, 353, 5159, 13, 4706, 396, 13649, 1549, 11840, 2198, 29892, 13271, 330, 5444, 29918, 1807, 411, 1269, 297, 2507, 13, 4706, 1550, 851, 29898, 1311, 29889, 29887, 5444, 29918, 2746, 29897, 297, 544, 29887, 29918, 1807, 29901, 13, 9651, 12183, 29889, 8382, 703, 29887, 5444, 29918, 2746, 29901, 1273, 29881, 613, 1583, 29889, 29887, 5444, 29918, 2746, 29897, 13, 9651, 544, 3174, 353, 1583, 29889, 5451, 29918, 265, 29918, 2746, 29898, 558, 29887, 29918, 1807, 29892, 1583, 29889, 29887, 5444, 29918, 2746, 29897, 13, 9651, 12183, 29889, 8382, 703, 558, 3174, 29901, 1273, 29879, 613, 544, 3174, 29897, 13, 9651, 4974, 7431, 29898, 558, 3174, 29897, 1275, 29871, 29941, 29892, 376, 13919, 544, 29887, 5665, 1273, 29879, 363, 3268, 1273, 29881, 322, 1178, 1273, 29881, 29908, 1273, 313, 13, 18884, 544, 29887, 29918, 1807, 29892, 13, 18884, 1583, 29889, 29887, 5444, 29918, 2746, 29892, 13, 18884, 1583, 29889, 29887, 5444, 29918, 333, 29892, 13, 9651, 1723, 13, 13, 9651, 396, 788, 758, 29899, 1707, 3268, 1347, 322, 2988, 515, 3517, 19359, 22370, 13, 9651, 565, 544, 3174, 29961, 29900, 29962, 2804, 376, 1115, 13, 18884, 1583, 29889, 29887, 5444, 29918, 1807, 4619, 376, 29903, 29905, 29873, 29995, 29881, 29905, 29873, 29995, 29879, 29905, 29873, 10363, 29901, 29875, 29901, 29900, 29905, 29876, 29908, 1273, 313, 1311, 29889, 29887, 5444, 29918, 333, 29892, 544, 3174, 29961, 29900, 2314, 13, 9651, 1683, 29901, 13, 18884, 396, 12778, 385, 4069, 2943, 363, 4069, 758, 722, 3268, 19359, 29879, 13, 18884, 1583, 29889, 29887, 5444, 29918, 1807, 4619, 376, 29903, 29905, 29873, 29995, 29881, 29905, 29873, 29995, 29879, 29905, 29873, 10363, 29901, 29875, 29901, 29900, 29905, 29876, 29908, 1273, 313, 1311, 29889, 29887, 5444, 29918, 333, 29892, 26345, 1159, 13, 9651, 758, 29918, 1707, 29918, 333, 353, 1583, 29889, 29887, 5444, 29918, 333, 13, 9651, 1583, 29889, 29887, 5444, 29918, 333, 4619, 29871, 29896, 13, 9651, 363, 1178, 297, 1095, 29918, 4841, 29901, 13, 18884, 1583, 29889, 29887, 5444, 29918, 1807, 4619, 376, 29931, 29905, 29873, 29995, 29881, 29905, 29873, 3124, 29873, 29995, 29881, 29905, 29873, 3124, 29873, 29900, 29924, 29905, 29876, 29908, 1273, 313, 333, 29892, 758, 29918, 1707, 29918, 333, 29897, 13, 18884, 1095, 29918, 4841, 353, 5159, 13, 13, 9651, 396, 8304, 3598, 788, 24611, 363, 1269, 310, 278, 17305, 447, 5317, 7384, 472, 13, 9651, 396, 445, 3268, 29892, 14238, 278, 1095, 1178, 363, 1269, 447, 5317, 668, 13, 9651, 24987, 353, 1583, 29889, 5451, 29918, 265, 29918, 2746, 29898, 558, 3174, 29961, 29896, 1402, 1583, 29889, 29887, 5444, 29918, 2746, 718, 29871, 29896, 29897, 13, 9651, 4974, 7431, 29898, 16908, 29897, 1405, 29871, 29896, 29892, 376, 13919, 544, 29887, 5665, 1273, 29879, 363, 3268, 1273, 29881, 322, 1178, 1273, 29881, 29908, 1273, 313, 13, 18884, 544, 29887, 29918, 1807, 29892, 13, 18884, 1583, 29889, 29887, 5444, 29918, 2746, 718, 29871, 29896, 29892, 13, 18884, 1583, 29889, 29887, 5444, 29918, 333, 29892, 13, 9651, 1723, 13, 9651, 12183, 29889, 8382, 703, 16908, 29901, 1273, 29879, 613, 24987, 29897, 13, 9651, 1583, 29889, 29887, 5444, 29918, 2746, 4619, 29871, 29906, 13, 9651, 12183, 29889, 8382, 703, 29887, 5444, 29918, 2746, 29901, 1273, 29881, 613, 1583, 29889, 29887, 5444, 29918, 2746, 29897, 13, 9651, 363, 722, 29918, 1807, 297, 24987, 29901, 13, 18884, 565, 758, 29918, 1707, 29918, 333, 2804, 6213, 29901, 13, 462, 1678, 1583, 29889, 29887, 5444, 29918, 1807, 4619, 376, 29931, 29905, 29873, 29995, 29881, 29905, 29873, 3124, 29873, 29995, 29881, 29905, 29873, 3124, 29873, 29900, 29924, 29905, 29876, 29908, 1273, 313, 13, 462, 4706, 758, 29918, 1707, 29918, 333, 29892, 13, 462, 4706, 1583, 29889, 29887, 5444, 29918, 333, 29892, 13, 462, 1678, 1723, 13, 18884, 722, 29918, 355, 29918, 4841, 353, 1583, 29889, 4282, 29918, 29887, 5444, 29918, 1807, 29898, 13, 462, 1678, 544, 29887, 29918, 1807, 29922, 1707, 29918, 1807, 29892, 758, 29918, 1707, 29918, 333, 29922, 1457, 29918, 1707, 29918, 333, 13, 18884, 1723, 13, 18884, 1095, 29918, 4841, 29889, 21843, 29898, 1707, 29918, 355, 29918, 4841, 29897, 13, 13, 9651, 544, 29887, 29918, 1807, 353, 544, 3174, 29961, 29906, 29962, 13, 9651, 758, 29918, 1707, 29918, 333, 353, 6213, 13, 13, 4706, 396, 7146, 788, 278, 2186, 2586, 310, 5665, 1156, 17305, 3268, 13, 4706, 565, 544, 29887, 29918, 1807, 2804, 376, 1115, 13, 9651, 1583, 29889, 29887, 5444, 29918, 1807, 4619, 376, 29903, 29905, 29873, 29995, 29881, 29905, 29873, 29995, 29879, 29905, 29873, 10363, 29901, 29875, 29901, 29900, 29905, 29876, 29908, 1273, 313, 1311, 29889, 29887, 5444, 29918, 333, 29892, 544, 29887, 29918, 1807, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 29887, 5444, 29918, 1807, 4619, 376, 29903, 29905, 29873, 29995, 29881, 29905, 29873, 29995, 29879, 29905, 29873, 10363, 29901, 29875, 29901, 29900, 29905, 29876, 29908, 1273, 313, 1311, 29889, 29887, 5444, 29918, 333, 29892, 26345, 1159, 13, 4706, 363, 1178, 297, 1095, 29918, 4841, 29901, 13, 9651, 1583, 29889, 29887, 5444, 29918, 1807, 4619, 376, 29931, 29905, 29873, 29995, 29881, 29905, 29873, 3124, 29873, 29995, 29881, 29905, 29873, 3124, 29873, 29900, 29924, 29905, 29876, 29908, 1273, 313, 333, 29892, 1583, 29889, 29887, 5444, 29918, 333, 29897, 13, 4706, 1095, 29918, 4841, 353, 5159, 13, 4706, 736, 29918, 333, 353, 518, 1311, 29889, 29887, 5444, 29918, 333, 29962, 13, 4706, 1583, 29889, 29887, 5444, 29918, 333, 4619, 29871, 29896, 13, 4706, 736, 736, 29918, 333, 13, 13, 13, 1753, 2436, 29918, 29887, 5444, 29898, 449, 1445, 29892, 544, 29887, 29918, 1807, 1125, 13, 1678, 9995, 13, 1678, 16849, 267, 263, 330, 5444, 934, 515, 544, 29887, 1347, 29889, 13, 1678, 9995, 13, 1678, 411, 1722, 29898, 449, 1445, 29892, 376, 29893, 1159, 408, 285, 29901, 13, 4706, 396, 11905, 330, 5444, 29918, 1807, 29892, 1178, 322, 3268, 29892, 769, 2767, 1347, 411, 278, 544, 29887, 13, 4706, 330, 5444, 29918, 1807, 353, 376, 29950, 29905, 29873, 29963, 29940, 29901, 29999, 29901, 29896, 29889, 29900, 29905, 29873, 11197, 29901, 29999, 20296, 10660, 1192, 2976, 1945, 29878, 29905, 29876, 29908, 13, 4706, 330, 5444, 29918, 333, 353, 29871, 29900, 13, 4706, 330, 5444, 29918, 2746, 353, 29871, 29945, 13, 4706, 330, 5444, 29918, 5415, 353, 402, 4519, 29918, 6466, 29898, 29887, 5444, 29918, 1807, 29897, 13, 4706, 330, 5444, 29918, 5415, 29889, 4282, 29918, 29887, 5444, 29918, 1807, 29898, 558, 29887, 29918, 1807, 29922, 558, 29887, 29918, 1807, 29897, 13, 4706, 285, 29889, 3539, 29898, 29887, 5444, 29918, 5415, 29889, 29887, 5444, 29918, 1807, 29897, 13, 13, 13, 29937, 334, 7775, 3877, 13, 29937, 14350, 12089, 29954, 775, 3776, 13, 29937, 334, 7775, 29914, 13, 13, 13, 1753, 2436, 29918, 558, 29887, 29898, 558, 29887, 29918, 29888, 978, 29901, 10802, 29892, 544, 29887, 29918, 1807, 29901, 851, 29892, 3987, 29901, 23125, 11726, 1125, 13, 1678, 9995, 13, 1678, 16849, 267, 266, 544, 29887, 304, 421, 4905, 29918, 1445, 1412, 13, 1678, 16849, 267, 372, 408, 263, 5199, 19909, 1347, 29892, 322, 884, 408, 385, 6043, 4608, 13, 1678, 9995, 13, 1678, 19359, 333, 353, 3987, 29889, 11762, 333, 470, 3987, 29889, 558, 29887, 29918, 978, 13, 13, 1678, 565, 3987, 29889, 4905, 29918, 1853, 29889, 558, 29887, 29901, 13, 4706, 411, 544, 29887, 29918, 29888, 978, 29889, 3150, 703, 29893, 1159, 408, 544, 29887, 29901, 13, 9651, 4839, 353, 285, 1013, 29912, 11762, 333, 29913, 4236, 29918, 17510, 3790, 6768, 29889, 3317, 29918, 17510, 292, 29913, 1375, 29918, 4352, 3790, 6768, 29889, 1195, 29918, 4352, 29918, 2848, 5038, 13, 9651, 1596, 29898, 29888, 29908, 29912, 6672, 1012, 29876, 29912, 558, 29887, 29918, 1807, 17671, 934, 29922, 558, 29887, 29897, 13, 13, 1678, 565, 3987, 29889, 4905, 29918, 1853, 29889, 19541, 29901, 13, 4706, 544, 29887, 29918, 9466, 29918, 29888, 2084, 353, 544, 29887, 29918, 29888, 978, 29889, 2541, 29918, 2146, 600, 861, 17350, 2109, 1159, 13, 4706, 544, 29887, 29918, 3977, 6119, 353, 1588, 29887, 8566, 6119, 580, 13, 4706, 544, 29887, 29918, 9466, 29901, 12089, 29954, 29918, 2928, 29879, 353, 544, 29887, 29918, 3977, 6119, 29889, 12508, 29898, 558, 29887, 29918, 1807, 29897, 13, 13, 4706, 411, 544, 29887, 29918, 9466, 29918, 29888, 2084, 29889, 3150, 703, 29893, 29890, 1159, 408, 288, 5461, 29901, 13, 9651, 544, 29887, 29918, 3977, 6119, 29889, 3539, 29898, 558, 29887, 29918, 9466, 29892, 288, 5461, 29897, 13, 2 ]
skbot/ignition/sdformat/bindings/v15/physics.py
FirefoxMetzger/ropy
6
13913
from dataclasses import dataclass, field from typing import Optional __NAMESPACE__ = "sdformat/v1.5/physics.xsd" @dataclass class Physics: """ The physics tag specifies the type and properties of the dynamics engine. Parameters ---------- max_step_size: Maximum time step size at which every system in simulation can interact with the states of the world. (was physics.sdf's dt). real_time_factor: target simulation speedup factor, defined by ratio of simulation time to real-time. real_time_update_rate: Rate at which to update the physics engine (UpdatePhysics calls per real-time second). (was physics.sdf's update_rate). max_contacts: Maximum number of contacts allowed between two entities. This value can be over ridden by a max_contacts element in a collision element. gravity: The gravity vector in m/s^2, expressed in a coordinate frame defined by the spherical_coordinates tag. magnetic_field: The magnetic vector in Tesla, expressed in a coordinate frame defined by the spherical_coordinates tag. simbody: Simbody specific physics properties bullet: Bullet specific physics properties ode: ODE specific physics properties name: The name of this set of physics parameters. default: If true, this physics element is set as the default physics profile for the world. If multiple default physics elements exist, the first element marked as default is chosen. If no default physics element exists, the first physics element is chosen. type: The type of the dynamics engine. Current options are ode, bullet, simbody and rtql8. Defaults to ode if left unspecified. """ class Meta: name = "physics" max_step_size: float = field( default=0.001, metadata={ "type": "Element", "namespace": "", "required": True, }, ) real_time_factor: float = field( default=1.0, metadata={ "type": "Element", "namespace": "", "required": True, }, ) real_time_update_rate: float = field( default=1000.0, metadata={ "type": "Element", "namespace": "", "required": True, }, ) max_contacts: int = field( default=20, metadata={ "type": "Element", "namespace": "", "required": True, }, ) gravity: str = field( default="0 0 -9.8", metadata={ "type": "Element", "namespace": "", "required": True, "pattern": r"(\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+)\s+){2}((-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+))\s*", }, ) magnetic_field: str = field( default="5.5645e-6 22.8758e-6 -42.3884e-6", metadata={ "type": "Element", "namespace": "", "required": True, "pattern": r"(\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+)\s+){2}((-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+))\s*", }, ) simbody: Optional["Physics.Simbody"] = field( default=None, metadata={ "type": "Element", "namespace": "", }, ) bullet: Optional["Physics.Bullet"] = field( default=None, metadata={ "type": "Element", "namespace": "", }, ) ode: Optional["Physics.Ode"] = field( default=None, metadata={ "type": "Element", "namespace": "", }, ) name: str = field( default="default_physics", metadata={ "type": "Attribute", }, ) default: bool = field( default=False, metadata={ "type": "Attribute", }, ) type: Optional[str] = field( default=None, metadata={ "type": "Attribute", "required": True, }, ) @dataclass class Simbody: """ Simbody specific physics properties. Parameters ---------- min_step_size: (Currently not used in simbody) The time duration which advances with each iteration of the dynamics engine, this has to be no bigger than max_step_size under physics block. If left unspecified, min_step_size defaults to max_step_size. accuracy: Roughly the relative error of the system. -LOG(accuracy) is roughly the number of significant digits. max_transient_velocity: Tolerable "slip" velocity allowed by the solver when static friction is supposed to hold object in place. contact: Relationship among dissipation, coef. restitution, etc. d = dissipation coefficient (1/velocity) vc = capture velocity (velocity where e=e_max) vp = plastic velocity (smallest v where e=e_min) &amp;gt; vc Assume real COR=1 when v=0. e_min = given minimum COR, at v &amp;gt;= vp (a.k.a. plastic_coef_restitution) d = slope = (1-e_min)/vp OR, e_min = 1 - d*vp e_max = maximum COR = 1-d*vc, reached at v=vc e = 0, v &amp;lt;= vc = 1 - d*v, vc &amp;lt; v &amp;lt; vp = e_min, v &amp;gt;= vp dissipation factor = d*min(v,vp) [compliant] cor = e [rigid] Combining rule e = 0, e1==e2==0 = 2*e1*e2/(e1+e2), otherwise """ min_step_size: float = field( default=0.0001, metadata={ "type": "Element", "namespace": "", "required": True, }, ) accuracy: float = field( default=0.001, metadata={ "type": "Element", "namespace": "", "required": True, }, ) max_transient_velocity: float = field( default=0.01, metadata={ "type": "Element", "namespace": "", "required": True, }, ) contact: Optional["Physics.Simbody.Contact"] = field( default=None, metadata={ "type": "Element", "namespace": "", }, ) @dataclass class Contact: """Relationship among dissipation, coef. restitution, etc. d = dissipation coefficient (1/velocity) vc = capture velocity (velocity where e=e_max) vp = plastic velocity (smallest v where e=e_min) &amp;gt; vc Assume real COR=1 when v=0. e_min = given minimum COR, at v &amp;gt;= vp (a.k.a. plastic_coef_restitution) d = slope = (1-e_min)/vp OR, e_min = 1 - d*vp e_max = maximum COR = 1-d*vc, reached at v=vc e = 0, v &amp;lt;= vc = 1 - d*v, vc &amp;lt; v &amp;lt; vp = e_min, v &amp;gt;= vp dissipation factor = d*min(v,vp) [compliant] cor = e [rigid] Combining rule e = 0, e1==e2==0 = 2*e1*e2/(e1+e2), otherwise Parameters ---------- stiffness: Default contact material stiffness (force/dist or torque/radian). dissipation: dissipation coefficient to be used in compliant contact; if not given it is (1-min_cor)/plastic_impact_velocity plastic_coef_restitution: this is the COR to be used at high velocities for rigid impacts; if not given it is 1 - dissipation*plastic_impact_velocity plastic_impact_velocity: smallest impact velocity at which min COR is reached; set to zero if you want the min COR always to be used static_friction: static friction (mu_s) as described by this plot: http://gazebosim.org/wiki/File:Stribeck_friction.png dynamic_friction: dynamic friction (mu_d) as described by this plot: http://gazebosim.org/wiki/File:Stribeck_friction.png viscous_friction: viscous friction (mu_v) with units of (1/velocity) as described by this plot: http://gazebosim.org/wiki/File:Stribeck_friction.png override_impact_capture_velocity: for rigid impacts only, impact velocity at which COR is set to zero; normally inherited from global default but can be overridden here. Combining rule: use larger velocity override_stiction_transition_velocity: This is the largest slip velocity at which we'll consider a transition to stiction. Normally inherited from a global default setting. For a continuous friction model this is the velocity at which the max static friction force is reached. Combining rule: use larger velocity """ stiffness: float = field( default=100000000.0, metadata={ "type": "Element", "namespace": "", "required": True, }, ) dissipation: float = field( default=100.0, metadata={ "type": "Element", "namespace": "", "required": True, }, ) plastic_coef_restitution: float = field( default=0.5, metadata={ "type": "Element", "namespace": "", "required": True, }, ) plastic_impact_velocity: float = field( default=0.5, metadata={ "type": "Element", "namespace": "", "required": True, }, ) static_friction: float = field( default=0.9, metadata={ "type": "Element", "namespace": "", "required": True, }, ) dynamic_friction: float = field( default=0.9, metadata={ "type": "Element", "namespace": "", "required": True, }, ) viscous_friction: float = field( default=0.0, metadata={ "type": "Element", "namespace": "", "required": True, }, ) override_impact_capture_velocity: float = field( default=0.001, metadata={ "type": "Element", "namespace": "", "required": True, }, ) override_stiction_transition_velocity: float = field( default=0.001, metadata={ "type": "Element", "namespace": "", "required": True, }, ) @dataclass class Bullet: """ Bullet specific physics properties. Parameters ---------- solver: constraints: Bullet constraint parameters. """ solver: Optional["Physics.Bullet.Solver"] = field( default=None, metadata={ "type": "Element", "namespace": "", "required": True, }, ) constraints: Optional["Physics.Bullet.Constraints"] = field( default=None, metadata={ "type": "Element", "namespace": "", "required": True, }, ) @dataclass class Solver: """ Parameters ---------- type: One of the following types: sequential_impulse only. min_step_size: The time duration which advances with each iteration of the dynamics engine, this has to be no bigger than max_step_size under physics block. If left unspecified, min_step_size defaults to max_step_size. iters: Number of iterations for each step. A higher number produces greater accuracy at a performance cost. sor: Set the successive over-relaxation parameter. """ type: str = field( default="sequential_impulse", metadata={ "type": "Element", "namespace": "", "required": True, }, ) min_step_size: float = field( default=0.0001, metadata={ "type": "Element", "namespace": "", "required": True, }, ) iters: int = field( default=50, metadata={ "type": "Element", "namespace": "", "required": True, }, ) sor: float = field( default=1.3, metadata={ "type": "Element", "namespace": "", "required": True, }, ) @dataclass class Constraints: """ Bullet constraint parameters. Parameters ---------- cfm: Constraint force mixing parameter. See the ODE page for more information. erp: Error reduction parameter. See the ODE page for more information. contact_surface_layer: The depth of the surface layer around all geometry objects. Contacts are allowed to sink into the surface layer up to the given depth before coming to rest. The default value is zero. Increasing this to some small value (e.g. 0.001) can help prevent jittering problems due to contacts being repeatedly made and broken. split_impulse: Similar to ODE's max_vel implementation. See http://web.archive.org/web/20120430155635/http://bulletphysics.org/mediawiki-1.5.8/index.php/BtContactSolverInfo#Split_Impulse for more information. split_impulse_penetration_threshold: Similar to ODE's max_vel implementation. See http://web.archive.org/web/20120430155635/http://bulletphysics.org/mediawiki-1.5.8/index.php/BtContactSolverInfo#Split_Impulse for more information. """ cfm: float = field( default=0.0, metadata={ "type": "Element", "namespace": "", "required": True, }, ) erp: float = field( default=0.2, metadata={ "type": "Element", "namespace": "", "required": True, }, ) contact_surface_layer: float = field( default=0.001, metadata={ "type": "Element", "namespace": "", "required": True, }, ) split_impulse: bool = field( default=True, metadata={ "type": "Element", "namespace": "", "required": True, }, ) split_impulse_penetration_threshold: float = field( default=-0.01, metadata={ "type": "Element", "namespace": "", "required": True, }, ) @dataclass class Ode: """ ODE specific physics properties. Parameters ---------- solver: constraints: ODE constraint parameters. """ solver: Optional["Physics.Ode.Solver"] = field( default=None, metadata={ "type": "Element", "namespace": "", "required": True, }, ) constraints: Optional["Physics.Ode.Constraints"] = field( default=None, metadata={ "type": "Element", "namespace": "", "required": True, }, ) @dataclass class Solver: """ Parameters ---------- type: One of the following types: world, quick min_step_size: The time duration which advances with each iteration of the dynamics engine, this has to be no bigger than max_step_size under physics block. If left unspecified, min_step_size defaults to max_step_size. iters: Number of iterations for each step. A higher number produces greater accuracy at a performance cost. precon_iters: Experimental parameter. sor: Set the successive over-relaxation parameter. use_dynamic_moi_rescaling: Flag to enable dynamic rescaling of moment of inertia in constrained directions. See gazebo pull request 1114 for the implementation of this feature. https://osrf- migration.github.io/gazebo-gh-pages/#!/osrf/gazebo/pull- request/1114 """ type: str = field( default="quick", metadata={ "type": "Element", "namespace": "", "required": True, }, ) min_step_size: float = field( default=0.0001, metadata={ "type": "Element", "namespace": "", "required": True, }, ) iters: int = field( default=50, metadata={ "type": "Element", "namespace": "", "required": True, }, ) precon_iters: int = field( default=0, metadata={ "type": "Element", "namespace": "", "required": True, }, ) sor: float = field( default=1.3, metadata={ "type": "Element", "namespace": "", "required": True, }, ) use_dynamic_moi_rescaling: bool = field( default=False, metadata={ "type": "Element", "namespace": "", "required": True, }, ) @dataclass class Constraints: """ ODE constraint parameters. Parameters ---------- cfm: Constraint force mixing parameter. See the ODE page for more information. erp: Error reduction parameter. See the ODE page for more information. contact_max_correcting_vel: The maximum correcting velocities allowed when resolving contacts. contact_surface_layer: The depth of the surface layer around all geometry objects. Contacts are allowed to sink into the surface layer up to the given depth before coming to rest. The default value is zero. Increasing this to some small value (e.g. 0.001) can help prevent jittering problems due to contacts being repeatedly made and broken. """ cfm: float = field( default=0.0, metadata={ "type": "Element", "namespace": "", "required": True, }, ) erp: float = field( default=0.2, metadata={ "type": "Element", "namespace": "", "required": True, }, ) contact_max_correcting_vel: float = field( default=100.0, metadata={ "type": "Element", "namespace": "", "required": True, }, ) contact_surface_layer: float = field( default=0.001, metadata={ "type": "Element", "namespace": "", "required": True, }, )
[ 1, 515, 848, 13203, 1053, 848, 1990, 29892, 1746, 13, 3166, 19229, 1053, 28379, 13, 13, 1649, 5813, 5550, 11538, 1649, 353, 376, 4928, 4830, 29914, 29894, 29896, 29889, 29945, 29914, 25105, 29889, 19168, 29908, 13, 13, 13, 29992, 1272, 1990, 13, 1990, 29837, 29901, 13, 1678, 9995, 13, 1678, 450, 17558, 4055, 1580, 11057, 278, 1134, 322, 4426, 310, 278, 19753, 6012, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 4236, 29918, 10568, 29918, 2311, 29901, 5918, 12539, 931, 4331, 2159, 472, 607, 1432, 1788, 297, 13, 4706, 17402, 508, 16254, 411, 278, 5922, 310, 278, 3186, 29889, 29871, 313, 11102, 13, 4706, 17558, 29889, 29879, 2176, 29915, 29879, 11636, 467, 13, 1678, 1855, 29918, 2230, 29918, 19790, 29901, 3646, 17402, 6210, 786, 7329, 29892, 3342, 491, 11959, 13, 4706, 310, 17402, 931, 304, 1855, 29899, 2230, 29889, 13, 1678, 1855, 29918, 2230, 29918, 5504, 29918, 10492, 29901, 390, 403, 472, 607, 304, 2767, 278, 17558, 6012, 13, 4706, 313, 6422, 25847, 1199, 5717, 639, 1855, 29899, 2230, 1473, 467, 313, 11102, 17558, 29889, 29879, 2176, 29915, 29879, 13, 4706, 2767, 29918, 10492, 467, 13, 1678, 4236, 29918, 12346, 29879, 29901, 5918, 12539, 1353, 310, 25957, 6068, 1546, 1023, 13, 4706, 16212, 29889, 910, 995, 508, 367, 975, 364, 4215, 491, 263, 4236, 29918, 12346, 29879, 13, 4706, 1543, 297, 263, 22369, 1543, 29889, 13, 1678, 20953, 29901, 450, 20953, 4608, 297, 286, 29914, 29879, 29985, 29906, 29892, 13384, 297, 263, 14821, 13, 4706, 3515, 3342, 491, 278, 26903, 936, 29918, 1111, 24266, 4055, 29889, 13, 1678, 15611, 29918, 2671, 29901, 450, 15611, 4608, 297, 323, 267, 433, 29892, 13384, 297, 263, 13, 4706, 14821, 3515, 3342, 491, 278, 26903, 936, 29918, 1111, 24266, 4055, 29889, 13, 1678, 1027, 2587, 29901, 3439, 2587, 2702, 17558, 4426, 13, 1678, 24334, 29901, 8313, 1026, 2702, 17558, 4426, 13, 1678, 288, 311, 29901, 438, 2287, 2702, 17558, 4426, 13, 1678, 1024, 29901, 450, 1024, 310, 445, 731, 310, 17558, 4128, 29889, 13, 1678, 2322, 29901, 960, 1565, 29892, 445, 17558, 1543, 338, 731, 408, 278, 2322, 17558, 13, 4706, 8722, 363, 278, 3186, 29889, 960, 2999, 2322, 17558, 3161, 13, 4706, 1863, 29892, 278, 937, 1543, 10902, 408, 2322, 338, 10434, 29889, 960, 694, 13, 4706, 2322, 17558, 1543, 4864, 29892, 278, 937, 17558, 1543, 338, 13, 4706, 10434, 29889, 13, 1678, 1134, 29901, 450, 1134, 310, 278, 19753, 6012, 29889, 9626, 3987, 526, 288, 311, 29892, 13, 4706, 24334, 29892, 1027, 2587, 322, 364, 29873, 1519, 29947, 29889, 29871, 13109, 29879, 304, 288, 311, 565, 2175, 443, 6550, 2164, 29889, 13, 1678, 9995, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 1024, 353, 376, 25105, 29908, 13, 13, 1678, 4236, 29918, 10568, 29918, 2311, 29901, 5785, 353, 1746, 29898, 13, 4706, 2322, 29922, 29900, 29889, 29900, 29900, 29896, 29892, 13, 4706, 15562, 3790, 13, 9651, 376, 1853, 1115, 376, 2642, 613, 13, 9651, 376, 22377, 1115, 12633, 13, 9651, 376, 12403, 1115, 5852, 29892, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 1855, 29918, 2230, 29918, 19790, 29901, 5785, 353, 1746, 29898, 13, 4706, 2322, 29922, 29896, 29889, 29900, 29892, 13, 4706, 15562, 3790, 13, 9651, 376, 1853, 1115, 376, 2642, 613, 13, 9651, 376, 22377, 1115, 12633, 13, 9651, 376, 12403, 1115, 5852, 29892, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 1855, 29918, 2230, 29918, 5504, 29918, 10492, 29901, 5785, 353, 1746, 29898, 13, 4706, 2322, 29922, 29896, 29900, 29900, 29900, 29889, 29900, 29892, 13, 4706, 15562, 3790, 13, 9651, 376, 1853, 1115, 376, 2642, 613, 13, 9651, 376, 22377, 1115, 12633, 13, 9651, 376, 12403, 1115, 5852, 29892, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 4236, 29918, 12346, 29879, 29901, 938, 353, 1746, 29898, 13, 4706, 2322, 29922, 29906, 29900, 29892, 13, 4706, 15562, 3790, 13, 9651, 376, 1853, 1115, 376, 2642, 613, 13, 9651, 376, 22377, 1115, 12633, 13, 9651, 376, 12403, 1115, 5852, 29892, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 20953, 29901, 851, 353, 1746, 29898, 13, 4706, 2322, 543, 29900, 29871, 29900, 448, 29929, 29889, 29947, 613, 13, 4706, 15562, 3790, 13, 9651, 376, 1853, 1115, 376, 2642, 613, 13, 9651, 376, 22377, 1115, 12633, 13, 9651, 376, 12403, 1115, 5852, 29892, 13, 9651, 376, 11037, 1115, 364, 29908, 1194, 29879, 29930, 6278, 4295, 29974, 6877, 1194, 29881, 29974, 1194, 7790, 29881, 29930, 6877, 4295, 7790, 29881, 29974, 4295, 29881, 3124, 7790, 29881, 29974, 29961, 29872, 29923, 3816, 2612, 29974, 29962, 29973, 29961, 29900, 29899, 29929, 10062, 2144, 29879, 29974, 2597, 29906, 2119, 6278, 4295, 29974, 6877, 1194, 29881, 29974, 1194, 7790, 29881, 29930, 6877, 4295, 7790, 29881, 29974, 4295, 29881, 3124, 7790, 29881, 29974, 29961, 29872, 29923, 3816, 2612, 29974, 29962, 29973, 29961, 29900, 29899, 29929, 10062, 28986, 29879, 29930, 613, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 15611, 29918, 2671, 29901, 851, 353, 1746, 29898, 13, 4706, 2322, 543, 29945, 29889, 29945, 29953, 29946, 29945, 29872, 29899, 29953, 29871, 29906, 29906, 29889, 29947, 29955, 29945, 29947, 29872, 29899, 29953, 448, 29946, 29906, 29889, 29941, 29947, 29947, 29946, 29872, 29899, 29953, 613, 13, 4706, 15562, 3790, 13, 9651, 376, 1853, 1115, 376, 2642, 613, 13, 9651, 376, 22377, 1115, 12633, 13, 9651, 376, 12403, 1115, 5852, 29892, 13, 9651, 376, 11037, 1115, 364, 29908, 1194, 29879, 29930, 6278, 4295, 29974, 6877, 1194, 29881, 29974, 1194, 7790, 29881, 29930, 6877, 4295, 7790, 29881, 29974, 4295, 29881, 3124, 7790, 29881, 29974, 29961, 29872, 29923, 3816, 2612, 29974, 29962, 29973, 29961, 29900, 29899, 29929, 10062, 2144, 29879, 29974, 2597, 29906, 2119, 6278, 4295, 29974, 6877, 1194, 29881, 29974, 1194, 7790, 29881, 29930, 6877, 4295, 7790, 29881, 29974, 4295, 29881, 3124, 7790, 29881, 29974, 29961, 29872, 29923, 3816, 2612, 29974, 29962, 29973, 29961, 29900, 29899, 29929, 10062, 28986, 29879, 29930, 613, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 1027, 2587, 29901, 28379, 3366, 25847, 1199, 29889, 8942, 2587, 3108, 353, 1746, 29898, 13, 4706, 2322, 29922, 8516, 29892, 13, 4706, 15562, 3790, 13, 9651, 376, 1853, 1115, 376, 2642, 613, 13, 9651, 376, 22377, 1115, 12633, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 24334, 29901, 28379, 3366, 25847, 1199, 29889, 29933, 352, 1026, 3108, 353, 1746, 29898, 13, 4706, 2322, 29922, 8516, 29892, 13, 4706, 15562, 3790, 13, 9651, 376, 1853, 1115, 376, 2642, 613, 13, 9651, 376, 22377, 1115, 12633, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 288, 311, 29901, 28379, 3366, 25847, 1199, 29889, 29949, 311, 3108, 353, 1746, 29898, 13, 4706, 2322, 29922, 8516, 29892, 13, 4706, 15562, 3790, 13, 9651, 376, 1853, 1115, 376, 2642, 613, 13, 9651, 376, 22377, 1115, 12633, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 1024, 29901, 851, 353, 1746, 29898, 13, 4706, 2322, 543, 4381, 29918, 25105, 613, 13, 4706, 15562, 3790, 13, 9651, 376, 1853, 1115, 376, 6708, 613, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 2322, 29901, 6120, 353, 1746, 29898, 13, 4706, 2322, 29922, 8824, 29892, 13, 4706, 15562, 3790, 13, 9651, 376, 1853, 1115, 376, 6708, 613, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 1134, 29901, 28379, 29961, 710, 29962, 353, 1746, 29898, 13, 4706, 2322, 29922, 8516, 29892, 13, 4706, 15562, 3790, 13, 9651, 376, 1853, 1115, 376, 6708, 613, 13, 9651, 376, 12403, 1115, 5852, 29892, 13, 4706, 2981, 13, 1678, 1723, 13, 13, 1678, 732, 1272, 1990, 13, 1678, 770, 3439, 2587, 29901, 13, 4706, 9995, 13, 4706, 3439, 2587, 2702, 17558, 4426, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1375, 29918, 10568, 29918, 2311, 29901, 313, 7583, 368, 451, 1304, 297, 1027, 2587, 29897, 450, 931, 14385, 13, 9651, 607, 3061, 2925, 411, 1269, 12541, 310, 278, 19753, 6012, 29892, 13, 9651, 445, 756, 304, 367, 694, 16600, 1135, 4236, 29918, 10568, 29918, 2311, 1090, 17558, 13, 9651, 2908, 29889, 29871, 960, 2175, 443, 6550, 2164, 29892, 1375, 29918, 10568, 29918, 2311, 21274, 304, 13, 9651, 4236, 29918, 10568, 29918, 2311, 29889, 13, 4706, 13600, 29901, 390, 820, 368, 278, 6198, 1059, 310, 278, 1788, 29889, 13, 9651, 448, 14480, 29898, 562, 2764, 4135, 29897, 338, 20928, 278, 1353, 310, 7282, 13340, 29889, 13, 4706, 4236, 29918, 3286, 993, 29918, 955, 25245, 29901, 16977, 261, 519, 376, 29879, 3466, 29908, 12885, 6068, 491, 278, 13, 9651, 899, 369, 746, 2294, 308, 1424, 2463, 338, 7424, 304, 4808, 13, 9651, 1203, 297, 2058, 29889, 13, 4706, 6958, 29901, 6376, 800, 4034, 4249, 16317, 666, 362, 29892, 1302, 1389, 29889, 1791, 5008, 29892, 2992, 29889, 13, 9651, 270, 353, 16317, 666, 362, 10825, 313, 29896, 29914, 955, 25245, 29897, 308, 325, 29883, 353, 13, 9651, 10446, 12885, 313, 955, 25245, 988, 321, 29922, 29872, 29918, 3317, 29897, 308, 325, 29886, 353, 13, 9651, 715, 6288, 12885, 313, 9278, 342, 325, 988, 321, 29922, 29872, 29918, 1195, 29897, 669, 1160, 29936, 4141, 29936, 325, 29883, 13, 9651, 22680, 1855, 315, 1955, 29922, 29896, 746, 325, 29922, 29900, 29889, 308, 321, 29918, 1195, 353, 2183, 9212, 13, 9651, 315, 1955, 29892, 472, 325, 669, 1160, 29936, 4141, 29936, 29922, 325, 29886, 313, 29874, 29889, 29895, 29889, 29874, 29889, 715, 6288, 29918, 1111, 1389, 29918, 5060, 5008, 29897, 13, 9651, 270, 353, 24968, 353, 313, 29896, 29899, 29872, 29918, 1195, 6802, 29894, 29886, 308, 6323, 29892, 321, 29918, 1195, 353, 29871, 29896, 448, 270, 29930, 29894, 29886, 13, 9651, 321, 29918, 3317, 353, 7472, 315, 1955, 353, 29871, 29896, 29899, 29881, 29930, 7071, 29892, 7450, 472, 325, 29922, 7071, 308, 321, 353, 29871, 29900, 29892, 13, 9651, 325, 669, 1160, 29936, 1896, 29936, 29922, 325, 29883, 965, 353, 29871, 29896, 448, 270, 29930, 29894, 29892, 1669, 325, 29883, 13, 9651, 669, 1160, 29936, 1896, 29936, 325, 669, 1160, 29936, 1896, 29936, 325, 29886, 965, 353, 321, 29918, 1195, 29892, 13, 9651, 325, 669, 1160, 29936, 4141, 29936, 29922, 325, 29886, 3986, 16317, 666, 362, 7329, 353, 270, 29930, 1195, 29898, 29894, 29892, 29894, 29886, 29897, 13, 9651, 518, 2388, 492, 424, 29962, 308, 1034, 353, 321, 13, 9651, 518, 8966, 333, 29962, 3986, 422, 2109, 292, 5751, 321, 353, 29871, 29900, 29892, 13, 9651, 321, 29896, 1360, 29872, 29906, 1360, 29900, 462, 3986, 353, 29871, 29906, 29930, 29872, 29896, 29930, 29872, 29906, 14571, 29872, 29896, 29974, 29872, 29906, 511, 13, 9651, 6467, 13, 4706, 9995, 13, 13, 4706, 1375, 29918, 10568, 29918, 2311, 29901, 5785, 353, 1746, 29898, 13, 9651, 2322, 29922, 29900, 29889, 29900, 29900, 29900, 29896, 29892, 13, 9651, 15562, 3790, 13, 18884, 376, 1853, 1115, 376, 2642, 613, 13, 18884, 376, 22377, 1115, 12633, 13, 18884, 376, 12403, 1115, 5852, 29892, 13, 9651, 2981, 13, 4706, 1723, 13, 4706, 13600, 29901, 5785, 353, 1746, 29898, 13, 9651, 2322, 29922, 29900, 29889, 29900, 29900, 29896, 29892, 13, 9651, 15562, 3790, 13, 18884, 376, 1853, 1115, 376, 2642, 613, 13, 18884, 376, 22377, 1115, 12633, 13, 18884, 376, 12403, 1115, 5852, 29892, 13, 9651, 2981, 13, 4706, 1723, 13, 4706, 4236, 29918, 3286, 993, 29918, 955, 25245, 29901, 5785, 353, 1746, 29898, 13, 9651, 2322, 29922, 29900, 29889, 29900, 29896, 29892, 13, 9651, 15562, 3790, 13, 18884, 376, 1853, 1115, 376, 2642, 613, 13, 18884, 376, 22377, 1115, 12633, 13, 18884, 376, 12403, 1115, 5852, 29892, 13, 9651, 2981, 13, 4706, 1723, 13, 4706, 6958, 29901, 28379, 3366, 25847, 1199, 29889, 8942, 2587, 29889, 13443, 3108, 353, 1746, 29898, 13, 9651, 2322, 29922, 8516, 29892, 13, 9651, 15562, 3790, 13, 18884, 376, 1853, 1115, 376, 2642, 613, 13, 18884, 376, 22377, 1115, 12633, 13, 9651, 2981, 13, 4706, 1723, 13, 13, 4706, 732, 1272, 1990, 13, 4706, 770, 22387, 29901, 13, 9651, 9995, 9662, 800, 4034, 4249, 16317, 666, 362, 29892, 1302, 1389, 29889, 13, 13, 9651, 1791, 5008, 29892, 2992, 29889, 308, 270, 353, 16317, 666, 362, 10825, 313, 29896, 29914, 955, 25245, 29897, 308, 325, 29883, 353, 10446, 12885, 313, 955, 25245, 988, 321, 29922, 29872, 29918, 3317, 29897, 308, 325, 29886, 353, 715, 6288, 12885, 313, 9278, 342, 325, 988, 321, 29922, 29872, 29918, 1195, 29897, 669, 1160, 29936, 4141, 29936, 325, 29883, 308, 22680, 1855, 315, 1955, 29922, 29896, 746, 325, 29922, 29900, 29889, 308, 321, 29918, 1195, 353, 2183, 9212, 315, 1955, 29892, 472, 325, 669, 1160, 29936, 4141, 29936, 29922, 325, 29886, 313, 29874, 29889, 29895, 29889, 29874, 29889, 715, 6288, 29918, 1111, 1389, 29918, 5060, 5008, 29897, 308, 270, 353, 24968, 353, 313, 29896, 29899, 29872, 29918, 1195, 6802, 29894, 29886, 308, 6323, 29892, 321, 29918, 1195, 353, 29871, 29896, 448, 270, 29930, 29894, 29886, 308, 321, 29918, 3317, 353, 7472, 315, 1955, 353, 29871, 29896, 29899, 29881, 29930, 7071, 29892, 7450, 472, 325, 29922, 7071, 308, 321, 353, 29871, 29900, 29892, 462, 539, 325, 669, 1160, 29936, 1896, 29936, 29922, 325, 29883, 965, 353, 29871, 29896, 448, 270, 29930, 29894, 29892, 1669, 325, 29883, 669, 1160, 29936, 1896, 29936, 325, 669, 1160, 29936, 1896, 29936, 325, 29886, 965, 353, 321, 29918, 1195, 29892, 462, 259, 325, 669, 1160, 29936, 4141, 29936, 29922, 325, 29886, 3986, 16317, 666, 362, 7329, 353, 270, 29930, 1195, 29898, 29894, 29892, 29894, 29886, 29897, 259, 518, 2388, 492, 424, 29962, 308, 1034, 353, 321, 462, 9651, 518, 8966, 333, 29962, 3986, 422, 2109, 292, 5751, 321, 353, 29871, 29900, 29892, 1669, 321, 29896, 1360, 29872, 29906, 1360, 29900, 462, 3986, 353, 29871, 29906, 29930, 29872, 29896, 29930, 29872, 29906, 14571, 29872, 29896, 29974, 29872, 29906, 511, 6467, 13, 13, 9651, 12662, 2699, 13, 9651, 448, 1378, 29899, 13, 9651, 380, 2593, 2264, 29901, 13109, 6958, 5518, 380, 2593, 2264, 13, 18884, 313, 10118, 29914, 5721, 470, 4842, 802, 29914, 3665, 713, 467, 13, 9651, 16317, 666, 362, 29901, 16317, 666, 362, 10825, 304, 367, 1304, 297, 752, 492, 424, 13, 18884, 6958, 29936, 268, 565, 451, 2183, 372, 338, 13, 18884, 313, 29896, 29899, 1195, 29918, 2616, 6802, 572, 6288, 29918, 6574, 627, 29918, 955, 25245, 13, 9651, 715, 6288, 29918, 1111, 1389, 29918, 5060, 5008, 29901, 445, 338, 278, 315, 1955, 304, 367, 1304, 472, 1880, 13, 18884, 9110, 1907, 363, 12912, 333, 268, 10879, 29879, 29936, 565, 451, 2183, 372, 338, 29871, 29896, 448, 13, 18884, 16317, 666, 362, 29930, 572, 6288, 29918, 6574, 627, 29918, 955, 25245, 13, 9651, 715, 6288, 29918, 6574, 627, 29918, 955, 25245, 29901, 19087, 10879, 12885, 472, 607, 13, 18884, 1375, 315, 1955, 338, 7450, 29936, 731, 539, 304, 5225, 565, 366, 864, 278, 13, 18884, 1375, 315, 1955, 2337, 304, 367, 1304, 13, 9651, 2294, 29918, 1341, 2463, 29901, 2294, 1424, 2463, 313, 2589, 29918, 29879, 29897, 408, 5439, 491, 445, 13, 18884, 6492, 29901, 13, 18884, 1732, 597, 29887, 834, 774, 359, 326, 29889, 990, 29914, 4594, 29914, 2283, 29901, 855, 374, 19645, 29918, 1341, 2463, 29889, 2732, 13, 9651, 7343, 29918, 1341, 2463, 29901, 7343, 1424, 2463, 313, 2589, 29918, 29881, 29897, 408, 5439, 491, 13, 18884, 445, 6492, 29901, 13, 18884, 1732, 597, 29887, 834, 774, 359, 326, 29889, 990, 29914, 4594, 29914, 2283, 29901, 855, 374, 19645, 29918, 1341, 2463, 29889, 2732, 13, 9651, 1998, 29883, 681, 29918, 1341, 2463, 29901, 1998, 29883, 681, 1424, 2463, 313, 2589, 29918, 29894, 29897, 411, 10340, 310, 13, 18884, 313, 29896, 29914, 955, 25245, 29897, 408, 5439, 491, 445, 6492, 29901, 13, 18884, 1732, 597, 29887, 834, 774, 359, 326, 29889, 990, 29914, 4594, 29914, 2283, 29901, 855, 374, 19645, 29918, 1341, 2463, 29889, 2732, 13, 9651, 5712, 29918, 6574, 627, 29918, 17885, 545, 29918, 955, 25245, 29901, 363, 12912, 333, 10879, 29879, 871, 29892, 13, 18884, 10879, 12885, 472, 607, 965, 315, 1955, 338, 731, 304, 5225, 29936, 13, 18884, 12891, 23878, 515, 5534, 2322, 541, 508, 13, 18884, 367, 20831, 1145, 1244, 29889, 422, 2109, 292, 5751, 29901, 671, 7200, 12885, 13, 9651, 5712, 29918, 303, 2463, 29918, 20543, 29918, 955, 25245, 29901, 910, 338, 278, 10150, 13, 18884, 269, 3466, 12885, 472, 607, 9651, 591, 29915, 645, 2050, 263, 13, 18884, 9558, 304, 380, 2463, 29889, 5655, 635, 23878, 13, 18884, 515, 263, 5534, 2322, 4444, 29889, 1152, 263, 9126, 1424, 2463, 13, 18884, 1904, 9651, 445, 338, 278, 12885, 472, 607, 278, 4236, 13, 18884, 2294, 1424, 2463, 4889, 9651, 338, 7450, 29889, 29871, 422, 2109, 292, 13, 18884, 5751, 29901, 671, 7200, 12885, 13, 9651, 9995, 13, 13, 9651, 380, 2593, 2264, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29889, 29900, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 16317, 666, 362, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29896, 29900, 29900, 29889, 29900, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 715, 6288, 29918, 1111, 1389, 29918, 5060, 5008, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29945, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 715, 6288, 29918, 6574, 627, 29918, 955, 25245, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29945, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 2294, 29918, 1341, 2463, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29929, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 7343, 29918, 1341, 2463, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29929, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 1998, 29883, 681, 29918, 1341, 2463, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29900, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 5712, 29918, 6574, 627, 29918, 17885, 545, 29918, 955, 25245, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29900, 29900, 29896, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 5712, 29918, 303, 2463, 29918, 20543, 29918, 955, 25245, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29900, 29900, 29896, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 13, 1678, 732, 1272, 1990, 13, 1678, 770, 8313, 1026, 29901, 13, 4706, 9995, 13, 4706, 8313, 1026, 2702, 17558, 4426, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 899, 369, 29901, 13, 4706, 11938, 29901, 8313, 1026, 7276, 4128, 29889, 13, 4706, 9995, 13, 13, 4706, 899, 369, 29901, 28379, 3366, 25847, 1199, 29889, 29933, 352, 1026, 29889, 13296, 369, 3108, 353, 1746, 29898, 13, 9651, 2322, 29922, 8516, 29892, 13, 9651, 15562, 3790, 13, 18884, 376, 1853, 1115, 376, 2642, 613, 13, 18884, 376, 22377, 1115, 12633, 13, 18884, 376, 12403, 1115, 5852, 29892, 13, 9651, 2981, 13, 4706, 1723, 13, 4706, 11938, 29901, 28379, 3366, 25847, 1199, 29889, 29933, 352, 1026, 29889, 27427, 3108, 353, 1746, 29898, 13, 9651, 2322, 29922, 8516, 29892, 13, 9651, 15562, 3790, 13, 18884, 376, 1853, 1115, 376, 2642, 613, 13, 18884, 376, 22377, 1115, 12633, 13, 18884, 376, 12403, 1115, 5852, 29892, 13, 9651, 2981, 13, 4706, 1723, 13, 13, 4706, 732, 1272, 1990, 13, 4706, 770, 4956, 369, 29901, 13, 9651, 9995, 13, 9651, 12662, 2699, 13, 9651, 448, 1378, 29899, 13, 9651, 1134, 29901, 3118, 310, 278, 1494, 4072, 29901, 8617, 2556, 29918, 6574, 19994, 871, 29889, 13, 9651, 1375, 29918, 10568, 29918, 2311, 29901, 450, 931, 14385, 607, 3061, 2925, 411, 1269, 13, 18884, 12541, 310, 278, 19753, 6012, 29892, 445, 756, 304, 367, 694, 13, 18884, 16600, 1135, 4236, 29918, 10568, 29918, 2311, 1090, 17558, 2908, 29889, 29871, 960, 2175, 13, 18884, 443, 6550, 2164, 29892, 1375, 29918, 10568, 29918, 2311, 21274, 304, 4236, 29918, 10568, 29918, 2311, 29889, 13, 9651, 372, 414, 29901, 9681, 310, 24372, 363, 1269, 4331, 29889, 319, 6133, 1353, 13, 18884, 13880, 7621, 13600, 472, 263, 4180, 3438, 29889, 13, 9651, 7319, 29901, 3789, 278, 2551, 573, 975, 29899, 27480, 362, 3443, 29889, 13, 9651, 9995, 13, 13, 9651, 1134, 29901, 851, 353, 1746, 29898, 13, 18884, 2322, 543, 6831, 2556, 29918, 6574, 19994, 613, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 1375, 29918, 10568, 29918, 2311, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29900, 29900, 29900, 29896, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 372, 414, 29901, 938, 353, 1746, 29898, 13, 18884, 2322, 29922, 29945, 29900, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 7319, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29896, 29889, 29941, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 13, 4706, 732, 1272, 1990, 13, 4706, 770, 1281, 4151, 9466, 29901, 13, 9651, 9995, 13, 9651, 8313, 1026, 7276, 4128, 29889, 13, 13, 9651, 12662, 2699, 13, 9651, 448, 1378, 29899, 13, 9651, 274, 24826, 29901, 1281, 4151, 524, 4889, 24907, 3443, 29889, 2823, 278, 438, 2287, 1813, 363, 13, 18884, 901, 2472, 29889, 13, 9651, 604, 29886, 29901, 4829, 20376, 3443, 29889, 2823, 278, 438, 2287, 1813, 363, 901, 13, 18884, 2472, 29889, 13, 9651, 6958, 29918, 7610, 2161, 29918, 13148, 29901, 450, 10809, 310, 278, 7101, 7546, 2820, 13, 18884, 599, 16303, 3618, 29889, 22387, 29879, 526, 6068, 304, 28169, 964, 13, 18884, 278, 7101, 7546, 701, 304, 278, 2183, 10809, 1434, 6421, 304, 13, 18884, 1791, 29889, 450, 2322, 995, 338, 5225, 29889, 512, 1037, 5832, 445, 304, 777, 13, 18884, 2319, 995, 313, 29872, 29889, 29887, 29889, 29871, 29900, 29889, 29900, 29900, 29896, 29897, 508, 1371, 5557, 432, 5171, 292, 13, 18884, 4828, 2861, 304, 25957, 1641, 28424, 1754, 322, 13, 18884, 9391, 29889, 13, 9651, 6219, 29918, 6574, 19994, 29901, 13999, 304, 438, 2287, 29915, 29879, 4236, 29918, 955, 5314, 29889, 2823, 13, 18884, 1732, 597, 2676, 29889, 10867, 29889, 990, 29914, 2676, 29914, 29906, 29900, 29896, 29906, 29900, 29946, 29941, 29900, 29896, 29945, 29945, 29953, 29941, 29945, 29914, 1124, 597, 18850, 25105, 29889, 990, 29914, 9799, 4594, 29899, 29896, 29889, 29945, 29889, 29947, 29914, 2248, 29889, 1961, 29914, 29933, 29873, 13443, 13296, 369, 3401, 29937, 18772, 29918, 24192, 19994, 13, 18884, 363, 901, 2472, 29889, 13, 9651, 6219, 29918, 6574, 19994, 29918, 2238, 18184, 362, 29918, 386, 12268, 29901, 13999, 304, 438, 2287, 29915, 29879, 13, 18884, 4236, 29918, 955, 5314, 29889, 29871, 2823, 13, 18884, 1732, 597, 2676, 29889, 10867, 29889, 990, 29914, 2676, 29914, 29906, 29900, 29896, 29906, 29900, 29946, 29941, 29900, 29896, 29945, 29945, 29953, 29941, 29945, 29914, 1124, 597, 18850, 25105, 29889, 990, 29914, 9799, 4594, 29899, 29896, 29889, 29945, 29889, 29947, 29914, 2248, 29889, 1961, 29914, 29933, 29873, 13443, 13296, 369, 3401, 29937, 18772, 29918, 24192, 19994, 13, 18884, 363, 901, 2472, 29889, 13, 9651, 9995, 13, 13, 9651, 274, 24826, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29900, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 604, 29886, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29906, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 6958, 29918, 7610, 2161, 29918, 13148, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29900, 29900, 29896, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 6219, 29918, 6574, 19994, 29901, 6120, 353, 1746, 29898, 13, 18884, 2322, 29922, 5574, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 6219, 29918, 6574, 19994, 29918, 2238, 18184, 362, 29918, 386, 12268, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 10457, 29900, 29889, 29900, 29896, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 13, 1678, 732, 1272, 1990, 13, 1678, 770, 438, 311, 29901, 13, 4706, 9995, 13, 4706, 438, 2287, 2702, 17558, 4426, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 899, 369, 29901, 13, 4706, 11938, 29901, 438, 2287, 7276, 4128, 29889, 13, 4706, 9995, 13, 13, 4706, 899, 369, 29901, 28379, 3366, 25847, 1199, 29889, 29949, 311, 29889, 13296, 369, 3108, 353, 1746, 29898, 13, 9651, 2322, 29922, 8516, 29892, 13, 9651, 15562, 3790, 13, 18884, 376, 1853, 1115, 376, 2642, 613, 13, 18884, 376, 22377, 1115, 12633, 13, 18884, 376, 12403, 1115, 5852, 29892, 13, 9651, 2981, 13, 4706, 1723, 13, 4706, 11938, 29901, 28379, 3366, 25847, 1199, 29889, 29949, 311, 29889, 27427, 3108, 353, 1746, 29898, 13, 9651, 2322, 29922, 8516, 29892, 13, 9651, 15562, 3790, 13, 18884, 376, 1853, 1115, 376, 2642, 613, 13, 18884, 376, 22377, 1115, 12633, 13, 18884, 376, 12403, 1115, 5852, 29892, 13, 9651, 2981, 13, 4706, 1723, 13, 13, 4706, 732, 1272, 1990, 13, 4706, 770, 4956, 369, 29901, 13, 9651, 9995, 13, 9651, 12662, 2699, 13, 9651, 448, 1378, 29899, 13, 9651, 1134, 29901, 3118, 310, 278, 1494, 4072, 29901, 3186, 29892, 4996, 13, 9651, 1375, 29918, 10568, 29918, 2311, 29901, 450, 931, 14385, 607, 3061, 2925, 411, 1269, 13, 18884, 12541, 310, 278, 19753, 6012, 29892, 445, 756, 304, 367, 694, 13, 18884, 16600, 1135, 4236, 29918, 10568, 29918, 2311, 1090, 17558, 2908, 29889, 29871, 960, 2175, 13, 18884, 443, 6550, 2164, 29892, 1375, 29918, 10568, 29918, 2311, 21274, 304, 4236, 29918, 10568, 29918, 2311, 29889, 13, 9651, 372, 414, 29901, 9681, 310, 24372, 363, 1269, 4331, 29889, 319, 6133, 1353, 13, 18884, 13880, 7621, 13600, 472, 263, 4180, 3438, 29889, 13, 9651, 758, 535, 29918, 277, 414, 29901, 1222, 27910, 3443, 29889, 13, 9651, 7319, 29901, 3789, 278, 2551, 573, 975, 29899, 27480, 362, 3443, 29889, 13, 9651, 671, 29918, 16626, 29918, 4346, 29875, 29918, 690, 1052, 292, 29901, 28697, 304, 9025, 7343, 620, 1052, 292, 13, 18884, 310, 3256, 310, 297, 814, 423, 297, 1040, 22042, 18112, 29889, 13, 18884, 2823, 12642, 774, 29877, 8206, 2009, 29871, 29896, 29896, 29896, 29946, 363, 278, 5314, 310, 13, 18884, 445, 4682, 29889, 965, 2045, 597, 359, 9600, 29899, 13, 18884, 20332, 29889, 3292, 29889, 601, 29914, 29887, 834, 774, 29877, 29899, 12443, 29899, 12292, 8484, 14708, 359, 9600, 29914, 29887, 834, 774, 29877, 29914, 26746, 29899, 13, 18884, 2009, 29914, 29896, 29896, 29896, 29946, 13, 9651, 9995, 13, 13, 9651, 1134, 29901, 851, 353, 1746, 29898, 13, 18884, 2322, 543, 24561, 613, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 1375, 29918, 10568, 29918, 2311, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29900, 29900, 29900, 29896, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 372, 414, 29901, 938, 353, 1746, 29898, 13, 18884, 2322, 29922, 29945, 29900, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 758, 535, 29918, 277, 414, 29901, 938, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 7319, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29896, 29889, 29941, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 671, 29918, 16626, 29918, 4346, 29875, 29918, 690, 1052, 292, 29901, 6120, 353, 1746, 29898, 13, 18884, 2322, 29922, 8824, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 13, 4706, 732, 1272, 1990, 13, 4706, 770, 1281, 4151, 9466, 29901, 13, 9651, 9995, 13, 9651, 438, 2287, 7276, 4128, 29889, 13, 13, 9651, 12662, 2699, 13, 9651, 448, 1378, 29899, 13, 9651, 274, 24826, 29901, 1281, 4151, 524, 4889, 24907, 3443, 29889, 2823, 278, 438, 2287, 1813, 363, 13, 18884, 901, 2472, 29889, 13, 9651, 604, 29886, 29901, 4829, 20376, 3443, 29889, 2823, 278, 438, 2287, 1813, 363, 901, 13, 18884, 2472, 29889, 13, 9651, 6958, 29918, 3317, 29918, 15728, 292, 29918, 955, 29901, 450, 7472, 1959, 292, 13, 18884, 9110, 1907, 6068, 746, 3770, 1747, 25957, 29889, 13, 9651, 6958, 29918, 7610, 2161, 29918, 13148, 29901, 450, 10809, 310, 278, 7101, 7546, 2820, 13, 18884, 599, 16303, 3618, 29889, 22387, 29879, 526, 6068, 304, 28169, 964, 13, 18884, 278, 7101, 7546, 701, 304, 278, 2183, 10809, 1434, 6421, 304, 13, 18884, 1791, 29889, 450, 2322, 995, 338, 5225, 29889, 512, 1037, 5832, 445, 304, 777, 13, 18884, 2319, 995, 313, 29872, 29889, 29887, 29889, 29871, 29900, 29889, 29900, 29900, 29896, 29897, 508, 1371, 5557, 432, 5171, 292, 13, 18884, 4828, 2861, 304, 25957, 1641, 28424, 1754, 322, 13, 18884, 9391, 29889, 13, 9651, 9995, 13, 13, 9651, 274, 24826, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29900, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 604, 29886, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29906, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 6958, 29918, 3317, 29918, 15728, 292, 29918, 955, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29896, 29900, 29900, 29889, 29900, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 9651, 6958, 29918, 7610, 2161, 29918, 13148, 29901, 5785, 353, 1746, 29898, 13, 18884, 2322, 29922, 29900, 29889, 29900, 29900, 29896, 29892, 13, 18884, 15562, 3790, 13, 462, 1678, 376, 1853, 1115, 376, 2642, 613, 13, 462, 1678, 376, 22377, 1115, 12633, 13, 462, 1678, 376, 12403, 1115, 5852, 29892, 13, 18884, 2981, 13, 9651, 1723, 13, 2 ]
server/routes/courses/courses_auth.py
giuseppe998e/unito-ium
0
77891
#!/usr/bin/python3 import sqlite3 from flask import Blueprint, request, abort, make_response from modules import simple_jwt from modules.database import get_db_conn from modules.utils import logged_before_request, get_role_perms from server_error import server_error route_courses_auth = Blueprint('route_courses_auth', __name__) route_courses_auth.before_request(logged_before_request) # Check for login # -------------------------- # Create new course # -------------------------- @route_courses_auth.route('/courses', methods=['POST']) def course_add(): token_data = simple_jwt.read(request.headers.get('Authorization').split(' ')[1]) user_perms = get_role_perms(token_data.get('user')) req_data = request.get_json() if req_data: if user_perms.get('course_add', 0): with get_db_conn() as database: try: cursor = database.cursor() cursor.execute("""INSERT INTO courses (name) VALUES (?)""", [req_data.get('name')]) last_id_inserted = cursor.lastrowid database.commit() result = make_response({'ok': True, 'data': last_id_inserted}, 200) except sqlite3.Error as e: database.rollback() result = abort(500) print(e) finally: cursor.close() return result return abort(401) return abort(400) # -------------------------- # # -------------------------- @route_courses_auth.route('/courses/<int:course_id>', methods=['PUT']) def course_update(course_id: int): token_data = simple_jwt.read(request.headers.get('Authorization').split(' ')[1]) user_perms = get_role_perms(token_data.get('role')) req_data = request.get_json() if req_data: if user_perms.get('course_update', 0): with get_db_conn() as database: try: cursor = database.cursor() cursor.execute('UPDATE courses SET name = ? WHERE id = ?', [req_data.get('name'), course_id]) database.commit() result = make_response({'ok': True}, 200) except sqlite3.Error: database.rollback() result = server_error('COURSE_NOT_FOUND') finally: cursor.close() return result return abort(401) return abort(400) # -------------------------- # # -------------------------- @route_courses_auth.route('/courses/<int:course_id>', methods=['DELETE']) def course_remove(course_id: int): token_data = simple_jwt.read(request.headers.get('Authorization').split(' ')[1]) user_perms = get_role_perms(token_data.get('role')) if user_perms.get('course_delete', 0): with get_db_conn() as database: try: cursor = database.cursor() cursor.execute('DELETE FROM courses WHERE id = ?', [course_id]) database.commit() result = make_response({'ok': True}, 200) except sqlite3.Error: database.rollback() result = server_error('COURSE_NOT_FOUND') finally: cursor.close() return result return abort(401)
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 29941, 13, 5215, 21120, 29941, 13, 13, 3166, 29784, 1053, 10924, 2158, 29892, 2009, 29892, 27450, 29892, 1207, 29918, 5327, 13, 13, 3166, 10585, 1053, 2560, 29918, 29926, 14554, 13, 3166, 10585, 29889, 9803, 1053, 679, 29918, 2585, 29918, 13082, 13, 3166, 10585, 29889, 13239, 1053, 13817, 29918, 11083, 29918, 3827, 29892, 679, 29918, 12154, 29918, 546, 1516, 13, 3166, 1923, 29918, 2704, 1053, 1923, 29918, 2704, 13, 13, 13134, 29918, 29883, 29781, 29918, 5150, 353, 10924, 2158, 877, 13134, 29918, 29883, 29781, 29918, 5150, 742, 4770, 978, 1649, 29897, 13, 13134, 29918, 29883, 29781, 29918, 5150, 29889, 11083, 29918, 3827, 29898, 1188, 3192, 29918, 11083, 29918, 3827, 29897, 29871, 396, 5399, 363, 6464, 13, 13, 13, 29937, 448, 2683, 1378, 29899, 13, 29937, 6204, 716, 3236, 13, 29937, 448, 2683, 1378, 29899, 13, 29992, 13134, 29918, 29883, 29781, 29918, 5150, 29889, 13134, 11219, 29883, 29781, 742, 3519, 29922, 1839, 5438, 11287, 13, 1753, 3236, 29918, 1202, 7295, 13, 1678, 5993, 29918, 1272, 353, 2560, 29918, 29926, 14554, 29889, 949, 29898, 3827, 29889, 13662, 29889, 657, 877, 25471, 2824, 5451, 877, 525, 9601, 29896, 2314, 13, 1678, 1404, 29918, 546, 1516, 353, 679, 29918, 12154, 29918, 546, 1516, 29898, 6979, 29918, 1272, 29889, 657, 877, 1792, 8785, 13, 1678, 12428, 29918, 1272, 353, 2009, 29889, 657, 29918, 3126, 580, 13, 1678, 565, 12428, 29918, 1272, 29901, 13, 4706, 565, 1404, 29918, 546, 1516, 29889, 657, 877, 15775, 29918, 1202, 742, 29871, 29900, 1125, 13, 9651, 411, 679, 29918, 2585, 29918, 13082, 580, 408, 2566, 29901, 13, 18884, 1018, 29901, 13, 462, 1678, 10677, 353, 2566, 29889, 18127, 580, 13, 462, 1678, 10677, 29889, 7978, 703, 15945, 19460, 11646, 21888, 313, 978, 29897, 15673, 22308, 5513, 29908, 613, 518, 7971, 29918, 1272, 29889, 657, 877, 978, 1495, 2314, 13, 462, 1678, 1833, 29918, 333, 29918, 7851, 287, 353, 10677, 29889, 4230, 798, 333, 13, 462, 1678, 2566, 29889, 15060, 580, 13, 462, 1678, 1121, 353, 1207, 29918, 5327, 3319, 29915, 554, 2396, 5852, 29892, 525, 1272, 2396, 1833, 29918, 333, 29918, 7851, 287, 1118, 29871, 29906, 29900, 29900, 29897, 13, 18884, 5174, 21120, 29941, 29889, 2392, 408, 321, 29901, 13, 462, 1678, 2566, 29889, 1245, 1627, 580, 13, 462, 1678, 1121, 353, 27450, 29898, 29945, 29900, 29900, 29897, 13, 462, 1678, 1596, 29898, 29872, 29897, 13, 18884, 7146, 29901, 13, 462, 1678, 10677, 29889, 5358, 580, 13, 9651, 736, 1121, 13, 13, 4706, 736, 27450, 29898, 29946, 29900, 29896, 29897, 13, 1678, 736, 27450, 29898, 29946, 29900, 29900, 29897, 13, 13, 13, 29937, 448, 2683, 1378, 29899, 13, 29937, 13, 29937, 448, 2683, 1378, 29899, 13, 29992, 13134, 29918, 29883, 29781, 29918, 5150, 29889, 13134, 11219, 29883, 29781, 29914, 29966, 524, 29901, 15775, 29918, 333, 29958, 742, 3519, 29922, 1839, 12336, 11287, 13, 1753, 3236, 29918, 5504, 29898, 15775, 29918, 333, 29901, 938, 1125, 13, 1678, 5993, 29918, 1272, 353, 2560, 29918, 29926, 14554, 29889, 949, 29898, 3827, 29889, 13662, 29889, 657, 877, 25471, 2824, 5451, 877, 525, 9601, 29896, 2314, 13, 1678, 1404, 29918, 546, 1516, 353, 679, 29918, 12154, 29918, 546, 1516, 29898, 6979, 29918, 1272, 29889, 657, 877, 12154, 8785, 13, 1678, 12428, 29918, 1272, 353, 2009, 29889, 657, 29918, 3126, 580, 13, 1678, 565, 12428, 29918, 1272, 29901, 13, 4706, 565, 1404, 29918, 546, 1516, 29889, 657, 877, 15775, 29918, 5504, 742, 29871, 29900, 1125, 13, 9651, 411, 679, 29918, 2585, 29918, 13082, 580, 408, 2566, 29901, 13, 18884, 1018, 29901, 13, 462, 1678, 10677, 353, 2566, 29889, 18127, 580, 13, 462, 1678, 10677, 29889, 7978, 877, 14474, 21888, 11368, 1024, 353, 1577, 5754, 1178, 353, 1577, 742, 518, 7971, 29918, 1272, 29889, 657, 877, 978, 5477, 3236, 29918, 333, 2314, 13, 462, 1678, 2566, 29889, 15060, 580, 13, 462, 1678, 1121, 353, 1207, 29918, 5327, 3319, 29915, 554, 2396, 5852, 1118, 29871, 29906, 29900, 29900, 29897, 13, 18884, 5174, 21120, 29941, 29889, 2392, 29901, 13, 462, 1678, 2566, 29889, 1245, 1627, 580, 13, 462, 1678, 1121, 353, 1923, 29918, 2704, 877, 3217, 4574, 1660, 29918, 12256, 29918, 5800, 18783, 1495, 13, 18884, 7146, 29901, 13, 462, 1678, 10677, 29889, 5358, 580, 13, 9651, 736, 1121, 13, 4706, 736, 27450, 29898, 29946, 29900, 29896, 29897, 13, 1678, 736, 27450, 29898, 29946, 29900, 29900, 29897, 13, 13, 13, 29937, 448, 2683, 1378, 29899, 13, 29937, 13, 29937, 448, 2683, 1378, 29899, 13, 29992, 13134, 29918, 29883, 29781, 29918, 5150, 29889, 13134, 11219, 29883, 29781, 29914, 29966, 524, 29901, 15775, 29918, 333, 29958, 742, 3519, 29922, 1839, 2287, 18476, 11287, 13, 1753, 3236, 29918, 5992, 29898, 15775, 29918, 333, 29901, 938, 1125, 13, 1678, 5993, 29918, 1272, 353, 2560, 29918, 29926, 14554, 29889, 949, 29898, 3827, 29889, 13662, 29889, 657, 877, 25471, 2824, 5451, 877, 525, 9601, 29896, 2314, 13, 1678, 1404, 29918, 546, 1516, 353, 679, 29918, 12154, 29918, 546, 1516, 29898, 6979, 29918, 1272, 29889, 657, 877, 12154, 8785, 13, 1678, 565, 1404, 29918, 546, 1516, 29889, 657, 877, 15775, 29918, 8143, 742, 29871, 29900, 1125, 13, 4706, 411, 679, 29918, 2585, 29918, 13082, 580, 408, 2566, 29901, 13, 9651, 1018, 29901, 13, 18884, 10677, 353, 2566, 29889, 18127, 580, 13, 18884, 10677, 29889, 7978, 877, 2287, 18476, 3895, 21888, 5754, 1178, 353, 1577, 742, 518, 15775, 29918, 333, 2314, 13, 18884, 2566, 29889, 15060, 580, 13, 18884, 1121, 353, 1207, 29918, 5327, 3319, 29915, 554, 2396, 5852, 1118, 29871, 29906, 29900, 29900, 29897, 13, 9651, 5174, 21120, 29941, 29889, 2392, 29901, 13, 18884, 2566, 29889, 1245, 1627, 580, 13, 18884, 1121, 353, 1923, 29918, 2704, 877, 3217, 4574, 1660, 29918, 12256, 29918, 5800, 18783, 1495, 13, 9651, 7146, 29901, 13, 18884, 10677, 29889, 5358, 580, 13, 4706, 736, 1121, 13, 1678, 736, 27450, 29898, 29946, 29900, 29896, 29897, 13, 2 ]
players/human.py
pikatyuu/deep-learning-othello
0
14339
class Human(): def __init__(self, name="Human"): self.name = name def action(self, game): safe_input = False while not safe_input: pos = input("choose a position: ") if pos == "draw": game.draw() elif pos == "exit": import sys sys.exit() elif pos == "movable": print(game.movable) elif len(pos) == 2: clone = game.clone() pos = tuple(map(int, tuple(pos))) if clone.can_play(pos): safe_input = True else: print("// Error: Can't put it down //") else: print("Error: Invaild input") return game.play(pos) def game_finished(self, game): pass def all_game_finished(self): pass
[ 1, 770, 12968, 7295, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1024, 543, 29950, 7889, 29908, 1125, 13, 4706, 1583, 29889, 978, 353, 1024, 13, 13, 1678, 822, 3158, 29898, 1311, 29892, 3748, 1125, 13, 4706, 9109, 29918, 2080, 353, 7700, 13, 4706, 1550, 451, 9109, 29918, 2080, 29901, 13, 9651, 926, 353, 1881, 703, 21803, 263, 2602, 29901, 16521, 13, 9651, 565, 926, 1275, 376, 4012, 1115, 13, 18884, 3748, 29889, 4012, 580, 13, 9651, 25342, 926, 1275, 376, 13322, 1115, 13, 18884, 1053, 10876, 13, 18884, 10876, 29889, 13322, 580, 13, 9651, 25342, 926, 1275, 376, 13529, 519, 1115, 13, 18884, 1596, 29898, 11802, 29889, 13529, 519, 29897, 13, 9651, 25342, 7431, 29898, 1066, 29897, 1275, 29871, 29906, 29901, 13, 18884, 17432, 353, 3748, 29889, 16513, 580, 13, 18884, 926, 353, 18761, 29898, 1958, 29898, 524, 29892, 18761, 29898, 1066, 4961, 13, 18884, 565, 17432, 29889, 3068, 29918, 1456, 29898, 1066, 1125, 13, 462, 1678, 9109, 29918, 2080, 353, 5852, 13, 18884, 1683, 29901, 13, 462, 1678, 1596, 703, 458, 4829, 29901, 1815, 29915, 29873, 1925, 372, 1623, 849, 1159, 13, 9651, 1683, 29901, 13, 18884, 1596, 703, 2392, 29901, 15518, 737, 29881, 1881, 1159, 13, 4706, 736, 3748, 29889, 1456, 29898, 1066, 29897, 13, 13, 1678, 822, 3748, 29918, 4951, 3276, 29898, 1311, 29892, 3748, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 599, 29918, 11802, 29918, 4951, 3276, 29898, 1311, 1125, 13, 4706, 1209, 13, 2 ]
octopus/blocktopus/blocks/machines.py
richardingham/octopus
12
1608389
# Package Imports from ..workspace import Block, Disconnected, Cancelled # Twisted Imports from twisted.internet import reactor, defer, task from twisted.python import log # Octopus Imports from octopus import data from octopus.constants import State import octopus.transport.basic # Do not auto-register these classes __exclude_blocks__ = [ "connection_declaration", "machine_declaration", ] class connection_declaration (Block): pass class machine_declaration (Block): def _varName (self, name = None): return "global.machine::" + (name or self.fields['NAME']) def created (self): @self.on('value-changed') def onVarNameChanged (data): if not (data["block"] is self and data["field"] == 'NAME'): return self.workspace.variables.rename(data["oldValue"], data["newValue"]) def _run (self): @defer.inlineCallbacks def _connect (): connection = yield self.getInputValue('CONNECTION', None) if connection is None: raise Exception("No connection specified for machine '{:s}'".format(self.fields['NAME'])) cls = self.getMachineClass() self.machine = cls( connection, alias = self.fields['NAME'], **self.getMachineParams() ) self.workspace.variables.add(self._varName(), self.machine) try: result = yield self.machine.waitUntilReady() except Exception as e: print ("Machine connection error: " + str(e)) raise e print ("Machine block: connection complete to " + str(self.machine)) self.workspace.on("workspace-stopped", self._onWorkspaceStopped) self.workspace.on("workspace-paused", self._onWorkspacePaused) self.workspace.on("workspace-resumed", self._onWorkspaceResumed) # Short delay to allow the machine to get its first data # TODO - machines should only return ready when they # have received their first data. # TODO - make reset configurable. yield defer.gatherResults([ task.deferLater(reactor, 2, lambda: result), self.machine.reset() ]) return _connect() def _onWorkspaceStopped (self, data): print ("Machine block: terminating connection to " + str(self.machine)) self.workspace.off("workspace-stopped", self._onWorkspaceStopped) self.workspace.off("workspace-paused", self._onWorkspacePaused) self.workspace.off("workspace-resumed", self._onWorkspaceResumed) self.machine.stop() self.workspace.variables.remove(self._varName()) def _disconnect (machine): try: machine.disconnect() except AttributeError: pass except: log.err() # Allow some time for any remaining messages to be received. reactor.callLater(2, _disconnect, self.machine) self.machine = None def _onWorkspacePaused (self, data): self.machine.pause() def _onWorkspaceResumed (self, data): self.machine.resume() def getMachineClass (self): raise NotImplementedError() def getMachineParams (self): return {} def getGlobalDeclarationNames (self): name = self._varName() return Block.getGlobalDeclarationNames(self, [name] if not self.disabled else [] ) class machine_knauer_K120 (machine_declaration): def getMachineClass (self): from octopus.manufacturer import knauer return knauer.K120 class machine_knauer_S100 (machine_declaration): def getMachineClass (self): from octopus.manufacturer import knauer return knauer.S100 class machine_vici_multivalve (machine_declaration): def getMachineClass (self): from octopus.manufacturer import vici return vici.MultiValve class machine_mt_icir (machine_declaration): def getMachineClass (self): from octopus.manufacturer import mt return mt.ICIR def getMachineParams (self): import json try: return { "stream_names": json.loads(self.mutation)['stream_names'] } except (ValueError, KeyError): return {} class machine_phidgets_phsensor (machine_declaration): def getMachineClass (self): from octopus.manufacturer import phidgets return phidgets.PHSensor def getMachineParams (self): import json try: return { "min_change": float(json.loads(self.mutation)['min_change']) } except (ValueError, KeyError): return {} class machine_omega_hh306a (machine_declaration): def getMachineClass (self): from octopus.manufacturer import omega return omega.HH306A class machine_harvard_phd2000 (machine_declaration): def getMachineClass (self): from octopus.manufacturer import harvard return harvard.PHD2000Infuser def getMachineParams (self): import json try: return { "syringe_diameter": int(json.loads(self.mutation)['syringe_diameter']) } except (ValueError, KeyError): return {} class machine_mt_sics_balance (machine_declaration): def getMachineClass (self): from octopus.manufacturer import mt return mt.SICSBalance class machine_startech_powerremotecontrol (machine_declaration): def getMachineClass (self): from octopus.manufacturer import startech return startech.PowerRemoteControl class machine_gilson_FractionCollector203B (machine_declaration): def getMachineClass (self): from octopus.manufacturer import gilson return gilson.FractionCollector203B class connection_tcp (connection_declaration): def eval (self): return defer.succeed(octopus.transport.basic.tcp( str(self.fields['HOST']), int(self.fields['PORT']) )) class connection_serial (connection_declaration): def eval (self): return defer.succeed(octopus.transport.basic.serial( str(self.fields['PORT']), baudrate = int(self.fields['BAUD']) )) class connection_phidget (connection_declaration): def eval (self): from octopus.transport.phidgets import Phidget return defer.succeed(Phidget( int(self.fields['ID']), ))
[ 1, 396, 22029, 1954, 4011, 13, 3166, 6317, 1287, 3493, 1053, 15658, 29892, 3295, 18045, 29892, 1815, 2242, 839, 13, 13, 29937, 8168, 12652, 1954, 4011, 13, 3166, 3252, 12652, 29889, 14168, 300, 1053, 337, 7168, 29892, 316, 571, 29892, 3414, 13, 3166, 3252, 12652, 29889, 4691, 1053, 1480, 13, 13, 29937, 4756, 26466, 1954, 4011, 13, 3166, 4725, 26466, 1053, 848, 13, 3166, 4725, 26466, 29889, 3075, 1934, 1053, 4306, 13, 5215, 4725, 26466, 29889, 27882, 29889, 16121, 13, 13, 29937, 1938, 451, 4469, 29899, 9573, 1438, 4413, 13, 1649, 735, 2325, 29918, 1271, 29879, 1649, 353, 518, 13, 12, 29908, 9965, 29918, 311, 16544, 362, 613, 13, 12, 29908, 23523, 29918, 311, 16544, 362, 613, 13, 29962, 13, 13, 13, 1990, 3957, 29918, 311, 16544, 362, 313, 7445, 1125, 13, 12, 3364, 13, 13, 13, 1990, 4933, 29918, 311, 16544, 362, 313, 7445, 1125, 13, 12, 1753, 903, 1707, 1170, 313, 1311, 29892, 1024, 353, 6213, 1125, 13, 12, 12, 2457, 376, 10945, 29889, 23523, 1057, 29908, 718, 313, 978, 470, 1583, 29889, 9621, 1839, 5813, 11287, 13, 13, 12, 1753, 2825, 313, 1311, 1125, 13, 12, 12, 29992, 1311, 29889, 265, 877, 1767, 29899, 15033, 1495, 13, 12, 12, 1753, 373, 9037, 1170, 7590, 313, 1272, 1125, 13, 12, 12, 12, 361, 451, 313, 1272, 3366, 1271, 3108, 338, 1583, 322, 848, 3366, 2671, 3108, 1275, 525, 5813, 29374, 13, 12, 12, 12, 12, 2457, 13, 13, 12, 12, 12, 1311, 29889, 1287, 3493, 29889, 20897, 29889, 1267, 420, 29898, 1272, 3366, 1025, 1917, 12436, 848, 3366, 1482, 1917, 20068, 13, 13, 12, 1753, 903, 3389, 313, 1311, 1125, 13, 12, 12, 29992, 311, 571, 29889, 14764, 10717, 29879, 13, 12, 12, 1753, 903, 6915, 313, 1125, 13, 12, 12, 12, 9965, 353, 7709, 1583, 29889, 657, 4290, 1917, 877, 6007, 8186, 9838, 742, 6213, 29897, 13, 13, 12, 12, 12, 361, 3957, 338, 6213, 29901, 13, 12, 12, 12, 12, 22692, 8960, 703, 3782, 3957, 6790, 363, 4933, 22372, 29901, 29879, 10162, 1642, 4830, 29898, 1311, 29889, 9621, 1839, 5813, 25901, 13, 13, 12, 12, 12, 25932, 353, 1583, 29889, 657, 29076, 2385, 580, 13, 12, 12, 12, 1311, 29889, 23523, 353, 1067, 29879, 29898, 13, 12, 12, 12, 12, 9965, 29892, 13, 12, 12, 12, 12, 19973, 353, 1583, 29889, 9621, 1839, 5813, 7464, 13, 12, 12, 12, 12, 1068, 1311, 29889, 657, 29076, 9629, 580, 13, 12, 12, 12, 29897, 13, 12, 12, 12, 1311, 29889, 1287, 3493, 29889, 20897, 29889, 1202, 29898, 1311, 3032, 1707, 1170, 3285, 1583, 29889, 23523, 29897, 13, 13, 12, 12, 12, 2202, 29901, 13, 12, 12, 12, 12, 2914, 353, 7709, 1583, 29889, 23523, 29889, 10685, 29965, 20233, 28181, 580, 13, 12, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 12, 2158, 4852, 29076, 3957, 1059, 29901, 376, 718, 851, 29898, 29872, 876, 13, 12, 12, 12, 12, 22692, 321, 13, 13, 12, 12, 12, 2158, 4852, 29076, 2908, 29901, 3957, 4866, 304, 376, 718, 851, 29898, 1311, 29889, 23523, 876, 13, 13, 12, 12, 12, 1311, 29889, 1287, 3493, 29889, 265, 703, 1287, 3493, 29899, 7864, 2986, 613, 1583, 3032, 265, 5531, 3493, 20754, 2986, 29897, 13, 12, 12, 12, 1311, 29889, 1287, 3493, 29889, 265, 703, 1287, 3493, 29899, 29886, 15244, 613, 1583, 3032, 265, 5531, 3493, 29925, 15244, 29897, 13, 12, 12, 12, 1311, 29889, 1287, 3493, 29889, 265, 703, 1287, 3493, 29899, 690, 21571, 613, 1583, 3032, 265, 5531, 3493, 1666, 21571, 29897, 13, 13, 12, 12, 12, 29937, 13899, 9055, 304, 2758, 278, 4933, 304, 679, 967, 937, 848, 13, 12, 12, 12, 29937, 14402, 448, 14884, 881, 871, 736, 7960, 746, 896, 13, 12, 12, 12, 29937, 505, 4520, 1009, 937, 848, 29889, 13, 12, 12, 12, 29937, 14402, 448, 1207, 10092, 17127, 519, 29889, 13, 12, 12, 12, 29891, 969, 316, 571, 29889, 29887, 1624, 12191, 4197, 13, 12, 12, 12, 12, 7662, 29889, 311, 571, 29931, 1008, 29898, 276, 7168, 29892, 29871, 29906, 29892, 14013, 29901, 1121, 511, 13, 12, 12, 12, 12, 1311, 29889, 23523, 29889, 12071, 580, 13, 12, 12, 12, 2314, 13, 13, 12, 12, 2457, 903, 6915, 580, 13, 13, 12, 1753, 903, 265, 5531, 3493, 20754, 2986, 313, 1311, 29892, 848, 1125, 13, 12, 12, 2158, 4852, 29076, 2908, 29901, 6624, 1218, 3957, 304, 376, 718, 851, 29898, 1311, 29889, 23523, 876, 13, 13, 12, 12, 1311, 29889, 1287, 3493, 29889, 2696, 703, 1287, 3493, 29899, 7864, 2986, 613, 1583, 3032, 265, 5531, 3493, 20754, 2986, 29897, 13, 12, 12, 1311, 29889, 1287, 3493, 29889, 2696, 703, 1287, 3493, 29899, 29886, 15244, 613, 1583, 3032, 265, 5531, 3493, 29925, 15244, 29897, 13, 12, 12, 1311, 29889, 1287, 3493, 29889, 2696, 703, 1287, 3493, 29899, 690, 21571, 613, 1583, 3032, 265, 5531, 3493, 1666, 21571, 29897, 13, 13, 12, 12, 1311, 29889, 23523, 29889, 9847, 580, 13, 12, 12, 1311, 29889, 1287, 3493, 29889, 20897, 29889, 5992, 29898, 1311, 3032, 1707, 1170, 3101, 13, 13, 12, 12, 1753, 903, 2218, 6915, 313, 23523, 1125, 13, 12, 12, 12, 2202, 29901, 13, 12, 12, 12, 12, 23523, 29889, 2218, 6915, 580, 13, 12, 12, 12, 19499, 23833, 2392, 29901, 13, 12, 12, 12, 12, 3364, 13, 12, 12, 12, 19499, 29901, 13, 12, 12, 12, 12, 1188, 29889, 3127, 580, 13, 13, 12, 12, 29937, 29408, 777, 931, 363, 738, 9886, 7191, 304, 367, 4520, 29889, 13, 12, 12, 276, 7168, 29889, 4804, 29931, 1008, 29898, 29906, 29892, 903, 2218, 6915, 29892, 1583, 29889, 23523, 29897, 13, 12, 12, 1311, 29889, 23523, 353, 6213, 13, 13, 12, 1753, 903, 265, 5531, 3493, 29925, 15244, 313, 1311, 29892, 848, 1125, 13, 12, 12, 1311, 29889, 23523, 29889, 29886, 1071, 580, 13, 13, 12, 1753, 903, 265, 5531, 3493, 1666, 21571, 313, 1311, 29892, 848, 1125, 13, 12, 12, 1311, 29889, 23523, 29889, 690, 2017, 580, 13, 13, 12, 1753, 679, 29076, 2385, 313, 1311, 1125, 13, 12, 12, 22692, 2216, 1888, 2037, 287, 2392, 580, 13, 12, 12, 13, 12, 1753, 679, 29076, 9629, 313, 1311, 1125, 13, 12, 12, 2457, 6571, 13, 13, 12, 1753, 679, 12756, 6185, 23838, 8659, 313, 1311, 1125, 13, 12, 12, 978, 353, 1583, 3032, 1707, 1170, 580, 13, 13, 12, 12, 2457, 15658, 29889, 657, 12756, 6185, 23838, 8659, 29898, 1311, 29892, 13, 12, 12, 12, 29961, 978, 29962, 565, 451, 1583, 29889, 18279, 1683, 5159, 13, 12, 12, 29897, 13, 13, 13, 1990, 4933, 29918, 3959, 7547, 29918, 29968, 29896, 29906, 29900, 313, 23523, 29918, 311, 16544, 362, 1125, 13, 12, 1753, 679, 29076, 2385, 313, 1311, 1125, 13, 12, 12, 3166, 4725, 26466, 29889, 1171, 9765, 9945, 1053, 889, 7547, 13, 12, 12, 2457, 889, 7547, 29889, 29968, 29896, 29906, 29900, 13, 13, 13, 1990, 4933, 29918, 3959, 7547, 29918, 29903, 29896, 29900, 29900, 313, 23523, 29918, 311, 16544, 362, 1125, 13, 12, 1753, 679, 29076, 2385, 313, 1311, 1125, 13, 12, 12, 3166, 4725, 26466, 29889, 1171, 9765, 9945, 1053, 889, 7547, 13, 12, 12, 2457, 889, 7547, 29889, 29903, 29896, 29900, 29900, 13, 13, 13, 1990, 4933, 29918, 29894, 1654, 29918, 4713, 2561, 345, 313, 23523, 29918, 311, 16544, 362, 1125, 13, 12, 1753, 679, 29076, 2385, 313, 1311, 1125, 13, 12, 12, 3166, 4725, 26466, 29889, 1171, 9765, 9945, 1053, 325, 1654, 13, 12, 12, 2457, 325, 1654, 29889, 15329, 1440, 345, 13, 13, 13, 1990, 4933, 29918, 4378, 29918, 293, 381, 313, 23523, 29918, 311, 16544, 362, 1125, 13, 12, 1753, 679, 29076, 2385, 313, 1311, 1125, 13, 12, 12, 3166, 4725, 26466, 29889, 1171, 9765, 9945, 1053, 286, 29873, 13, 12, 12, 2457, 286, 29873, 29889, 2965, 8193, 13, 13, 12, 1753, 679, 29076, 9629, 313, 1311, 1125, 13, 12, 12, 5215, 4390, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 2457, 426, 13, 12, 12, 12, 12, 29908, 5461, 29918, 7039, 1115, 4390, 29889, 18132, 29898, 1311, 29889, 6149, 362, 29897, 1839, 5461, 29918, 7039, 2033, 13, 12, 12, 12, 29913, 13, 12, 12, 19499, 313, 1917, 2392, 29892, 7670, 2392, 1125, 13, 12, 12, 12, 2457, 6571, 13, 13, 13, 1990, 4933, 29918, 561, 3690, 29879, 29918, 561, 29879, 6073, 313, 23523, 29918, 311, 16544, 362, 1125, 13, 12, 1753, 679, 29076, 2385, 313, 1311, 1125, 13, 12, 12, 3166, 4725, 26466, 29889, 1171, 9765, 9945, 1053, 1374, 3690, 29879, 13, 12, 12, 2457, 1374, 3690, 29879, 29889, 29925, 14851, 6073, 13, 13, 12, 1753, 679, 29076, 9629, 313, 1311, 1125, 13, 12, 12, 5215, 4390, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 2457, 426, 13, 12, 12, 12, 12, 29908, 1195, 29918, 3167, 1115, 5785, 29898, 3126, 29889, 18132, 29898, 1311, 29889, 6149, 362, 29897, 1839, 1195, 29918, 3167, 11287, 13, 12, 12, 12, 29913, 13, 12, 12, 19499, 313, 1917, 2392, 29892, 7670, 2392, 1125, 13, 12, 12, 12, 2457, 6571, 13, 13, 13, 1990, 4933, 29918, 4787, 29918, 25446, 29941, 29900, 29953, 29874, 313, 23523, 29918, 311, 16544, 362, 1125, 13, 12, 1753, 679, 29076, 2385, 313, 1311, 1125, 13, 12, 12, 3166, 4725, 26466, 29889, 1171, 9765, 9945, 1053, 2703, 2442, 13, 12, 12, 2457, 2703, 2442, 29889, 27590, 29941, 29900, 29953, 29909, 13, 13, 13, 1990, 4933, 29918, 8222, 16927, 29918, 561, 29881, 29906, 29900, 29900, 29900, 313, 23523, 29918, 311, 16544, 362, 1125, 13, 12, 1753, 679, 29076, 2385, 313, 1311, 1125, 13, 12, 12, 3166, 4725, 26466, 29889, 1171, 9765, 9945, 1053, 4023, 16927, 13, 12, 12, 2457, 4023, 16927, 29889, 19689, 29928, 29906, 29900, 29900, 29900, 25433, 1792, 13, 13, 12, 1753, 679, 29076, 9629, 313, 1311, 1125, 13, 12, 12, 5215, 4390, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 2457, 426, 13, 12, 12, 12, 12, 29908, 29879, 4316, 19144, 29918, 29881, 2829, 1308, 1115, 938, 29898, 3126, 29889, 18132, 29898, 1311, 29889, 6149, 362, 29897, 1839, 29879, 4316, 19144, 29918, 29881, 2829, 1308, 11287, 13, 12, 12, 12, 29913, 13, 12, 12, 19499, 313, 1917, 2392, 29892, 7670, 2392, 1125, 13, 12, 12, 12, 2457, 6571, 13, 13, 13, 1990, 4933, 29918, 4378, 29918, 29879, 1199, 29918, 5521, 749, 313, 23523, 29918, 311, 16544, 362, 1125, 13, 12, 1753, 679, 29076, 2385, 313, 1311, 1125, 13, 12, 12, 3166, 4725, 26466, 29889, 1171, 9765, 9945, 1053, 286, 29873, 13, 12, 12, 2457, 286, 29873, 29889, 29903, 2965, 1744, 284, 749, 13, 13, 13, 1990, 4933, 29918, 8508, 11345, 29918, 13519, 16674, 6451, 313, 23523, 29918, 311, 16544, 362, 1125, 13, 12, 1753, 679, 29076, 2385, 313, 1311, 1125, 13, 12, 12, 3166, 4725, 26466, 29889, 1171, 9765, 9945, 1053, 5810, 11345, 13, 12, 12, 2457, 5810, 11345, 29889, 21472, 20224, 4809, 13, 13, 13, 1990, 4933, 29918, 29887, 309, 1100, 29918, 29943, 13857, 28916, 272, 29906, 29900, 29941, 29933, 313, 23523, 29918, 311, 16544, 362, 1125, 13, 12, 1753, 679, 29076, 2385, 313, 1311, 1125, 13, 12, 12, 3166, 4725, 26466, 29889, 1171, 9765, 9945, 1053, 330, 309, 1100, 13, 12, 12, 2457, 330, 309, 1100, 29889, 29943, 13857, 28916, 272, 29906, 29900, 29941, 29933, 13, 13, 13, 1990, 3957, 29918, 23981, 313, 9965, 29918, 311, 16544, 362, 1125, 13, 12, 1753, 19745, 313, 1311, 1125, 13, 12, 12, 2457, 316, 571, 29889, 29879, 1682, 3947, 29898, 20082, 26466, 29889, 27882, 29889, 16121, 29889, 23981, 29898, 13, 12, 12, 12, 710, 29898, 1311, 29889, 9621, 1839, 20832, 2033, 511, 13, 12, 12, 12, 524, 29898, 1311, 29889, 9621, 1839, 15082, 11287, 13, 12, 12, 876, 13, 13, 13, 1990, 3957, 29918, 15550, 313, 9965, 29918, 311, 16544, 362, 1125, 13, 12, 1753, 19745, 313, 1311, 1125, 13, 12, 12, 2457, 316, 571, 29889, 29879, 1682, 3947, 29898, 20082, 26466, 29889, 27882, 29889, 16121, 29889, 15550, 29898, 13, 12, 12, 12, 710, 29898, 1311, 29889, 9621, 1839, 15082, 2033, 511, 13, 12, 12, 12, 2291, 566, 10492, 353, 938, 29898, 1311, 29889, 9621, 1839, 5688, 15789, 11287, 13, 12, 12, 876, 13, 13, 13, 1990, 3957, 29918, 561, 3690, 313, 9965, 29918, 311, 16544, 362, 1125, 13, 12, 1753, 19745, 313, 1311, 1125, 13, 12, 12, 3166, 4725, 26466, 29889, 27882, 29889, 561, 3690, 29879, 1053, 1963, 3690, 13, 12, 12, 2457, 316, 571, 29889, 29879, 1682, 3947, 29898, 4819, 3690, 29898, 13, 12, 12, 12, 524, 29898, 1311, 29889, 9621, 1839, 1367, 2033, 511, 13, 12, 12, 876, 13, 2 ]
shapely/tests/geometry/test_multipoint.py
whophil/shapely
0
89551
<filename>shapely/tests/geometry/test_multipoint.py import numpy as np import pytest from shapely.errors import EmptyPartError from shapely.geometry import MultiPoint, Point from shapely.geometry.base import dump_coords from .test_multi import MultiGeometryTestCase class TestMultiPoint(MultiGeometryTestCase): def test_multipoint(self): # From coordinate tuples geom = MultiPoint(((1.0, 2.0), (3.0, 4.0))) assert len(geom.geoms) == 2 assert dump_coords(geom) == [[(1.0, 2.0)], [(3.0, 4.0)]] # From points geom = MultiPoint((Point(1.0, 2.0), Point(3.0, 4.0))) assert len(geom.geoms) == 2 assert dump_coords(geom) == [[(1.0, 2.0)], [(3.0, 4.0)]] # From another multi-point geom2 = MultiPoint(geom) assert len(geom2.geoms) == 2 assert dump_coords(geom2) == [[(1.0, 2.0)], [(3.0, 4.0)]] # Sub-geometry Access assert isinstance(geom.geoms[0], Point) assert geom.geoms[0].x == 1.0 assert geom.geoms[0].y == 2.0 with pytest.raises(IndexError): # index out of range geom.geoms[2] # Geo interface assert geom.__geo_interface__ == { "type": "MultiPoint", "coordinates": ((1.0, 2.0), (3.0, 4.0)), } def test_multipoint_from_numpy(self): # Construct from a numpy array geom = MultiPoint(np.array([[0.0, 0.0], [1.0, 2.0]])) assert isinstance(geom, MultiPoint) assert len(geom.geoms) == 2 assert dump_coords(geom) == [[(0.0, 0.0)], [(1.0, 2.0)]] def test_subgeom_access(self): p0 = Point(1.0, 2.0) p1 = Point(3.0, 4.0) self.subgeom_access_test(MultiPoint, [p0, p1]) def test_create_multi_with_empty_component(self): msg = "Can't create MultiPoint with empty component" with pytest.raises(EmptyPartError, match=msg): MultiPoint([Point(0, 0), Point()]).wkt def test_multipoint_array_coercion(): geom = MultiPoint(((1.0, 2.0), (3.0, 4.0))) arr = np.array(geom) assert arr.ndim == 0 assert arr.size == 1 assert arr.dtype == np.dtype("object") assert arr.item() == geom def test_numpy_object_array(): geom = MultiPoint(((1.0, 2.0), (3.0, 4.0))) ar = np.empty(1, object) ar[:] = [geom] assert ar[0] == geom def test_len_raises(): geom = MultiPoint([[5.0, 6.0], [7.0, 8.0]]) with pytest.raises(TypeError): len(geom)
[ 1, 529, 9507, 29958, 845, 481, 873, 29914, 21150, 29914, 19156, 29914, 1688, 29918, 18056, 2461, 29889, 2272, 13, 5215, 12655, 408, 7442, 13, 5215, 11451, 1688, 13, 13, 3166, 528, 481, 873, 29889, 12523, 1053, 2812, 2349, 7439, 2392, 13, 3166, 528, 481, 873, 29889, 19156, 1053, 14974, 5228, 29892, 8984, 13, 3166, 528, 481, 873, 29889, 19156, 29889, 3188, 1053, 16766, 29918, 1111, 4339, 13, 13, 3166, 869, 1688, 29918, 9910, 1053, 14974, 7999, 7843, 3057, 8259, 13, 13, 13, 1990, 4321, 15329, 5228, 29898, 15329, 7999, 7843, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 18056, 2461, 29898, 1311, 1125, 13, 13, 4706, 396, 3645, 14821, 5291, 2701, 13, 4706, 23216, 353, 14974, 5228, 3552, 29898, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 511, 313, 29941, 29889, 29900, 29892, 29871, 29946, 29889, 29900, 4961, 13, 4706, 4974, 7431, 29898, 479, 290, 29889, 479, 4835, 29897, 1275, 29871, 29906, 13, 4706, 4974, 16766, 29918, 1111, 4339, 29898, 479, 290, 29897, 1275, 5519, 29898, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 29897, 1402, 17288, 29941, 29889, 29900, 29892, 29871, 29946, 29889, 29900, 4638, 29962, 13, 13, 4706, 396, 3645, 3291, 13, 4706, 23216, 353, 14974, 5228, 3552, 5228, 29898, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 511, 8984, 29898, 29941, 29889, 29900, 29892, 29871, 29946, 29889, 29900, 4961, 13, 4706, 4974, 7431, 29898, 479, 290, 29889, 479, 4835, 29897, 1275, 29871, 29906, 13, 4706, 4974, 16766, 29918, 1111, 4339, 29898, 479, 290, 29897, 1275, 5519, 29898, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 29897, 1402, 17288, 29941, 29889, 29900, 29892, 29871, 29946, 29889, 29900, 4638, 29962, 13, 13, 4706, 396, 3645, 1790, 2473, 29899, 3149, 13, 4706, 23216, 29906, 353, 14974, 5228, 29898, 479, 290, 29897, 13, 4706, 4974, 7431, 29898, 479, 290, 29906, 29889, 479, 4835, 29897, 1275, 29871, 29906, 13, 4706, 4974, 16766, 29918, 1111, 4339, 29898, 479, 290, 29906, 29897, 1275, 5519, 29898, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 29897, 1402, 17288, 29941, 29889, 29900, 29892, 29871, 29946, 29889, 29900, 4638, 29962, 13, 13, 4706, 396, 3323, 29899, 19156, 11028, 13, 4706, 4974, 338, 8758, 29898, 479, 290, 29889, 479, 4835, 29961, 29900, 1402, 8984, 29897, 13, 4706, 4974, 23216, 29889, 479, 4835, 29961, 29900, 1822, 29916, 1275, 29871, 29896, 29889, 29900, 13, 4706, 4974, 23216, 29889, 479, 4835, 29961, 29900, 1822, 29891, 1275, 29871, 29906, 29889, 29900, 13, 4706, 411, 11451, 1688, 29889, 336, 4637, 29898, 3220, 2392, 1125, 29871, 396, 2380, 714, 310, 3464, 13, 9651, 23216, 29889, 479, 4835, 29961, 29906, 29962, 13, 13, 4706, 396, 1879, 29877, 5067, 13, 4706, 4974, 23216, 17255, 24756, 29918, 13248, 1649, 1275, 426, 13, 9651, 376, 1853, 1115, 376, 15329, 5228, 613, 13, 9651, 376, 1111, 24266, 1115, 5135, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 511, 313, 29941, 29889, 29900, 29892, 29871, 29946, 29889, 29900, 8243, 13, 4706, 500, 13, 13, 1678, 822, 1243, 29918, 18056, 2461, 29918, 3166, 29918, 23749, 29898, 1311, 1125, 13, 4706, 396, 1281, 4984, 515, 263, 12655, 1409, 13, 4706, 23216, 353, 14974, 5228, 29898, 9302, 29889, 2378, 4197, 29961, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 1402, 518, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 5262, 876, 13, 4706, 4974, 338, 8758, 29898, 479, 290, 29892, 14974, 5228, 29897, 13, 4706, 4974, 7431, 29898, 479, 290, 29889, 479, 4835, 29897, 1275, 29871, 29906, 13, 4706, 4974, 16766, 29918, 1111, 4339, 29898, 479, 290, 29897, 1275, 5519, 29898, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29897, 1402, 17288, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 4638, 29962, 13, 13, 1678, 822, 1243, 29918, 1491, 479, 290, 29918, 5943, 29898, 1311, 1125, 13, 4706, 282, 29900, 353, 8984, 29898, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 29897, 13, 4706, 282, 29896, 353, 8984, 29898, 29941, 29889, 29900, 29892, 29871, 29946, 29889, 29900, 29897, 13, 4706, 1583, 29889, 1491, 479, 290, 29918, 5943, 29918, 1688, 29898, 15329, 5228, 29892, 518, 29886, 29900, 29892, 282, 29896, 2314, 13, 13, 1678, 822, 1243, 29918, 3258, 29918, 9910, 29918, 2541, 29918, 6310, 29918, 9700, 29898, 1311, 1125, 13, 4706, 10191, 353, 376, 6028, 29915, 29873, 1653, 14974, 5228, 411, 4069, 4163, 29908, 13, 4706, 411, 11451, 1688, 29889, 336, 4637, 29898, 8915, 7439, 2392, 29892, 1993, 29922, 7645, 1125, 13, 9651, 14974, 5228, 4197, 5228, 29898, 29900, 29892, 29871, 29900, 511, 8984, 580, 14664, 29893, 1193, 13, 13, 13, 1753, 1243, 29918, 18056, 2461, 29918, 2378, 29918, 1111, 6269, 291, 7295, 13, 1678, 23216, 353, 14974, 5228, 3552, 29898, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 511, 313, 29941, 29889, 29900, 29892, 29871, 29946, 29889, 29900, 4961, 13, 1678, 3948, 353, 7442, 29889, 2378, 29898, 479, 290, 29897, 13, 1678, 4974, 3948, 29889, 299, 326, 1275, 29871, 29900, 13, 1678, 4974, 3948, 29889, 2311, 1275, 29871, 29896, 13, 1678, 4974, 3948, 29889, 29881, 1853, 1275, 7442, 29889, 29881, 1853, 703, 3318, 1159, 13, 1678, 4974, 3948, 29889, 667, 580, 1275, 23216, 13, 13, 13, 1753, 1243, 29918, 23749, 29918, 3318, 29918, 2378, 7295, 13, 1678, 23216, 353, 14974, 5228, 3552, 29898, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 511, 313, 29941, 29889, 29900, 29892, 29871, 29946, 29889, 29900, 4961, 13, 1678, 564, 353, 7442, 29889, 6310, 29898, 29896, 29892, 1203, 29897, 13, 1678, 564, 7503, 29962, 353, 518, 479, 290, 29962, 13, 1678, 4974, 564, 29961, 29900, 29962, 1275, 23216, 13, 13, 13, 1753, 1243, 29918, 2435, 29918, 336, 4637, 7295, 13, 1678, 23216, 353, 14974, 5228, 4197, 29961, 29945, 29889, 29900, 29892, 29871, 29953, 29889, 29900, 1402, 518, 29955, 29889, 29900, 29892, 29871, 29947, 29889, 29900, 24960, 13, 1678, 411, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 1125, 13, 4706, 7431, 29898, 479, 290, 29897, 13, 2 ]
beta/nncf/tensorflow/graph/patterns.py
xiao1228/nncf
0
87207
""" Copyright (c) 2020 Intel Corporation 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 operator from functools import reduce from beta.nncf.tensorflow.graph.metatypes.common import ELEMENTWISE_LAYER_METATYPES from beta.nncf.tensorflow.graph.metatypes.common import GENERAL_CONV_LAYER_METATYPES from beta.nncf.tensorflow.graph.metatypes.common import LAYER_METATYPES_AGNOSTIC_TO_DATA_PRECISION_WITH_ONE_INPUT from beta.nncf.tensorflow.graph.metatypes.common import LINEAR_LAYER_METATYPES from beta.nncf.tensorflow.graph.pattern_matching import NodeExpression as N SET_CONV_LAYERS = {layer for m in GENERAL_CONV_LAYER_METATYPES for layer in m.get_all_aliases()} LIST_CONV_OPS = [N(layer) for layer in SET_CONV_LAYERS] SET_LINEAR_LAYERS = {layer for m in LINEAR_LAYER_METATYPES for layer in m.get_all_aliases()} LIST_LINEAR_OPS = [N(layer) for layer in SET_LINEAR_LAYERS] LIST_CONV_LINEAR_OPS = LIST_CONV_OPS + LIST_LINEAR_OPS CONV_LINEAR_OPS = reduce(operator.or_, LIST_CONV_LINEAR_OPS[1:], LIST_CONV_LINEAR_OPS[0]) SET_AGNOSTIC_LAYERS = { layer for m in LAYER_METATYPES_AGNOSTIC_TO_DATA_PRECISION_WITH_ONE_INPUT for layer in m.get_all_aliases() } LIST_AGNOSTIC_OPS = [N(layer) for layer in SET_AGNOSTIC_LAYERS] AG = reduce(operator.or_, LIST_AGNOSTIC_OPS[1:], LIST_AGNOSTIC_OPS[0]) BN = N('BatchNormalization') | N('SyncBatchNormalization') HARD_SIGMOID = (N('AddV2') + N('ReLU') + N('Mul')) HARD_SWISH = (N('Multiply') & (HARD_SIGMOID + N('Multiply'))) KERAS_ACTIVATIONS = N('ReLU') | N('ThresholdedReLU') | N('ELU') | N('PReLU') | N('LeakyReLU') | N('Activation') TF_ACTIVATIONS = N('Relu') ACT = KERAS_ACTIVATIONS | TF_ACTIVATIONS | HARD_SIGMOID | HARD_SWISH ANY_BN_ACT_COMBO = BN + ACT | ACT + BN | BN | ACT ANY_AG_BN_ACT_COMBO = AG + ACT | ANY_BN_ACT_COMBO POOLING = N('AveragePooling2D') | N('AveragePooling3D') | N('GlobalAveragePooling2D') | N('GlobalAveragePooling3D') SINGLE_OPS = POOLING | N('Average') | N('LayerNormalization') SET_ELEMENTWISE_LAYERS = {layer for m in ELEMENTWISE_LAYER_METATYPES for layer in m.get_all_aliases()} LIST_ELEMENTWISE_OPS = [N(layer) for layer in SET_ELEMENTWISE_LAYERS] ELEMENTWISE = reduce(operator.or_, LIST_ELEMENTWISE_OPS[1:], LIST_ELEMENTWISE_OPS[0])
[ 1, 9995, 13, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29900, 18555, 15025, 13, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 887, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 418, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 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, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 27028, 1090, 278, 19245, 29889, 13, 15945, 29908, 13, 13, 5215, 5455, 13, 3166, 2090, 312, 8789, 1053, 10032, 13, 13, 3166, 21762, 29889, 15755, 6854, 29889, 29056, 29889, 4262, 29889, 2527, 271, 7384, 29889, 9435, 1053, 382, 1307, 13780, 22119, 1660, 29918, 18799, 1001, 29918, 2303, 29911, 1299, 29979, 29925, 2890, 13, 3166, 21762, 29889, 15755, 6854, 29889, 29056, 29889, 4262, 29889, 2527, 271, 7384, 29889, 9435, 1053, 402, 1430, 1001, 1964, 29918, 6007, 29963, 29918, 18799, 1001, 29918, 2303, 29911, 1299, 29979, 29925, 2890, 13, 3166, 21762, 29889, 15755, 6854, 29889, 29056, 29889, 4262, 29889, 2527, 271, 7384, 29889, 9435, 1053, 17900, 29979, 1001, 29918, 2303, 29911, 1299, 29979, 29925, 2890, 29918, 10051, 29940, 3718, 2965, 29918, 4986, 29918, 14573, 29918, 15094, 29907, 3235, 2725, 29918, 29956, 13054, 29918, 12413, 29918, 1177, 12336, 13, 3166, 21762, 29889, 15755, 6854, 29889, 29056, 29889, 4262, 29889, 2527, 271, 7384, 29889, 9435, 1053, 365, 8895, 1718, 29918, 18799, 1001, 29918, 2303, 29911, 1299, 29979, 29925, 2890, 13, 3166, 21762, 29889, 15755, 6854, 29889, 29056, 29889, 4262, 29889, 11037, 29918, 4352, 292, 1053, 9071, 10960, 408, 405, 13, 13, 13, 10490, 29918, 6007, 29963, 29918, 18799, 23598, 353, 426, 13148, 363, 286, 297, 402, 1430, 1001, 1964, 29918, 6007, 29963, 29918, 18799, 1001, 29918, 2303, 29911, 1299, 29979, 29925, 2890, 363, 7546, 297, 286, 29889, 657, 29918, 497, 29918, 2606, 2129, 28296, 13, 24360, 29918, 6007, 29963, 29918, 4590, 29903, 353, 518, 29940, 29898, 13148, 29897, 363, 7546, 297, 11368, 29918, 6007, 29963, 29918, 18799, 23598, 29962, 13, 10490, 29918, 18521, 1718, 29918, 18799, 23598, 353, 426, 13148, 363, 286, 297, 365, 8895, 1718, 29918, 18799, 1001, 29918, 2303, 29911, 1299, 29979, 29925, 2890, 363, 7546, 297, 286, 29889, 657, 29918, 497, 29918, 2606, 2129, 28296, 13, 24360, 29918, 18521, 1718, 29918, 4590, 29903, 353, 518, 29940, 29898, 13148, 29897, 363, 7546, 297, 11368, 29918, 18521, 1718, 29918, 18799, 23598, 29962, 13, 24360, 29918, 6007, 29963, 29918, 18521, 1718, 29918, 4590, 29903, 353, 365, 9047, 29918, 6007, 29963, 29918, 4590, 29903, 718, 365, 9047, 29918, 18521, 1718, 29918, 4590, 29903, 13, 6007, 29963, 29918, 18521, 1718, 29918, 4590, 29903, 353, 10032, 29898, 6891, 29889, 272, 3383, 365, 9047, 29918, 6007, 29963, 29918, 18521, 1718, 29918, 4590, 29903, 29961, 29896, 29901, 1402, 365, 9047, 29918, 6007, 29963, 29918, 18521, 1718, 29918, 4590, 29903, 29961, 29900, 2314, 13, 13, 10490, 29918, 10051, 29940, 3718, 2965, 29918, 18799, 23598, 353, 426, 13, 1678, 7546, 363, 286, 297, 17900, 29979, 1001, 29918, 2303, 29911, 1299, 29979, 29925, 2890, 29918, 10051, 29940, 3718, 2965, 29918, 4986, 29918, 14573, 29918, 15094, 29907, 3235, 2725, 29918, 29956, 13054, 29918, 12413, 29918, 1177, 12336, 363, 7546, 297, 286, 29889, 657, 29918, 497, 29918, 2606, 2129, 580, 13, 29913, 13, 24360, 29918, 10051, 29940, 3718, 2965, 29918, 4590, 29903, 353, 518, 29940, 29898, 13148, 29897, 363, 7546, 297, 11368, 29918, 10051, 29940, 3718, 2965, 29918, 18799, 23598, 29962, 13, 10051, 353, 10032, 29898, 6891, 29889, 272, 3383, 365, 9047, 29918, 10051, 29940, 3718, 2965, 29918, 4590, 29903, 29961, 29896, 29901, 1402, 365, 9047, 29918, 10051, 29940, 3718, 2965, 29918, 4590, 29903, 29961, 29900, 2314, 13, 13, 29933, 29940, 353, 405, 877, 23145, 19077, 2133, 1495, 891, 405, 877, 21077, 23145, 19077, 2133, 1495, 13, 13, 29950, 17011, 29918, 5425, 29954, 6720, 1367, 353, 313, 29940, 877, 2528, 29963, 29906, 1495, 718, 405, 877, 1123, 29931, 29965, 1495, 718, 405, 877, 29924, 352, 8785, 13, 29950, 17011, 29918, 23066, 3235, 29950, 353, 313, 29940, 877, 6857, 666, 368, 1495, 669, 313, 29950, 17011, 29918, 5425, 29954, 6720, 1367, 718, 405, 877, 6857, 666, 368, 29915, 4961, 13, 13, 29968, 1001, 3289, 29918, 17923, 5667, 8098, 29903, 353, 405, 877, 1123, 29931, 29965, 1495, 891, 405, 877, 1349, 12268, 287, 1123, 29931, 29965, 1495, 891, 405, 877, 6670, 29965, 1495, 891, 405, 877, 29925, 1123, 29931, 29965, 1495, 891, 405, 877, 3226, 557, 29891, 1123, 29931, 29965, 1495, 891, 405, 877, 21786, 362, 1495, 13, 8969, 29918, 17923, 5667, 8098, 29903, 353, 405, 877, 9662, 29884, 1495, 13, 17923, 353, 476, 1001, 3289, 29918, 17923, 5667, 8098, 29903, 891, 323, 29943, 29918, 17923, 5667, 8098, 29903, 891, 379, 17011, 29918, 5425, 29954, 6720, 1367, 891, 379, 17011, 29918, 23066, 3235, 29950, 13, 13, 2190, 29979, 29918, 29933, 29940, 29918, 17923, 29918, 19795, 8456, 353, 350, 29940, 718, 319, 1783, 891, 319, 1783, 718, 350, 29940, 891, 350, 29940, 891, 319, 1783, 13, 13, 2190, 29979, 29918, 10051, 29918, 29933, 29940, 29918, 17923, 29918, 19795, 8456, 353, 16369, 718, 319, 1783, 891, 13764, 29979, 29918, 29933, 29940, 29918, 17923, 29918, 19795, 8456, 13, 13, 13152, 5607, 4214, 353, 405, 877, 29909, 19698, 11426, 292, 29906, 29928, 1495, 891, 405, 877, 29909, 19698, 11426, 292, 29941, 29928, 1495, 891, 405, 877, 12756, 29909, 19698, 11426, 292, 29906, 29928, 1495, 891, 405, 877, 12756, 29909, 19698, 11426, 292, 29941, 29928, 1495, 13, 13, 29903, 4214, 1307, 29918, 4590, 29903, 353, 21521, 5607, 4214, 891, 405, 877, 29909, 19698, 1495, 891, 405, 877, 14420, 19077, 2133, 1495, 13, 13, 10490, 29918, 29923, 1307, 13780, 22119, 1660, 29918, 18799, 23598, 353, 426, 13148, 363, 286, 297, 382, 1307, 13780, 22119, 1660, 29918, 18799, 1001, 29918, 2303, 29911, 1299, 29979, 29925, 2890, 363, 7546, 297, 286, 29889, 657, 29918, 497, 29918, 2606, 2129, 28296, 13, 24360, 29918, 29923, 1307, 13780, 22119, 1660, 29918, 4590, 29903, 353, 518, 29940, 29898, 13148, 29897, 363, 7546, 297, 11368, 29918, 29923, 1307, 13780, 22119, 1660, 29918, 18799, 23598, 29962, 13, 29923, 1307, 13780, 22119, 1660, 353, 10032, 29898, 6891, 29889, 272, 3383, 365, 9047, 29918, 29923, 1307, 13780, 22119, 1660, 29918, 4590, 29903, 29961, 29896, 29901, 1402, 365, 9047, 29918, 29923, 1307, 13780, 22119, 1660, 29918, 4590, 29903, 29961, 29900, 2314, 13, 2 ]
slcyGeneral.py
mirrorcoloured/slcypi
0
9350
# Python 2.7.1 import RPi.GPIO as GPIO from twython import Twython import time import sys import os import pygame APP_KEY='zmmlyAJzMDIntLpDYmSH98gbw' APP_SECRET='<KEY>' OAUTH_TOKEN='<KEY>' OAUTH_TOKEN_SECRET='<KEY>' applepislcy = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET) ### GENERAL ### def Cleanup(): GPIO.cleanup() def Sleep(seconds): """Puts the program to sleep""" time.sleep(seconds) def Alert(channel): """Simple alert function for testing event interrupts""" print('Alert on channel',channel) def TimeString(): """Returns the current time""" t = time.localtime() return str(t[0])+'.'+str(t[1])+'.'+str(t[2])+'.'+str(t[3])+'.'+str(t[4])+'.'+str(t[5]) def LoadPins(mapping,inp): """Organizes an input into a pin mapping dict mapping <list>, ['IA','IB'] inp <dict>, <list>, <int> {'IA':1,'IB':2}, [1,2] """ if type(inp) is int and len(mapping) == 1: return {mapping[0]:inp} elif type(inp) is list and len(mapping) == len(inp): o = {} for i in range(len(inp)): o[mapping[i]] = inp[i] return o elif type(inp) is dict: return inp else: print('Invalid input for pins:',inp,type(inp)) print('Expected:',mapping) return {} def BoolToSign(inp): """Converts boolean bits into signed bits 0 -> -1 1 -> 1""" return (inp * 2) - 1 def SignToBool(inp): """Converts signed bits into boolean bits -1 -> 0 1 -> 1""" return (inp + 1) / 2 ### PYGAME ### def WindowSetup(size=(300,50),caption='',text='',background=(0,0,0),foreground=(255,255,255)): """Sets up a pygame window to take keyboard input size <tuple>, width by height caption <str>, window title bar text <str>, text to display in window, accepts \n background <tuple>, foreground <tuple>, (r,g,b) color """ pygame.init() screen = pygame.display.set_mode(size,0,32) pygame.display.set_caption(caption) myfont = pygame.font.SysFont('Monospace',15) labels = [] lines = text.split('\n') for line in lines: labels.append(myfont.render(line,1,foreground)) screen.fill(background) y = 0 for label in labels: screen.blit(label, (0,y)) y += 15 pygame.display.update() def InputLoop(eventmap): """Begins a pygame loop, mapping key inputs to functions eventmap <dict>, {pygame.K_t:myfunction} """ index = 0 while True: events = pygame.event.get() for event in events: if event.type == pygame.KEYDOWN: #print("{0}: You pressed {1:c}".format ( index , event.key )) if event.key in eventmap: eventmap[event.key]() elif event.type == pygame.QUIT: pygame.quit() sys.exit() def InputLoopDemo(): def dog(): print('woof') def cat(): print('meow') def fish(): print('blub') WindowSetup(caption='pet simulator',text='d for dog\nc for cat\nf for fish') InputLoop({pygame.K_d:dog, pygame.K_c:cat, pygame.K_f:fish}) ### TWITTER ### def Tweet(twit,statustext): """Tweets a message twit <Twython>, create with Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET) statustext <str>, must be <= 140 characters """ if len(statustext) > 140: print('ERROR: Character limit 140 exceeded:',len(statustext)) else: twit.update_status(status=statustext) def TweetPicture(twit,file,statustext): """Tweets a message with a picture twit <Twython>, create with Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET) file <str>, path and filename to picture statustext <str>, must be <= 140 characters """ photo = open(file, 'rb') response = twitter.upload_media(media=photo) twit.update_status(status=statustext, media_ids=[response['media_id']]) def TweetVideo(twit,file,statustext): """Tweets a message with a video twit <Twython>, create with Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET) file <str>, path and filename to video statustext <str>, must be <= 140 characters """ video = open(file, 'rb') response = twitter.upload_video(media=video, media_type='video/mp4') twit.update_status(status=statustext, media_ids=[response['media_id']])
[ 1, 396, 5132, 29871, 29906, 29889, 29955, 29889, 29896, 13, 13, 5215, 390, 12197, 29889, 29954, 2227, 29949, 408, 402, 2227, 29949, 13, 3166, 3252, 1656, 1053, 8168, 1656, 13, 5215, 931, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 22028, 13, 13, 20576, 29918, 10818, 2433, 29920, 4317, 368, 29909, 29967, 29920, 5773, 2928, 29931, 29886, 29928, 29979, 29885, 7068, 29929, 29947, 26300, 29893, 29915, 13, 20576, 29918, 1660, 22245, 29911, 2433, 29966, 10818, 16299, 13, 29949, 20656, 29950, 29918, 4986, 29968, 1430, 2433, 29966, 10818, 16299, 13, 29949, 20656, 29950, 29918, 4986, 29968, 1430, 29918, 1660, 22245, 29911, 2433, 29966, 10818, 16299, 13, 11548, 3334, 29880, 1270, 353, 8168, 1656, 29898, 20576, 29918, 10818, 29892, 12279, 29925, 29918, 1660, 22245, 29911, 29892, 438, 20656, 29950, 29918, 4986, 29968, 1430, 29892, 438, 20656, 29950, 29918, 4986, 29968, 1430, 29918, 1660, 22245, 29911, 29897, 13, 13, 2277, 29937, 402, 1430, 1001, 1964, 835, 13, 13, 1753, 315, 14044, 786, 7295, 13, 1678, 402, 2227, 29949, 29889, 14941, 786, 580, 13, 13, 1753, 317, 5436, 29898, 23128, 1125, 13, 1678, 9995, 29925, 8842, 278, 1824, 304, 8709, 15945, 29908, 13, 1678, 931, 29889, 17059, 29898, 23128, 29897, 13, 13, 1753, 28861, 29898, 12719, 1125, 13, 1678, 9995, 15427, 6655, 740, 363, 6724, 1741, 23754, 29879, 15945, 29908, 13, 1678, 1596, 877, 16649, 373, 8242, 742, 12719, 29897, 13, 13, 1753, 5974, 1231, 7295, 13, 1678, 9995, 11609, 29879, 278, 1857, 931, 15945, 29908, 13, 1678, 260, 353, 931, 29889, 2997, 2230, 580, 13, 1678, 736, 851, 29898, 29873, 29961, 29900, 2314, 29974, 4286, 18717, 710, 29898, 29873, 29961, 29896, 2314, 29974, 4286, 18717, 710, 29898, 29873, 29961, 29906, 2314, 29974, 4286, 18717, 710, 29898, 29873, 29961, 29941, 2314, 29974, 4286, 18717, 710, 29898, 29873, 29961, 29946, 2314, 29974, 4286, 18717, 710, 29898, 29873, 29961, 29945, 2314, 13, 13, 1753, 16012, 29925, 1144, 29898, 20698, 29892, 262, 29886, 1125, 13, 1678, 9995, 27356, 7093, 385, 1881, 964, 263, 12534, 10417, 9657, 13, 1678, 10417, 529, 1761, 10202, 6024, 10764, 3788, 8979, 2033, 13, 1678, 297, 29886, 529, 8977, 10202, 529, 1761, 10202, 529, 524, 29958, 11117, 10764, 2396, 29896, 5501, 8979, 2396, 29906, 1118, 518, 29896, 29892, 29906, 29962, 13, 1678, 9995, 13, 1678, 565, 1134, 29898, 262, 29886, 29897, 338, 938, 322, 7431, 29898, 20698, 29897, 1275, 29871, 29896, 29901, 13, 4706, 736, 426, 20698, 29961, 29900, 5387, 262, 29886, 29913, 13, 1678, 25342, 1134, 29898, 262, 29886, 29897, 338, 1051, 322, 7431, 29898, 20698, 29897, 1275, 7431, 29898, 262, 29886, 1125, 13, 4706, 288, 353, 6571, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 262, 29886, 22164, 13, 9651, 288, 29961, 20698, 29961, 29875, 5262, 353, 297, 29886, 29961, 29875, 29962, 13, 4706, 736, 288, 13, 1678, 25342, 1134, 29898, 262, 29886, 29897, 338, 9657, 29901, 13, 4706, 736, 297, 29886, 13, 1678, 1683, 29901, 13, 4706, 1596, 877, 13919, 1881, 363, 282, 1144, 29901, 742, 262, 29886, 29892, 1853, 29898, 262, 29886, 876, 13, 4706, 1596, 877, 1252, 6021, 29901, 742, 20698, 29897, 13, 4706, 736, 6571, 13, 13, 1753, 18912, 1762, 10140, 29898, 262, 29886, 1125, 13, 1678, 9995, 1168, 369, 1372, 7223, 9978, 964, 8794, 9978, 13, 268, 29900, 1599, 448, 29896, 13, 268, 29896, 1599, 29871, 29896, 15945, 29908, 13, 1678, 736, 313, 262, 29886, 334, 29871, 29906, 29897, 448, 29871, 29896, 13, 13, 1753, 9954, 1762, 24693, 29898, 262, 29886, 1125, 13, 1678, 9995, 1168, 369, 1372, 8794, 9978, 964, 7223, 9978, 13, 1678, 448, 29896, 1599, 29871, 29900, 13, 268, 29896, 1599, 29871, 29896, 15945, 29908, 13, 1678, 736, 313, 262, 29886, 718, 29871, 29896, 29897, 847, 29871, 29906, 13, 13, 2277, 29937, 349, 29979, 12739, 2303, 835, 13, 13, 1753, 18379, 26947, 29898, 2311, 7607, 29941, 29900, 29900, 29892, 29945, 29900, 511, 6671, 2433, 742, 726, 2433, 742, 7042, 7607, 29900, 29892, 29900, 29892, 29900, 511, 1454, 18128, 7607, 29906, 29945, 29945, 29892, 29906, 29945, 29945, 29892, 29906, 29945, 29945, 22164, 13, 1678, 9995, 29903, 1691, 701, 263, 22028, 3474, 304, 2125, 12247, 1881, 13, 1678, 2159, 529, 23583, 10202, 2920, 491, 3171, 13, 1678, 5777, 683, 529, 710, 10202, 3474, 3611, 2594, 13, 1678, 1426, 529, 710, 10202, 1426, 304, 2479, 297, 3474, 29892, 21486, 320, 29876, 13, 1678, 3239, 529, 23583, 10202, 363, 18128, 529, 23583, 10202, 313, 29878, 29892, 29887, 29892, 29890, 29897, 2927, 13, 1678, 9995, 13, 1678, 22028, 29889, 2344, 580, 13, 1678, 4315, 353, 22028, 29889, 4990, 29889, 842, 29918, 8513, 29898, 2311, 29892, 29900, 29892, 29941, 29906, 29897, 13, 1678, 22028, 29889, 4990, 29889, 842, 29918, 6671, 29898, 6671, 29897, 13, 1678, 590, 5657, 353, 22028, 29889, 5657, 29889, 29903, 952, 9824, 877, 7185, 359, 3535, 742, 29896, 29945, 29897, 13, 1678, 11073, 353, 5159, 13, 1678, 3454, 353, 1426, 29889, 5451, 28909, 29876, 1495, 13, 1678, 363, 1196, 297, 3454, 29901, 13, 4706, 11073, 29889, 4397, 29898, 1357, 5657, 29889, 9482, 29898, 1220, 29892, 29896, 29892, 1454, 18128, 876, 13, 1678, 4315, 29889, 5589, 29898, 7042, 29897, 13, 1678, 343, 353, 29871, 29900, 13, 1678, 363, 3858, 297, 11073, 29901, 13, 4706, 4315, 29889, 2204, 277, 29898, 1643, 29892, 313, 29900, 29892, 29891, 876, 13, 4706, 343, 4619, 29871, 29896, 29945, 13, 1678, 22028, 29889, 4990, 29889, 5504, 580, 13, 13, 1753, 10567, 18405, 29898, 3696, 1958, 1125, 13, 1678, 9995, 17946, 29879, 263, 22028, 2425, 29892, 10417, 1820, 10970, 304, 3168, 13, 1678, 1741, 1958, 529, 8977, 10202, 426, 2272, 11802, 29889, 29968, 29918, 29873, 29901, 1357, 2220, 29913, 13, 1678, 9995, 13, 1678, 2380, 353, 29871, 29900, 13, 1678, 1550, 5852, 29901, 13, 4706, 4959, 353, 22028, 29889, 3696, 29889, 657, 580, 13, 4706, 363, 1741, 297, 4959, 29901, 13, 9651, 565, 1741, 29889, 1853, 1275, 22028, 29889, 10818, 3970, 16048, 29901, 13, 18884, 396, 2158, 703, 29912, 29900, 6177, 887, 15385, 426, 29896, 29901, 29883, 29913, 1642, 4830, 313, 2380, 1919, 1741, 29889, 1989, 29871, 876, 13, 18884, 565, 1741, 29889, 1989, 297, 1741, 1958, 29901, 13, 462, 1678, 1741, 1958, 29961, 3696, 29889, 1989, 29962, 580, 13, 9651, 25342, 1741, 29889, 1853, 1275, 22028, 29889, 13356, 1806, 29901, 13, 18884, 22028, 29889, 28358, 580, 13, 18884, 10876, 29889, 13322, 580, 13, 13, 1753, 10567, 18405, 23444, 7295, 13, 1678, 822, 11203, 7295, 13, 4706, 1596, 877, 827, 974, 1495, 13, 1678, 822, 6635, 7295, 13, 4706, 1596, 877, 1004, 340, 1495, 13, 1678, 822, 9427, 7295, 13, 4706, 1596, 877, 2204, 431, 1495, 13, 1678, 18379, 26947, 29898, 6671, 2433, 10963, 1027, 9183, 742, 726, 2433, 29881, 363, 11203, 29905, 17608, 363, 6635, 29905, 29876, 29888, 363, 9427, 1495, 13, 1678, 10567, 18405, 3319, 2272, 11802, 29889, 29968, 29918, 29881, 29901, 26169, 29892, 22028, 29889, 29968, 29918, 29883, 29901, 4117, 29892, 22028, 29889, 29968, 29918, 29888, 29901, 15161, 1800, 13, 13, 2277, 29937, 323, 29956, 1806, 4945, 835, 13, 13, 1753, 323, 16668, 29898, 7516, 277, 29892, 6112, 504, 1062, 1125, 13, 1678, 9995, 29911, 705, 1691, 263, 2643, 13, 1678, 3252, 277, 529, 27418, 1656, 10202, 1653, 411, 8168, 1656, 29898, 20576, 29918, 10818, 29892, 12279, 29925, 29918, 1660, 22245, 29911, 29892, 438, 20656, 29950, 29918, 4986, 29968, 1430, 29892, 438, 20656, 29950, 29918, 4986, 29968, 1430, 29918, 1660, 22245, 29911, 29897, 13, 1678, 1002, 504, 1062, 529, 710, 10202, 1818, 367, 5277, 29871, 29896, 29946, 29900, 4890, 13, 1678, 9995, 13, 1678, 565, 7431, 29898, 6112, 504, 1062, 29897, 1405, 29871, 29896, 29946, 29900, 29901, 13, 4706, 1596, 877, 11432, 29901, 26804, 4046, 29871, 29896, 29946, 29900, 13461, 287, 29901, 742, 2435, 29898, 6112, 504, 1062, 876, 13, 1678, 1683, 29901, 13, 4706, 3252, 277, 29889, 5504, 29918, 4882, 29898, 4882, 29922, 6112, 504, 1062, 29897, 13, 13, 1753, 323, 16668, 28210, 29898, 7516, 277, 29892, 1445, 29892, 6112, 504, 1062, 1125, 13, 1678, 9995, 29911, 705, 1691, 263, 2643, 411, 263, 7623, 13, 1678, 3252, 277, 529, 27418, 1656, 10202, 1653, 411, 8168, 1656, 29898, 20576, 29918, 10818, 29892, 12279, 29925, 29918, 1660, 22245, 29911, 29892, 438, 20656, 29950, 29918, 4986, 29968, 1430, 29892, 438, 20656, 29950, 29918, 4986, 29968, 1430, 29918, 1660, 22245, 29911, 29897, 13, 1678, 934, 529, 710, 10202, 2224, 322, 10422, 304, 7623, 13, 1678, 1002, 504, 1062, 529, 710, 10202, 1818, 367, 5277, 29871, 29896, 29946, 29900, 4890, 13, 1678, 9995, 13, 1678, 15373, 353, 1722, 29898, 1445, 29892, 525, 6050, 1495, 13, 1678, 2933, 353, 23394, 29889, 9009, 29918, 9799, 29898, 9799, 29922, 21596, 29897, 13, 1678, 3252, 277, 29889, 5504, 29918, 4882, 29898, 4882, 29922, 6112, 504, 1062, 29892, 5745, 29918, 4841, 11759, 5327, 1839, 9799, 29918, 333, 2033, 2314, 13, 13, 1753, 323, 16668, 15167, 29898, 7516, 277, 29892, 1445, 29892, 6112, 504, 1062, 1125, 13, 1678, 9995, 29911, 705, 1691, 263, 2643, 411, 263, 4863, 13, 1678, 3252, 277, 529, 27418, 1656, 10202, 1653, 411, 8168, 1656, 29898, 20576, 29918, 10818, 29892, 12279, 29925, 29918, 1660, 22245, 29911, 29892, 438, 20656, 29950, 29918, 4986, 29968, 1430, 29892, 438, 20656, 29950, 29918, 4986, 29968, 1430, 29918, 1660, 22245, 29911, 29897, 13, 1678, 934, 529, 710, 10202, 2224, 322, 10422, 304, 4863, 13, 1678, 1002, 504, 1062, 529, 710, 10202, 1818, 367, 5277, 29871, 29896, 29946, 29900, 4890, 13, 1678, 9995, 13, 1678, 4863, 353, 1722, 29898, 1445, 29892, 525, 6050, 1495, 13, 1678, 2933, 353, 23394, 29889, 9009, 29918, 9641, 29898, 9799, 29922, 9641, 29892, 5745, 29918, 1853, 2433, 9641, 29914, 1526, 29946, 1495, 13, 1678, 3252, 277, 29889, 5504, 29918, 4882, 29898, 4882, 29922, 6112, 504, 1062, 29892, 5745, 29918, 4841, 11759, 5327, 1839, 9799, 29918, 333, 2033, 2314, 13, 2 ]
syntactic_complexity.py
volkancirik/synlana
1
54402
'''ORIGINAL file:https://github.com/neubig/util-scripts/blob/master/syntactic-complexity.py ''' #!/usr/bin/env python ''' A program to calculate syntactic complexity of parse trees. (Relies on NLTK) This is an implementation of some of the methods in: Syntactic complexity measures for detecting Mild Cognitive Impairment <NAME>, <NAME> and <NAME> Proc BioNLP 2007. ''' try: import sys from nltk.tree import Tree from nltk.draw.tree import TreeWidget from nltk.draw.util import (CanvasFrame, CanvasWidget, BoxWidget, TextWidget, ParenWidget, OvalWidget) except ImportError: print('Error: cannot import the NLTK!') print('You need to install the NLTK. Please visit http://nltk.org/install.html for details.') print("On Ubuntu, the installation can be done via 'sudo apt-get install python-nltk'") sys.exit() def calc_words(t): if type(t) == str: return 1 else: val = 0 for child in t: val += calc_words(child) return val def calc_nodes(t): if type(t) == str: return 0 else: val = 0 for child in t: val += calc_nodes(child)+1 return val def calc_yngve(t, par): if type(t) == str: return par else: val = 0 for i, child in enumerate(reversed(t)): val += calc_yngve(child, par+i) return val def is_sent(val): return len(val) > 0 and val[0] == "S" def calc_frazier(t, par, par_lab): # print t # print par if type(t) == str: # print par-1 return par-1 else: val = 0 for i, child in enumerate(t): # For all but the leftmost child, zero score = 0 if i == 0: my_lab = t.label() # If it's a sentence, and not duplicated, add 1.5 if is_sent(my_lab): score = (0 if is_sent(par_lab) else par+1.5) # Otherwise, unless it's a root node, add one elif my_lab != "" and my_lab != "ROOT" and my_lab != "TOP": score = par + 1 val += calc_frazier(child, score, my_lab) return val def main(): sents = 0 words_tot = 0 yngve_tot = 0 frazier_tot = 0 nodes_tot = 0 for line in sys.stdin: if line == "end": break print('>>>line', line) t = Tree.fromstring(line) words = calc_words(t) words_tot += words sents += 1 yngve = calc_yngve(t, 0) yngve_avg = float(yngve)/words yngve_tot += yngve_avg nodes = calc_nodes(t) nodes_avg = float(nodes)/words nodes_tot += nodes_avg frazier = calc_frazier(t, 0, "") frazier_avg = float(frazier)/words frazier_tot += frazier_avg print("Sentence=%d\twords=%d\tyngve=%f\tfrazier=%f\tnodes=%f" % (sents, words, yngve_avg, frazier_avg, nodes_avg)) # yngve_avg = float(yngve_tot)/sents # frazier_avg = float(frazier_tot)/sents # nodes_avg = float(nodes_tot)/sents # words_avg = float(words_tot)/sents # print("Total\tsents=%d\twords=%f\tyngve=%f\tfrazier=%f\tnodes=%f" % # (sents, words_avg, yngve_avg, frazier_avg, nodes_avg)) if __name__ == '__main__': main()
[ 1, 14550, 1955, 6259, 1177, 1964, 934, 29901, 991, 597, 3292, 29889, 510, 29914, 484, 431, 335, 29914, 4422, 29899, 16713, 29914, 10054, 29914, 6207, 29914, 29879, 3903, 17911, 29899, 19676, 537, 29889, 2272, 13, 12008, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 12008, 13, 29909, 1824, 304, 8147, 269, 3903, 17911, 13644, 310, 6088, 10697, 29889, 313, 9662, 583, 373, 405, 5850, 29968, 29897, 13, 4013, 338, 385, 5314, 310, 777, 310, 278, 3519, 297, 29901, 13, 13, 29903, 3903, 17911, 13644, 15366, 363, 6459, 292, 341, 789, 315, 3811, 3321, 14305, 1466, 358, 13, 29966, 5813, 10202, 529, 5813, 29958, 322, 529, 5813, 29958, 13, 27893, 21184, 29940, 13208, 29871, 29906, 29900, 29900, 29955, 29889, 13, 12008, 13, 13, 13, 2202, 29901, 13, 29871, 1053, 10876, 13, 29871, 515, 302, 1896, 29895, 29889, 8336, 1053, 15472, 13, 29871, 515, 302, 1896, 29895, 29889, 4012, 29889, 8336, 1053, 15472, 8801, 13, 29871, 515, 302, 1896, 29895, 29889, 4012, 29889, 4422, 1053, 313, 21960, 4308, 29892, 1815, 4428, 8801, 29892, 11773, 8801, 29892, 13, 462, 795, 3992, 8801, 29892, 1459, 264, 8801, 29892, 438, 791, 8801, 29897, 13, 19499, 16032, 2392, 29901, 13, 29871, 1596, 877, 2392, 29901, 2609, 1053, 278, 405, 5850, 29968, 29991, 1495, 13, 29871, 1596, 877, 3492, 817, 304, 2601, 278, 405, 5850, 29968, 29889, 3529, 6493, 1732, 597, 29876, 1896, 29895, 29889, 990, 29914, 6252, 29889, 1420, 363, 4902, 29889, 1495, 13, 29871, 1596, 703, 2951, 8294, 29892, 278, 11161, 508, 367, 2309, 3025, 525, 15360, 10882, 29899, 657, 2601, 3017, 29899, 29876, 1896, 29895, 29915, 1159, 13, 29871, 10876, 29889, 13322, 580, 13, 13, 13, 1753, 22235, 29918, 9303, 29898, 29873, 1125, 13, 29871, 565, 1134, 29898, 29873, 29897, 1275, 851, 29901, 13, 1678, 736, 29871, 29896, 13, 29871, 1683, 29901, 13, 1678, 659, 353, 29871, 29900, 13, 1678, 363, 2278, 297, 260, 29901, 13, 418, 659, 4619, 22235, 29918, 9303, 29898, 5145, 29897, 13, 1678, 736, 659, 13, 13, 13, 1753, 22235, 29918, 18010, 29898, 29873, 1125, 13, 29871, 565, 1134, 29898, 29873, 29897, 1275, 851, 29901, 13, 1678, 736, 29871, 29900, 13, 29871, 1683, 29901, 13, 1678, 659, 353, 29871, 29900, 13, 1678, 363, 2278, 297, 260, 29901, 13, 418, 659, 4619, 22235, 29918, 18010, 29898, 5145, 7240, 29896, 13, 1678, 736, 659, 13, 13, 13, 1753, 22235, 29918, 29891, 865, 345, 29898, 29873, 29892, 610, 1125, 13, 29871, 565, 1134, 29898, 29873, 29897, 1275, 851, 29901, 13, 1678, 736, 610, 13, 29871, 1683, 29901, 13, 1678, 659, 353, 29871, 29900, 13, 1678, 363, 474, 29892, 2278, 297, 26985, 29898, 276, 874, 287, 29898, 29873, 22164, 13, 418, 659, 4619, 22235, 29918, 29891, 865, 345, 29898, 5145, 29892, 610, 29974, 29875, 29897, 13, 1678, 736, 659, 13, 13, 13, 1753, 338, 29918, 18616, 29898, 791, 1125, 13, 29871, 736, 7431, 29898, 791, 29897, 1405, 29871, 29900, 322, 659, 29961, 29900, 29962, 1275, 376, 29903, 29908, 13, 13, 13, 1753, 22235, 29918, 29888, 9504, 631, 29898, 29873, 29892, 610, 29892, 610, 29918, 8205, 1125, 13, 29871, 396, 1596, 260, 13, 29871, 396, 1596, 610, 13, 29871, 565, 1134, 29898, 29873, 29897, 1275, 851, 29901, 13, 1678, 396, 1596, 610, 29899, 29896, 13, 1678, 736, 610, 29899, 29896, 13, 29871, 1683, 29901, 13, 1678, 659, 353, 29871, 29900, 13, 1678, 363, 474, 29892, 2278, 297, 26985, 29898, 29873, 1125, 13, 418, 396, 1152, 599, 541, 278, 2175, 3242, 2278, 29892, 5225, 13, 418, 8158, 353, 29871, 29900, 13, 418, 565, 474, 1275, 29871, 29900, 29901, 13, 4706, 590, 29918, 8205, 353, 260, 29889, 1643, 580, 13, 4706, 396, 960, 372, 29915, 29879, 263, 10541, 29892, 322, 451, 5141, 9169, 29892, 788, 29871, 29896, 29889, 29945, 13, 4706, 565, 338, 29918, 18616, 29898, 1357, 29918, 8205, 1125, 13, 3986, 8158, 353, 313, 29900, 565, 338, 29918, 18616, 29898, 862, 29918, 8205, 29897, 1683, 610, 29974, 29896, 29889, 29945, 29897, 13, 4706, 396, 13466, 29892, 6521, 372, 29915, 29879, 263, 3876, 2943, 29892, 788, 697, 13, 4706, 25342, 590, 29918, 8205, 2804, 5124, 322, 590, 29918, 8205, 2804, 376, 21289, 29908, 322, 590, 29918, 8205, 2804, 376, 29911, 4590, 1115, 13, 3986, 8158, 353, 610, 718, 29871, 29896, 13, 418, 659, 4619, 22235, 29918, 29888, 9504, 631, 29898, 5145, 29892, 8158, 29892, 590, 29918, 8205, 29897, 13, 1678, 736, 659, 13, 13, 13, 1753, 1667, 7295, 13, 29871, 269, 1237, 353, 29871, 29900, 13, 29871, 3838, 29918, 4260, 353, 29871, 29900, 13, 29871, 343, 865, 345, 29918, 4260, 353, 29871, 29900, 13, 29871, 5227, 29920, 631, 29918, 4260, 353, 29871, 29900, 13, 29871, 7573, 29918, 4260, 353, 29871, 29900, 13, 29871, 363, 1196, 297, 10876, 29889, 4172, 262, 29901, 13, 1678, 565, 1196, 1275, 376, 355, 1115, 13, 418, 2867, 13, 1678, 1596, 877, 6778, 29958, 1220, 742, 1196, 29897, 13, 1678, 260, 353, 15472, 29889, 3166, 1807, 29898, 1220, 29897, 13, 1678, 3838, 353, 22235, 29918, 9303, 29898, 29873, 29897, 13, 1678, 3838, 29918, 4260, 4619, 3838, 13, 1678, 269, 1237, 4619, 29871, 29896, 13, 1678, 343, 865, 345, 353, 22235, 29918, 29891, 865, 345, 29898, 29873, 29892, 29871, 29900, 29897, 13, 1678, 343, 865, 345, 29918, 485, 29887, 353, 5785, 29898, 29891, 865, 345, 6802, 9303, 13, 1678, 343, 865, 345, 29918, 4260, 4619, 343, 865, 345, 29918, 485, 29887, 13, 1678, 7573, 353, 22235, 29918, 18010, 29898, 29873, 29897, 13, 1678, 7573, 29918, 485, 29887, 353, 5785, 29898, 18010, 6802, 9303, 13, 1678, 7573, 29918, 4260, 4619, 7573, 29918, 485, 29887, 13, 1678, 5227, 29920, 631, 353, 22235, 29918, 29888, 9504, 631, 29898, 29873, 29892, 29871, 29900, 29892, 20569, 13, 1678, 5227, 29920, 631, 29918, 485, 29887, 353, 5785, 29898, 29888, 9504, 631, 6802, 9303, 13, 1678, 5227, 29920, 631, 29918, 4260, 4619, 5227, 29920, 631, 29918, 485, 29887, 13, 1678, 1596, 703, 29903, 296, 663, 16328, 29881, 29905, 29873, 9303, 16328, 29881, 29905, 1017, 865, 345, 16328, 29888, 29905, 13264, 9504, 631, 16328, 29888, 29905, 6277, 2631, 16328, 29888, 29908, 1273, 13, 3986, 313, 29879, 1237, 29892, 3838, 29892, 343, 865, 345, 29918, 485, 29887, 29892, 5227, 29920, 631, 29918, 485, 29887, 29892, 7573, 29918, 485, 29887, 876, 13, 29871, 396, 343, 865, 345, 29918, 485, 29887, 353, 5785, 29898, 29891, 865, 345, 29918, 4260, 6802, 29879, 1237, 13, 29871, 396, 5227, 29920, 631, 29918, 485, 29887, 353, 5785, 29898, 29888, 9504, 631, 29918, 4260, 6802, 29879, 1237, 13, 29871, 396, 7573, 29918, 485, 29887, 353, 5785, 29898, 18010, 29918, 4260, 6802, 29879, 1237, 13, 29871, 396, 3838, 29918, 485, 29887, 353, 5785, 29898, 9303, 29918, 4260, 6802, 29879, 1237, 13, 29871, 396, 1596, 703, 11536, 29905, 1372, 1237, 16328, 29881, 29905, 29873, 9303, 16328, 29888, 29905, 1017, 865, 345, 16328, 29888, 29905, 13264, 9504, 631, 16328, 29888, 29905, 6277, 2631, 16328, 29888, 29908, 1273, 13, 29871, 396, 539, 313, 29879, 1237, 29892, 3838, 29918, 485, 29887, 29892, 343, 865, 345, 29918, 485, 29887, 29892, 5227, 29920, 631, 29918, 485, 29887, 29892, 7573, 29918, 485, 29887, 876, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 29871, 1667, 580, 13, 2 ]
ex02_randomness_test/tests/test_main.py
ittigorn-tra/exercises
0
32288
from logging import getLogger from lottery_config import LotteryConfig from main import draw_lottery logger = getLogger() def test_draw_lottery(): for test_count in range(10000): draw_results = draw_lottery() logger.info(f'Test #{str(test_count).ljust(4)} Draw Results : {draw_results}') # check if return type is as in the requirement assert isinstance(draw_results, list) # check if properties is as in config assert len(draw_results) == LotteryConfig.DRAW_SIZE.value assert min(draw_results) >= LotteryConfig.BALL_MIN_NO.value assert max(draw_results) <= LotteryConfig.BALL_MAX_NO.value # check that the previous ball is always less than current ball previous_ball = LotteryConfig.BALL_MIN_NO.value - 1 for ball in draw_results: assert ball > previous_ball previous_ball = ball
[ 1, 515, 12183, 1053, 679, 16363, 13, 13, 3166, 3287, 22005, 29918, 2917, 1053, 20815, 22005, 3991, 13, 3166, 1667, 1053, 4216, 29918, 8276, 22005, 13, 13, 21707, 353, 679, 16363, 580, 13, 13, 13, 1753, 1243, 29918, 4012, 29918, 8276, 22005, 7295, 13, 1678, 363, 1243, 29918, 2798, 297, 3464, 29898, 29896, 29900, 29900, 29900, 29900, 1125, 13, 4706, 4216, 29918, 9902, 353, 4216, 29918, 8276, 22005, 580, 13, 4706, 17927, 29889, 3888, 29898, 29888, 29915, 3057, 24037, 710, 29898, 1688, 29918, 2798, 467, 29880, 5143, 29898, 29946, 2915, 18492, 17212, 584, 426, 4012, 29918, 9902, 29913, 1495, 13, 13, 4706, 396, 1423, 565, 736, 1134, 338, 408, 297, 278, 11809, 13, 4706, 4974, 338, 8758, 29898, 4012, 29918, 9902, 29892, 1051, 29897, 13, 13, 4706, 396, 1423, 565, 4426, 338, 408, 297, 2295, 13, 4706, 4974, 7431, 29898, 4012, 29918, 9902, 29897, 1275, 20815, 22005, 3991, 29889, 29928, 4717, 29956, 29918, 14226, 29889, 1767, 13, 4706, 4974, 1375, 29898, 4012, 29918, 9902, 29897, 6736, 20815, 22005, 3991, 29889, 29933, 9818, 29918, 16173, 29918, 6632, 29889, 1767, 13, 4706, 4974, 4236, 29898, 4012, 29918, 9902, 29897, 5277, 20815, 22005, 3991, 29889, 29933, 9818, 29918, 12648, 29918, 6632, 29889, 1767, 13, 13, 4706, 396, 1423, 393, 278, 3517, 8287, 338, 2337, 3109, 1135, 1857, 8287, 13, 4706, 3517, 29918, 2135, 353, 20815, 22005, 3991, 29889, 29933, 9818, 29918, 16173, 29918, 6632, 29889, 1767, 448, 29871, 29896, 13, 4706, 363, 8287, 297, 4216, 29918, 9902, 29901, 13, 9651, 4974, 8287, 1405, 3517, 29918, 2135, 13, 9651, 3517, 29918, 2135, 353, 8287, 13, 2 ]
Qt_interface/add_subject.py
kithsirij/NLP-based-Syllabus-Coverage-Exam-paper-checker-Tool
1
44
<reponame>kithsirij/NLP-based-Syllabus-Coverage-Exam-paper-checker-Tool # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'add_subject.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig, _encoding) except AttributeError: def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig) class Ui_Dialog_add_subject(object): def setupUi(self, Dialog_add_subject): Dialog_add_subject.setObjectName(_fromUtf8("Dialog_add_subject")) Dialog_add_subject.resize(568, 374) font = QtGui.QFont() font.setFamily(_fromUtf8("Times New Roman")) font.setPointSize(10) Dialog_add_subject.setFont(font) Dialog_add_subject.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8("Qt_interface/SE_syllabus/4zIr6y.jpg")), QtGui.QIcon.Normal, QtGui.QIcon.Off) Dialog_add_subject.setWindowIcon(icon) self.lbl_subject_name = QtGui.QLabel(Dialog_add_subject) self.lbl_subject_name.setGeometry(QtCore.QRect(50, 235, 131, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("Times New Roman")) font.setPointSize(12) self.lbl_subject_name.setFont(font) self.lbl_subject_name.setObjectName(_fromUtf8("lbl_subject_name")) self.label_add_subject = QtGui.QLabel(Dialog_add_subject) self.label_add_subject.setGeometry(QtCore.QRect(220, 30, 151, 31)) font = QtGui.QFont() font.setFamily(_fromUtf8("Times New Roman")) font.setPointSize(14) font.setBold(True) font.setWeight(75) self.label_add_subject.setFont(font) self.label_add_subject.setObjectName(_fromUtf8("label_add_subject")) self.lineEdit_subject_name = QtGui.QLineEdit(Dialog_add_subject) self.lineEdit_subject_name.setGeometry(QtCore.QRect(190, 230, 321, 31)) font = QtGui.QFont() font.setFamily(_fromUtf8("Times New Roman")) font.setPointSize(12) self.lineEdit_subject_name.setFont(font) self.lineEdit_subject_name.setObjectName(_fromUtf8("lineEdit_subject_name")) self.label_year = QtGui.QLabel(Dialog_add_subject) self.label_year.setGeometry(QtCore.QRect(50, 95, 81, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("Times New Roman")) font.setPointSize(12) self.label_year.setFont(font) self.label_year.setObjectName(_fromUtf8("label_year")) self.label_semester = QtGui.QLabel(Dialog_add_subject) self.label_semester.setGeometry(QtCore.QRect(50, 165, 91, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("Times New Roman")) font.setPointSize(12) self.label_semester.setFont(font) self.label_semester.setObjectName(_fromUtf8("label_semester")) self.pushButton_save = QtGui.QPushButton(Dialog_add_subject) self.pushButton_save.setGeometry(QtCore.QRect(190, 290, 111, 31)) font = QtGui.QFont() font.setFamily(_fromUtf8("Times New Roman")) font.setPointSize(10) self.pushButton_save.setFont(font) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(_fromUtf8("Qt_interface/SE_syllabus/Save-as.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_save.setIcon(icon1) self.pushButton_save.setIconSize(QtCore.QSize(20, 20)) self.pushButton_save.setObjectName(_fromUtf8("pushButton_save")) self.pushButton_cancel = QtGui.QPushButton(Dialog_add_subject) self.pushButton_cancel.setGeometry(QtCore.QRect(340, 290, 111, 31)) font = QtGui.QFont() font.setFamily(_fromUtf8("Times New Roman")) self.pushButton_cancel.setFont(font) icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap(_fromUtf8("Qt_interface/SE_syllabus/if_draw-08_725558.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_cancel.setIcon(icon2) self.pushButton_cancel.setIconSize(QtCore.QSize(20, 20)) self.pushButton_cancel.setObjectName(_fromUtf8("pushButton_cancel")) self.comboBox_year = QtGui.QComboBox(Dialog_add_subject) self.comboBox_year.setGeometry(QtCore.QRect(190, 91, 111, 31)) font = QtGui.QFont() font.setFamily(_fromUtf8("Times New Roman")) font.setPointSize(12) self.comboBox_year.setFont(font) self.comboBox_year.setObjectName(_fromUtf8("comboBox_year")) self.comboBox_semester = QtGui.QComboBox(Dialog_add_subject) self.comboBox_semester.setGeometry(QtCore.QRect(190, 160, 111, 31)) font = QtGui.QFont() font.setFamily(_fromUtf8("Times New Roman")) font.setPointSize(12) self.comboBox_semester.setFont(font) self.comboBox_semester.setObjectName(_fromUtf8("comboBox_semester")) self.retranslateUi(Dialog_add_subject) QtCore.QObject.connect(self.pushButton_cancel, QtCore.SIGNAL(_fromUtf8("clicked()")), self.lineEdit_subject_name.clear) QtCore.QMetaObject.connectSlotsByName(Dialog_add_subject) def retranslateUi(self, Dialog_add_subject): Dialog_add_subject.setWindowTitle(_translate("Dialog_add_subject", "Dialog", None)) self.lbl_subject_name.setText(_translate("Dialog_add_subject", "SUBJECT NAME", None)) self.label_add_subject.setText(_translate("Dialog_add_subject", "ADD SUBJECT", None)) self.label_year.setText(_translate("Dialog_add_subject", "YEAR", None)) self.label_semester.setText(_translate("Dialog_add_subject", "SEMESTER", None)) self.pushButton_save.setText(_translate("Dialog_add_subject", "SAVE", None)) self.pushButton_cancel.setText(_translate("Dialog_add_subject", "CANCEL", None)) if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) Dialog_add_subject = QtGui.QDialog() ui = Ui_Dialog_add_subject() ui.setupUi(Dialog_add_subject) Dialog_add_subject.show() sys.exit(app.exec_())
[ 1, 529, 276, 1112, 420, 29958, 29895, 389, 1039, 4927, 29914, 29940, 13208, 29899, 6707, 29899, 29903, 15114, 370, 375, 29899, 29907, 957, 482, 29899, 1252, 314, 29899, 19773, 29899, 3198, 261, 29899, 12229, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 30004, 13, 30004, 13, 29937, 3812, 5314, 5759, 515, 5183, 14313, 934, 525, 1202, 29918, 16009, 29889, 1481, 29915, 30004, 13, 29937, 30004, 13, 29937, 6760, 630, 491, 29901, 10772, 17303, 29946, 3740, 775, 15299, 29871, 29946, 29889, 29896, 29896, 29889, 29946, 30004, 13, 29937, 30004, 13, 29937, 399, 25614, 29991, 2178, 3620, 1754, 297, 445, 934, 674, 367, 5714, 29991, 30004, 13, 30004, 13, 3166, 10772, 17303, 29946, 1053, 14705, 9203, 29892, 14705, 28707, 30004, 13, 30004, 13, 2202, 29901, 30004, 13, 1678, 903, 3166, 29965, 13264, 29947, 353, 14705, 9203, 29889, 29984, 1231, 29889, 3166, 29965, 13264, 29947, 30004, 13, 19499, 23833, 2392, 29901, 30004, 13, 1678, 822, 903, 3166, 29965, 13264, 29947, 29898, 29879, 1125, 30004, 13, 4706, 736, 269, 30004, 13, 30004, 13, 2202, 29901, 30004, 13, 1678, 903, 22331, 353, 14705, 28707, 29889, 29984, 4873, 29889, 2525, 12858, 10496, 29947, 30004, 13, 1678, 822, 903, 21652, 29898, 4703, 29892, 1426, 29892, 766, 1117, 335, 1125, 30004, 13, 4706, 736, 14705, 28707, 29889, 29984, 4873, 29889, 21652, 29898, 4703, 29892, 1426, 29892, 766, 1117, 335, 29892, 903, 22331, 8443, 13, 19499, 23833, 2392, 29901, 30004, 13, 1678, 822, 903, 21652, 29898, 4703, 29892, 1426, 29892, 766, 1117, 335, 1125, 30004, 13, 4706, 736, 14705, 28707, 29889, 29984, 4873, 29889, 21652, 29898, 4703, 29892, 1426, 29892, 766, 1117, 335, 8443, 13, 30004, 13, 1990, 501, 29875, 29918, 7647, 29918, 1202, 29918, 16009, 29898, 3318, 1125, 30004, 13, 1678, 822, 6230, 29965, 29875, 29898, 1311, 29892, 18878, 29918, 1202, 29918, 16009, 1125, 30004, 13, 4706, 18878, 29918, 1202, 29918, 16009, 29889, 842, 2061, 1170, 7373, 3166, 29965, 13264, 29947, 703, 7647, 29918, 1202, 29918, 16009, 5783, 30004, 13, 4706, 18878, 29918, 1202, 29918, 16009, 29889, 21476, 29898, 29945, 29953, 29947, 29892, 29871, 29941, 29955, 29946, 8443, 13, 4706, 4079, 353, 14705, 28707, 29889, 29984, 9824, 26471, 13, 4706, 4079, 29889, 842, 27104, 7373, 3166, 29965, 13264, 29947, 703, 29164, 1570, 5917, 5783, 30004, 13, 4706, 4079, 29889, 842, 5228, 3505, 29898, 29896, 29900, 8443, 13, 4706, 18878, 29918, 1202, 29918, 16009, 29889, 842, 9824, 29898, 5657, 8443, 13, 4706, 18878, 29918, 1202, 29918, 16009, 29889, 842, 2677, 6823, 15644, 29898, 17303, 9203, 29889, 17303, 29889, 7281, 2677, 6823, 8443, 13, 4706, 9849, 353, 14705, 28707, 29889, 29984, 12492, 26471, 13, 4706, 9849, 29889, 1202, 29925, 861, 1958, 29898, 17303, 28707, 29889, 29984, 29925, 861, 1958, 7373, 3166, 29965, 13264, 29947, 703, 17303, 29918, 13248, 29914, 1660, 29918, 29879, 15114, 370, 375, 29914, 29946, 29920, 29902, 29878, 29953, 29891, 29889, 6173, 1159, 511, 14705, 28707, 29889, 29984, 12492, 29889, 19077, 29892, 14705, 28707, 29889, 29984, 12492, 29889, 6880, 8443, 13, 4706, 18878, 29918, 1202, 29918, 16009, 29889, 842, 5907, 12492, 29898, 4144, 8443, 13, 4706, 1583, 29889, 26648, 29918, 16009, 29918, 978, 353, 14705, 28707, 29889, 2239, 1107, 29898, 7647, 29918, 1202, 29918, 16009, 8443, 13, 4706, 1583, 29889, 26648, 29918, 16009, 29918, 978, 29889, 842, 7999, 7843, 29898, 17303, 9203, 29889, 29984, 7364, 29898, 29945, 29900, 29892, 29871, 29906, 29941, 29945, 29892, 29871, 29896, 29941, 29896, 29892, 29871, 29906, 29896, 876, 30004, 13, 4706, 4079, 353, 14705, 28707, 29889, 29984, 9824, 26471, 13, 4706, 4079, 29889, 842, 27104, 7373, 3166, 29965, 13264, 29947, 703, 29164, 1570, 5917, 5783, 30004, 13, 4706, 4079, 29889, 842, 5228, 3505, 29898, 29896, 29906, 8443, 13, 4706, 1583, 29889, 26648, 29918, 16009, 29918, 978, 29889, 842, 9824, 29898, 5657, 8443, 13, 4706, 1583, 29889, 26648, 29918, 16009, 29918, 978, 29889, 842, 2061, 1170, 7373, 3166, 29965, 13264, 29947, 703, 26648, 29918, 16009, 29918, 978, 5783, 30004, 13, 4706, 1583, 29889, 1643, 29918, 1202, 29918, 16009, 353, 14705, 28707, 29889, 2239, 1107, 29898, 7647, 29918, 1202, 29918, 16009, 8443, 13, 4706, 1583, 29889, 1643, 29918, 1202, 29918, 16009, 29889, 842, 7999, 7843, 29898, 17303, 9203, 29889, 29984, 7364, 29898, 29906, 29906, 29900, 29892, 29871, 29941, 29900, 29892, 29871, 29896, 29945, 29896, 29892, 29871, 29941, 29896, 876, 30004, 13, 4706, 4079, 353, 14705, 28707, 29889, 29984, 9824, 26471, 13, 4706, 4079, 29889, 842, 27104, 7373, 3166, 29965, 13264, 29947, 703, 29164, 1570, 5917, 5783, 30004, 13, 4706, 4079, 29889, 842, 5228, 3505, 29898, 29896, 29946, 8443, 13, 4706, 4079, 29889, 842, 29933, 1025, 29898, 5574, 8443, 13, 4706, 4079, 29889, 842, 22676, 29898, 29955, 29945, 8443, 13, 4706, 1583, 29889, 1643, 29918, 1202, 29918, 16009, 29889, 842, 9824, 29898, 5657, 8443, 13, 4706, 1583, 29889, 1643, 29918, 1202, 29918, 16009, 29889, 842, 2061, 1170, 7373, 3166, 29965, 13264, 29947, 703, 1643, 29918, 1202, 29918, 16009, 5783, 30004, 13, 4706, 1583, 29889, 1220, 6103, 29918, 16009, 29918, 978, 353, 14705, 28707, 29889, 2239, 457, 6103, 29898, 7647, 29918, 1202, 29918, 16009, 8443, 13, 4706, 1583, 29889, 1220, 6103, 29918, 16009, 29918, 978, 29889, 842, 7999, 7843, 29898, 17303, 9203, 29889, 29984, 7364, 29898, 29896, 29929, 29900, 29892, 29871, 29906, 29941, 29900, 29892, 29871, 29941, 29906, 29896, 29892, 29871, 29941, 29896, 876, 30004, 13, 4706, 4079, 353, 14705, 28707, 29889, 29984, 9824, 26471, 13, 4706, 4079, 29889, 842, 27104, 7373, 3166, 29965, 13264, 29947, 703, 29164, 1570, 5917, 5783, 30004, 13, 4706, 4079, 29889, 842, 5228, 3505, 29898, 29896, 29906, 8443, 13, 4706, 1583, 29889, 1220, 6103, 29918, 16009, 29918, 978, 29889, 842, 9824, 29898, 5657, 8443, 13, 4706, 1583, 29889, 1220, 6103, 29918, 16009, 29918, 978, 29889, 842, 2061, 1170, 7373, 3166, 29965, 13264, 29947, 703, 1220, 6103, 29918, 16009, 29918, 978, 5783, 30004, 13, 4706, 1583, 29889, 1643, 29918, 6360, 353, 14705, 28707, 29889, 2239, 1107, 29898, 7647, 29918, 1202, 29918, 16009, 8443, 13, 4706, 1583, 29889, 1643, 29918, 6360, 29889, 842, 7999, 7843, 29898, 17303, 9203, 29889, 29984, 7364, 29898, 29945, 29900, 29892, 29871, 29929, 29945, 29892, 29871, 29947, 29896, 29892, 29871, 29906, 29896, 876, 30004, 13, 4706, 4079, 353, 14705, 28707, 29889, 29984, 9824, 26471, 13, 4706, 4079, 29889, 842, 27104, 7373, 3166, 29965, 13264, 29947, 703, 29164, 1570, 5917, 5783, 30004, 13, 4706, 4079, 29889, 842, 5228, 3505, 29898, 29896, 29906, 8443, 13, 4706, 1583, 29889, 1643, 29918, 6360, 29889, 842, 9824, 29898, 5657, 8443, 13, 4706, 1583, 29889, 1643, 29918, 6360, 29889, 842, 2061, 1170, 7373, 3166, 29965, 13264, 29947, 703, 1643, 29918, 6360, 5783, 30004, 13, 4706, 1583, 29889, 1643, 29918, 12846, 4156, 353, 14705, 28707, 29889, 2239, 1107, 29898, 7647, 29918, 1202, 29918, 16009, 8443, 13, 4706, 1583, 29889, 1643, 29918, 12846, 4156, 29889, 842, 7999, 7843, 29898, 17303, 9203, 29889, 29984, 7364, 29898, 29945, 29900, 29892, 29871, 29896, 29953, 29945, 29892, 29871, 29929, 29896, 29892, 29871, 29906, 29896, 876, 30004, 13, 4706, 4079, 353, 14705, 28707, 29889, 29984, 9824, 26471, 13, 4706, 4079, 29889, 842, 27104, 7373, 3166, 29965, 13264, 29947, 703, 29164, 1570, 5917, 5783, 30004, 13, 4706, 4079, 29889, 842, 5228, 3505, 29898, 29896, 29906, 8443, 13, 4706, 1583, 29889, 1643, 29918, 12846, 4156, 29889, 842, 9824, 29898, 5657, 8443, 13, 4706, 1583, 29889, 1643, 29918, 12846, 4156, 29889, 842, 2061, 1170, 7373, 3166, 29965, 13264, 29947, 703, 1643, 29918, 12846, 4156, 5783, 30004, 13, 4706, 1583, 29889, 5910, 3125, 29918, 7620, 353, 14705, 28707, 29889, 29984, 27031, 3125, 29898, 7647, 29918, 1202, 29918, 16009, 8443, 13, 4706, 1583, 29889, 5910, 3125, 29918, 7620, 29889, 842, 7999, 7843, 29898, 17303, 9203, 29889, 29984, 7364, 29898, 29896, 29929, 29900, 29892, 29871, 29906, 29929, 29900, 29892, 29871, 29896, 29896, 29896, 29892, 29871, 29941, 29896, 876, 30004, 13, 4706, 4079, 353, 14705, 28707, 29889, 29984, 9824, 26471, 13, 4706, 4079, 29889, 842, 27104, 7373, 3166, 29965, 13264, 29947, 703, 29164, 1570, 5917, 5783, 30004, 13, 4706, 4079, 29889, 842, 5228, 3505, 29898, 29896, 29900, 8443, 13, 4706, 1583, 29889, 5910, 3125, 29918, 7620, 29889, 842, 9824, 29898, 5657, 8443, 13, 4706, 9849, 29896, 353, 14705, 28707, 29889, 29984, 12492, 26471, 13, 4706, 9849, 29896, 29889, 1202, 29925, 861, 1958, 29898, 17303, 28707, 29889, 29984, 29925, 861, 1958, 7373, 3166, 29965, 13264, 29947, 703, 17303, 29918, 13248, 29914, 1660, 29918, 29879, 15114, 370, 375, 29914, 11371, 29899, 294, 29889, 2732, 1159, 511, 14705, 28707, 29889, 29984, 12492, 29889, 19077, 29892, 14705, 28707, 29889, 29984, 12492, 29889, 6880, 8443, 13, 4706, 1583, 29889, 5910, 3125, 29918, 7620, 29889, 842, 12492, 29898, 4144, 29896, 8443, 13, 4706, 1583, 29889, 5910, 3125, 29918, 7620, 29889, 842, 12492, 3505, 29898, 17303, 9203, 29889, 29984, 3505, 29898, 29906, 29900, 29892, 29871, 29906, 29900, 876, 30004, 13, 4706, 1583, 29889, 5910, 3125, 29918, 7620, 29889, 842, 2061, 1170, 7373, 3166, 29965, 13264, 29947, 703, 5910, 3125, 29918, 7620, 5783, 30004, 13, 4706, 1583, 29889, 5910, 3125, 29918, 20713, 353, 14705, 28707, 29889, 29984, 27031, 3125, 29898, 7647, 29918, 1202, 29918, 16009, 8443, 13, 4706, 1583, 29889, 5910, 3125, 29918, 20713, 29889, 842, 7999, 7843, 29898, 17303, 9203, 29889, 29984, 7364, 29898, 29941, 29946, 29900, 29892, 29871, 29906, 29929, 29900, 29892, 29871, 29896, 29896, 29896, 29892, 29871, 29941, 29896, 876, 30004, 13, 4706, 4079, 353, 14705, 28707, 29889, 29984, 9824, 26471, 13, 4706, 4079, 29889, 842, 27104, 7373, 3166, 29965, 13264, 29947, 703, 29164, 1570, 5917, 5783, 30004, 13, 4706, 1583, 29889, 5910, 3125, 29918, 20713, 29889, 842, 9824, 29898, 5657, 8443, 13, 4706, 9849, 29906, 353, 14705, 28707, 29889, 29984, 12492, 26471, 13, 4706, 9849, 29906, 29889, 1202, 29925, 861, 1958, 29898, 17303, 28707, 29889, 29984, 29925, 861, 1958, 7373, 3166, 29965, 13264, 29947, 703, 17303, 29918, 13248, 29914, 1660, 29918, 29879, 15114, 370, 375, 29914, 361, 29918, 4012, 29899, 29900, 29947, 29918, 29955, 29906, 29945, 29945, 29945, 29947, 29889, 2732, 1159, 511, 14705, 28707, 29889, 29984, 12492, 29889, 19077, 29892, 14705, 28707, 29889, 29984, 12492, 29889, 6880, 8443, 13, 4706, 1583, 29889, 5910, 3125, 29918, 20713, 29889, 842, 12492, 29898, 4144, 29906, 8443, 13, 4706, 1583, 29889, 5910, 3125, 29918, 20713, 29889, 842, 12492, 3505, 29898, 17303, 9203, 29889, 29984, 3505, 29898, 29906, 29900, 29892, 29871, 29906, 29900, 876, 30004, 13, 4706, 1583, 29889, 5910, 3125, 29918, 20713, 29889, 842, 2061, 1170, 7373, 3166, 29965, 13264, 29947, 703, 5910, 3125, 29918, 20713, 5783, 30004, 13, 4706, 1583, 29889, 510, 17801, 29918, 6360, 353, 14705, 28707, 29889, 29984, 26628, 29898, 7647, 29918, 1202, 29918, 16009, 8443, 13, 4706, 1583, 29889, 510, 17801, 29918, 6360, 29889, 842, 7999, 7843, 29898, 17303, 9203, 29889, 29984, 7364, 29898, 29896, 29929, 29900, 29892, 29871, 29929, 29896, 29892, 29871, 29896, 29896, 29896, 29892, 29871, 29941, 29896, 876, 30004, 13, 4706, 4079, 353, 14705, 28707, 29889, 29984, 9824, 26471, 13, 4706, 4079, 29889, 842, 27104, 7373, 3166, 29965, 13264, 29947, 703, 29164, 1570, 5917, 5783, 30004, 13, 4706, 4079, 29889, 842, 5228, 3505, 29898, 29896, 29906, 8443, 13, 4706, 1583, 29889, 510, 17801, 29918, 6360, 29889, 842, 9824, 29898, 5657, 8443, 13, 4706, 1583, 29889, 510, 17801, 29918, 6360, 29889, 842, 2061, 1170, 7373, 3166, 29965, 13264, 29947, 703, 510, 17801, 29918, 6360, 5783, 30004, 13, 4706, 1583, 29889, 510, 17801, 29918, 12846, 4156, 353, 14705, 28707, 29889, 29984, 26628, 29898, 7647, 29918, 1202, 29918, 16009, 8443, 13, 4706, 1583, 29889, 510, 17801, 29918, 12846, 4156, 29889, 842, 7999, 7843, 29898, 17303, 9203, 29889, 29984, 7364, 29898, 29896, 29929, 29900, 29892, 29871, 29896, 29953, 29900, 29892, 29871, 29896, 29896, 29896, 29892, 29871, 29941, 29896, 876, 30004, 13, 4706, 4079, 353, 14705, 28707, 29889, 29984, 9824, 26471, 13, 4706, 4079, 29889, 842, 27104, 7373, 3166, 29965, 13264, 29947, 703, 29164, 1570, 5917, 5783, 30004, 13, 4706, 4079, 29889, 842, 5228, 3505, 29898, 29896, 29906, 8443, 13, 4706, 1583, 29889, 510, 17801, 29918, 12846, 4156, 29889, 842, 9824, 29898, 5657, 8443, 13, 4706, 1583, 29889, 510, 17801, 29918, 12846, 4156, 29889, 842, 2061, 1170, 7373, 3166, 29965, 13264, 29947, 703, 510, 17801, 29918, 12846, 4156, 5783, 30004, 13, 30004, 13, 4706, 1583, 29889, 276, 21652, 29965, 29875, 29898, 7647, 29918, 1202, 29918, 16009, 8443, 13, 4706, 14705, 9203, 29889, 29984, 2061, 29889, 6915, 29898, 1311, 29889, 5910, 3125, 29918, 20713, 29892, 14705, 9203, 29889, 5425, 20728, 1964, 7373, 3166, 29965, 13264, 29947, 703, 3808, 287, 580, 1159, 511, 1583, 29889, 1220, 6103, 29918, 16009, 29918, 978, 29889, 8551, 8443, 13, 4706, 14705, 9203, 29889, 29984, 19346, 2061, 29889, 6915, 16973, 1862, 2059, 1170, 29898, 7647, 29918, 1202, 29918, 16009, 8443, 13, 30004, 13, 1678, 822, 337, 21652, 29965, 29875, 29898, 1311, 29892, 18878, 29918, 1202, 29918, 16009, 1125, 30004, 13, 4706, 18878, 29918, 1202, 29918, 16009, 29889, 842, 5907, 7030, 7373, 21652, 703, 7647, 29918, 1202, 29918, 16009, 613, 376, 7647, 613, 6213, 876, 30004, 13, 4706, 1583, 29889, 26648, 29918, 16009, 29918, 978, 29889, 12038, 7373, 21652, 703, 7647, 29918, 1202, 29918, 16009, 613, 376, 20633, 17637, 27085, 613, 6213, 876, 30004, 13, 4706, 1583, 29889, 1643, 29918, 1202, 29918, 16009, 29889, 12038, 7373, 21652, 703, 7647, 29918, 1202, 29918, 16009, 613, 376, 17744, 27092, 17637, 613, 6213, 876, 30004, 13, 4706, 1583, 29889, 1643, 29918, 6360, 29889, 12038, 7373, 21652, 703, 7647, 29918, 1202, 29918, 16009, 613, 376, 29979, 26441, 613, 6213, 876, 30004, 13, 4706, 1583, 29889, 1643, 29918, 12846, 4156, 29889, 12038, 7373, 21652, 703, 7647, 29918, 1202, 29918, 16009, 613, 376, 1660, 2303, 1254, 1001, 613, 6213, 876, 30004, 13, 4706, 1583, 29889, 5910, 3125, 29918, 7620, 29889, 12038, 7373, 21652, 703, 7647, 29918, 1202, 29918, 16009, 613, 376, 29903, 7520, 29923, 613, 6213, 876, 30004, 13, 4706, 1583, 29889, 5910, 3125, 29918, 20713, 29889, 12038, 7373, 21652, 703, 7647, 29918, 1202, 29918, 16009, 613, 376, 29907, 23219, 29931, 613, 6213, 876, 30004, 13, 30004, 13, 30004, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 30004, 13, 1678, 1053, 10876, 30004, 13, 1678, 623, 353, 14705, 28707, 29889, 29984, 4873, 29898, 9675, 29889, 19218, 8443, 13, 1678, 18878, 29918, 1202, 29918, 16009, 353, 14705, 28707, 29889, 29984, 7647, 26471, 13, 1678, 14313, 353, 501, 29875, 29918, 7647, 29918, 1202, 29918, 16009, 26471, 13, 1678, 14313, 29889, 14669, 29965, 29875, 29898, 7647, 29918, 1202, 29918, 16009, 8443, 13, 1678, 18878, 29918, 1202, 29918, 16009, 29889, 4294, 26471, 13, 1678, 10876, 29889, 13322, 29898, 932, 29889, 4258, 29918, 3101, 30004, 13, 30004, 13, 2 ]
opennem/utils/scrapyd.py
paulculmsee/opennem
22
8687
<reponame>paulculmsee/opennem #!/usr/bin/env python """ Srapyd control methods """ import logging from typing import Any, Dict, List from urllib.parse import urljoin from opennem.settings import settings from opennem.utils.http import http from opennem.utils.scrapy import get_spiders logger = logging.getLogger("scrapyd.client") def get_jobs() -> Dict[str, Any]: job_url = urljoin( settings.scrapyd_url, "listjobs.json?project={}".format(settings.scrapyd_project_name), ) jobs = http.get(job_url).json() return jobs def job_cancel(id: str) -> bool: cancel_job_url = urljoin(settings.scrapyd_url, "cancel.json") r = http.post(cancel_job_url, data={"project": "opennem", "job": id}) resp = r.json() if resp["status"] == "error": logger.error("Error: {}".format(resp["message"])) return False logger.info("Cancelled job: {}".format(resp["jobid"])) return True def job_schedule(spider_name: str) -> bool: schedule_url = urljoin(settings.scrapyd_url, "schedule.json") try: r = http.post(schedule_url, data={"project": "opennem", "spider": spider_name}) except Exception as e: logger.error("Error getting {}: {}".format(schedule_url, e)) return False if not r.ok: logger.error("Error: {}".format(r.status_code)) return False resp = r.json() if resp["status"] == "error": logger.error("Error: {}".format(resp["message"])) return False logger.info("Queued spider {} with task: {}".format(spider_name, resp["jobid"])) return True def job_cancel_state(state: str = "pending") -> bool: jobs = get_jobs() if state not in jobs: logger.info("Invalid state or no jobs in state {}".format(state)) return False pending_jobs = jobs[state] for job in pending_jobs: job_id = job["id"] logger.info("Cancelling {}".format(job_id)) job_cancel(job_id) return True def job_schedule_all(matches: str = None) -> List[str]: spiders = get_spiders() spider_scheduled = [] for s in spiders: if matches and matches != s: continue job_schedule(s) spider_scheduled.append(s) return spider_scheduled
[ 1, 529, 276, 1112, 420, 29958, 3274, 352, 1810, 29885, 4149, 29914, 459, 2108, 331, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 15945, 29908, 13, 29903, 336, 2272, 29881, 2761, 3519, 13, 13, 15945, 29908, 13, 5215, 12183, 13, 3166, 19229, 1053, 3139, 29892, 360, 919, 29892, 2391, 13, 3166, 3142, 1982, 29889, 5510, 1053, 3142, 7122, 13, 13, 3166, 1722, 15344, 29889, 11027, 1053, 6055, 13, 3166, 1722, 15344, 29889, 13239, 29889, 1124, 1053, 1732, 13, 3166, 1722, 15344, 29889, 13239, 29889, 1557, 336, 2272, 1053, 679, 29918, 1028, 11376, 13, 13, 21707, 353, 12183, 29889, 657, 16363, 703, 1557, 336, 2272, 29881, 29889, 4645, 1159, 13, 13, 13, 1753, 679, 29918, 9057, 29879, 580, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 1678, 4982, 29918, 2271, 353, 3142, 7122, 29898, 13, 4706, 6055, 29889, 1557, 336, 2272, 29881, 29918, 2271, 29892, 13, 4706, 376, 1761, 9057, 29879, 29889, 3126, 29973, 4836, 3790, 29913, 1642, 4830, 29898, 11027, 29889, 1557, 336, 2272, 29881, 29918, 4836, 29918, 978, 511, 13, 1678, 1723, 13, 13, 1678, 17643, 353, 1732, 29889, 657, 29898, 9057, 29918, 2271, 467, 3126, 580, 13, 13, 1678, 736, 17643, 13, 13, 13, 1753, 4982, 29918, 20713, 29898, 333, 29901, 851, 29897, 1599, 6120, 29901, 13, 1678, 12611, 29918, 9057, 29918, 2271, 353, 3142, 7122, 29898, 11027, 29889, 1557, 336, 2272, 29881, 29918, 2271, 29892, 376, 20713, 29889, 3126, 1159, 13, 13, 1678, 364, 353, 1732, 29889, 2490, 29898, 20713, 29918, 9057, 29918, 2271, 29892, 848, 3790, 29908, 4836, 1115, 376, 459, 2108, 331, 613, 376, 9057, 1115, 1178, 1800, 13, 13, 1678, 4613, 353, 364, 29889, 3126, 580, 13, 13, 1678, 565, 4613, 3366, 4882, 3108, 1275, 376, 2704, 1115, 13, 4706, 17927, 29889, 2704, 703, 2392, 29901, 6571, 1642, 4830, 29898, 13713, 3366, 4906, 3108, 876, 13, 4706, 736, 7700, 13, 13, 1678, 17927, 29889, 3888, 703, 19420, 839, 4982, 29901, 6571, 1642, 4830, 29898, 13713, 3366, 9057, 333, 3108, 876, 13, 13, 1678, 736, 5852, 13, 13, 13, 1753, 4982, 29918, 816, 11272, 29898, 1028, 1241, 29918, 978, 29901, 851, 29897, 1599, 6120, 29901, 13, 1678, 20410, 29918, 2271, 353, 3142, 7122, 29898, 11027, 29889, 1557, 336, 2272, 29881, 29918, 2271, 29892, 376, 816, 11272, 29889, 3126, 1159, 13, 13, 1678, 1018, 29901, 13, 4706, 364, 353, 1732, 29889, 2490, 29898, 816, 11272, 29918, 2271, 29892, 848, 3790, 29908, 4836, 1115, 376, 459, 2108, 331, 613, 376, 1028, 1241, 1115, 805, 1241, 29918, 978, 1800, 13, 1678, 5174, 8960, 408, 321, 29901, 13, 4706, 17927, 29889, 2704, 703, 2392, 2805, 426, 6177, 6571, 1642, 4830, 29898, 816, 11272, 29918, 2271, 29892, 321, 876, 13, 4706, 736, 7700, 13, 13, 1678, 565, 451, 364, 29889, 554, 29901, 13, 4706, 17927, 29889, 2704, 703, 2392, 29901, 6571, 1642, 4830, 29898, 29878, 29889, 4882, 29918, 401, 876, 13, 4706, 736, 7700, 13, 13, 1678, 4613, 353, 364, 29889, 3126, 580, 13, 13, 1678, 565, 4613, 3366, 4882, 3108, 1275, 376, 2704, 1115, 13, 4706, 17927, 29889, 2704, 703, 2392, 29901, 6571, 1642, 4830, 29898, 13713, 3366, 4906, 3108, 876, 13, 4706, 736, 7700, 13, 13, 1678, 17927, 29889, 3888, 703, 8654, 6742, 805, 1241, 6571, 411, 3414, 29901, 6571, 1642, 4830, 29898, 1028, 1241, 29918, 978, 29892, 4613, 3366, 9057, 333, 3108, 876, 13, 13, 1678, 736, 5852, 13, 13, 13, 1753, 4982, 29918, 20713, 29918, 3859, 29898, 3859, 29901, 851, 353, 376, 29886, 2548, 1159, 1599, 6120, 29901, 13, 1678, 17643, 353, 679, 29918, 9057, 29879, 580, 13, 13, 1678, 565, 2106, 451, 297, 17643, 29901, 13, 4706, 17927, 29889, 3888, 703, 13919, 2106, 470, 694, 17643, 297, 2106, 6571, 1642, 4830, 29898, 3859, 876, 13, 4706, 736, 7700, 13, 13, 1678, 28235, 29918, 9057, 29879, 353, 17643, 29961, 3859, 29962, 13, 13, 1678, 363, 4982, 297, 28235, 29918, 9057, 29879, 29901, 13, 4706, 4982, 29918, 333, 353, 4982, 3366, 333, 3108, 13, 4706, 17927, 29889, 3888, 703, 6028, 3729, 292, 6571, 1642, 4830, 29898, 9057, 29918, 333, 876, 13, 4706, 4982, 29918, 20713, 29898, 9057, 29918, 333, 29897, 13, 13, 1678, 736, 5852, 13, 13, 13, 1753, 4982, 29918, 816, 11272, 29918, 497, 29898, 20317, 29901, 851, 353, 6213, 29897, 1599, 2391, 29961, 710, 5387, 13, 1678, 805, 11376, 353, 679, 29918, 1028, 11376, 580, 13, 13, 1678, 805, 1241, 29918, 816, 14989, 353, 5159, 13, 13, 1678, 363, 269, 297, 805, 11376, 29901, 13, 4706, 565, 7087, 322, 7087, 2804, 269, 29901, 13, 9651, 6773, 13, 4706, 4982, 29918, 816, 11272, 29898, 29879, 29897, 13, 4706, 805, 1241, 29918, 816, 14989, 29889, 4397, 29898, 29879, 29897, 13, 13, 1678, 736, 805, 1241, 29918, 816, 14989, 13, 2 ]
WordRPG/systems/character/slot.py
ChristopherLBruce/WordRPG
2
114664
<reponame>ChristopherLBruce/WordRPG class Slot: def __init__(name, _type=None, item=None): self.name = name, if _type is not None: self.type = _type else: self.type = name self.item = item, def equip(self): pass def unequip(self): pass def show(self): pass
[ 1, 529, 276, 1112, 420, 29958, 18687, 13434, 29931, 29933, 582, 346, 29914, 14463, 29934, 16903, 13, 1990, 317, 8276, 29901, 13, 1678, 822, 4770, 2344, 12035, 978, 29892, 903, 1853, 29922, 8516, 29892, 2944, 29922, 8516, 1125, 13, 4706, 1583, 29889, 978, 353, 1024, 29892, 13, 308, 13, 4706, 565, 903, 1853, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 1853, 353, 903, 1853, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 1853, 353, 1024, 13, 13, 4706, 1583, 29889, 667, 353, 2944, 29892, 13, 268, 13, 13, 1678, 822, 7462, 29898, 1311, 1125, 13, 4706, 1209, 13, 13, 13, 1678, 822, 1597, 14254, 29898, 1311, 1125, 13, 4706, 1209, 13, 13, 13, 1678, 822, 1510, 29898, 1311, 1125, 13, 4706, 1209, 13, 2 ]
config_manager.py
jbytes1027/notify-mirror
0
31569
import pathlib import configparser class ConfigManager: DEFAULT_CONFIG_PATH = "~/.config/notify-sync.ini" SETTING_NOTIFICATION_ICON = "icon" SETTING_NOTIFICATION_TIMEOUT = "timeout" # in ms # SETTING_NOTIFICATION_URGENCY = "urgency" # 0,1,2 low, avg, urgent SETTING_NOTIFICATION_EXEC = "exec_on_click" def __init__(self, config_path=DEFAULT_CONFIG_PATH): self.config_path = config_path self.config = configparser.ConfigParser() path = pathlib.PosixPath(self.config_path).expanduser() if path.exists(): # read config file with open(path, "r") as config_file: self.config.read_file(config_file) else: if not path.parent.exists(): # create config dir path.parent.mkdir(parents=True) # set default settings self.config["GENERAL"] = { "api_key": "", "notify_on_error": "no", "notify_on_connection_changed": "no", } self.config["DEFAULT NOTIFICATION"] = { "icon": "given", "timeout": "default", # "urgency": "default", "exec_on_click": "", } # create config file with open(path, "w") as config_file: self.config.write(config_file) def get_notification_setting(self, android_notification, setting): if ( android_notification.package in self.config and setting in self.config[android_notification.package] ): return self.config[android_notification.package][setting] else: return self.config["DEFAULT NOTIFICATION"][setting] def get_api_key(self): return self.config["GENERAL"]["api_key"]
[ 1, 1053, 2224, 1982, 13, 5215, 2295, 16680, 13, 13, 13, 1990, 12782, 3260, 29901, 13, 1678, 22236, 29918, 25903, 29918, 10145, 353, 376, 30022, 6294, 2917, 29914, 25140, 29899, 16593, 29889, 2172, 29908, 13, 1678, 11368, 29911, 4214, 29918, 12256, 6545, 28541, 29918, 2965, 1164, 353, 376, 4144, 29908, 13, 1678, 11368, 29911, 4214, 29918, 12256, 6545, 28541, 29918, 15307, 12015, 353, 376, 15619, 29908, 29871, 396, 297, 10887, 13, 1678, 396, 11368, 29911, 4214, 29918, 12256, 6545, 28541, 29918, 4574, 24647, 29907, 29979, 353, 376, 332, 14703, 29908, 29871, 396, 29871, 29900, 29892, 29896, 29892, 29906, 259, 4482, 29892, 1029, 29887, 29892, 5065, 5362, 13, 1678, 11368, 29911, 4214, 29918, 12256, 6545, 28541, 29918, 5746, 11206, 353, 376, 4258, 29918, 265, 29918, 3808, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2295, 29918, 2084, 29922, 23397, 29918, 25903, 29918, 10145, 1125, 13, 4706, 1583, 29889, 2917, 29918, 2084, 353, 2295, 29918, 2084, 13, 4706, 1583, 29889, 2917, 353, 2295, 16680, 29889, 3991, 11726, 580, 13, 13, 4706, 2224, 353, 2224, 1982, 29889, 9135, 861, 2605, 29898, 1311, 29889, 2917, 29918, 2084, 467, 18837, 1792, 580, 13, 13, 4706, 565, 2224, 29889, 9933, 7295, 13, 9651, 396, 1303, 2295, 934, 13, 9651, 411, 1722, 29898, 2084, 29892, 376, 29878, 1159, 408, 2295, 29918, 1445, 29901, 13, 18884, 1583, 29889, 2917, 29889, 949, 29918, 1445, 29898, 2917, 29918, 1445, 29897, 13, 4706, 1683, 29901, 13, 9651, 565, 451, 2224, 29889, 3560, 29889, 9933, 7295, 13, 18884, 396, 1653, 2295, 4516, 13, 18884, 2224, 29889, 3560, 29889, 11256, 3972, 29898, 862, 1237, 29922, 5574, 29897, 13, 13, 9651, 396, 731, 2322, 6055, 13, 9651, 1583, 29889, 2917, 3366, 24647, 1001, 1964, 3108, 353, 426, 13, 18884, 376, 2754, 29918, 1989, 1115, 12633, 13, 18884, 376, 25140, 29918, 265, 29918, 2704, 1115, 376, 1217, 613, 13, 18884, 376, 25140, 29918, 265, 29918, 9965, 29918, 15033, 1115, 376, 1217, 613, 13, 9651, 500, 13, 13, 9651, 1583, 29889, 2917, 3366, 23397, 6058, 6545, 28541, 3108, 353, 426, 13, 18884, 376, 4144, 1115, 376, 29887, 5428, 613, 13, 18884, 376, 15619, 1115, 376, 4381, 613, 13, 18884, 396, 376, 332, 14703, 1115, 376, 4381, 613, 13, 18884, 376, 4258, 29918, 265, 29918, 3808, 1115, 12633, 13, 9651, 500, 13, 13, 9651, 396, 1653, 2295, 934, 13, 9651, 411, 1722, 29898, 2084, 29892, 376, 29893, 1159, 408, 2295, 29918, 1445, 29901, 13, 18884, 1583, 29889, 2917, 29889, 3539, 29898, 2917, 29918, 1445, 29897, 13, 13, 1678, 822, 679, 29918, 24671, 29918, 26740, 29898, 1311, 29892, 1442, 29918, 24671, 29892, 4444, 1125, 13, 4706, 565, 313, 13, 9651, 1442, 29918, 24671, 29889, 5113, 297, 1583, 29889, 2917, 13, 9651, 322, 4444, 297, 1583, 29889, 2917, 29961, 2843, 29918, 24671, 29889, 5113, 29962, 13, 308, 1125, 13, 9651, 736, 1583, 29889, 2917, 29961, 2843, 29918, 24671, 29889, 5113, 3816, 26740, 29962, 13, 4706, 1683, 29901, 13, 9651, 736, 1583, 29889, 2917, 3366, 23397, 6058, 6545, 28541, 3108, 29961, 26740, 29962, 13, 13, 1678, 822, 679, 29918, 2754, 29918, 1989, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 2917, 3366, 24647, 1001, 1964, 3108, 3366, 2754, 29918, 1989, 3108, 13, 2 ]
doc/source/code/tut3.py
FernandoSBorges/netpyne
0
1609171
from netpyne import specs, sim # Network parameters netParams = specs.NetParams() # object of class NetParams to store the network parameters ## Cell types PYRcell = {'secs': {}} PYRcell['secs']['soma'] = {'geom': {}, 'mechs': {}} PYRcell['secs']['soma']['geom'] = {'diam': 18.8, 'L': 18.8, 'Ra': 123.0} PYRcell['secs']['soma']['mechs']['hh'] = {'gnabar': 0.12, 'gkbar': 0.036, 'gl': 0.003, 'el': -70} PYRcell['secs']['dend'] = {'geom': {}, 'topol': {}, 'mechs': {}} PYRcell['secs']['dend']['geom'] = {'diam': 5.0, 'L': 150.0, 'Ra': 150.0, 'cm': 1} PYRcell['secs']['dend']['topol'] = {'parentSec': 'soma', 'parentX': 1.0, 'childX': 0} PYRcell['secs']['dend']['mechs']['pas'] = {'g': 0.0000357, 'e': -70} netParams.cellParams['PYR'] = PYRcell ## Population parameters netParams.popParams['S'] = {'cellType': 'PYR', 'numCells': 20} netParams.popParams['M'] = {'cellType': 'PYR', 'numCells': 20} ## Synaptic mechanism parameters netParams.synMechParams['exc'] = {'mod': 'Exp2Syn', 'tau1': 1.0, 'tau2': 5.0, 'e': 0} # excitatory synaptic mechanism # Stimulation parameters netParams.stimSourceParams['bkg'] = {'type': 'NetStim', 'rate': 10, 'noise': 0.5} netParams.stimTargetParams['bkg->PYR'] = {'source': 'bkg', 'conds': {'cellType': 'PYR'}, 'weight': 0.01, 'delay': 5, 'synMech': 'exc'} ## Cell connectivity rules netParams.connParams['S->M'] = {'preConds': {'pop': 'S'}, 'postConds': {'pop': 'M'}, # S -> M 'probability': 0.5, # probability of connection 'weight': 0.01, # synaptic weight 'delay': 5, # transmission delay (ms) 'sec': 'dend', # section to connect to 'loc': 1.0, # location of synapse 'synMech': 'exc'} # target synaptic mechanism # Simulation options simConfig = specs.SimConfig() # object of class SimConfig to store simulation configuration simConfig.duration = 1*1e3 # Duration of the simulation, in ms simConfig.dt = 0.025 # Internal integration timestep to use simConfig.verbose = False # Show detailed messages simConfig.recordTraces = {'V_soma':{'sec':'soma','loc':0.5,'var':'v'}} # Dict with traces to record simConfig.recordStep = 1 # Step size in ms to save data (eg. V traces, LFP, etc) simConfig.filename = 'tut3' # Set file output name simConfig.savePickle = False # Save params, network and sim output to pickle file simConfig.analysis['plotRaster'] = {'saveFig': True} # Plot a raster simConfig.analysis['plotTraces'] = {'include': [1], 'saveFig': True} # Plot recorded traces for this list of cells simConfig.analysis['plot2Dnet'] = {'saveFig': True} # plot 2D cell positions and connections # Create network and run simulation sim.createSimulateAnalyze(netParams = netParams, simConfig = simConfig) # import pylab; pylab.show() # this line is only necessary in certain systems where figures appear empty # check model output sim.checkOutput('tut3')
[ 1, 515, 7787, 2272, 484, 1053, 1580, 29879, 29892, 1027, 13, 13, 29937, 8527, 4128, 13, 1212, 9629, 353, 1580, 29879, 29889, 6779, 9629, 580, 29871, 396, 1203, 310, 770, 12670, 9629, 304, 3787, 278, 3564, 4128, 13, 13, 13, 2277, 19413, 4072, 13, 20055, 29934, 3729, 353, 11117, 344, 2395, 2396, 426, 930, 13, 13, 20055, 29934, 3729, 1839, 344, 2395, 16215, 29879, 4125, 2033, 353, 11117, 479, 290, 2396, 24335, 525, 1004, 12168, 2396, 426, 930, 259, 13, 20055, 29934, 3729, 1839, 344, 2395, 16215, 29879, 4125, 16215, 479, 290, 2033, 353, 11117, 29881, 2829, 2396, 29871, 29896, 29947, 29889, 29947, 29892, 525, 29931, 2396, 29871, 29896, 29947, 29889, 29947, 29892, 525, 29934, 29874, 2396, 29871, 29896, 29906, 29941, 29889, 29900, 29913, 259, 13, 20055, 29934, 3729, 1839, 344, 2395, 16215, 29879, 4125, 16215, 1004, 12168, 16215, 25446, 2033, 353, 11117, 5138, 370, 279, 2396, 29871, 29900, 29889, 29896, 29906, 29892, 525, 29887, 29895, 1646, 2396, 29871, 29900, 29889, 29900, 29941, 29953, 29892, 525, 3820, 2396, 29871, 29900, 29889, 29900, 29900, 29941, 29892, 525, 295, 2396, 448, 29955, 29900, 29913, 29871, 13, 13, 20055, 29934, 3729, 1839, 344, 2395, 16215, 29881, 355, 2033, 353, 11117, 479, 290, 2396, 24335, 525, 3332, 324, 2396, 24335, 525, 1004, 12168, 2396, 426, 930, 29871, 13, 20055, 29934, 3729, 1839, 344, 2395, 16215, 29881, 355, 16215, 479, 290, 2033, 353, 11117, 29881, 2829, 2396, 29871, 29945, 29889, 29900, 29892, 525, 29931, 2396, 29871, 29896, 29945, 29900, 29889, 29900, 29892, 525, 29934, 29874, 2396, 29871, 29896, 29945, 29900, 29889, 29900, 29892, 525, 4912, 2396, 29871, 29896, 29913, 29871, 13, 20055, 29934, 3729, 1839, 344, 2395, 16215, 29881, 355, 16215, 3332, 324, 2033, 353, 11117, 3560, 7898, 2396, 525, 29879, 4125, 742, 525, 3560, 29990, 2396, 29871, 29896, 29889, 29900, 29892, 525, 5145, 29990, 2396, 29871, 29900, 29913, 29871, 13, 20055, 29934, 3729, 1839, 344, 2395, 16215, 29881, 355, 16215, 1004, 12168, 16215, 18182, 2033, 353, 11117, 29887, 2396, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29941, 29945, 29955, 29892, 525, 29872, 2396, 448, 29955, 29900, 29913, 29871, 13, 13, 1212, 9629, 29889, 3729, 9629, 1839, 20055, 29934, 2033, 353, 349, 29979, 29934, 3729, 13, 13, 13, 2277, 24810, 4128, 13, 1212, 9629, 29889, 7323, 9629, 1839, 29903, 2033, 353, 11117, 3729, 1542, 2396, 525, 20055, 29934, 742, 525, 1949, 13418, 2396, 29871, 29906, 29900, 29913, 13, 1212, 9629, 29889, 7323, 9629, 1839, 29924, 2033, 353, 11117, 3729, 1542, 2396, 525, 20055, 29934, 742, 525, 1949, 13418, 2396, 29871, 29906, 29900, 29913, 13, 13, 13, 2277, 10829, 2156, 293, 13336, 4128, 13, 1212, 9629, 29889, 19274, 29924, 5309, 9629, 1839, 735, 29883, 2033, 353, 11117, 1545, 2396, 525, 9544, 29906, 29216, 742, 525, 4722, 29896, 2396, 29871, 29896, 29889, 29900, 29892, 525, 4722, 29906, 2396, 29871, 29945, 29889, 29900, 29892, 525, 29872, 2396, 29871, 29900, 29913, 29871, 396, 5566, 7366, 706, 5222, 2156, 293, 13336, 13, 13, 13, 29937, 26256, 2785, 4128, 13, 1212, 9629, 29889, 303, 326, 4435, 9629, 1839, 29890, 9415, 2033, 353, 11117, 1853, 2396, 525, 6779, 855, 326, 742, 525, 10492, 2396, 29871, 29896, 29900, 29892, 525, 1217, 895, 2396, 29871, 29900, 29889, 29945, 29913, 13, 1212, 9629, 29889, 303, 326, 8667, 9629, 1839, 29890, 9415, 976, 20055, 29934, 2033, 353, 11117, 4993, 2396, 525, 29890, 9415, 742, 525, 1116, 29879, 2396, 11117, 3729, 1542, 2396, 525, 20055, 29934, 16675, 525, 7915, 2396, 29871, 29900, 29889, 29900, 29896, 29892, 525, 18829, 2396, 29871, 29945, 29892, 525, 19274, 29924, 5309, 2396, 525, 735, 29883, 10827, 13, 13, 13, 2277, 19413, 4511, 2068, 6865, 13, 1212, 9629, 29889, 13082, 9629, 1839, 29903, 976, 29924, 2033, 353, 11117, 1457, 10983, 29879, 2396, 11117, 7323, 2396, 525, 29903, 16675, 525, 2490, 10983, 29879, 2396, 11117, 7323, 2396, 525, 29924, 16675, 29871, 396, 29871, 317, 1599, 341, 13, 1678, 525, 22795, 3097, 2396, 29871, 29900, 29889, 29945, 29892, 308, 396, 6976, 310, 3957, 13, 1678, 525, 7915, 2396, 29871, 29900, 29889, 29900, 29896, 29892, 632, 396, 5222, 2156, 293, 7688, 29871, 13, 1678, 525, 18829, 2396, 29871, 29945, 29892, 462, 396, 22713, 9055, 313, 1516, 29897, 29871, 13, 1678, 525, 3471, 2396, 525, 29881, 355, 742, 795, 396, 4004, 304, 4511, 304, 13, 1678, 525, 2029, 2396, 29871, 29896, 29889, 29900, 29892, 462, 396, 4423, 310, 5222, 481, 344, 13, 1678, 525, 19274, 29924, 5309, 2396, 525, 735, 29883, 10827, 965, 396, 3646, 5222, 2156, 293, 13336, 13, 13, 13, 29937, 3439, 2785, 3987, 13, 3601, 3991, 353, 1580, 29879, 29889, 8942, 3991, 580, 539, 396, 1203, 310, 770, 3439, 3991, 304, 3787, 17402, 5285, 13, 13, 3601, 3991, 29889, 19708, 353, 29871, 29896, 29930, 29896, 29872, 29941, 3986, 396, 360, 2633, 310, 278, 17402, 29892, 297, 10887, 13, 3601, 3991, 29889, 6008, 353, 29871, 29900, 29889, 29900, 29906, 29945, 18884, 396, 512, 1890, 13465, 5335, 342, 1022, 304, 671, 13, 3601, 3991, 29889, 369, 15828, 353, 7700, 965, 396, 7704, 13173, 7191, 29871, 13, 3601, 3991, 29889, 11651, 5323, 778, 353, 11117, 29963, 29918, 29879, 4125, 2396, 10998, 3471, 22099, 29879, 4125, 3788, 2029, 2396, 29900, 29889, 29945, 5501, 1707, 22099, 29894, 29915, 930, 29871, 396, 360, 919, 411, 26695, 304, 2407, 13, 3601, 3991, 29889, 11651, 14448, 353, 29871, 29896, 9651, 396, 16696, 2159, 297, 10887, 304, 4078, 848, 313, 387, 29889, 478, 26695, 29892, 365, 26353, 29892, 2992, 29897, 13, 3601, 3991, 29889, 9507, 353, 525, 29873, 329, 29941, 29915, 308, 396, 3789, 934, 1962, 1024, 13, 3601, 3991, 29889, 7620, 29925, 860, 280, 353, 7700, 4706, 396, 16913, 8636, 29892, 3564, 322, 1027, 1962, 304, 5839, 280, 934, 13, 13, 3601, 3991, 29889, 15916, 1839, 5317, 29934, 1901, 2033, 353, 11117, 7620, 13080, 2396, 5852, 29913, 462, 29871, 396, 18399, 263, 364, 1901, 13, 3601, 3991, 29889, 15916, 1839, 5317, 5323, 778, 2033, 353, 11117, 2856, 2396, 518, 29896, 1402, 525, 7620, 13080, 2396, 5852, 29913, 29871, 396, 18399, 10478, 26695, 363, 445, 1051, 310, 9101, 13, 3601, 3991, 29889, 15916, 1839, 5317, 29906, 29928, 1212, 2033, 353, 11117, 7620, 13080, 2396, 5852, 29913, 462, 259, 396, 6492, 29871, 29906, 29928, 3038, 11909, 322, 12368, 13, 13, 13, 29937, 6204, 3564, 322, 1065, 17402, 13, 3601, 29889, 3258, 8942, 5987, 2744, 14997, 911, 29898, 1212, 9629, 353, 7787, 9629, 29892, 1027, 3991, 353, 1027, 3991, 29897, 268, 13, 1678, 13, 29937, 1053, 282, 2904, 370, 29936, 282, 2904, 370, 29889, 4294, 580, 29871, 396, 445, 1196, 338, 871, 5181, 297, 3058, 6757, 988, 13994, 2615, 4069, 13, 13, 29937, 1423, 1904, 1962, 13, 3601, 29889, 3198, 6466, 877, 29873, 329, 29941, 1495, 13, 2 ]
setup.py
andrewdodd/docopt_uc
6
91929
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name="docopt-uc", description="A docopt library suitable for microcontrollers.", license="MIT", version="1.0.2", author="<NAME>", author_email="<EMAIL>", maintainer="<NAME>", maintainer_email="<EMAIL>", keywords=["docopt", "microcontroller", "cli"], packages=find_packages(where="src"), package_dir={"": "src"}, package_data={'docopt_uc': ['templates/*.c', 'templates/*.h']}, zip_safe=False, classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", ], install_requires=["docopt", "jinja2"], entry_points={'console_scripts': [ 'docopt-uc = docopt_uc.docopt_uc:main', ]})
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 731, 21245, 8789, 1053, 6230, 29892, 1284, 29918, 8318, 13, 13, 14669, 29898, 13, 1678, 1024, 543, 1514, 3670, 29899, 1682, 613, 13, 1678, 6139, 543, 29909, 437, 1111, 415, 3489, 13907, 363, 9200, 1285, 11897, 19602, 13, 1678, 19405, 543, 26349, 613, 13, 1678, 1873, 543, 29896, 29889, 29900, 29889, 29906, 613, 13, 1678, 4148, 543, 29966, 5813, 28341, 13, 1678, 4148, 29918, 5269, 543, 29966, 26862, 6227, 28341, 13, 1678, 7344, 261, 543, 29966, 5813, 28341, 13, 1678, 7344, 261, 29918, 5269, 543, 29966, 26862, 6227, 28341, 13, 1678, 29361, 29922, 3366, 1514, 3670, 613, 376, 29885, 2357, 8299, 613, 376, 11303, 12436, 13, 1678, 9741, 29922, 2886, 29918, 8318, 29898, 3062, 543, 4351, 4968, 13, 1678, 3577, 29918, 3972, 3790, 29908, 1115, 376, 4351, 10758, 13, 1678, 3577, 29918, 1272, 3790, 29915, 1514, 3670, 29918, 1682, 2396, 6024, 20943, 5515, 29889, 29883, 742, 525, 20943, 5515, 29889, 29882, 2033, 1118, 13, 1678, 14319, 29918, 11177, 29922, 8824, 29892, 13, 1678, 770, 14903, 11759, 13, 4706, 376, 21956, 358, 16034, 4761, 29871, 29941, 448, 838, 2026, 613, 13, 4706, 376, 2928, 2760, 319, 4749, 663, 4761, 10682, 414, 613, 13, 4706, 376, 29931, 293, 1947, 4761, 438, 5425, 28268, 1490, 4761, 341, 1806, 19245, 613, 13, 4706, 376, 29940, 18771, 17088, 4761, 4223, 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, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29946, 613, 13, 4706, 376, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29945, 613, 13, 4706, 376, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29953, 613, 13, 1678, 21251, 13, 1678, 2601, 29918, 276, 339, 2658, 29922, 3366, 1514, 3670, 613, 376, 28789, 1764, 29906, 12436, 13, 1678, 6251, 29918, 9748, 3790, 29915, 11058, 29918, 16713, 2396, 518, 13, 4706, 525, 1514, 3670, 29899, 1682, 353, 437, 1111, 415, 29918, 1682, 29889, 1514, 3670, 29918, 1682, 29901, 3396, 742, 13, 1678, 4514, 1800, 13, 2 ]
source/_sample/networkx/drawing_tree.py
showa-yojyo/notebook
14
93905
<reponame>showa-yojyo/notebook #!/usr/bin/env python """drawing_tree.py: draw a tree graph with pydot_layout. """ import colorsys import networkx as nx import matplotlib.pyplot as plt # A tree graph is given. branching = 2 height = 5 G = nx.balanced_tree(branching, height) #pos = nx.spring_layout(G) # default; bad #pos = nx.shell_layout(G) # bad #pos = nx.spectral_layout(G) # poor pos = nx.nx_pydot.pydot_layout(G, prog='dot') # good # Node colors. ncolors = [] height += 1 for i in range(height): ncolors.extend( [colorsys.hsv_to_rgb(i / height, 1.0, 1.0)] * branching ** i) nx.draw_networkx(G, pos, node_color=ncolors) #plt.axes().set_aspect('equal', 'datalim') plt.axis('off') plt.show()
[ 1, 529, 276, 1112, 420, 29958, 4294, 29874, 29899, 29891, 3848, 9029, 29914, 1333, 19273, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 15945, 29908, 4012, 292, 29918, 8336, 29889, 2272, 29901, 4216, 263, 5447, 3983, 411, 282, 2941, 327, 29918, 2680, 29889, 13, 15945, 29908, 13, 5215, 11955, 952, 13, 13, 5215, 3564, 29916, 408, 302, 29916, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 13, 29937, 319, 5447, 3983, 338, 2183, 29889, 13, 17519, 292, 353, 29871, 29906, 13, 3545, 353, 29871, 29945, 13, 29954, 353, 302, 29916, 29889, 5521, 8362, 29918, 8336, 29898, 17519, 292, 29892, 3171, 29897, 13, 13, 29937, 1066, 353, 302, 29916, 29889, 4278, 29918, 2680, 29898, 29954, 29897, 396, 2322, 29936, 4319, 13, 29937, 1066, 353, 302, 29916, 29889, 15903, 29918, 2680, 29898, 29954, 29897, 396, 4319, 13, 29937, 1066, 353, 302, 29916, 29889, 21494, 1705, 29918, 2680, 29898, 29954, 29897, 396, 6460, 13, 1066, 353, 302, 29916, 29889, 23818, 29918, 2272, 6333, 29889, 2272, 6333, 29918, 2680, 29898, 29954, 29892, 410, 29887, 2433, 6333, 1495, 396, 1781, 13, 13, 29937, 9071, 11955, 29889, 13, 29876, 27703, 353, 5159, 13, 3545, 4619, 29871, 29896, 13, 1454, 474, 297, 3464, 29898, 3545, 1125, 13, 1678, 302, 27703, 29889, 21843, 29898, 13, 4706, 518, 27703, 952, 29889, 29882, 4501, 29918, 517, 29918, 23973, 29898, 29875, 847, 3171, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 4638, 334, 5443, 292, 3579, 474, 29897, 13, 13, 23818, 29889, 4012, 29918, 11618, 29916, 29898, 29954, 29892, 926, 29892, 2943, 29918, 2780, 29922, 29876, 27703, 29897, 13, 13, 29937, 572, 29873, 29889, 1165, 267, 2141, 842, 29918, 294, 1103, 877, 11745, 742, 525, 29881, 2075, 326, 1495, 13, 572, 29873, 29889, 8990, 877, 2696, 1495, 13, 572, 29873, 29889, 4294, 580, 13, 2 ]
tracker/urls.py
sansaralab/shiva-dropped
0
159326
from django.conf.urls import url from .views import tracker_serve, track, attach_contact, send_event, attach_data urlpatterns = [ url(r'shiva.js$', tracker_serve), url(r'track$', track), url(r'attach$', attach_contact), url(r'data$', attach_data), url(r'event$', send_event), ]
[ 1, 515, 9557, 29889, 5527, 29889, 26045, 1053, 3142, 13, 3166, 869, 7406, 1053, 1020, 4937, 29918, 16349, 29892, 5702, 29892, 10641, 29918, 12346, 29892, 3638, 29918, 3696, 29892, 10641, 29918, 1272, 13, 13, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 3142, 29898, 29878, 29915, 845, 4244, 29889, 1315, 29938, 742, 1020, 4937, 29918, 16349, 511, 13, 1678, 3142, 29898, 29878, 29915, 11294, 29938, 742, 5702, 511, 13, 1678, 3142, 29898, 29878, 29915, 14930, 29938, 742, 10641, 29918, 12346, 511, 13, 1678, 3142, 29898, 29878, 29915, 1272, 29938, 742, 10641, 29918, 1272, 511, 13, 1678, 3142, 29898, 29878, 29915, 3696, 29938, 742, 3638, 29918, 3696, 511, 13, 29962, 13, 2 ]
old/SimpleElectroSim/python/electro_sim.py
0xDBFB7/Nyion
0
196110
<filename>old/SimpleElectroSim/python/electro_sim.py #imports from shapely.geometry import Point import numpy as np import random import math from decimal import * from time import sleep import copy try: from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * except: print "OpenGL wrapper for python not found" from stl import mesh #The grid is m^2. Force is in newtons. Charge is Coloumbs. data_file = open("data.csv","w+") #display values timestep = 0.0000001 pixel_size = 10 pixel_spacing = 20 grid_width = 1000 rotation_x_speed = 0 rotation_y_speed = 10 rotation_y = 0 rotation_x = 0 #Physical constants k_constant = 8990000000.0 electron_charge = 0.000000000000016021766 electron_mass = 0.0000000000000000000000000016726218 aluminum_mass = 0.00000000000000000000000004483263 time = 0 particles = [] glutInit(); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glEnable(GL_MULTISAMPLE); glutInitWindowSize(1920, 1080); glutCreateWindow("Solver"); glViewport(0, 0, 1920, 1080); glClearColor(1.0, 1.0, 1.0, 1.0); glClearDepth(1.0); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glShadeModel(GL_SMOOTH); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(60, (1920.0/1080.0), 1, 3000); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0,0,0); glRotatef(0, 45, 0.1, 0); glRotatef(0, 0, 45, 0); glTranslatef(-grid_width/2,-grid_width/2, -2000); def vector(a): if(a > 0): return 1.0 else: return -1.0 def draw_square(x,y,z,color): glPushMatrix(); glTranslatef(x,y,z); glColor3f(color[0],color[1],color[2]); glutSolidCube(pixel_size); glPopMatrix(); def draw_sphere(x,y,z,color): glPushMatrix(); glTranslatef(x,y,z); glColor3f(color[0],color[1],color[2]); glutSolidSphere(pixel_size/2.0,10,10); glPopMatrix(); glutSwapBuffers(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glutSwapBuffers(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); ############################################DEFINE THE SIM######################################### def particle_circle(center=(0, 0, 0), charge=electron_charge,r=1, n=10,velocity=132620500, fixed=False): global particles for i in [ ( center[0]+(math.cos(2 * math.pi / n * x) * r), # x center[1] + (math.sin(2 * math.pi / n * x) * r) # y ) for x in xrange(0, n + 1)]: particles.append({"charge": 1.0*charge, "mass": electron_mass, "position": [i[0],center[2],i[1]], "velocity": [0,velocity,0], "constrain": [[],[],[]],"color":[0,0,0], "fixed": fixed}) def charged_plate(position=(5.0, 10, 0.001), size=(2,5,5), n=50, charge=(1/2000000.0),velocity=1000): global particles for i in range(0,n): particles.append({"charge": charge/n, "mass": electron_mass, "position": [random.uniform(position[0],position[0]+size[0]),random.uniform(position[1],position[1]+size[1]),\ random.uniform(position[2],position[2]+size[2])], "velocity": [velocity,velocity,0], "fixed": True,"constrain": [],"color":[100,0,0]}) def charged_plate_with_hole(position=(5.0, 10, 0.001), size=(2,5,5), n=50, charge=(1/2000000.0),velocity=1000): global particles for i in range(0,n): particles.append({"charge": charge/n, "mass": electron_mass, "position": [random.uniform(position[0],position[0]+size[0]),random.uniform(position[1],position[1]+size[1]),\ random.uniform(position[2],position[2]+size[2])], "velocity": [velocity,velocity,0], "fixed": True,"constrain": [],"color":[100,0,0]}) # anode = mesh.Mesh.from_file('anode.stl') # # def charged_mesh(input_mesh, charge=(1/2000000.0), n=0,velocity=1000): # global particles # prev_point = input_mesh.points[0] # print(len(input_mesh.points)) # print(input_mesh.points.flatten(-1)) # for point in input_mesh.points: # for i in np.arange(0,point[0],n/len(input_mesh.points)): # particles.append({"charge": charge/n, "mass": electron_mass, "position": [point[0]-prev_point[0],point[1],point[2]], "velocity": [velocity,velocity,0], "fixed": True,"constrain": [],"color":[100,0,0]}) # prev_point = point particle_circle(velocity=1326000) particle_circle(r=5,velocity=1326000) # charged_mesh(anode) for i in np.arange(10,30): particle_circle(center=(0,0,i), r=10,fixed=True,charge=electron_charge) for i in np.arange(40,60): particle_circle(center=(0,0,i), r=10,fixed=True,charge=-electron_charge) for i in np.arange(70,90): particle_circle(center=(0,0,i), r=10,fixed=True,charge=electron_charge) # charged_plate() print(particles) sleep(3) # # particles = [{"charge": 1.0*electron_charge, "mass": electron_mass, "position": [10,1,0], "velocity": [0,0,0]}, # {"charge": 1.0*electron_charge, "mass": electron_mass, "position": [15,1,0], "velocity": [0,0,0]}, # {"charge": 1.0*electron_charge, "mass": electron_mass, "position": [50.3,53,0.3], "velocity": [0,0,0]}, # {"charge": 1.0*electron_charge, "mass": electron_mass, "position": [50.4,54,0.4], "velocity": [-100,0,0]}] ############################################DEFINE THE SIM######################################### while True: # glTranslatef(0,0,2000); # glRotatef(rotation_y, 0, 0.1, 0); # glRotatef(45, 0.1, 0, 0); # glTranslatef(-grid_width/2,-grid_width/2, -2000); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); rotation_y = rotation_y_speed*time print("Time: {}".format(time)) frozen_state = copy.deepcopy(particles) for p1_index,particle in enumerate(frozen_state): if not particle["fixed"]: force_x = 0 force_y = 0 force_z = 0 for second_particle in [x for i,x in enumerate(frozen_state) if i!=p1_index]: magnitude = (k_constant*particle['charge']*second_particle['charge']); distance_x = (particle["position"][0]-second_particle["position"][0]) distance_y = (particle["position"][1]-second_particle["position"][1]) distance_z = (particle["position"][2]-second_particle["position"][2]) distance = math.sqrt(distance_x**2.0+distance_y**2.0+distance_z**2.0) e_force = (magnitude/((distance)**2.0)); force_x += e_force*(distance_x/distance) force_y += e_force*(distance_y/distance) force_z += e_force*(distance_z/distance) print("Distance: {}".format(math.sqrt(distance_x**2.0+distance_y**2.0+distance_z**2.0))) accel_x = force_x/particle['mass'] accel_y = force_y/particle['mass'] accel_z = force_z/particle['mass'] particles[p1_index]["velocity"][0] += accel_x*timestep; particles[p1_index]["velocity"][1] += accel_y*timestep; particles[p1_index]["velocity"][2] += accel_z*timestep; particles[p1_index]["position"][0] += particles[p1_index]["velocity"][0]*timestep particles[p1_index]["position"][1] += particles[p1_index]["velocity"][1]*timestep particles[p1_index]["position"][2] += particles[p1_index]["velocity"][2]*timestep print("-"*20) print("Particle: {} X: {} Y: {} Z: {}".format(p1_index,frozen_state[p1_index]["position"][0],frozen_state[p1_index]["position"][1],frozen_state[p1_index]["position"][2])) print("Velocity: X: {} Y: {} Z: {}".format(particles[p1_index]["velocity"][0],particles[p1_index]["velocity"][1],particles[p1_index]["velocity"][2])) print("Acceleration: X: {} Y: {} Z: {}".format(accel_x,accel_y,accel_z)) print("Force: X: {} Y: {} Z: {}".format(force_x,force_y,force_z)) # data_file.write("{},{},{},{},{},{},{},{},{},{},\n".format(particles[p1_index]["position"][0],particles[p1_index]["position"][1],particles[p1_index]["position"][2])) print("-"*20) draw_sphere(particles[p1_index]["position"][0]*pixel_spacing,particles[p1_index]["position"][1]*pixel_spacing,particles[p1_index]["position"][2]*pixel_spacing,particles[p1_index]["color"]) print("Frame complete") print("#"*20) glutSwapBuffers(); time += timestep sleep(0.01)
[ 1, 529, 9507, 29958, 1025, 29914, 15427, 29923, 781, 307, 8942, 29914, 4691, 29914, 15436, 307, 29918, 3601, 29889, 2272, 13, 29937, 326, 4011, 13, 3166, 528, 481, 873, 29889, 19156, 1053, 8984, 13, 5215, 12655, 408, 7442, 13, 5215, 4036, 13, 5215, 5844, 13, 3166, 13677, 1053, 334, 13, 3166, 931, 1053, 8709, 13, 5215, 3509, 13, 2202, 29901, 13, 1678, 515, 29508, 29889, 7239, 1053, 334, 13, 1678, 515, 29508, 29889, 7239, 29965, 1053, 334, 13, 1678, 515, 29508, 29889, 7239, 2692, 1053, 334, 13, 19499, 29901, 13, 1678, 1596, 376, 6585, 7239, 14476, 363, 3017, 451, 1476, 29908, 13, 3166, 380, 29880, 1053, 27716, 13, 13, 29937, 1576, 6856, 338, 286, 29985, 29906, 29889, 11004, 338, 297, 716, 7453, 29889, 2896, 479, 338, 1530, 283, 29885, 5824, 29889, 13, 13, 1272, 29918, 1445, 353, 1722, 703, 1272, 29889, 7638, 3284, 29893, 29974, 1159, 13, 13, 29937, 4990, 1819, 13, 9346, 342, 1022, 353, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 13, 29886, 15711, 29918, 2311, 353, 29871, 29896, 29900, 13, 29886, 15711, 29918, 1028, 9390, 353, 29871, 29906, 29900, 13, 7720, 29918, 2103, 353, 29871, 29896, 29900, 29900, 29900, 13, 5450, 362, 29918, 29916, 29918, 19322, 353, 29871, 29900, 13, 5450, 362, 29918, 29891, 29918, 19322, 353, 29871, 29896, 29900, 13, 5450, 362, 29918, 29891, 353, 29871, 29900, 13, 5450, 362, 29918, 29916, 353, 29871, 29900, 13, 13, 29937, 25847, 936, 17727, 13, 29895, 29918, 23362, 353, 29871, 29947, 29929, 29929, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29889, 29900, 13, 15436, 1617, 29918, 23367, 353, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 29953, 29900, 29906, 29896, 29955, 29953, 29953, 13, 15436, 1617, 29918, 25379, 353, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29896, 29953, 29955, 29906, 29953, 29906, 29896, 29947, 13, 284, 9735, 398, 29918, 25379, 353, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 29946, 29946, 29947, 29941, 29906, 29953, 29941, 13, 13, 2230, 353, 29871, 29900, 13, 1595, 4027, 353, 5159, 13, 13, 3820, 329, 6644, 890, 13, 3820, 329, 6644, 9323, 6818, 29898, 7239, 2692, 29918, 3970, 7466, 1307, 891, 12729, 2692, 29918, 28212, 891, 12729, 2692, 29918, 2287, 29925, 4690, 416, 13, 3820, 20701, 29898, 7239, 29918, 29924, 8647, 3235, 19297, 1307, 416, 13, 3820, 329, 6644, 5907, 3505, 29898, 29896, 29929, 29906, 29900, 29892, 29871, 29896, 29900, 29947, 29900, 416, 13, 3820, 329, 4391, 5907, 703, 13296, 369, 1496, 13, 3820, 1043, 637, 29898, 29900, 29892, 29871, 29900, 29892, 29871, 29896, 29929, 29906, 29900, 29892, 29871, 29896, 29900, 29947, 29900, 416, 13, 3820, 18759, 3306, 29898, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 416, 13, 3820, 18759, 8498, 386, 29898, 29896, 29889, 29900, 416, 13, 3820, 20701, 29898, 7239, 29918, 2287, 29925, 4690, 29918, 18267, 416, 13, 3820, 8498, 386, 14400, 29898, 7239, 29918, 1307, 13356, 1964, 416, 13, 3820, 2713, 1943, 3195, 29898, 7239, 29918, 29903, 6720, 2891, 29950, 416, 13, 3820, 28016, 29898, 7239, 29918, 13171, 29903, 4162, 1783, 18474, 29918, 29907, 1955, 1525, 9838, 29918, 29950, 10192, 29892, 12729, 29918, 29940, 12107, 1254, 416, 13, 13, 13, 3820, 18759, 29898, 7239, 29918, 15032, 1955, 29918, 7838, 28483, 29918, 22698, 891, 12729, 29918, 2287, 29925, 4690, 29918, 7838, 28483, 29918, 22698, 416, 13, 3820, 14609, 6818, 29898, 7239, 29918, 8618, 29967, 29923, 9838, 416, 13, 3820, 5896, 18415, 890, 13, 3820, 29884, 15136, 12645, 29898, 29953, 29900, 29892, 313, 29896, 29929, 29906, 29900, 29889, 29900, 29914, 29896, 29900, 29947, 29900, 29889, 29900, 511, 29871, 29896, 29892, 29871, 29941, 29900, 29900, 29900, 416, 13, 3820, 14609, 6818, 29898, 7239, 29918, 20387, 29931, 29963, 8673, 29956, 416, 13, 3820, 5896, 18415, 890, 13, 13, 13, 3820, 4300, 9632, 29888, 29898, 29900, 29892, 29900, 29892, 29900, 416, 13, 3820, 21281, 403, 29888, 29898, 29900, 29892, 29871, 29946, 29945, 29892, 29871, 29900, 29889, 29896, 29892, 29871, 29900, 416, 13, 3820, 21281, 403, 29888, 29898, 29900, 29892, 29871, 29900, 29892, 29871, 29946, 29945, 29892, 29871, 29900, 416, 13, 3820, 4300, 9632, 29888, 6278, 7720, 29918, 2103, 29914, 29906, 6653, 7720, 29918, 2103, 29914, 29906, 29892, 448, 29906, 29900, 29900, 29900, 416, 13, 13, 1753, 4608, 29898, 29874, 1125, 13, 1678, 565, 29898, 29874, 1405, 29871, 29900, 1125, 13, 4706, 736, 29871, 29896, 29889, 29900, 13, 1678, 1683, 29901, 13, 4706, 736, 448, 29896, 29889, 29900, 13, 13, 1753, 4216, 29918, 17619, 29898, 29916, 29892, 29891, 29892, 29920, 29892, 2780, 1125, 13, 1678, 3144, 27031, 14609, 890, 13, 1678, 3144, 4300, 9632, 29888, 29898, 29916, 29892, 29891, 29892, 29920, 416, 13, 1678, 3144, 3306, 29941, 29888, 29898, 2780, 29961, 29900, 1402, 2780, 29961, 29896, 1402, 2780, 29961, 29906, 5691, 13, 1678, 3144, 329, 13296, 333, 29907, 4003, 29898, 29886, 15711, 29918, 2311, 416, 13, 1678, 3144, 12310, 14609, 890, 13, 13, 1753, 4216, 29918, 29879, 9085, 29898, 29916, 29892, 29891, 29892, 29920, 29892, 2780, 1125, 13, 1678, 3144, 27031, 14609, 890, 13, 1678, 3144, 4300, 9632, 29888, 29898, 29916, 29892, 29891, 29892, 29920, 416, 13, 1678, 3144, 3306, 29941, 29888, 29898, 2780, 29961, 29900, 1402, 2780, 29961, 29896, 1402, 2780, 29961, 29906, 5691, 13, 1678, 3144, 329, 13296, 333, 29903, 9085, 29898, 29886, 15711, 29918, 2311, 29914, 29906, 29889, 29900, 29892, 29896, 29900, 29892, 29896, 29900, 416, 13, 1678, 3144, 12310, 14609, 890, 13, 13, 3820, 329, 10840, 481, 29933, 3096, 414, 890, 13, 3820, 18759, 29898, 7239, 29918, 15032, 1955, 29918, 7838, 28483, 29918, 22698, 891, 12729, 29918, 2287, 29925, 4690, 29918, 7838, 28483, 29918, 22698, 416, 13, 3820, 329, 10840, 481, 29933, 3096, 414, 890, 13, 3820, 18759, 29898, 7239, 29918, 15032, 1955, 29918, 7838, 28483, 29918, 22698, 891, 12729, 29918, 2287, 29925, 4690, 29918, 7838, 28483, 29918, 22698, 416, 13, 13, 13, 13, 13, 13, 13383, 13383, 7346, 4136, 24405, 8895, 6093, 317, 7833, 13383, 13383, 7346, 29937, 13, 13, 1753, 16445, 29918, 16622, 29898, 5064, 7607, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 511, 8323, 29922, 15436, 1617, 29918, 23367, 29892, 29878, 29922, 29896, 29892, 302, 29922, 29896, 29900, 29892, 955, 25245, 29922, 29896, 29941, 29906, 29953, 29906, 29900, 29945, 29900, 29900, 29892, 4343, 29922, 8824, 1125, 13, 1678, 5534, 17105, 13, 1678, 363, 474, 297, 29871, 518, 13, 4706, 313, 13, 9651, 4818, 29961, 29900, 10062, 29898, 755, 29889, 3944, 29898, 29906, 334, 5844, 29889, 1631, 847, 302, 334, 921, 29897, 334, 364, 511, 29871, 396, 921, 13, 9651, 4818, 29961, 29896, 29962, 718, 313, 755, 29889, 5223, 29898, 29906, 334, 5844, 29889, 1631, 847, 302, 334, 921, 29897, 334, 364, 29897, 29871, 396, 343, 13, 13, 4706, 1723, 363, 921, 297, 921, 3881, 29898, 29900, 29892, 302, 718, 29871, 29896, 4638, 29901, 13, 4706, 17105, 29889, 4397, 3319, 29908, 23367, 1115, 29871, 29896, 29889, 29900, 29930, 23367, 29892, 376, 25379, 1115, 11966, 29918, 25379, 29892, 376, 3283, 1115, 518, 29875, 29961, 29900, 1402, 5064, 29961, 29906, 1402, 29875, 29961, 29896, 20526, 376, 955, 25245, 1115, 518, 29900, 29892, 955, 25245, 29892, 29900, 1402, 376, 3075, 6038, 1115, 5519, 16272, 1402, 2636, 1402, 29908, 2780, 1115, 29961, 29900, 29892, 29900, 29892, 29900, 1402, 376, 20227, 1115, 4343, 1800, 13, 13, 1753, 20139, 29918, 2341, 29898, 3283, 7607, 29945, 29889, 29900, 29892, 29871, 29896, 29900, 29892, 29871, 29900, 29889, 29900, 29900, 29896, 511, 2159, 7607, 29906, 29892, 29945, 29892, 29945, 511, 302, 29922, 29945, 29900, 29892, 8323, 7607, 29896, 29914, 29906, 29900, 29900, 29900, 29900, 29900, 29900, 29889, 29900, 511, 955, 25245, 29922, 29896, 29900, 29900, 29900, 1125, 13, 1678, 5534, 17105, 13, 1678, 363, 474, 297, 3464, 29898, 29900, 29892, 29876, 1125, 13, 4706, 17105, 29889, 4397, 3319, 29908, 23367, 1115, 8323, 29914, 29876, 29892, 376, 25379, 1115, 11966, 29918, 25379, 29892, 376, 3283, 1115, 518, 8172, 29889, 29590, 29898, 3283, 29961, 29900, 1402, 3283, 29961, 29900, 10062, 2311, 29961, 29900, 11724, 8172, 29889, 29590, 29898, 3283, 29961, 29896, 1402, 3283, 29961, 29896, 10062, 2311, 29961, 29896, 11724, 29905, 13, 4706, 4036, 29889, 29590, 29898, 3283, 29961, 29906, 1402, 3283, 29961, 29906, 10062, 2311, 29961, 29906, 2314, 1402, 376, 955, 25245, 1115, 518, 955, 25245, 29892, 955, 25245, 29892, 29900, 1402, 376, 20227, 1115, 5852, 1699, 3075, 6038, 1115, 19997, 29908, 2780, 1115, 29961, 29896, 29900, 29900, 29892, 29900, 29892, 29900, 29962, 1800, 13, 13, 1753, 20139, 29918, 2341, 29918, 2541, 29918, 29716, 29898, 3283, 7607, 29945, 29889, 29900, 29892, 29871, 29896, 29900, 29892, 29871, 29900, 29889, 29900, 29900, 29896, 511, 2159, 7607, 29906, 29892, 29945, 29892, 29945, 511, 302, 29922, 29945, 29900, 29892, 8323, 7607, 29896, 29914, 29906, 29900, 29900, 29900, 29900, 29900, 29900, 29889, 29900, 511, 955, 25245, 29922, 29896, 29900, 29900, 29900, 1125, 13, 1678, 5534, 17105, 13, 1678, 363, 474, 297, 3464, 29898, 29900, 29892, 29876, 1125, 13, 4706, 17105, 29889, 4397, 3319, 29908, 23367, 1115, 8323, 29914, 29876, 29892, 376, 25379, 1115, 11966, 29918, 25379, 29892, 376, 3283, 1115, 518, 8172, 29889, 29590, 29898, 3283, 29961, 29900, 1402, 3283, 29961, 29900, 10062, 2311, 29961, 29900, 11724, 8172, 29889, 29590, 29898, 3283, 29961, 29896, 1402, 3283, 29961, 29896, 10062, 2311, 29961, 29896, 11724, 29905, 13, 4706, 4036, 29889, 29590, 29898, 3283, 29961, 29906, 1402, 3283, 29961, 29906, 10062, 2311, 29961, 29906, 2314, 1402, 376, 955, 25245, 1115, 518, 955, 25245, 29892, 955, 25245, 29892, 29900, 1402, 376, 20227, 1115, 5852, 1699, 3075, 6038, 1115, 19997, 29908, 2780, 1115, 29961, 29896, 29900, 29900, 29892, 29900, 29892, 29900, 29962, 1800, 13, 13, 29937, 385, 356, 353, 27716, 29889, 29924, 12094, 29889, 3166, 29918, 1445, 877, 273, 356, 29889, 303, 29880, 1495, 13, 29937, 13, 29937, 822, 20139, 29918, 4467, 29882, 29898, 2080, 29918, 4467, 29882, 29892, 8323, 7607, 29896, 29914, 29906, 29900, 29900, 29900, 29900, 29900, 29900, 29889, 29900, 511, 302, 29922, 29900, 29892, 955, 25245, 29922, 29896, 29900, 29900, 29900, 1125, 13, 29937, 268, 5534, 17105, 13, 29937, 268, 12379, 29918, 3149, 353, 1881, 29918, 4467, 29882, 29889, 9748, 29961, 29900, 29962, 13, 29937, 268, 1596, 29898, 2435, 29898, 2080, 29918, 4467, 29882, 29889, 9748, 876, 13, 29937, 268, 1596, 29898, 2080, 29918, 4467, 29882, 29889, 9748, 29889, 1579, 8606, 6278, 29896, 876, 13, 29937, 268, 363, 1298, 297, 1881, 29918, 4467, 29882, 29889, 9748, 29901, 13, 29937, 308, 363, 474, 297, 7442, 29889, 279, 927, 29898, 29900, 29892, 3149, 29961, 29900, 1402, 29876, 29914, 2435, 29898, 2080, 29918, 4467, 29882, 29889, 9748, 22164, 13, 29937, 632, 17105, 29889, 4397, 3319, 29908, 23367, 1115, 8323, 29914, 29876, 29892, 376, 25379, 1115, 11966, 29918, 25379, 29892, 376, 3283, 1115, 518, 3149, 29961, 29900, 29962, 29899, 16304, 29918, 3149, 29961, 29900, 1402, 3149, 29961, 29896, 1402, 3149, 29961, 29906, 20526, 376, 955, 25245, 1115, 518, 955, 25245, 29892, 955, 25245, 29892, 29900, 1402, 376, 20227, 1115, 5852, 1699, 3075, 6038, 1115, 19997, 29908, 2780, 1115, 29961, 29896, 29900, 29900, 29892, 29900, 29892, 29900, 29962, 1800, 13, 29937, 308, 12379, 29918, 3149, 353, 1298, 13, 13, 1595, 2512, 29918, 16622, 29898, 955, 25245, 29922, 29896, 29941, 29906, 29953, 29900, 29900, 29900, 29897, 13, 1595, 2512, 29918, 16622, 29898, 29878, 29922, 29945, 29892, 955, 25245, 29922, 29896, 29941, 29906, 29953, 29900, 29900, 29900, 29897, 13, 29937, 20139, 29918, 4467, 29882, 29898, 273, 356, 29897, 13, 13, 1454, 474, 297, 7442, 29889, 279, 927, 29898, 29896, 29900, 29892, 29941, 29900, 1125, 13, 1678, 16445, 29918, 16622, 29898, 5064, 7607, 29900, 29892, 29900, 29892, 29875, 511, 364, 29922, 29896, 29900, 29892, 20227, 29922, 5574, 29892, 23367, 29922, 15436, 1617, 29918, 23367, 29897, 13, 1454, 474, 297, 7442, 29889, 279, 927, 29898, 29946, 29900, 29892, 29953, 29900, 1125, 13, 1678, 16445, 29918, 16622, 29898, 5064, 7607, 29900, 29892, 29900, 29892, 29875, 511, 364, 29922, 29896, 29900, 29892, 20227, 29922, 5574, 29892, 23367, 10457, 15436, 1617, 29918, 23367, 29897, 13, 1454, 474, 297, 7442, 29889, 279, 927, 29898, 29955, 29900, 29892, 29929, 29900, 1125, 13, 1678, 16445, 29918, 16622, 29898, 5064, 7607, 29900, 29892, 29900, 29892, 29875, 511, 364, 29922, 29896, 29900, 29892, 20227, 29922, 5574, 29892, 23367, 29922, 15436, 1617, 29918, 23367, 29897, 13, 29937, 20139, 29918, 2341, 580, 13, 13, 2158, 29898, 1595, 4027, 29897, 13, 17059, 29898, 29941, 29897, 13, 13, 29937, 13, 29937, 17105, 353, 518, 6377, 23367, 1115, 29871, 29896, 29889, 29900, 29930, 15436, 1617, 29918, 23367, 29892, 376, 25379, 1115, 11966, 29918, 25379, 29892, 376, 3283, 1115, 518, 29896, 29900, 29892, 29896, 29892, 29900, 1402, 376, 955, 25245, 1115, 518, 29900, 29892, 29900, 29892, 29900, 29962, 1118, 13, 29937, 632, 8853, 23367, 1115, 29871, 29896, 29889, 29900, 29930, 15436, 1617, 29918, 23367, 29892, 376, 25379, 1115, 11966, 29918, 25379, 29892, 376, 3283, 1115, 518, 29896, 29945, 29892, 29896, 29892, 29900, 1402, 376, 955, 25245, 1115, 518, 29900, 29892, 29900, 29892, 29900, 29962, 1118, 13, 29937, 632, 8853, 23367, 1115, 29871, 29896, 29889, 29900, 29930, 15436, 1617, 29918, 23367, 29892, 376, 25379, 1115, 11966, 29918, 25379, 29892, 376, 3283, 1115, 518, 29945, 29900, 29889, 29941, 29892, 29945, 29941, 29892, 29900, 29889, 29941, 1402, 376, 955, 25245, 1115, 518, 29900, 29892, 29900, 29892, 29900, 29962, 1118, 13, 29937, 632, 8853, 23367, 1115, 29871, 29896, 29889, 29900, 29930, 15436, 1617, 29918, 23367, 29892, 376, 25379, 1115, 11966, 29918, 25379, 29892, 376, 3283, 1115, 518, 29945, 29900, 29889, 29946, 29892, 29945, 29946, 29892, 29900, 29889, 29946, 1402, 376, 955, 25245, 1115, 21069, 29896, 29900, 29900, 29892, 29900, 29892, 29900, 29962, 6525, 13, 13, 13, 13383, 13383, 7346, 4136, 24405, 8895, 6093, 317, 7833, 13383, 13383, 7346, 29937, 13, 13, 13, 13, 13, 8000, 5852, 29901, 13, 1678, 396, 3144, 4300, 9632, 29888, 29898, 29900, 29892, 29900, 29892, 29906, 29900, 29900, 29900, 416, 13, 1678, 396, 3144, 21281, 403, 29888, 29898, 5450, 362, 29918, 29891, 29892, 29871, 29900, 29892, 29871, 29900, 29889, 29896, 29892, 29871, 29900, 416, 13, 1678, 396, 3144, 21281, 403, 29888, 29898, 29946, 29945, 29892, 29871, 29900, 29889, 29896, 29892, 29871, 29900, 29892, 29871, 29900, 416, 13, 1678, 396, 3144, 4300, 9632, 29888, 6278, 7720, 29918, 2103, 29914, 29906, 6653, 7720, 29918, 2103, 29914, 29906, 29892, 448, 29906, 29900, 29900, 29900, 416, 13, 1678, 3144, 18759, 29898, 7239, 29918, 15032, 1955, 29918, 7838, 28483, 29918, 22698, 891, 12729, 29918, 2287, 29925, 4690, 29918, 7838, 28483, 29918, 22698, 416, 13, 1678, 13733, 29918, 29891, 353, 13733, 29918, 29891, 29918, 19322, 29930, 2230, 13, 1678, 1596, 703, 2481, 29901, 6571, 1642, 4830, 29898, 2230, 876, 13, 13, 1678, 14671, 2256, 29918, 3859, 353, 3509, 29889, 24535, 8552, 29898, 1595, 4027, 29897, 13, 1678, 363, 282, 29896, 29918, 2248, 29892, 1595, 2512, 297, 26985, 29898, 29888, 307, 2256, 29918, 3859, 1125, 13, 4706, 565, 451, 16445, 3366, 20227, 3108, 29901, 13, 9651, 4889, 29918, 29916, 353, 29871, 29900, 13, 9651, 4889, 29918, 29891, 353, 29871, 29900, 13, 9651, 4889, 29918, 29920, 353, 29871, 29900, 13, 9651, 363, 1473, 29918, 1595, 2512, 297, 518, 29916, 363, 474, 29892, 29916, 297, 26985, 29898, 29888, 307, 2256, 29918, 3859, 29897, 565, 474, 19216, 29886, 29896, 29918, 2248, 5387, 13, 18884, 18497, 353, 313, 29895, 29918, 23362, 29930, 1595, 2512, 1839, 23367, 2033, 29930, 7496, 29918, 1595, 2512, 1839, 23367, 17077, 13, 18884, 5418, 29918, 29916, 353, 313, 1595, 2512, 3366, 3283, 3108, 29961, 29900, 29962, 29899, 7496, 29918, 1595, 2512, 3366, 3283, 3108, 29961, 29900, 2314, 13, 18884, 5418, 29918, 29891, 353, 313, 1595, 2512, 3366, 3283, 3108, 29961, 29896, 29962, 29899, 7496, 29918, 1595, 2512, 3366, 3283, 3108, 29961, 29896, 2314, 13, 18884, 5418, 29918, 29920, 353, 313, 1595, 2512, 3366, 3283, 3108, 29961, 29906, 29962, 29899, 7496, 29918, 1595, 2512, 3366, 3283, 3108, 29961, 29906, 2314, 13, 18884, 5418, 353, 5844, 29889, 3676, 29898, 19244, 29918, 29916, 1068, 29906, 29889, 29900, 29974, 19244, 29918, 29891, 1068, 29906, 29889, 29900, 29974, 19244, 29918, 29920, 1068, 29906, 29889, 29900, 29897, 13, 18884, 321, 29918, 10118, 353, 313, 29885, 4211, 4279, 29914, 3552, 19244, 29897, 1068, 29906, 29889, 29900, 2483, 13, 13, 18884, 4889, 29918, 29916, 4619, 321, 29918, 10118, 16395, 19244, 29918, 29916, 29914, 19244, 29897, 13, 18884, 4889, 29918, 29891, 4619, 321, 29918, 10118, 16395, 19244, 29918, 29891, 29914, 19244, 29897, 13, 18884, 4889, 29918, 29920, 4619, 321, 29918, 10118, 16395, 19244, 29918, 29920, 29914, 19244, 29897, 13, 18884, 1596, 703, 27469, 29901, 6571, 1642, 4830, 29898, 755, 29889, 3676, 29898, 19244, 29918, 29916, 1068, 29906, 29889, 29900, 29974, 19244, 29918, 29891, 1068, 29906, 29889, 29900, 29974, 19244, 29918, 29920, 1068, 29906, 29889, 29900, 4961, 13, 13, 13, 9651, 1035, 295, 29918, 29916, 353, 4889, 29918, 29916, 29914, 1595, 2512, 1839, 25379, 2033, 13, 9651, 1035, 295, 29918, 29891, 353, 4889, 29918, 29891, 29914, 1595, 2512, 1839, 25379, 2033, 13, 9651, 1035, 295, 29918, 29920, 353, 4889, 29918, 29920, 29914, 1595, 2512, 1839, 25379, 2033, 13, 13, 9651, 17105, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 955, 25245, 3108, 29961, 29900, 29962, 4619, 1035, 295, 29918, 29916, 29930, 9346, 342, 1022, 29936, 13, 9651, 17105, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 955, 25245, 3108, 29961, 29896, 29962, 4619, 1035, 295, 29918, 29891, 29930, 9346, 342, 1022, 29936, 13, 9651, 17105, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 955, 25245, 3108, 29961, 29906, 29962, 4619, 1035, 295, 29918, 29920, 29930, 9346, 342, 1022, 29936, 13, 13, 9651, 17105, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 3283, 3108, 29961, 29900, 29962, 4619, 17105, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 955, 25245, 3108, 29961, 29900, 14178, 9346, 342, 1022, 13, 9651, 17105, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 3283, 3108, 29961, 29896, 29962, 4619, 17105, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 955, 25245, 3108, 29961, 29896, 14178, 9346, 342, 1022, 13, 9651, 17105, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 3283, 3108, 29961, 29906, 29962, 4619, 17105, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 955, 25245, 3108, 29961, 29906, 14178, 9346, 342, 1022, 13, 13, 13, 13, 9651, 1596, 703, 29899, 29908, 29930, 29906, 29900, 29897, 13, 9651, 1596, 703, 7439, 2512, 29901, 6571, 1060, 29901, 6571, 612, 29901, 6571, 796, 29901, 6571, 1642, 4830, 29898, 29886, 29896, 29918, 2248, 29892, 29888, 307, 2256, 29918, 3859, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 3283, 3108, 29961, 29900, 1402, 29888, 307, 2256, 29918, 3859, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 3283, 3108, 29961, 29896, 1402, 29888, 307, 2256, 29918, 3859, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 3283, 3108, 29961, 29906, 12622, 13, 9651, 1596, 703, 29963, 295, 25245, 29901, 1060, 29901, 6571, 612, 29901, 6571, 796, 29901, 6571, 1642, 4830, 29898, 1595, 4027, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 955, 25245, 3108, 29961, 29900, 1402, 1595, 4027, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 955, 25245, 3108, 29961, 29896, 1402, 1595, 4027, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 955, 25245, 3108, 29961, 29906, 12622, 13, 9651, 1596, 703, 7504, 7367, 362, 29901, 1060, 29901, 6571, 612, 29901, 6571, 796, 29901, 6571, 1642, 4830, 29898, 562, 2242, 29918, 29916, 29892, 562, 2242, 29918, 29891, 29892, 562, 2242, 29918, 29920, 876, 13, 9651, 1596, 703, 2831, 346, 29901, 1060, 29901, 6571, 612, 29901, 6571, 796, 29901, 6571, 1642, 4830, 29898, 10118, 29918, 29916, 29892, 10118, 29918, 29891, 29892, 10118, 29918, 29920, 876, 13, 9651, 396, 848, 29918, 1445, 29889, 3539, 703, 29912, 29087, 29087, 29087, 29087, 29087, 29087, 29087, 29087, 29087, 7570, 29876, 1642, 4830, 29898, 1595, 4027, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 3283, 3108, 29961, 29900, 1402, 1595, 4027, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 3283, 3108, 29961, 29896, 1402, 1595, 4027, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 3283, 3108, 29961, 29906, 12622, 13, 9651, 1596, 703, 29899, 29908, 29930, 29906, 29900, 29897, 13, 4706, 4216, 29918, 29879, 9085, 29898, 1595, 4027, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 3283, 3108, 29961, 29900, 14178, 29886, 15711, 29918, 1028, 9390, 29892, 1595, 4027, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 3283, 3108, 29961, 29896, 14178, 29886, 15711, 29918, 1028, 9390, 29892, 1595, 4027, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 3283, 3108, 29961, 29906, 14178, 29886, 15711, 29918, 1028, 9390, 29892, 1595, 4027, 29961, 29886, 29896, 29918, 2248, 29962, 3366, 2780, 20068, 13, 13, 1678, 1596, 703, 4308, 4866, 1159, 13, 1678, 1596, 14822, 29908, 29930, 29906, 29900, 29897, 13, 1678, 3144, 329, 10840, 481, 29933, 3096, 414, 890, 13, 1678, 931, 4619, 5335, 342, 1022, 13, 1678, 8709, 29898, 29900, 29889, 29900, 29896, 29897, 13, 2 ]
Aeneas/aeneas/aeneas/synthesizer.py
yalhaizaey/Dreich
25
110783
#!/usr/bin/env python # coding=utf-8 # aeneas is a Python/C library and a set of tools # to automagically synchronize audio and text (aka forced alignment) # # Copyright (C) 2012-2013, <NAME> (www.albertopettarin.it) # Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it) # Copyright (C) 2015-2017, <NAME> (www.albertopettarin.it) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. """ This module contains the following classes: * :class:`~aeneas.synthesizer.Synthesizer`, for synthesizing text fragments into an audio file, along with the corresponding time anchors. .. warning:: This module might be refactored in a future version """ from __future__ import absolute_import from __future__ import print_function from aeneas.logger import Loggable from aeneas.runtimeconfiguration import RuntimeConfiguration from aeneas.textfile import TextFile from aeneas.ttswrappers.awsttswrapper import AWSTTSWrapper from aeneas.ttswrappers.espeakngttswrapper import ESPEAKNGTTSWrapper from aeneas.ttswrappers.espeakttswrapper import ESPEAKTTSWrapper from aeneas.ttswrappers.festivalttswrapper import FESTIVALTTSWrapper from aeneas.ttswrappers.macosttswrapper import MacOSTTSWrapper from aeneas.ttswrappers.nuancettswrapper import NuanceTTSWrapper import aeneas.globalfunctions as gf class Synthesizer(Loggable): """ A class to synthesize text fragments into an audio file, along with the corresponding time anchors. :param rconf: a runtime configuration :type rconf: :class:`~aeneas.runtimeconfiguration.RuntimeConfiguration` :param logger: the logger object :type logger: :class:`~aeneas.logger.Logger` :raises: OSError: if a custom TTS engine is requested but it cannot be loaded :raises: ImportError: if the AWS Polly TTS API wrapper is requested but the ``boto3`` module is not installed, or if the Nuance TTS API wrapper is requested but the``requests`` module is not installed """ AWS = "aws" """ Select AWS Polly TTS API wrapper """ CUSTOM = "custom" """ Select custom TTS engine wrapper """ ESPEAK = "espeak" """ Select eSpeak wrapper """ ESPEAKNG = "espeak-ng" """ Select eSpeak-ng wrapper """ FESTIVAL = "festival" """ Select Festival wrapper """ MACOS = "macos" """ Select macOS "say" wrapper """ NUANCE = "nuance" """ Select Nuance TTS API wrapper """ ALLOWED_VALUES = [AWS, CUSTOM, ESPEAK, ESPEAKNG, FESTIVAL, MACOS, NUANCE] """ List of all the allowed values """ TAG = u"Synthesizer" def __init__(self, rconf=None, logger=None): super(Synthesizer, self).__init__(rconf=rconf, logger=logger) self.tts_engine = None self._select_tts_engine() def _select_tts_engine(self): """ Select the TTS engine to be used by looking at the rconf object. """ self.log(u"Selecting TTS engine...") requested_tts_engine = self.rconf[RuntimeConfiguration.TTS] if requested_tts_engine == self.CUSTOM: self.log(u"TTS engine: custom") tts_path = self.rconf[RuntimeConfiguration.TTS_PATH] if tts_path is None: self.log_exc(u"You must specify a value for tts_path", None, True, ValueError) if not gf.file_can_be_read(tts_path): self.log_exc(u"Cannot read tts_path", None, True, OSError) try: import imp self.log([u"Loading CustomTTSWrapper module from '%s'...", tts_path]) imp.load_source("CustomTTSWrapperModule", tts_path) self.log([u"Loading CustomTTSWrapper module from '%s'... done", tts_path]) self.log(u"Importing CustomTTSWrapper...") from CustomTTSWrapperModule import CustomTTSWrapper self.log(u"Importing CustomTTSWrapper... done") self.log(u"Creating CustomTTSWrapper instance...") self.tts_engine = CustomTTSWrapper(rconf=self.rconf, logger=self.logger) self.log(u"Creating CustomTTSWrapper instance... done") except Exception as exc: self.log_exc(u"Unable to load custom TTS wrapper", exc, True, OSError) elif requested_tts_engine == self.AWS: try: import boto3 except ImportError as exc: self.log_exc(u"Unable to import boto3 for AWS Polly TTS API wrapper", exc, True, ImportError) self.log(u"TTS engine: AWS Polly TTS API") self.tts_engine = AWSTTSWrapper(rconf=self.rconf, logger=self.logger) elif requested_tts_engine == self.NUANCE: try: import requests except ImportError as exc: self.log_exc(u"Unable to import requests for Nuance TTS API wrapper", exc, True, ImportError) self.log(u"TTS engine: Nuance TTS API") self.tts_engine = NuanceTTSWrapper(rconf=self.rconf, logger=self.logger) elif requested_tts_engine == self.ESPEAKNG: self.log(u"TTS engine: eSpeak-ng") self.tts_engine = ESPEAKNGTTSWrapper(rconf=self.rconf, logger=self.logger) elif requested_tts_engine == self.FESTIVAL: self.log(u"TTS engine: Festival") self.tts_engine = FESTIVALTTSWrapper(rconf=self.rconf, logger=self.logger) elif requested_tts_engine == self.MACOS: self.log(u"TTS engine: macOS") self.tts_engine = MacOSTTSWrapper(rconf=self.rconf, logger=self.logger) else: self.log(u"TTS engine: eSpeak") self.tts_engine = ESPEAKTTSWrapper(rconf=self.rconf, logger=self.logger) self.log(u"Selecting TTS engine... done") @property def output_audio_format(self): """ Return a tuple ``(codec, channels, rate)`` specifying the audio format generated by the actual TTS engine. :rtype: tuple """ if self.tts_engine is not None: return self.tts_engine.OUTPUT_AUDIO_FORMAT return None def clear_cache(self): """ Clear the TTS cache, removing all cache files from disk. .. versionadded:: 1.6.0 """ if self.tts_engine is not None: self.tts_engine.clear_cache() def synthesize( self, text_file, audio_file_path, quit_after=None, backwards=False ): """ Synthesize the text contained in the given fragment list into a ``wav`` file. Return a tuple ``(anchors, total_time, num_chars)``. :param text_file: the text file to be synthesized :type text_file: :class:`~aeneas.textfile.TextFile` :param string audio_file_path: the path to the output audio file :param float quit_after: stop synthesizing as soon as reaching this many seconds :param bool backwards: if ``True``, synthesizing from the end of the text file :rtype: tuple :raises: TypeError: if ``text_file`` is ``None`` or not an instance of ``TextFile`` :raises: OSError: if ``audio_file_path`` cannot be written :raises: OSError: if ``tts=custom`` in the RuntimeConfiguration and ``tts_path`` cannot be read :raises: ValueError: if the TTS engine has not been set yet """ if text_file is None: self.log_exc(u"text_file is None", None, True, TypeError) if not isinstance(text_file, TextFile): self.log_exc(u"text_file is not an instance of TextFile", None, True, TypeError) if not gf.file_can_be_written(audio_file_path): self.log_exc(u"Audio file path '%s' cannot be written" % (audio_file_path), None, True, OSError) if self.tts_engine is None: self.log_exc(u"Cannot select the TTS engine", None, True, ValueError) # synthesize self.log(u"Synthesizing text...") result = self.tts_engine.synthesize_multiple( text_file=text_file, output_file_path=audio_file_path, quit_after=quit_after, backwards=backwards ) self.log(u"Synthesizing text... done") # check that the output file has been written if not gf.file_exists(audio_file_path): self.log_exc(u"Audio file path '%s' cannot be read" % (audio_file_path), None, True, OSError) return result
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 13, 29937, 263, 1600, 294, 338, 263, 5132, 29914, 29907, 3489, 322, 263, 731, 310, 8492, 13, 29937, 304, 3345, 351, 1711, 12231, 675, 10348, 322, 1426, 313, 8245, 11826, 22239, 29897, 13, 29937, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29906, 29899, 29906, 29900, 29896, 29941, 29892, 529, 5813, 29958, 313, 1636, 29889, 284, 2151, 459, 1803, 27139, 29889, 277, 29897, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29941, 29899, 29906, 29900, 29896, 29945, 29892, 7523, 29933, 1032, 898, 317, 2096, 259, 313, 1636, 29889, 949, 915, 8538, 29889, 277, 29897, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29945, 29899, 29906, 29900, 29896, 29955, 29892, 529, 5813, 29958, 313, 1636, 29889, 284, 2151, 459, 1803, 27139, 29889, 277, 29897, 13, 29937, 13, 29937, 910, 1824, 338, 3889, 7047, 29901, 366, 508, 2654, 391, 2666, 372, 322, 29914, 272, 6623, 13, 29937, 372, 1090, 278, 4958, 310, 278, 15143, 10393, 571, 29877, 4593, 5236, 19245, 408, 6369, 491, 13, 29937, 278, 12362, 18540, 10606, 29892, 2845, 1873, 29871, 29941, 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, 10393, 571, 29877, 4593, 5236, 19245, 363, 901, 4902, 29889, 13, 29937, 13, 29937, 887, 881, 505, 4520, 263, 3509, 310, 278, 15143, 10393, 571, 29877, 4593, 5236, 19245, 13, 29937, 3412, 411, 445, 1824, 29889, 29871, 960, 451, 29892, 1074, 529, 1124, 597, 1636, 29889, 18713, 29889, 990, 29914, 506, 11259, 3779, 29889, 13, 13, 15945, 29908, 13, 4013, 3883, 3743, 278, 1494, 4413, 29901, 13, 13, 29930, 584, 1990, 18078, 30022, 29874, 1600, 294, 29889, 19274, 26041, 3950, 29889, 29216, 26041, 3950, 1673, 13, 29871, 363, 14710, 267, 5281, 1426, 22370, 964, 385, 10348, 934, 29892, 13, 29871, 3412, 411, 278, 6590, 931, 23791, 943, 29889, 13, 13, 636, 9177, 1057, 910, 3883, 1795, 367, 2143, 627, 4395, 297, 263, 5434, 1873, 13, 15945, 29908, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 13, 3166, 263, 1600, 294, 29889, 21707, 1053, 4522, 29531, 13, 3166, 263, 1600, 294, 29889, 15634, 13305, 1053, 24875, 8614, 13, 3166, 263, 1600, 294, 29889, 726, 1445, 1053, 3992, 2283, 13, 3166, 263, 1600, 294, 29889, 698, 2774, 336, 22437, 29889, 1450, 303, 1372, 17699, 1053, 319, 29956, 1254, 9375, 15646, 13, 3166, 263, 1600, 294, 29889, 698, 2774, 336, 22437, 29889, 267, 412, 557, 865, 698, 2774, 6794, 1053, 17956, 4162, 22311, 9312, 29911, 9375, 15646, 13, 3166, 263, 1600, 294, 29889, 698, 2774, 336, 22437, 29889, 267, 412, 557, 698, 2774, 6794, 1053, 17956, 4162, 22311, 29911, 9375, 15646, 13, 3166, 263, 1600, 294, 29889, 698, 2774, 336, 22437, 29889, 29888, 6074, 698, 2774, 6794, 1053, 383, 29923, 1254, 5667, 1964, 29911, 9375, 15646, 13, 3166, 263, 1600, 294, 29889, 698, 2774, 336, 22437, 29889, 8628, 520, 1372, 17699, 1053, 4326, 3718, 9375, 15646, 13, 3166, 263, 1600, 294, 29889, 698, 2774, 336, 22437, 29889, 3433, 4564, 300, 1372, 17699, 1053, 12487, 749, 29911, 9375, 15646, 13, 5215, 263, 1600, 294, 29889, 10945, 12171, 408, 330, 29888, 13, 13, 13, 1990, 10829, 26041, 3950, 29898, 3403, 29531, 1125, 13, 1678, 9995, 13, 1678, 319, 770, 304, 14710, 267, 675, 1426, 22370, 964, 13, 1678, 385, 10348, 934, 29892, 13, 1678, 3412, 411, 278, 6590, 931, 23791, 943, 29889, 13, 13, 1678, 584, 3207, 364, 5527, 29901, 263, 10073, 5285, 13, 1678, 584, 1853, 29871, 364, 5527, 29901, 584, 1990, 18078, 30022, 29874, 1600, 294, 29889, 15634, 13305, 29889, 7944, 8614, 29952, 13, 1678, 584, 3207, 17927, 29901, 278, 17927, 1203, 13, 1678, 584, 1853, 29871, 17927, 29901, 584, 1990, 18078, 30022, 29874, 1600, 294, 29889, 21707, 29889, 16363, 29952, 13, 1678, 584, 336, 4637, 29901, 438, 29173, 29901, 565, 263, 2888, 323, 9375, 6012, 338, 13877, 13, 462, 418, 541, 372, 2609, 367, 7500, 13, 1678, 584, 336, 4637, 29901, 16032, 2392, 29901, 565, 278, 15540, 2043, 368, 323, 9375, 3450, 14476, 338, 13877, 13, 462, 3986, 541, 278, 4954, 29890, 3747, 29941, 16159, 3883, 338, 451, 5130, 29892, 470, 13, 462, 3986, 565, 278, 12487, 749, 323, 9375, 3450, 14476, 338, 13877, 13, 462, 3986, 541, 278, 16159, 24830, 16159, 3883, 338, 451, 5130, 13, 1678, 9995, 13, 13, 1678, 15540, 353, 376, 10467, 29908, 13, 1678, 9995, 7605, 15540, 2043, 368, 323, 9375, 3450, 14476, 9995, 13, 13, 1678, 315, 17321, 6488, 353, 376, 6341, 29908, 13, 1678, 9995, 7605, 2888, 323, 9375, 6012, 14476, 9995, 13, 13, 1678, 17956, 4162, 22311, 353, 376, 267, 412, 557, 29908, 13, 1678, 9995, 7605, 321, 10649, 557, 14476, 9995, 13, 13, 1678, 17956, 4162, 22311, 9312, 353, 376, 267, 412, 557, 29899, 865, 29908, 13, 1678, 9995, 7605, 321, 10649, 557, 29899, 865, 14476, 9995, 13, 13, 1678, 383, 29923, 1254, 5667, 1964, 353, 376, 29888, 6074, 29908, 13, 1678, 9995, 7605, 8518, 14476, 9995, 13, 13, 1678, 26750, 3267, 353, 376, 8628, 359, 29908, 13, 1678, 9995, 7605, 5825, 3267, 376, 20834, 29908, 14476, 9995, 13, 13, 1678, 405, 29965, 23219, 353, 376, 3433, 749, 29908, 13, 1678, 9995, 7605, 12487, 749, 323, 9375, 3450, 14476, 9995, 13, 13, 1678, 15149, 9806, 3352, 29918, 8932, 12996, 353, 518, 29909, 7811, 29892, 315, 17321, 6488, 29892, 17956, 4162, 22311, 29892, 17956, 4162, 22311, 9312, 29892, 383, 29923, 1254, 5667, 1964, 29892, 26750, 3267, 29892, 405, 29965, 23219, 29962, 13, 1678, 9995, 2391, 310, 599, 278, 6068, 1819, 9995, 13, 13, 1678, 323, 10051, 353, 318, 29908, 29216, 26041, 3950, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 364, 5527, 29922, 8516, 29892, 17927, 29922, 8516, 1125, 13, 4706, 2428, 29898, 29216, 26041, 3950, 29892, 1583, 467, 1649, 2344, 12035, 29878, 5527, 29922, 29878, 5527, 29892, 17927, 29922, 21707, 29897, 13, 4706, 1583, 29889, 698, 29879, 29918, 10599, 353, 6213, 13, 4706, 1583, 3032, 2622, 29918, 698, 29879, 29918, 10599, 580, 13, 13, 1678, 822, 903, 2622, 29918, 698, 29879, 29918, 10599, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 7605, 278, 323, 9375, 6012, 304, 367, 1304, 491, 3063, 472, 278, 364, 5527, 1203, 29889, 13, 4706, 9995, 13, 4706, 1583, 29889, 1188, 29898, 29884, 29908, 3549, 292, 323, 9375, 6012, 856, 1159, 13, 4706, 13877, 29918, 698, 29879, 29918, 10599, 353, 1583, 29889, 29878, 5527, 29961, 7944, 8614, 29889, 29911, 9375, 29962, 13, 4706, 565, 13877, 29918, 698, 29879, 29918, 10599, 1275, 1583, 29889, 29907, 17321, 6488, 29901, 13, 9651, 1583, 29889, 1188, 29898, 29884, 29908, 29911, 9375, 6012, 29901, 2888, 1159, 13, 9651, 260, 1372, 29918, 2084, 353, 1583, 29889, 29878, 5527, 29961, 7944, 8614, 29889, 29911, 9375, 29918, 10145, 29962, 13, 9651, 565, 260, 1372, 29918, 2084, 338, 6213, 29901, 13, 18884, 1583, 29889, 1188, 29918, 735, 29883, 29898, 29884, 29908, 3492, 1818, 6084, 263, 995, 363, 260, 1372, 29918, 2084, 613, 6213, 29892, 5852, 29892, 7865, 2392, 29897, 13, 9651, 565, 451, 330, 29888, 29889, 1445, 29918, 3068, 29918, 915, 29918, 949, 29898, 698, 29879, 29918, 2084, 1125, 13, 18884, 1583, 29889, 1188, 29918, 735, 29883, 29898, 29884, 29908, 29089, 1303, 260, 1372, 29918, 2084, 613, 6213, 29892, 5852, 29892, 438, 29173, 29897, 13, 9651, 1018, 29901, 13, 18884, 1053, 2411, 13, 18884, 1583, 29889, 1188, 4197, 29884, 29908, 23456, 8701, 29911, 9375, 15646, 3883, 515, 14210, 29879, 29915, 856, 613, 260, 1372, 29918, 2084, 2314, 13, 18884, 2411, 29889, 1359, 29918, 4993, 703, 7281, 29911, 9375, 15646, 7355, 613, 260, 1372, 29918, 2084, 29897, 13, 18884, 1583, 29889, 1188, 4197, 29884, 29908, 23456, 8701, 29911, 9375, 15646, 3883, 515, 14210, 29879, 29915, 856, 2309, 613, 260, 1372, 29918, 2084, 2314, 13, 18884, 1583, 29889, 1188, 29898, 29884, 29908, 17518, 292, 8701, 29911, 9375, 15646, 856, 1159, 13, 18884, 515, 8701, 29911, 9375, 15646, 7355, 1053, 8701, 29911, 9375, 15646, 13, 18884, 1583, 29889, 1188, 29898, 29884, 29908, 17518, 292, 8701, 29911, 9375, 15646, 856, 2309, 1159, 13, 18884, 1583, 29889, 1188, 29898, 29884, 29908, 9832, 1218, 8701, 29911, 9375, 15646, 2777, 856, 1159, 13, 18884, 1583, 29889, 698, 29879, 29918, 10599, 353, 8701, 29911, 9375, 15646, 29898, 29878, 5527, 29922, 1311, 29889, 29878, 5527, 29892, 17927, 29922, 1311, 29889, 21707, 29897, 13, 18884, 1583, 29889, 1188, 29898, 29884, 29908, 9832, 1218, 8701, 29911, 9375, 15646, 2777, 856, 2309, 1159, 13, 9651, 5174, 8960, 408, 5566, 29901, 13, 18884, 1583, 29889, 1188, 29918, 735, 29883, 29898, 29884, 29908, 2525, 519, 304, 2254, 2888, 323, 9375, 14476, 613, 5566, 29892, 5852, 29892, 438, 29173, 29897, 13, 4706, 25342, 13877, 29918, 698, 29879, 29918, 10599, 1275, 1583, 29889, 29909, 7811, 29901, 13, 9651, 1018, 29901, 13, 18884, 1053, 289, 3747, 29941, 13, 9651, 5174, 16032, 2392, 408, 5566, 29901, 13, 18884, 1583, 29889, 1188, 29918, 735, 29883, 29898, 29884, 29908, 2525, 519, 304, 1053, 289, 3747, 29941, 363, 15540, 2043, 368, 323, 9375, 3450, 14476, 613, 5566, 29892, 5852, 29892, 16032, 2392, 29897, 13, 9651, 1583, 29889, 1188, 29898, 29884, 29908, 29911, 9375, 6012, 29901, 15540, 2043, 368, 323, 9375, 3450, 1159, 13, 9651, 1583, 29889, 698, 29879, 29918, 10599, 353, 319, 29956, 1254, 9375, 15646, 29898, 29878, 5527, 29922, 1311, 29889, 29878, 5527, 29892, 17927, 29922, 1311, 29889, 21707, 29897, 13, 4706, 25342, 13877, 29918, 698, 29879, 29918, 10599, 1275, 1583, 29889, 11601, 23219, 29901, 13, 9651, 1018, 29901, 13, 18884, 1053, 7274, 13, 9651, 5174, 16032, 2392, 408, 5566, 29901, 13, 18884, 1583, 29889, 1188, 29918, 735, 29883, 29898, 29884, 29908, 2525, 519, 304, 1053, 7274, 363, 12487, 749, 323, 9375, 3450, 14476, 613, 5566, 29892, 5852, 29892, 16032, 2392, 29897, 13, 9651, 1583, 29889, 1188, 29898, 29884, 29908, 29911, 9375, 6012, 29901, 12487, 749, 323, 9375, 3450, 1159, 13, 9651, 1583, 29889, 698, 29879, 29918, 10599, 353, 12487, 749, 29911, 9375, 15646, 29898, 29878, 5527, 29922, 1311, 29889, 29878, 5527, 29892, 17927, 29922, 1311, 29889, 21707, 29897, 13, 4706, 25342, 13877, 29918, 698, 29879, 29918, 10599, 1275, 1583, 29889, 2890, 4162, 22311, 9312, 29901, 13, 9651, 1583, 29889, 1188, 29898, 29884, 29908, 29911, 9375, 6012, 29901, 321, 10649, 557, 29899, 865, 1159, 13, 9651, 1583, 29889, 698, 29879, 29918, 10599, 353, 17956, 4162, 22311, 9312, 29911, 9375, 15646, 29898, 29878, 5527, 29922, 1311, 29889, 29878, 5527, 29892, 17927, 29922, 1311, 29889, 21707, 29897, 13, 4706, 25342, 13877, 29918, 698, 29879, 29918, 10599, 1275, 1583, 29889, 16359, 1254, 5667, 1964, 29901, 13, 9651, 1583, 29889, 1188, 29898, 29884, 29908, 29911, 9375, 6012, 29901, 8518, 1159, 13, 9651, 1583, 29889, 698, 29879, 29918, 10599, 353, 383, 29923, 1254, 5667, 1964, 29911, 9375, 15646, 29898, 29878, 5527, 29922, 1311, 29889, 29878, 5527, 29892, 17927, 29922, 1311, 29889, 21707, 29897, 13, 4706, 25342, 13877, 29918, 698, 29879, 29918, 10599, 1275, 1583, 29889, 1529, 3217, 29903, 29901, 13, 9651, 1583, 29889, 1188, 29898, 29884, 29908, 29911, 9375, 6012, 29901, 5825, 3267, 1159, 13, 9651, 1583, 29889, 698, 29879, 29918, 10599, 353, 4326, 3718, 9375, 15646, 29898, 29878, 5527, 29922, 1311, 29889, 29878, 5527, 29892, 17927, 29922, 1311, 29889, 21707, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 1188, 29898, 29884, 29908, 29911, 9375, 6012, 29901, 321, 10649, 557, 1159, 13, 9651, 1583, 29889, 698, 29879, 29918, 10599, 353, 17956, 4162, 22311, 29911, 9375, 15646, 29898, 29878, 5527, 29922, 1311, 29889, 29878, 5527, 29892, 17927, 29922, 1311, 29889, 21707, 29897, 13, 4706, 1583, 29889, 1188, 29898, 29884, 29908, 3549, 292, 323, 9375, 6012, 856, 2309, 1159, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1962, 29918, 18494, 29918, 4830, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 7106, 263, 18761, 4954, 29898, 401, 29883, 29892, 18196, 29892, 6554, 3569, 29952, 13, 4706, 22146, 278, 10348, 3402, 13, 4706, 5759, 491, 278, 3935, 323, 9375, 6012, 29889, 13, 13, 4706, 584, 29878, 1853, 29901, 18761, 13, 4706, 9995, 13, 4706, 565, 1583, 29889, 698, 29879, 29918, 10599, 338, 451, 6213, 29901, 13, 9651, 736, 1583, 29889, 698, 29879, 29918, 10599, 29889, 12015, 12336, 29918, 25951, 4571, 29949, 29918, 19094, 1299, 13, 4706, 736, 6213, 13, 13, 1678, 822, 2821, 29918, 8173, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 17732, 278, 323, 9375, 7090, 29892, 11077, 599, 7090, 2066, 515, 8086, 29889, 13, 13, 4706, 6317, 1873, 23959, 1057, 29871, 29896, 29889, 29953, 29889, 29900, 13, 4706, 9995, 13, 4706, 565, 1583, 29889, 698, 29879, 29918, 10599, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 698, 29879, 29918, 10599, 29889, 8551, 29918, 8173, 580, 13, 13, 1678, 822, 14710, 267, 675, 29898, 13, 9651, 1583, 29892, 13, 9651, 1426, 29918, 1445, 29892, 13, 9651, 10348, 29918, 1445, 29918, 2084, 29892, 13, 9651, 23283, 29918, 7045, 29922, 8516, 29892, 13, 9651, 28953, 29922, 8824, 13, 268, 1125, 13, 4706, 9995, 13, 4706, 10829, 26041, 675, 278, 1426, 11122, 297, 278, 2183, 9376, 1051, 13, 4706, 964, 263, 4954, 29893, 485, 16159, 934, 29889, 13, 13, 4706, 7106, 263, 18761, 4954, 29898, 14588, 943, 29892, 3001, 29918, 2230, 29892, 954, 29918, 305, 1503, 3569, 1412, 13, 13, 4706, 584, 3207, 1426, 29918, 1445, 29901, 278, 1426, 934, 304, 367, 14710, 267, 1891, 13, 4706, 584, 1853, 29871, 1426, 29918, 1445, 29901, 584, 1990, 18078, 30022, 29874, 1600, 294, 29889, 726, 1445, 29889, 1626, 2283, 29952, 13, 4706, 584, 3207, 1347, 10348, 29918, 1445, 29918, 2084, 29901, 278, 2224, 304, 278, 1962, 10348, 934, 13, 4706, 584, 3207, 5785, 23283, 29918, 7045, 29901, 5040, 14710, 267, 5281, 408, 4720, 408, 13, 462, 462, 20888, 445, 1784, 6923, 13, 4706, 584, 3207, 6120, 28953, 29901, 565, 4954, 5574, 29952, 1673, 14710, 267, 5281, 515, 278, 1095, 310, 278, 1426, 934, 13, 4706, 584, 29878, 1853, 29901, 18761, 13, 4706, 584, 336, 4637, 29901, 20948, 29901, 565, 4954, 726, 29918, 1445, 16159, 338, 4954, 8516, 16159, 470, 451, 385, 2777, 310, 4954, 1626, 2283, 16159, 13, 4706, 584, 336, 4637, 29901, 438, 29173, 29901, 565, 4954, 18494, 29918, 1445, 29918, 2084, 16159, 2609, 367, 3971, 13, 4706, 584, 336, 4637, 29901, 438, 29173, 29901, 565, 4954, 698, 29879, 29922, 6341, 16159, 297, 278, 24875, 8614, 322, 4954, 698, 29879, 29918, 2084, 16159, 2609, 367, 1303, 13, 4706, 584, 336, 4637, 29901, 7865, 2392, 29901, 565, 278, 323, 9375, 6012, 756, 451, 1063, 731, 3447, 13, 4706, 9995, 13, 4706, 565, 1426, 29918, 1445, 338, 6213, 29901, 13, 9651, 1583, 29889, 1188, 29918, 735, 29883, 29898, 29884, 29908, 726, 29918, 1445, 338, 6213, 613, 6213, 29892, 5852, 29892, 20948, 29897, 13, 4706, 565, 451, 338, 8758, 29898, 726, 29918, 1445, 29892, 3992, 2283, 1125, 13, 9651, 1583, 29889, 1188, 29918, 735, 29883, 29898, 29884, 29908, 726, 29918, 1445, 338, 451, 385, 2777, 310, 3992, 2283, 613, 6213, 29892, 5852, 29892, 20948, 29897, 13, 4706, 565, 451, 330, 29888, 29889, 1445, 29918, 3068, 29918, 915, 29918, 17625, 29898, 18494, 29918, 1445, 29918, 2084, 1125, 13, 9651, 1583, 29889, 1188, 29918, 735, 29883, 29898, 29884, 29908, 17111, 934, 2224, 14210, 29879, 29915, 2609, 367, 3971, 29908, 1273, 313, 18494, 29918, 1445, 29918, 2084, 511, 6213, 29892, 5852, 29892, 438, 29173, 29897, 13, 4706, 565, 1583, 29889, 698, 29879, 29918, 10599, 338, 6213, 29901, 13, 9651, 1583, 29889, 1188, 29918, 735, 29883, 29898, 29884, 29908, 29089, 1831, 278, 323, 9375, 6012, 613, 6213, 29892, 5852, 29892, 7865, 2392, 29897, 13, 13, 4706, 396, 14710, 267, 675, 13, 4706, 1583, 29889, 1188, 29898, 29884, 29908, 29216, 26041, 5281, 1426, 856, 1159, 13, 4706, 1121, 353, 1583, 29889, 698, 29879, 29918, 10599, 29889, 19274, 26041, 675, 29918, 20787, 29898, 13, 9651, 1426, 29918, 1445, 29922, 726, 29918, 1445, 29892, 13, 9651, 1962, 29918, 1445, 29918, 2084, 29922, 18494, 29918, 1445, 29918, 2084, 29892, 13, 9651, 23283, 29918, 7045, 29922, 28358, 29918, 7045, 29892, 13, 9651, 28953, 29922, 1627, 2935, 13, 4706, 1723, 13, 4706, 1583, 29889, 1188, 29898, 29884, 29908, 29216, 26041, 5281, 1426, 856, 2309, 1159, 13, 13, 4706, 396, 1423, 393, 278, 1962, 934, 756, 1063, 3971, 13, 4706, 565, 451, 330, 29888, 29889, 1445, 29918, 9933, 29898, 18494, 29918, 1445, 29918, 2084, 1125, 13, 9651, 1583, 29889, 1188, 29918, 735, 29883, 29898, 29884, 29908, 17111, 934, 2224, 14210, 29879, 29915, 2609, 367, 1303, 29908, 1273, 313, 18494, 29918, 1445, 29918, 2084, 511, 6213, 29892, 5852, 29892, 438, 29173, 29897, 13, 13, 4706, 736, 1121, 13, 2 ]
Gerador_de_Senha.py
Jhon-Dx/Program
0
40053
import Gerador_de_senhas.Defs as ge import PySimpleGUI as sg class Gerador: sg.theme('DarkPurple1') def __init__(self): layout = [ [sg.Checkbox('Numeros', key='sonumeros'), sg.Text(size=(3, 1)), sg.Checkbox('Letras', key='soletras'), sg.Text(size=(3, 1)), sg.Checkbox('Simbolos', key='sosimbolos')], [sg.Text('Quantidade de senhas'), sg.Combo(values=list(range(30)), key='totalchars', default_value=1, size=(3, 1))], [sg.Text(size=(11, 3)), sg.Button('Gerar Senha')], [sg.Text('Resultado:', size=(9, 1)), sg.Text(size=(22, 0))], [sg.Output(size=(40, 5))] ] self.janela = sg.Window("Gerador de Senha").layout(layout) def iniciar(self): while True: self.evento, self.values = self.janela.read() com_numeros = self.values['sonumeros'] com_letras = self.values['soletras'] com_simbolos = self.values['sosimbolos'] total_de_caracteres = self.values['totalchars'] if self.evento == sg.WINDOW_CLOSED: break if self.evento == 'Gerar Senha': newsenha = ge.truefalse(com_numeros, com_simbolos, com_letras, total_de_caracteres) print(newsenha) tela = Gerador() tela.iniciar()
[ 1, 1053, 5681, 3136, 29918, 311, 29918, 4881, 5349, 29889, 3206, 29879, 408, 1737, 13, 5215, 10772, 15427, 29954, 3120, 408, 269, 29887, 13, 13, 13, 1990, 5681, 3136, 29901, 13, 1678, 269, 29887, 29889, 18193, 877, 29928, 935, 29925, 332, 552, 29896, 1495, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 5912, 353, 518, 13, 9651, 518, 5311, 29889, 5596, 1884, 877, 29940, 4680, 359, 742, 1820, 2433, 1100, 4680, 359, 5477, 269, 29887, 29889, 1626, 29898, 2311, 7607, 29941, 29892, 29871, 29896, 8243, 269, 29887, 29889, 5596, 1884, 877, 12024, 3417, 742, 1820, 2433, 2170, 10678, 5477, 13, 9651, 269, 29887, 29889, 1626, 29898, 2311, 7607, 29941, 29892, 29871, 29896, 8243, 269, 29887, 29889, 5596, 1884, 877, 8942, 2095, 359, 742, 1820, 2433, 29879, 359, 326, 2095, 359, 1495, 1402, 13, 9651, 518, 5311, 29889, 1626, 877, 22930, 5558, 316, 6940, 5349, 5477, 269, 29887, 29889, 1523, 833, 29898, 5975, 29922, 1761, 29898, 3881, 29898, 29941, 29900, 8243, 1820, 2433, 7827, 305, 1503, 742, 2322, 29918, 1767, 29922, 29896, 29892, 13, 9651, 2159, 7607, 29941, 29892, 29871, 29896, 876, 1402, 13, 9651, 518, 5311, 29889, 1626, 29898, 2311, 7607, 29896, 29896, 29892, 29871, 29941, 8243, 269, 29887, 29889, 3125, 877, 29954, 261, 279, 5811, 2350, 1495, 1402, 13, 9651, 518, 5311, 29889, 1626, 877, 1666, 2727, 29901, 742, 2159, 7607, 29929, 29892, 29871, 29896, 8243, 269, 29887, 29889, 1626, 29898, 2311, 7607, 29906, 29906, 29892, 29871, 29900, 876, 1402, 13, 9651, 518, 5311, 29889, 6466, 29898, 2311, 7607, 29946, 29900, 29892, 29871, 29945, 28166, 13, 4706, 4514, 13, 4706, 1583, 29889, 8931, 3100, 353, 269, 29887, 29889, 5907, 703, 29954, 261, 3136, 316, 5811, 2350, 2564, 2680, 29898, 2680, 29897, 13, 13, 1678, 822, 21855, 279, 29898, 1311, 1125, 13, 4706, 1550, 5852, 29901, 13, 9651, 1583, 29889, 3696, 29877, 29892, 1583, 29889, 5975, 353, 1583, 29889, 8931, 3100, 29889, 949, 580, 13, 9651, 419, 29918, 8058, 359, 353, 1583, 29889, 5975, 1839, 1100, 4680, 359, 2033, 13, 9651, 419, 29918, 280, 10678, 353, 1583, 29889, 5975, 1839, 2170, 10678, 2033, 13, 9651, 419, 29918, 3601, 2095, 359, 353, 1583, 29889, 5975, 1839, 29879, 359, 326, 2095, 359, 2033, 13, 9651, 3001, 29918, 311, 29918, 4287, 5761, 267, 353, 1583, 29889, 5975, 1839, 7827, 305, 1503, 2033, 13, 9651, 565, 1583, 29889, 3696, 29877, 1275, 269, 29887, 29889, 25152, 3970, 29956, 29918, 29907, 3927, 1660, 29928, 29901, 13, 18884, 2867, 13, 9651, 565, 1583, 29889, 3696, 29877, 1275, 525, 29954, 261, 279, 5811, 2350, 2396, 13, 18884, 716, 4881, 2350, 353, 1737, 29889, 3009, 4541, 29898, 510, 29918, 8058, 359, 29892, 419, 29918, 3601, 2095, 359, 29892, 419, 29918, 280, 10678, 29892, 3001, 29918, 311, 29918, 4287, 5761, 267, 29897, 13, 18884, 1596, 29898, 1482, 4881, 2350, 29897, 13, 13, 13, 29873, 3100, 353, 5681, 3136, 580, 13, 29873, 3100, 29889, 262, 1654, 279, 580, 2 ]
apps/users/views.py
madjaqk/puzzle_master_v2
0
114086
<filename>apps/users/views.py from django.contrib import messages from django.contrib.auth import authenticate, login, logout, update_session_auth_hash from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm, UserCreationForm, AdminPasswordChangeForm, PasswordChangeForm from django.contrib.auth.models import User from django.shortcuts import render, redirect from social_django.models import UserSocialAuth from .forms import MyAuthenticationForm def login_page(request): oauth_buttons = [ ("facebook", "users/img/facebook_login.png"), ("twitter", "users/img/sign-in-with-twitter-gray.png"), ("github", "users/img/GitHub_Logo.png"), ] context = { "register_form": UserCreationForm(), "login_form": MyAuthenticationForm(), "oauth_buttons": oauth_buttons } return render(request, "users/login.html", context) def register(request): if request.method != "POST": return redirect("users:login_page") form = UserCreationForm(request.POST) if form.is_valid(): form.save() username = form.cleaned_data.get("username") raw_password = form.cleaned_data.get("<PASSWORD>") user = authenticate(username=username, password=raw_password) login(request, user) return redirect("puzzles:index") # Change this back to puzzles:index !!! else: for field, errors in form.errors.get_json_data().items(): for error in errors: messages.error(request, error["message"]) return redirect("users:login_page") def login_user(request): if request.method != "POST": return redirect("users:login_page") user = authenticate(username=request.POST["username"], password=request.POST["password"]) if user is not None: login(request, user) return redirect("puzzles:index") else: messages.error(request, "Username or password incorrect") return redirect("users:login_page") def logout_user(request): logout(request) return redirect("users:login_page") @login_required def settings(request): user = request.user other_sites = ["github", "twitter", "facebook"] other_site_logins = [] for site in other_sites: try: other_site_logins.append(user.social_auth.get(provider=site)) except UserSocialAuth.DoesNotExist: other_site_logins.append(None) context = {f"{site}_login": site_login for site, site_login in zip (other_sites, other_site_logins)} context["can_disconnect"] = user.social_auth.count() > 1 or user.has_usable_password() return render(request, "users/settings.html", context) @login_required def password(request): if request.user.has_usable_password(): PasswordForm = PasswordChangeForm else: PasswordForm = AdminPasswordChangeForm if request.method == "POST": form = PasswordForm(request.user, request.POST) if form.is_valid(): form.save() update_session_auth_hash(request, form.user) messages.success(request, "Your password was successfully updated!") else: for field, errors in form.errors.get_json_data().items(): for error in errors: messages.error(request, error["message"]) return redirect("users:password") else: form = PasswordForm(request.user) return render(request, "users/password.html", {"form": form}) def privacy(request): return render(request, "users/privacy.html")
[ 1, 529, 9507, 29958, 13371, 29914, 7193, 29914, 7406, 29889, 2272, 13, 3166, 9557, 29889, 21570, 1053, 7191, 13, 3166, 9557, 29889, 21570, 29889, 5150, 1053, 15585, 403, 29892, 6464, 29892, 1480, 449, 29892, 2767, 29918, 7924, 29918, 5150, 29918, 8568, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 19557, 4097, 1053, 6464, 29918, 12403, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9514, 1053, 27241, 2500, 29892, 4911, 9832, 362, 2500, 29892, 10229, 10048, 7277, 2500, 29892, 25280, 7277, 2500, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9794, 1053, 4911, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 4050, 29892, 6684, 13, 13, 3166, 5264, 29918, 14095, 29889, 9794, 1053, 4911, 6295, 1455, 6444, 13, 13, 3166, 869, 9514, 1053, 1619, 16746, 2500, 13, 13, 1753, 6464, 29918, 3488, 29898, 3827, 1125, 13, 12, 23106, 29918, 4187, 7453, 353, 518, 13, 12, 12, 703, 15445, 613, 376, 7193, 29914, 2492, 29914, 15445, 29918, 7507, 29889, 2732, 4968, 13, 12, 12, 703, 24946, 613, 376, 7193, 29914, 2492, 29914, 4530, 29899, 262, 29899, 2541, 29899, 24946, 29899, 21012, 29889, 2732, 4968, 13, 12, 12, 703, 3292, 613, 376, 7193, 29914, 2492, 29914, 28712, 16046, 29918, 3403, 29877, 29889, 2732, 4968, 13, 12, 29962, 13, 13, 12, 4703, 353, 426, 13, 12, 12, 29908, 9573, 29918, 689, 1115, 4911, 9832, 362, 2500, 3285, 13, 12, 12, 29908, 7507, 29918, 689, 1115, 1619, 16746, 2500, 3285, 13, 12, 12, 29908, 23106, 29918, 4187, 7453, 1115, 288, 5150, 29918, 4187, 7453, 13, 12, 29913, 13, 12, 2457, 4050, 29898, 3827, 29892, 376, 7193, 29914, 7507, 29889, 1420, 613, 3030, 29897, 13, 13, 1753, 6036, 29898, 3827, 1125, 13, 12, 361, 2009, 29889, 5696, 2804, 376, 5438, 1115, 13, 12, 12, 2457, 6684, 703, 7193, 29901, 7507, 29918, 3488, 1159, 13, 13, 12, 689, 353, 4911, 9832, 362, 2500, 29898, 3827, 29889, 5438, 29897, 13, 12, 361, 883, 29889, 275, 29918, 3084, 7295, 13, 12, 12, 689, 29889, 7620, 580, 13, 12, 12, 6786, 353, 883, 29889, 14941, 287, 29918, 1272, 29889, 657, 703, 6786, 1159, 13, 12, 12, 1610, 29918, 5630, 353, 883, 29889, 14941, 287, 29918, 1272, 29889, 657, 28945, 25711, 17013, 29958, 1159, 13, 12, 12, 1792, 353, 15585, 403, 29898, 6786, 29922, 6786, 29892, 4800, 29922, 1610, 29918, 5630, 29897, 13, 12, 12, 7507, 29898, 3827, 29892, 1404, 29897, 13, 12, 12, 2457, 6684, 703, 29886, 18813, 793, 29901, 2248, 1159, 396, 10726, 445, 1250, 304, 20285, 793, 29901, 2248, 1738, 6824, 13, 12, 2870, 29901, 13, 12, 12, 1454, 1746, 29892, 4436, 297, 883, 29889, 12523, 29889, 657, 29918, 3126, 29918, 1272, 2141, 7076, 7295, 13, 12, 12, 12, 1454, 1059, 297, 4436, 29901, 13, 12, 12, 12, 12, 19158, 29889, 2704, 29898, 3827, 29892, 1059, 3366, 4906, 20068, 13, 13, 12, 2457, 6684, 703, 7193, 29901, 7507, 29918, 3488, 1159, 13, 13, 1753, 6464, 29918, 1792, 29898, 3827, 1125, 13, 12, 361, 2009, 29889, 5696, 2804, 376, 5438, 1115, 13, 12, 12, 2457, 6684, 703, 7193, 29901, 7507, 29918, 3488, 1159, 13, 13, 12, 1792, 353, 15585, 403, 29898, 6786, 29922, 3827, 29889, 5438, 3366, 6786, 12436, 4800, 29922, 3827, 29889, 5438, 3366, 5630, 20068, 13, 13, 12, 361, 1404, 338, 451, 6213, 29901, 13, 12, 12, 7507, 29898, 3827, 29892, 1404, 29897, 13, 12, 12, 2457, 6684, 703, 29886, 18813, 793, 29901, 2248, 1159, 13, 12, 2870, 29901, 13, 12, 12, 19158, 29889, 2704, 29898, 3827, 29892, 376, 20249, 470, 4800, 10240, 1159, 13, 12, 12, 2457, 6684, 703, 7193, 29901, 7507, 29918, 3488, 1159, 13, 13, 1753, 1480, 449, 29918, 1792, 29898, 3827, 1125, 13, 12, 1188, 449, 29898, 3827, 29897, 13, 12, 2457, 6684, 703, 7193, 29901, 7507, 29918, 3488, 1159, 13, 13, 29992, 7507, 29918, 12403, 13, 1753, 6055, 29898, 3827, 1125, 13, 12, 1792, 353, 2009, 29889, 1792, 13, 13, 12, 1228, 29918, 16315, 353, 6796, 3292, 613, 376, 24946, 613, 376, 15445, 3108, 13, 12, 1228, 29918, 2746, 29918, 1188, 1144, 353, 5159, 13, 13, 12, 1454, 3268, 297, 916, 29918, 16315, 29901, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 1228, 29918, 2746, 29918, 1188, 1144, 29889, 4397, 29898, 1792, 29889, 24911, 29918, 5150, 29889, 657, 29898, 18121, 29922, 2746, 876, 13, 12, 12, 19499, 4911, 6295, 1455, 6444, 29889, 25125, 3664, 1252, 391, 29901, 13, 12, 12, 12, 1228, 29918, 2746, 29918, 1188, 1144, 29889, 4397, 29898, 8516, 29897, 13, 13, 12, 4703, 353, 426, 29888, 29908, 29912, 2746, 2403, 7507, 1115, 3268, 29918, 7507, 363, 3268, 29892, 3268, 29918, 7507, 297, 14319, 313, 1228, 29918, 16315, 29892, 916, 29918, 2746, 29918, 1188, 1144, 2915, 13, 13, 12, 4703, 3366, 3068, 29918, 2218, 6915, 3108, 353, 1404, 29889, 24911, 29918, 5150, 29889, 2798, 580, 1405, 29871, 29896, 470, 1404, 29889, 5349, 29918, 27979, 29918, 5630, 580, 13, 13, 12, 2457, 4050, 29898, 3827, 29892, 376, 7193, 29914, 11027, 29889, 1420, 613, 3030, 29897, 13, 13, 29992, 7507, 29918, 12403, 13, 1753, 4800, 29898, 3827, 1125, 13, 12, 361, 2009, 29889, 1792, 29889, 5349, 29918, 27979, 29918, 5630, 7295, 13, 12, 12, 10048, 2500, 353, 25280, 7277, 2500, 13, 12, 2870, 29901, 13, 12, 12, 10048, 2500, 353, 10229, 10048, 7277, 2500, 13, 13, 12, 361, 2009, 29889, 5696, 1275, 376, 5438, 1115, 13, 12, 12, 689, 353, 25280, 2500, 29898, 3827, 29889, 1792, 29892, 2009, 29889, 5438, 29897, 13, 12, 12, 361, 883, 29889, 275, 29918, 3084, 7295, 13, 12, 12, 12, 689, 29889, 7620, 580, 13, 12, 12, 12, 5504, 29918, 7924, 29918, 5150, 29918, 8568, 29898, 3827, 29892, 883, 29889, 1792, 29897, 13, 12, 12, 12, 19158, 29889, 8698, 29898, 3827, 29892, 376, 10858, 4800, 471, 8472, 4784, 29991, 1159, 13, 12, 12, 2870, 29901, 13, 12, 12, 12, 1454, 1746, 29892, 4436, 297, 883, 29889, 12523, 29889, 657, 29918, 3126, 29918, 1272, 2141, 7076, 7295, 13, 12, 12, 12, 12, 1454, 1059, 297, 4436, 29901, 13, 12, 12, 12, 12, 12, 19158, 29889, 2704, 29898, 3827, 29892, 1059, 3366, 4906, 20068, 13, 13, 12, 12, 2457, 6684, 703, 7193, 29901, 5630, 1159, 13, 12, 2870, 29901, 13, 12, 12, 689, 353, 25280, 2500, 29898, 3827, 29889, 1792, 29897, 13, 13, 12, 2457, 4050, 29898, 3827, 29892, 376, 7193, 29914, 5630, 29889, 1420, 613, 8853, 689, 1115, 883, 1800, 13, 13, 1753, 5999, 4135, 29898, 3827, 1125, 13, 12, 2457, 4050, 29898, 3827, 29892, 376, 7193, 29914, 22534, 4135, 29889, 1420, 1159, 2 ]
puzzle_captcha/management/commands/load_images.py
MegaMark16/django-puzzle-captcha
4
72464
import os from django.core.management.base import BaseCommand, CommandError from django.core.files.uploadedfile import SimpleUploadedFile from puzzle_captcha.models import Puzzle class Command(BaseCommand): args = '<path_to_images_folder ...>' help = 'Loads all the images from the folder specified into the Puzzle Captcha library' def add_arguments(self, parser): parser.add_argument('path') def handle(self, *args, **options): path = options['path'] files = os.listdir(path) for filename in files: print "Loading %s..." % filename create_puzzle(path, filename) try: pass except Exception as ex: print ex def create_puzzle(directory, filename): puzzle = Puzzle(key='') try: full_file_path = os.path.join(directory, filename) image = open(full_file_path, 'rb')#Image.open(full_file_path) puzzle.image.save(filename, SimpleUploadedFile(filename, image.read(), content_type='image/jpg'), save=True) puzzle.save() except Exception as ex: if puzzle.id: puzzle.delete() print 'An error occurred: %s' % ex
[ 1, 1053, 2897, 13, 3166, 9557, 29889, 3221, 29889, 21895, 29889, 3188, 1053, 7399, 6255, 29892, 10516, 2392, 13, 3166, 9557, 29889, 3221, 29889, 5325, 29889, 9009, 287, 1445, 1053, 12545, 3373, 15638, 2283, 13, 3166, 20285, 280, 29918, 17885, 5815, 29889, 9794, 1053, 349, 18813, 280, 13, 13, 1990, 10516, 29898, 5160, 6255, 1125, 13, 1678, 6389, 353, 12801, 2084, 29918, 517, 29918, 8346, 29918, 12083, 2023, 16299, 13, 1678, 1371, 353, 525, 5896, 29879, 599, 278, 4558, 515, 278, 4138, 6790, 964, 278, 349, 18813, 280, 8868, 5815, 3489, 29915, 13, 13, 1678, 822, 788, 29918, 25699, 29898, 1311, 29892, 13812, 1125, 13, 4706, 13812, 29889, 1202, 29918, 23516, 877, 2084, 1495, 13, 13, 1678, 822, 4386, 29898, 1311, 29892, 334, 5085, 29892, 3579, 6768, 1125, 13, 4706, 2224, 353, 3987, 1839, 2084, 2033, 13, 4706, 2066, 353, 2897, 29889, 1761, 3972, 29898, 2084, 29897, 13, 4706, 363, 10422, 297, 2066, 29901, 13, 9651, 1596, 376, 23456, 1273, 29879, 17794, 1273, 10422, 13, 9651, 1653, 29918, 29886, 18813, 280, 29898, 2084, 29892, 10422, 29897, 13, 9651, 1018, 29901, 13, 18884, 1209, 13, 9651, 5174, 8960, 408, 429, 29901, 13, 18884, 1596, 429, 268, 13, 308, 13, 308, 13, 462, 268, 13, 1753, 1653, 29918, 29886, 18813, 280, 29898, 12322, 29892, 10422, 1125, 13, 1678, 20285, 280, 353, 349, 18813, 280, 29898, 1989, 2433, 1495, 13, 1678, 1018, 29901, 13, 4706, 2989, 29918, 1445, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 12322, 29892, 10422, 29897, 13, 4706, 1967, 353, 1722, 29898, 8159, 29918, 1445, 29918, 2084, 29892, 525, 6050, 1495, 29937, 2940, 29889, 3150, 29898, 8159, 29918, 1445, 29918, 2084, 29897, 13, 4706, 20285, 280, 29889, 3027, 29889, 7620, 29898, 9507, 29892, 12545, 3373, 15638, 2283, 29898, 9507, 29892, 1967, 29889, 949, 3285, 2793, 29918, 1853, 2433, 3027, 29914, 6173, 5477, 4078, 29922, 5574, 29897, 13, 4706, 20285, 280, 29889, 7620, 580, 4706, 13, 1678, 5174, 8960, 408, 429, 29901, 13, 4706, 565, 20285, 280, 29889, 333, 29901, 13, 9651, 20285, 280, 29889, 8143, 580, 13, 4706, 1596, 525, 2744, 1059, 10761, 29901, 1273, 29879, 29915, 1273, 429, 13, 13, 2 ]
shareloc/geofunctions/rectification.py
CNES/shareloc
10
197458
<reponame>CNES/shareloc<gh_stars>1-10 #!/usr/bin/env python # coding: utf8 # # Copyright (c) 2022 Centre National d'Etudes Spatiales (CNES). # # This file is part of Shareloc # (see https://github.com/CNES/shareloc). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # """ This module contains functions to generate stereo-rectification epipolar grids """ # Standard imports import math # Third party imports import numpy as np import rasterio # Shareloc imports from shareloc.geofunctions.localization import Localization, coloc from shareloc.image import Image def write_epipolar_grid(grid, filename, xy_convention=True): """ Write epipolar grid in a tiff file :param grid: epipolar grid :type grid: shareloc.Image :param filename: output filename :type filename: string :param xy_convention: True: write grid with xy convention : [band 1 = col displacement, band 2 = row displacement] False: write grid with yx convention : [band 1 = row displacement, band 2 = col displacement] :param xy_convention: bool """ band, row, col = grid.data.shape with rasterio.open( filename, "w", driver="GTiff", dtype=np.float64, width=col, height=row, count=band, transform=grid.transform ) as source_ds: if xy_convention: source_ds.write(grid.data[1, :, :], 1) source_ds.write(grid.data[0, :, :], 2) else: source_ds.write(grid.data[0, :, :], 1) source_ds.write(grid.data[1, :, :], 2) def compute_epipolar_angle(end_line, start_line): """ Define the epipolar angle :param end_line: ending of the epipolar line (georeferenced coordinates) :type end_line: 1D np.array [row, col, altitude] or 2D np.array [number of points, [row, col, altitude]] :param start_line: beginning of the epipolar line (georeferenced coordinates) :type start_line: 1D np.array [row, col, altitude] or 2D np.array [number of points, [row, col, altitude]] :return: epipolar angle :rtype : float or 1D np.array """ # Only one point, expand the shape of the array if len(end_line.shape) == 1: end_line = np.expand_dims(end_line, axis=0) start_line = np.expand_dims(start_line, axis=0) # Compute the equation of the epipolar line y = a*x + b and define the epipolare angle alpha = np.zeros(end_line.shape[0]) # Same columns, positive direction same_col_positive = (end_line[:, 1] == start_line[:, 1]) & (end_line[:, 0] > start_line[:, 0]) alpha[same_col_positive] = 0.5 * math.pi # Same columns, negative direction same_col_negative = (end_line[:, 1] == start_line[:, 1]) & (end_line[:, 0] <= start_line[:, 0]) alpha[same_col_negative] = -0.5 * math.pi # Different columns, positive direction diff_col_pos = np.where((end_line[:, 1] != start_line[:, 1]) & (end_line[:, 1] > start_line[:, 1])) slope = (end_line[diff_col_pos[0], 0] - start_line[diff_col_pos[0], 0]) / ( end_line[diff_col_pos[0], 1] - start_line[diff_col_pos[0], 1] ) alpha[diff_col_pos] = np.arctan(slope) # Different columns, negative direction diff_col_neg = np.where((end_line[:, 1] != start_line[:, 1]) & (end_line[:, 1] <= start_line[:, 1])) slope = (end_line[diff_col_neg[0], 0] - start_line[diff_col_neg[0], 0]) / ( end_line[diff_col_neg[0], 1] - start_line[diff_col_neg[0], 1] ) alpha[diff_col_neg[0]] = math.pi + np.arctan(slope) return np.squeeze(alpha) def compute_local_epipolar_line(geom_model_left, geom_model_right, left_point, elevation, elevation_offset): """ Estimate the beginning and the ending of local epipolar line in left image :param geom_model_left: geometric model of the left image :type geom_model_left: shareloc.grid or shareloc.rpc :param geom_model_right: geometric model of the right image :type geom_model_right: shareloc.grid or shareloc.rpc :param left_point: georeferenced coordinates in the left image :type left_point: 1D numpy array : [row coord, col coord, altitude] or 2D numpy array : (number of points, [row coord, col coord, altitude]) :param elevation: elevation :type elevation: shareloc.dtm or float :param elevation_offset: elevation difference used to estimate the local tangent :type elevation_offset: int :return: Coordinates of the beginning and the ending of local epipolar line in the left image :rtype: Tuple(1D np.array [row, col, altitude], 1D numpy array [row, col, altitude]) or Tuple(2D np.array (nb points, [row, col, altitude]), 2D np.array (nb points, [row, col, altitude])) """ # Only one point, expand the shape of the array if len(left_point.shape) == 1: left_point = np.expand_dims(left_point, axis=0) # Right correspondent of the left coordinates right_corr = np.zeros((left_point.shape[0], 3)) right_corr[:, 0], right_corr[:, 1], right_corr[:, 2] = coloc( geom_model_left, geom_model_right, left_point[:, 0], left_point[:, 1], elevation ) ground_elev = np.array(right_corr[:, 2]) # Find the beginning of the epipolar line in the left image, using right correspondent at lower elevation right_corr[:, 2] = ground_elev - elevation_offset epi_line_start = np.zeros((left_point.shape[0], 3)) epi_line_start[:, 0], epi_line_start[:, 1], epi_line_start[:, 2] = coloc( geom_model_right, geom_model_left, right_corr[:, 0], right_corr[:, 1], right_corr[:, 2] ) # Find the ending of the epipolar line in the left image, using right correspondent at higher elevation right_corr[:, 2] = ground_elev + elevation_offset epi_line_end = np.zeros((left_point.shape[0], 3)) epi_line_end[:, 0], epi_line_end[:, 1], epi_line_end[:, 2] = coloc( geom_model_right, geom_model_left, right_corr[:, 0], right_corr[:, 1], right_corr[:, 2] ) return np.squeeze(epi_line_start), np.squeeze(epi_line_end) # pylint: disable=too-many-locals def prepare_rectification(left_im, geom_model_left, geom_model_right, elevation, epi_step, elevation_offset): """ Determine size and spacing of the epipolar grids. Determine size of the epipolare images and the upper-left origin of the stereo-rectified left image (starting point) :param left_im: left image :type left_im: shareloc.image object :param geom_model_left: geometric model of the left image :type geom_model_left: shareloc.grid or shareloc.rpc :param geom_model_right: geometric model of the right image :type geom_model_right: shareloc.grid or shareloc.rpc :param elevation: elevation :type elevation: shareloc.dtm or float :param epi_step: epipolar step :type epi_step: int :param elevation_offset: elevation difference used to estimate the local tangent :type elevation_offset: int :return: return : - epipolar grids spacing (pixel size), 1D np.array [row pixel size, col pixel size] - epipolar grids size, 1D np.array [number of row, number of columns] - epipolar images size, 1D np.array [number of row, number of columns] - epipolar image starting point in the left image, 1D np.array [georef row, georef col, altitude] - epipolar image estimated ending point in the left image, 1D np.array [georef row, georef col, altitude] :rtype: Tuple """ # Choose a square spacing mean_spacing = 0.5 * (abs(left_im.pixel_size_col) + abs(left_im.pixel_size_row)) #  Pixel size (spacing) of the epipolar grids, convention [row, col] grid_pixel_size = np.full(shape=2, fill_value=epi_step, dtype=np.float64) grid_pixel_size *= mean_spacing # Georeferenced coordinates of the upper-left origin of left image : [row, col, altitude] origin_row, origin_col = left_im.transform_index_to_physical_point(0, 0) left_origin = np.array([origin_row, origin_col]) # --- Compute the parameters of the local epipolar line at the left image origin --- local_epi_start, local_epi_end = compute_local_epipolar_line( geom_model_left, geom_model_right, left_origin, elevation, elevation_offset ) # 2) Compute epipolar angle using the begin and the end of the left local epipolar line alpha = compute_epipolar_angle(local_epi_end, local_epi_start) # 3) Compute unitary vectors, useful for moving in rows and columns in epipolar geometry # Unit vector tangent to the epipolar line (moving along line) unit_vector_along_epi_x = math.cos(alpha) unit_vector_along_epi_y = math.sin(alpha) # Unit vector orthogonal to epipolar direction (moving to next line) unit_vector_ortho_epi_x = -math.sin(alpha) unit_vector_ortho_epi_y = math.cos(alpha) # 4) Compute the bounding box of the left input image in the epipolar geometry # Coordinates of the 4 corners ulx = 0 uly = 0 urx = unit_vector_along_epi_x * left_im.nb_columns * left_im.pixel_size_col ury = unit_vector_ortho_epi_x * left_im.nb_columns * left_im.pixel_size_col llx = unit_vector_along_epi_y * left_im.nb_rows * left_im.pixel_size_row lly = unit_vector_ortho_epi_y * left_im.nb_rows * left_im.pixel_size_row lrx = ( unit_vector_along_epi_x * left_im.nb_columns * left_im.pixel_size_col + unit_vector_along_epi_y * left_im.nb_rows * left_im.pixel_size_row ) lry = ( unit_vector_ortho_epi_x * left_im.nb_columns * left_im.pixel_size_col + unit_vector_ortho_epi_y * left_im.nb_rows * left_im.pixel_size_row ) # Bounding box minx = min(min(min(urx, llx), lrx), ulx) miny = min(min(min(ury, lly), lry), uly) maxx = max(max(max(urx, llx), lrx), ulx) maxy = max(max(max(ury, lly), lry), uly) # 5) Compute the size of epipolar images rectified_image_size = [int((maxy - miny) / mean_spacing), int((maxx - minx) / mean_spacing)] # 6) Georeferenced coordinates of the upper-left and lower right position of left epipolar image # (starting point, end point) left_epi_origin = [ left_origin[0] + (unit_vector_along_epi_y * minx + unit_vector_ortho_epi_y * miny), left_origin[1] + (unit_vector_along_epi_x * minx + unit_vector_ortho_epi_x * miny), (local_epi_start[2] + local_epi_end[2]) / 2.0, ] left_epi_end = [ left_origin[0] + (unit_vector_along_epi_y * maxx + unit_vector_ortho_epi_y * maxy), left_origin[1] + (unit_vector_along_epi_x * maxx + unit_vector_ortho_epi_x * maxy), (local_epi_start[2] + local_epi_end[2]) / 2.0, ] # 7) Compute the size of the epipolar grids, convention [nb_row, nb_col] grid_size = [int(rectified_image_size[0] / epi_step + 2), int(rectified_image_size[1] / epi_step + 2)] return grid_pixel_size, grid_size, rectified_image_size, left_epi_origin, left_epi_end def get_epipolar_extent( left_im, geom_model_left, geom_model_right, elevation=0.0, epi_step=30.0, elevation_offset=50.0, margin=0.0 ): """ return epipolar footprint using reprojection of epipolar geometry in left image. :param left_im: left image :type left_im: shareloc.image object :param geom_model_left: geometric model of the left image :type geom_model_left: shareloc.grid or shareloc.rpc :param geom_model_right: geometric model of the right image :type geom_model_right: shareloc.grid or shareloc.rpc :param elevation: elevation :type elevation: shareloc.dtm or float :param epi_step: epipolar step :type epi_step: float :param elevation_offset: elevation difference used to estimate the local tangent :type elevation_offset: float :param margin: footprint margin (in degrees) :type margin : float :return extent : [lon_min,lat_min,lon max,lat max] (2D np.array) :rtype numpy.array """ footprint = np.zeros([2, 2]) __, __, __, left_epi_origin, left_epi_end = prepare_rectification( left_im, geom_model_left, geom_model_right, elevation, epi_step, elevation_offset ) footprint[0, :] = left_epi_origin[0:2] footprint[1, :] = left_epi_end[0:2] using_geotransform = False loc_left = Localization(geom_model_left, image=left_im) on_ground_pos = loc_left.direct(footprint[:, 0], footprint[:, 1], 0, using_geotransform=using_geotransform) [lon_min, lat_min, __] = np.min(on_ground_pos, 0) [lon_max, lat_max, __] = np.max(on_ground_pos, 0) return np.array([lat_min - margin, lon_min - margin, lat_max + margin, lon_max + margin]) def initialize_grids(epi_step, nb_row, nb_col): """ Initialize left and right epipolar grids : set geo-transform and zeros data :param epi_step: epipolar step :param nb_row: rows of the grid :param nb_col: columns of the grid :return: left epipolar grid, right epipolar grid :rtype : Tuple(shareloc.Image, shareloc.Image) """ # Initialize left and right epipolar grids left_grid = Image(image_path=None) # Convention : # | col pixel size, row rotation , origin col upper-left| # | col rotation, row pixel size, , origin row upper-left| left_grid_geo_transform = np.array( [epi_step, 0, -(epi_step * 0.5), 0, epi_step, -(epi_step * 0.5)], dtype=np.float64 ) left_grid.set_metadata(nb_row, nb_col, 2, left_grid_geo_transform, datatype=np.float64) right_grid = Image(image_path=None) right_grid_geo_transform = np.array( [epi_step, 0, -(epi_step * 0.5), 0, epi_step, -(epi_step * 0.5)], dtype=np.float64 ) right_grid.set_metadata(nb_row, nb_col, 2, right_grid_geo_transform, datatype=np.float64) return left_grid, right_grid def moving_to_next_line(geom_model_left, geom_model_right, current_line, mean_spacing, elevation, epi_step, alpha): """ Moving to the next line in epipolar geometry :param geom_model_left: geometric model of the left image :type geom_model_left: shareloc.grid or shareloc.rpc :param geom_model_right: geometric model of the right image :type geom_model_right: shareloc.grid or shareloc.rpc :param current_line: current line in the left epipolar geometry :type current_line: 1D np.array [row, col, altitude] :param mean_spacing: mean spacing of epipolar grids :type mean_spacing: int :param elevation: elevation :type elevation: shareloc.dtm or float :param epi_step: epipolar step :type epi_step: int :param alpha: epipolar angle :type alpha: float :return: left and right coordinates of the next line in epioplar geometry :rtype: Tuple([row, col, altitude], [row, col, altitude]) """ # Find the start of next line in epipolar geometry # Unit vector orthogonal to epipolar direction unit_vector_ortho_epi_y = epi_step * mean_spacing * math.cos(alpha) unit_vector_ortho_epi_x = -1 * mean_spacing * epi_step * math.sin(alpha) next_line_start_left = np.zeros(3, dtype=np.float64) next_line_start_left[0] = np.copy(current_line[0]) + unit_vector_ortho_epi_y next_line_start_left[1] = np.copy(current_line[1]) + unit_vector_ortho_epi_x # Find the corresponding starting point in the right image next_line_start_right = np.zeros(3, dtype=np.float64) next_line_start_right[0], next_line_start_right[1], next_line_start_right[2] = coloc( geom_model_left, geom_model_right, next_line_start_left[0], next_line_start_left[1], elevation ) return next_line_start_left, next_line_start_right def moving_along_lines( geom_model_left, geom_model_right, current_left_coords, mean_spacing, elevation, epi_step, alphas ): """ Determine the position of next pixels in the epipolare lines :param geom_model_left: geometric model of the left image :type geom_model_left: shareloc.grid or shareloc.rpc :param geom_model_right: geometric model of the right image :type geom_model_right: shareloc.grid or shareloc.rpc :param current_left_coords: current georeferenced coordinates in left epipolare line :type current_left_coords: 2D numpy array (number rows in epipolar geometry, [row, col, altitude]) :param mean_spacing: mean spacing of epipolar grids :type mean_spacing: int :param elevation: elevation :type elevation: shareloc.dtm or float :param epi_step: epipolar step :type epi_step: int :param alphas: epipolar angles of each local epipolar lines :type alphas: List :return: coordinates of next pixels in left epipolar line, coordinates of next pixels in right epipolar line :rtype: Tuple(2D numpy array (number rows in epipolar geometry, [row, col, altitude]), 2D numpy array (number rows in epipolar geometry, [row, col, altitude])) """ # Determine position of next pixels in the epipolar line of the left image (moving along lines) # Unit vector tangent to the epipolar line unit_vector_along_epi_y = epi_step * mean_spacing * np.sin(alphas) unit_vector_along_epi_x = epi_step * mean_spacing * np.cos(alphas) # Move to the next pixels in left image next_left_coords = np.copy(current_left_coords) next_left_coords[:, 0] += unit_vector_along_epi_y next_left_coords[:, 1] += unit_vector_along_epi_x # Find the corresponding next pixels in the right image next_right_coords = np.zeros(next_left_coords.shape, dtype=next_left_coords.dtype) next_right_coords[:, 0], next_right_coords[:, 1], next_right_coords[:, 2] = coloc( geom_model_left, geom_model_right, next_left_coords[:, 0], next_left_coords[:, 1], elevation ) return next_left_coords, next_right_coords # disable for api symmetry between left and right data # pylint: disable=unused-argument # pylint: disable=too-many-locals def compute_stereorectification_epipolar_grids( left_im, geom_model_left, right_im, geom_model_right, elevation=0.0, epi_step=1, elevation_offset=50.0 ): """ Compute stereo-rectification epipolar grids :param left_im: left image :type left_im: shareloc.image object :param geom_model_left: geometric model of the left image :type geom_model_left: shareloc.grid or shareloc.rpc :param right_im: right image :type right_im: shareloc.image object :param geom_model_right: geometric model of the right image :type geom_model_right: shareloc.grid or shareloc.rpc :param elevation: elevation :type elevation: shareloc.dtm or float :param epi_step: epipolar step :type epi_step: int :param elevation_offset: elevation difference used to estimate the local tangent :type elevation_offset: float :return: return : - left epipolar grid, shareloc.image object convention [[row displacement, col displacement], nb rows, nb cols] - right epipolar grid, shareloc.image object convention [[row displacement, col displacement], nb rows, nb cols] - number of rows of the epipolar image, int - number of columns of the epipolar image, int - mean value of the baseline to sensor altitude ratio, float :rtype: Tuple """ # Retrieve grids : spacing (pixel size) and size # Retrieve epipolar image : size and upper-left origin in the left image geometry (starting point) __, grid_size, rectified_image_size, left_epi_origin, __ = prepare_rectification( left_im, geom_model_left, geom_model_right, elevation, epi_step, elevation_offset ) # Use the mean spacing as before mean_spacing = 0.5 * (abs(left_im.pixel_size_col) + abs(left_im.pixel_size_row)) left_grid, right_grid = initialize_grids(epi_step, grid_size[0], grid_size[1]) # Starting points are the upper-left origin of the left epipolar image, and it's correspondent in the right image start_left = np.copy(left_epi_origin) start_right = np.zeros(3, dtype=start_left.dtype) start_right[0], start_right[1], start_right[2] = coloc( geom_model_left, geom_model_right, start_left[0], start_left[1], elevation ) mean_baseline_ratio = 0 # Compute the starting point of each epipolar line to be able to move along the lines (useful to vectorize the code) # Georeferenced coordinates of each starting epipolar lines in left and right image left_epi_lines = [np.copy(start_left)] right_epi_lines = [np.copy(start_right)] # For each rows of the epipolar geometry, define left and right starting coordinates of each epipolar lines for __ in range(grid_size[0] - 1): # --- Compute left local epipolar line, useful for moving to the next line --- local_epi_start, local_epi_end = compute_local_epipolar_line( geom_model_left, geom_model_right, left_epi_lines[-1], elevation, elevation_offset ) # epipolar angle using the begin and the end of the left local epipolar line alpha = compute_epipolar_angle(local_epi_end, local_epi_start) # Find the start of next line in epipolar geometry next_epi_line_left, next_epi_line_right = moving_to_next_line( geom_model_left, geom_model_right, left_epi_lines[-1], mean_spacing, elevation, epi_step, alpha ) # Save the starting points, useful to be able to move along the lines in the next loop left_epi_lines.append(np.copy(next_epi_line_left)) right_epi_lines.append(np.copy(next_epi_line_right)) # Left and right epipolar coordinates of the current point left_epi_coords = np.array(left_epi_lines) right_epi_coords = np.array(right_epi_lines) # Moving along epipolar lines rows = np.arange(grid_size[0]) for col in range(grid_size[1]): # Estimate the displacement values of the current pixels # Cast grid index to georeferenced grid coordinates current_left_grid = left_grid.transform_index_to_physical_point(rows, np.repeat(col, rows.shape[0])) current_right_grid = right_grid.transform_index_to_physical_point(rows, np.repeat(col, rows.shape[0])) left_grid.data[0, :, col] = left_epi_coords[:, 0] - current_left_grid[0] left_grid.data[1, :, col] = left_epi_coords[:, 1] - current_left_grid[1] right_grid.data[0, :, col] = right_epi_coords[:, 0] - current_right_grid[0] right_grid.data[1, :, col] = right_epi_coords[:, 1] - current_right_grid[1] # Compute left local epipolar line, useful to estimate the local baseline ratio and moving to the next pixels local_epi_start, local_epi_end = compute_local_epipolar_line( geom_model_left, geom_model_right, left_epi_coords, elevation, elevation_offset ) # Estimate the local baseline ratio local_baseline_ratio = np.sqrt( (local_epi_end[:, 1] - local_epi_start[:, 1]) * (local_epi_end[:, 1] - local_epi_start[:, 1]) + (local_epi_end[:, 0] - local_epi_start[:, 0]) * (local_epi_end[:, 0] - local_epi_start[:, 0]) ) / (2 * elevation_offset) mean_baseline_ratio += np.sum(local_baseline_ratio) # epipolar angle using the begin and the end of the left local epipolar lines alphas = compute_epipolar_angle(local_epi_end, local_epi_start) # Move to the next pixels in the epipolar line (moving along lines) left_epi_coords, right_epi_coords = moving_along_lines( geom_model_left, geom_model_right, left_epi_coords, mean_spacing, elevation, epi_step, alphas ) # Compute the mean baseline ratio mean_baseline_ratio /= grid_size[0] * grid_size[1] return left_grid, right_grid, rectified_image_size[0], rectified_image_size[1], mean_baseline_ratio
[ 1, 529, 276, 1112, 420, 29958, 13778, 2890, 29914, 13653, 2029, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 14137, 29901, 23616, 29947, 13, 29937, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29906, 11319, 3086, 270, 29915, 29923, 29873, 8192, 1706, 15238, 267, 313, 13778, 2890, 467, 13, 29937, 13, 29937, 910, 934, 338, 760, 310, 26849, 2029, 13, 29937, 313, 4149, 2045, 597, 3292, 29889, 510, 29914, 13778, 2890, 29914, 13653, 2029, 467, 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, 268, 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, 29937, 13, 15945, 29908, 13, 4013, 3883, 3743, 3168, 304, 5706, 269, 12358, 29877, 29899, 1621, 2450, 9358, 666, 10170, 867, 4841, 13, 15945, 29908, 13, 13, 29937, 10117, 24802, 13, 5215, 5844, 13, 13, 29937, 18008, 6263, 24802, 13, 5215, 12655, 408, 7442, 13, 5215, 364, 1901, 601, 13, 13, 29937, 26849, 2029, 24802, 13, 3166, 6232, 2029, 29889, 479, 974, 651, 29879, 29889, 2997, 2133, 1053, 9959, 2133, 29892, 28853, 13, 3166, 6232, 2029, 29889, 3027, 1053, 7084, 13, 13, 13, 1753, 2436, 29918, 1022, 666, 10170, 29918, 7720, 29898, 7720, 29892, 10422, 29892, 921, 29891, 29918, 535, 7316, 29922, 5574, 1125, 13, 1678, 9995, 13, 1678, 14350, 9358, 666, 10170, 6856, 297, 263, 260, 2593, 934, 13, 13, 1678, 584, 3207, 6856, 29901, 9358, 666, 10170, 6856, 13, 1678, 584, 1853, 6856, 29901, 6232, 2029, 29889, 2940, 13, 1678, 584, 3207, 10422, 29901, 29871, 1962, 10422, 13, 1678, 584, 1853, 10422, 29901, 1347, 13, 1678, 584, 3207, 921, 29891, 29918, 535, 7316, 29901, 5852, 29901, 2436, 6856, 411, 921, 29891, 15687, 584, 518, 4980, 29871, 29896, 353, 784, 12272, 9552, 29892, 3719, 29871, 29906, 353, 1948, 12272, 9552, 29962, 13, 462, 3986, 7700, 29901, 2436, 6856, 411, 343, 29916, 15687, 584, 518, 4980, 29871, 29896, 353, 1948, 12272, 9552, 29892, 3719, 29871, 29906, 353, 784, 12272, 9552, 29962, 13, 1678, 584, 3207, 921, 29891, 29918, 535, 7316, 29901, 6120, 13, 1678, 9995, 13, 1678, 3719, 29892, 1948, 29892, 784, 353, 6856, 29889, 1272, 29889, 12181, 13, 13, 1678, 411, 364, 1901, 601, 29889, 3150, 29898, 13, 4706, 10422, 29892, 376, 29893, 613, 7156, 543, 23799, 2593, 613, 26688, 29922, 9302, 29889, 7411, 29953, 29946, 29892, 2920, 29922, 1054, 29892, 3171, 29922, 798, 29892, 2302, 29922, 4980, 29892, 4327, 29922, 7720, 29889, 9067, 13, 1678, 1723, 408, 2752, 29918, 6289, 29901, 13, 4706, 565, 921, 29891, 29918, 535, 7316, 29901, 13, 9651, 2752, 29918, 6289, 29889, 3539, 29898, 7720, 29889, 1272, 29961, 29896, 29892, 584, 29892, 584, 1402, 29871, 29896, 29897, 13, 9651, 2752, 29918, 6289, 29889, 3539, 29898, 7720, 29889, 1272, 29961, 29900, 29892, 584, 29892, 584, 1402, 29871, 29906, 29897, 13, 4706, 1683, 29901, 13, 9651, 2752, 29918, 6289, 29889, 3539, 29898, 7720, 29889, 1272, 29961, 29900, 29892, 584, 29892, 584, 1402, 29871, 29896, 29897, 13, 9651, 2752, 29918, 6289, 29889, 3539, 29898, 7720, 29889, 1272, 29961, 29896, 29892, 584, 29892, 584, 1402, 29871, 29906, 29897, 13, 13, 13, 1753, 10272, 29918, 1022, 666, 10170, 29918, 2521, 29898, 355, 29918, 1220, 29892, 1369, 29918, 1220, 1125, 13, 1678, 9995, 13, 1678, 22402, 278, 9358, 666, 10170, 10696, 13, 13, 1678, 584, 3207, 1095, 29918, 1220, 29901, 17140, 310, 278, 9358, 666, 10170, 1196, 313, 479, 487, 571, 9223, 10350, 29897, 13, 1678, 584, 1853, 1095, 29918, 1220, 29901, 29871, 29896, 29928, 7442, 29889, 2378, 518, 798, 29892, 784, 29892, 5272, 4279, 29962, 470, 29871, 29906, 29928, 7442, 29889, 2378, 518, 4537, 310, 3291, 29892, 518, 798, 29892, 784, 29892, 5272, 4279, 5262, 13, 1678, 584, 3207, 1369, 29918, 1220, 29901, 6763, 310, 278, 9358, 666, 10170, 1196, 313, 479, 487, 571, 9223, 10350, 29897, 13, 1678, 584, 1853, 1369, 29918, 1220, 29901, 29871, 29896, 29928, 7442, 29889, 2378, 518, 798, 29892, 784, 29892, 5272, 4279, 29962, 470, 29871, 29906, 29928, 7442, 29889, 2378, 518, 4537, 310, 3291, 29892, 518, 798, 29892, 784, 29892, 5272, 4279, 5262, 13, 1678, 584, 2457, 29901, 9358, 666, 10170, 10696, 13, 1678, 584, 29878, 1853, 584, 5785, 470, 29871, 29896, 29928, 7442, 29889, 2378, 13, 1678, 9995, 13, 1678, 396, 9333, 697, 1298, 29892, 7985, 278, 8267, 310, 278, 1409, 13, 1678, 565, 7431, 29898, 355, 29918, 1220, 29889, 12181, 29897, 1275, 29871, 29896, 29901, 13, 4706, 1095, 29918, 1220, 353, 7442, 29889, 18837, 29918, 6229, 29879, 29898, 355, 29918, 1220, 29892, 9685, 29922, 29900, 29897, 13, 4706, 1369, 29918, 1220, 353, 7442, 29889, 18837, 29918, 6229, 29879, 29898, 2962, 29918, 1220, 29892, 9685, 29922, 29900, 29897, 13, 13, 1678, 396, 11796, 29872, 278, 6306, 310, 278, 9358, 666, 10170, 1196, 343, 353, 263, 29930, 29916, 718, 289, 322, 4529, 278, 9358, 666, 13517, 10696, 13, 1678, 15595, 353, 7442, 29889, 3298, 359, 29898, 355, 29918, 1220, 29889, 12181, 29961, 29900, 2314, 13, 13, 1678, 396, 19491, 4341, 29892, 6374, 5305, 13, 1678, 1021, 29918, 1054, 29918, 1066, 3321, 353, 313, 355, 29918, 1220, 7503, 29892, 29871, 29896, 29962, 1275, 1369, 29918, 1220, 7503, 29892, 29871, 29896, 2314, 669, 313, 355, 29918, 1220, 7503, 29892, 29871, 29900, 29962, 1405, 1369, 29918, 1220, 7503, 29892, 29871, 29900, 2314, 13, 1678, 15595, 29961, 17642, 29918, 1054, 29918, 1066, 3321, 29962, 353, 29871, 29900, 29889, 29945, 334, 5844, 29889, 1631, 13, 13, 1678, 396, 19491, 4341, 29892, 8178, 5305, 13, 1678, 1021, 29918, 1054, 29918, 22198, 353, 313, 355, 29918, 1220, 7503, 29892, 29871, 29896, 29962, 1275, 1369, 29918, 1220, 7503, 29892, 29871, 29896, 2314, 669, 313, 355, 29918, 1220, 7503, 29892, 29871, 29900, 29962, 5277, 1369, 29918, 1220, 7503, 29892, 29871, 29900, 2314, 13, 1678, 15595, 29961, 17642, 29918, 1054, 29918, 22198, 29962, 353, 448, 29900, 29889, 29945, 334, 5844, 29889, 1631, 13, 13, 1678, 396, 360, 15622, 4341, 29892, 6374, 5305, 13, 1678, 2923, 29918, 1054, 29918, 1066, 353, 7442, 29889, 3062, 3552, 355, 29918, 1220, 7503, 29892, 29871, 29896, 29962, 2804, 1369, 29918, 1220, 7503, 29892, 29871, 29896, 2314, 669, 313, 355, 29918, 1220, 7503, 29892, 29871, 29896, 29962, 1405, 1369, 29918, 1220, 7503, 29892, 29871, 29896, 12622, 13, 1678, 24968, 353, 313, 355, 29918, 1220, 29961, 12765, 29918, 1054, 29918, 1066, 29961, 29900, 1402, 29871, 29900, 29962, 448, 1369, 29918, 1220, 29961, 12765, 29918, 1054, 29918, 1066, 29961, 29900, 1402, 29871, 29900, 2314, 847, 313, 13, 4706, 1095, 29918, 1220, 29961, 12765, 29918, 1054, 29918, 1066, 29961, 29900, 1402, 29871, 29896, 29962, 448, 1369, 29918, 1220, 29961, 12765, 29918, 1054, 29918, 1066, 29961, 29900, 1402, 29871, 29896, 29962, 13, 1678, 1723, 13, 1678, 15595, 29961, 12765, 29918, 1054, 29918, 1066, 29962, 353, 7442, 29889, 27014, 273, 29898, 29879, 417, 412, 29897, 13, 13, 1678, 396, 360, 15622, 4341, 29892, 8178, 5305, 13, 1678, 2923, 29918, 1054, 29918, 10052, 353, 7442, 29889, 3062, 3552, 355, 29918, 1220, 7503, 29892, 29871, 29896, 29962, 2804, 1369, 29918, 1220, 7503, 29892, 29871, 29896, 2314, 669, 313, 355, 29918, 1220, 7503, 29892, 29871, 29896, 29962, 5277, 1369, 29918, 1220, 7503, 29892, 29871, 29896, 12622, 13, 1678, 24968, 353, 313, 355, 29918, 1220, 29961, 12765, 29918, 1054, 29918, 10052, 29961, 29900, 1402, 29871, 29900, 29962, 448, 1369, 29918, 1220, 29961, 12765, 29918, 1054, 29918, 10052, 29961, 29900, 1402, 29871, 29900, 2314, 847, 313, 13, 4706, 1095, 29918, 1220, 29961, 12765, 29918, 1054, 29918, 10052, 29961, 29900, 1402, 29871, 29896, 29962, 448, 1369, 29918, 1220, 29961, 12765, 29918, 1054, 29918, 10052, 29961, 29900, 1402, 29871, 29896, 29962, 13, 1678, 1723, 13, 1678, 15595, 29961, 12765, 29918, 1054, 29918, 10052, 29961, 29900, 5262, 353, 5844, 29889, 1631, 718, 7442, 29889, 27014, 273, 29898, 29879, 417, 412, 29897, 13, 13, 1678, 736, 7442, 29889, 29879, 802, 29872, 911, 29898, 2312, 29897, 13, 13, 13, 1753, 10272, 29918, 2997, 29918, 1022, 666, 10170, 29918, 1220, 29898, 479, 290, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 2175, 29918, 3149, 29892, 11858, 362, 29892, 11858, 362, 29918, 10289, 1125, 13, 1678, 9995, 13, 1678, 2661, 6490, 278, 6763, 322, 278, 17140, 310, 1887, 9358, 666, 10170, 1196, 297, 2175, 1967, 13, 13, 1678, 584, 3207, 23216, 29918, 4299, 29918, 1563, 29901, 26224, 1904, 310, 278, 2175, 1967, 13, 1678, 584, 1853, 23216, 29918, 4299, 29918, 1563, 29901, 6232, 2029, 29889, 7720, 470, 6232, 2029, 29889, 29878, 6739, 13, 1678, 584, 3207, 23216, 29918, 4299, 29918, 1266, 29901, 26224, 1904, 310, 278, 1492, 1967, 13, 1678, 584, 1853, 23216, 29918, 4299, 29918, 1266, 29901, 6232, 2029, 29889, 7720, 470, 6232, 2029, 29889, 29878, 6739, 13, 1678, 584, 3207, 2175, 29918, 3149, 29901, 1737, 487, 571, 9223, 10350, 297, 278, 2175, 1967, 13, 1678, 584, 1853, 2175, 29918, 3149, 29901, 29871, 29896, 29928, 12655, 1409, 584, 518, 798, 29311, 29892, 784, 29311, 29892, 5272, 4279, 29962, 13, 462, 418, 470, 29871, 29906, 29928, 12655, 1409, 584, 313, 4537, 310, 3291, 29892, 518, 798, 29311, 29892, 784, 29311, 29892, 5272, 4279, 2314, 13, 1678, 584, 3207, 11858, 362, 29901, 11858, 362, 13, 1678, 584, 1853, 11858, 362, 29901, 6232, 2029, 29889, 6008, 29885, 470, 5785, 13, 1678, 584, 3207, 11858, 362, 29918, 10289, 29901, 11858, 362, 4328, 1304, 304, 12678, 278, 1887, 18806, 296, 13, 1678, 584, 1853, 11858, 362, 29918, 10289, 29901, 938, 13, 1678, 584, 2457, 29901, 3189, 24266, 310, 278, 6763, 322, 278, 17140, 310, 1887, 9358, 666, 10170, 1196, 297, 278, 2175, 1967, 13, 1678, 584, 29878, 1853, 29901, 12603, 552, 29898, 29896, 29928, 7442, 29889, 2378, 518, 798, 29892, 784, 29892, 5272, 4279, 1402, 29871, 29896, 29928, 12655, 1409, 518, 798, 29892, 784, 29892, 5272, 4279, 2314, 13, 9651, 470, 12603, 552, 29898, 29906, 29928, 7442, 29889, 2378, 313, 9877, 3291, 29892, 518, 798, 29892, 784, 29892, 5272, 4279, 11724, 29871, 29906, 29928, 7442, 29889, 2378, 313, 9877, 3291, 29892, 518, 798, 29892, 784, 29892, 5272, 4279, 12622, 13, 1678, 9995, 13, 1678, 396, 9333, 697, 1298, 29892, 7985, 278, 8267, 310, 278, 1409, 13, 1678, 565, 7431, 29898, 1563, 29918, 3149, 29889, 12181, 29897, 1275, 29871, 29896, 29901, 13, 4706, 2175, 29918, 3149, 353, 7442, 29889, 18837, 29918, 6229, 29879, 29898, 1563, 29918, 3149, 29892, 9685, 29922, 29900, 29897, 13, 13, 1678, 396, 10428, 3928, 296, 310, 278, 2175, 10350, 13, 1678, 1492, 29918, 29725, 353, 7442, 29889, 3298, 359, 3552, 1563, 29918, 3149, 29889, 12181, 29961, 29900, 1402, 29871, 29941, 876, 13, 1678, 1492, 29918, 29725, 7503, 29892, 29871, 29900, 1402, 1492, 29918, 29725, 7503, 29892, 29871, 29896, 1402, 1492, 29918, 29725, 7503, 29892, 29871, 29906, 29962, 353, 28853, 29898, 13, 4706, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 2175, 29918, 3149, 7503, 29892, 29871, 29900, 1402, 2175, 29918, 3149, 7503, 29892, 29871, 29896, 1402, 11858, 362, 13, 1678, 1723, 13, 1678, 5962, 29918, 29872, 2608, 353, 7442, 29889, 2378, 29898, 1266, 29918, 29725, 7503, 29892, 29871, 29906, 2314, 13, 13, 1678, 396, 10987, 278, 6763, 310, 278, 9358, 666, 10170, 1196, 297, 278, 2175, 1967, 29892, 773, 1492, 3928, 296, 472, 5224, 11858, 362, 13, 1678, 1492, 29918, 29725, 7503, 29892, 29871, 29906, 29962, 353, 5962, 29918, 29872, 2608, 448, 11858, 362, 29918, 10289, 13, 1678, 321, 1631, 29918, 1220, 29918, 2962, 353, 7442, 29889, 3298, 359, 3552, 1563, 29918, 3149, 29889, 12181, 29961, 29900, 1402, 29871, 29941, 876, 13, 1678, 321, 1631, 29918, 1220, 29918, 2962, 7503, 29892, 29871, 29900, 1402, 321, 1631, 29918, 1220, 29918, 2962, 7503, 29892, 29871, 29896, 1402, 321, 1631, 29918, 1220, 29918, 2962, 7503, 29892, 29871, 29906, 29962, 353, 28853, 29898, 13, 4706, 23216, 29918, 4299, 29918, 1266, 29892, 23216, 29918, 4299, 29918, 1563, 29892, 1492, 29918, 29725, 7503, 29892, 29871, 29900, 1402, 1492, 29918, 29725, 7503, 29892, 29871, 29896, 1402, 1492, 29918, 29725, 7503, 29892, 29871, 29906, 29962, 13, 1678, 1723, 13, 13, 1678, 396, 10987, 278, 17140, 310, 278, 9358, 666, 10170, 1196, 297, 278, 2175, 1967, 29892, 773, 1492, 3928, 296, 472, 6133, 11858, 362, 13, 1678, 1492, 29918, 29725, 7503, 29892, 29871, 29906, 29962, 353, 5962, 29918, 29872, 2608, 718, 11858, 362, 29918, 10289, 13, 1678, 321, 1631, 29918, 1220, 29918, 355, 353, 7442, 29889, 3298, 359, 3552, 1563, 29918, 3149, 29889, 12181, 29961, 29900, 1402, 29871, 29941, 876, 13, 1678, 321, 1631, 29918, 1220, 29918, 355, 7503, 29892, 29871, 29900, 1402, 321, 1631, 29918, 1220, 29918, 355, 7503, 29892, 29871, 29896, 1402, 321, 1631, 29918, 1220, 29918, 355, 7503, 29892, 29871, 29906, 29962, 353, 28853, 29898, 13, 4706, 23216, 29918, 4299, 29918, 1266, 29892, 23216, 29918, 4299, 29918, 1563, 29892, 1492, 29918, 29725, 7503, 29892, 29871, 29900, 1402, 1492, 29918, 29725, 7503, 29892, 29871, 29896, 1402, 1492, 29918, 29725, 7503, 29892, 29871, 29906, 29962, 13, 1678, 1723, 13, 13, 1678, 736, 7442, 29889, 29879, 802, 29872, 911, 29898, 1022, 29875, 29918, 1220, 29918, 2962, 511, 7442, 29889, 29879, 802, 29872, 911, 29898, 1022, 29875, 29918, 1220, 29918, 355, 29897, 13, 13, 13, 29937, 282, 2904, 524, 29901, 11262, 29922, 517, 29877, 29899, 13011, 29899, 2997, 29879, 13, 1753, 19012, 29918, 1621, 2450, 29898, 1563, 29918, 326, 29892, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 11858, 362, 29892, 321, 1631, 29918, 10568, 29892, 11858, 362, 29918, 10289, 1125, 13, 1678, 9995, 13, 1678, 5953, 837, 457, 2159, 322, 29250, 310, 278, 9358, 666, 10170, 867, 4841, 29889, 13, 1678, 5953, 837, 457, 2159, 310, 278, 9358, 666, 13517, 4558, 322, 278, 7568, 29899, 1563, 3978, 310, 278, 269, 12358, 29877, 29899, 1621, 2164, 2175, 1967, 313, 2962, 292, 1298, 29897, 13, 13, 1678, 584, 3207, 2175, 29918, 326, 29901, 2175, 1967, 13, 1678, 584, 1853, 2175, 29918, 326, 29901, 6232, 2029, 29889, 3027, 1203, 13, 1678, 584, 3207, 23216, 29918, 4299, 29918, 1563, 29901, 26224, 1904, 310, 278, 2175, 1967, 13, 1678, 584, 1853, 23216, 29918, 4299, 29918, 1563, 29901, 6232, 2029, 29889, 7720, 470, 6232, 2029, 29889, 29878, 6739, 13, 1678, 584, 3207, 23216, 29918, 4299, 29918, 1266, 29901, 26224, 1904, 310, 278, 1492, 1967, 13, 1678, 584, 1853, 23216, 29918, 4299, 29918, 1266, 29901, 6232, 2029, 29889, 7720, 470, 6232, 2029, 29889, 29878, 6739, 13, 1678, 584, 3207, 11858, 362, 29901, 11858, 362, 13, 1678, 584, 1853, 11858, 362, 29901, 6232, 2029, 29889, 6008, 29885, 470, 5785, 13, 1678, 584, 3207, 321, 1631, 29918, 10568, 29901, 9358, 666, 10170, 4331, 13, 1678, 584, 1853, 321, 1631, 29918, 10568, 29901, 938, 13, 1678, 584, 3207, 11858, 362, 29918, 10289, 29901, 11858, 362, 4328, 1304, 304, 12678, 278, 1887, 18806, 296, 13, 1678, 584, 1853, 11858, 362, 29918, 10289, 29901, 938, 13, 1678, 584, 2457, 29901, 736, 584, 13, 4706, 448, 9358, 666, 10170, 867, 4841, 29250, 313, 29886, 15711, 2159, 511, 29871, 29896, 29928, 7442, 29889, 2378, 518, 798, 15526, 2159, 29892, 784, 15526, 2159, 29962, 13, 4706, 448, 9358, 666, 10170, 867, 4841, 2159, 29892, 29871, 29896, 29928, 7442, 29889, 2378, 518, 4537, 310, 1948, 29892, 1353, 310, 4341, 29962, 13, 4706, 448, 9358, 666, 10170, 4558, 2159, 29892, 29871, 29896, 29928, 7442, 29889, 2378, 518, 4537, 310, 1948, 29892, 1353, 310, 4341, 29962, 13, 4706, 448, 9358, 666, 10170, 1967, 6257, 1298, 297, 278, 2175, 1967, 29892, 29871, 29896, 29928, 7442, 29889, 2378, 518, 479, 487, 29888, 1948, 29892, 1737, 487, 29888, 784, 29892, 5272, 4279, 29962, 13, 4706, 448, 9358, 666, 10170, 1967, 15899, 17140, 1298, 297, 278, 2175, 1967, 29892, 29871, 29896, 29928, 7442, 29889, 2378, 518, 479, 487, 29888, 1948, 29892, 1737, 487, 29888, 784, 29892, 5272, 4279, 29962, 13, 1678, 584, 29878, 1853, 29901, 12603, 552, 13, 1678, 9995, 13, 1678, 396, 14542, 852, 263, 6862, 29250, 13, 1678, 2099, 29918, 1028, 9390, 353, 29871, 29900, 29889, 29945, 334, 313, 6897, 29898, 1563, 29918, 326, 29889, 29886, 15711, 29918, 2311, 29918, 1054, 29897, 718, 6425, 29898, 1563, 29918, 326, 29889, 29886, 15711, 29918, 2311, 29918, 798, 876, 13, 13, 1678, 396, 20246, 29637, 2159, 313, 1028, 9390, 29897, 310, 278, 9358, 666, 10170, 867, 4841, 29892, 15687, 518, 798, 29892, 784, 29962, 13, 1678, 6856, 29918, 29886, 15711, 29918, 2311, 353, 7442, 29889, 8159, 29898, 12181, 29922, 29906, 29892, 5445, 29918, 1767, 29922, 1022, 29875, 29918, 10568, 29892, 26688, 29922, 9302, 29889, 7411, 29953, 29946, 29897, 13, 1678, 6856, 29918, 29886, 15711, 29918, 2311, 334, 29922, 2099, 29918, 1028, 9390, 13, 13, 1678, 396, 1879, 487, 571, 9223, 10350, 310, 278, 7568, 29899, 1563, 3978, 310, 2175, 1967, 584, 518, 798, 29892, 784, 29892, 5272, 4279, 29962, 13, 1678, 3978, 29918, 798, 29892, 3978, 29918, 1054, 353, 2175, 29918, 326, 29889, 9067, 29918, 2248, 29918, 517, 29918, 14017, 936, 29918, 3149, 29898, 29900, 29892, 29871, 29900, 29897, 13, 1678, 2175, 29918, 12574, 353, 7442, 29889, 2378, 4197, 12574, 29918, 798, 29892, 3978, 29918, 1054, 2314, 13, 13, 1678, 396, 11474, 11796, 29872, 278, 4128, 310, 278, 1887, 9358, 666, 10170, 1196, 472, 278, 2175, 1967, 3978, 11474, 13, 1678, 1887, 29918, 1022, 29875, 29918, 2962, 29892, 1887, 29918, 1022, 29875, 29918, 355, 353, 10272, 29918, 2997, 29918, 1022, 666, 10170, 29918, 1220, 29898, 13, 4706, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 2175, 29918, 12574, 29892, 11858, 362, 29892, 11858, 362, 29918, 10289, 13, 1678, 1723, 13, 13, 1678, 396, 29871, 29906, 29897, 11796, 29872, 9358, 666, 10170, 10696, 773, 278, 3380, 322, 278, 1095, 310, 278, 2175, 1887, 9358, 666, 10170, 1196, 13, 1678, 15595, 353, 10272, 29918, 1022, 666, 10170, 29918, 2521, 29898, 2997, 29918, 1022, 29875, 29918, 355, 29892, 1887, 29918, 1022, 29875, 29918, 2962, 29897, 13, 13, 1678, 396, 29871, 29941, 29897, 11796, 29872, 5190, 653, 12047, 29892, 5407, 363, 8401, 297, 4206, 322, 4341, 297, 9358, 666, 10170, 16303, 13, 1678, 396, 13223, 4608, 18806, 296, 304, 278, 9358, 666, 10170, 1196, 313, 13529, 292, 3412, 1196, 29897, 13, 1678, 5190, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29916, 353, 5844, 29889, 3944, 29898, 2312, 29897, 13, 1678, 5190, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29891, 353, 5844, 29889, 5223, 29898, 2312, 29897, 13, 1678, 396, 13223, 4608, 28143, 304, 9358, 666, 10170, 5305, 313, 13529, 292, 304, 2446, 1196, 29897, 13, 1678, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29916, 353, 448, 755, 29889, 5223, 29898, 2312, 29897, 13, 1678, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29891, 353, 5844, 29889, 3944, 29898, 2312, 29897, 13, 13, 1678, 396, 29871, 29946, 29897, 11796, 29872, 278, 3216, 292, 3800, 310, 278, 2175, 1881, 1967, 297, 278, 9358, 666, 10170, 16303, 13, 1678, 396, 3189, 24266, 310, 278, 29871, 29946, 26995, 13, 1678, 9238, 29916, 353, 29871, 29900, 13, 1678, 318, 368, 353, 29871, 29900, 13, 1678, 5065, 29916, 353, 5190, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29916, 334, 2175, 29918, 326, 29889, 9877, 29918, 13099, 334, 2175, 29918, 326, 29889, 29886, 15711, 29918, 2311, 29918, 1054, 13, 1678, 318, 719, 353, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29916, 334, 2175, 29918, 326, 29889, 9877, 29918, 13099, 334, 2175, 29918, 326, 29889, 29886, 15711, 29918, 2311, 29918, 1054, 13, 1678, 11148, 29916, 353, 5190, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29891, 334, 2175, 29918, 326, 29889, 9877, 29918, 5727, 334, 2175, 29918, 326, 29889, 29886, 15711, 29918, 2311, 29918, 798, 13, 1678, 301, 368, 353, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29891, 334, 2175, 29918, 326, 29889, 9877, 29918, 5727, 334, 2175, 29918, 326, 29889, 29886, 15711, 29918, 2311, 29918, 798, 13, 1678, 301, 17697, 353, 313, 13, 4706, 5190, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29916, 334, 2175, 29918, 326, 29889, 9877, 29918, 13099, 334, 2175, 29918, 326, 29889, 29886, 15711, 29918, 2311, 29918, 1054, 13, 4706, 718, 5190, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29891, 334, 2175, 29918, 326, 29889, 9877, 29918, 5727, 334, 2175, 29918, 326, 29889, 29886, 15711, 29918, 2311, 29918, 798, 13, 1678, 1723, 13, 1678, 301, 719, 353, 313, 13, 4706, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29916, 334, 2175, 29918, 326, 29889, 9877, 29918, 13099, 334, 2175, 29918, 326, 29889, 29886, 15711, 29918, 2311, 29918, 1054, 13, 4706, 718, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29891, 334, 2175, 29918, 326, 29889, 9877, 29918, 5727, 334, 2175, 29918, 326, 29889, 29886, 15711, 29918, 2311, 29918, 798, 13, 1678, 1723, 13, 13, 1678, 396, 350, 12449, 3800, 13, 1678, 1375, 29916, 353, 1375, 29898, 1195, 29898, 1195, 29898, 332, 29916, 29892, 11148, 29916, 511, 301, 17697, 511, 9238, 29916, 29897, 13, 1678, 1375, 29891, 353, 1375, 29898, 1195, 29898, 1195, 29898, 2857, 29892, 301, 368, 511, 301, 719, 511, 318, 368, 29897, 13, 1678, 4236, 29916, 353, 4236, 29898, 3317, 29898, 3317, 29898, 332, 29916, 29892, 11148, 29916, 511, 301, 17697, 511, 9238, 29916, 29897, 13, 1678, 611, 3594, 353, 4236, 29898, 3317, 29898, 3317, 29898, 2857, 29892, 301, 368, 511, 301, 719, 511, 318, 368, 29897, 13, 13, 1678, 396, 29871, 29945, 29897, 11796, 29872, 278, 2159, 310, 9358, 666, 10170, 4558, 13, 1678, 7705, 2164, 29918, 3027, 29918, 2311, 353, 518, 524, 3552, 3317, 29891, 448, 1375, 29891, 29897, 847, 2099, 29918, 1028, 9390, 511, 938, 3552, 3317, 29916, 448, 1375, 29916, 29897, 847, 2099, 29918, 1028, 9390, 4638, 13, 13, 1678, 396, 29871, 29953, 29897, 1879, 487, 571, 9223, 10350, 310, 278, 7568, 29899, 1563, 322, 5224, 1492, 2602, 310, 2175, 9358, 666, 10170, 1967, 13, 1678, 396, 313, 2962, 292, 1298, 29892, 1095, 1298, 29897, 13, 1678, 2175, 29918, 1022, 29875, 29918, 12574, 353, 518, 13, 4706, 2175, 29918, 12574, 29961, 29900, 29962, 718, 313, 5441, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29891, 334, 1375, 29916, 718, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29891, 334, 1375, 29891, 511, 13, 4706, 2175, 29918, 12574, 29961, 29896, 29962, 718, 313, 5441, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29916, 334, 1375, 29916, 718, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29916, 334, 1375, 29891, 511, 13, 4706, 313, 2997, 29918, 1022, 29875, 29918, 2962, 29961, 29906, 29962, 718, 1887, 29918, 1022, 29875, 29918, 355, 29961, 29906, 2314, 847, 29871, 29906, 29889, 29900, 29892, 13, 1678, 4514, 13, 13, 1678, 2175, 29918, 1022, 29875, 29918, 355, 353, 518, 13, 4706, 2175, 29918, 12574, 29961, 29900, 29962, 718, 313, 5441, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29891, 334, 4236, 29916, 718, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29891, 334, 611, 3594, 511, 13, 4706, 2175, 29918, 12574, 29961, 29896, 29962, 718, 313, 5441, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29916, 334, 4236, 29916, 718, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29916, 334, 611, 3594, 511, 13, 4706, 313, 2997, 29918, 1022, 29875, 29918, 2962, 29961, 29906, 29962, 718, 1887, 29918, 1022, 29875, 29918, 355, 29961, 29906, 2314, 847, 29871, 29906, 29889, 29900, 29892, 13, 1678, 4514, 13, 13, 1678, 396, 29871, 29955, 29897, 11796, 29872, 278, 2159, 310, 278, 9358, 666, 10170, 867, 4841, 29892, 15687, 518, 9877, 29918, 798, 29892, 302, 29890, 29918, 1054, 29962, 13, 1678, 6856, 29918, 2311, 353, 518, 524, 29898, 1621, 2164, 29918, 3027, 29918, 2311, 29961, 29900, 29962, 847, 321, 1631, 29918, 10568, 718, 29871, 29906, 511, 938, 29898, 1621, 2164, 29918, 3027, 29918, 2311, 29961, 29896, 29962, 847, 321, 1631, 29918, 10568, 718, 29871, 29906, 4638, 13, 13, 1678, 736, 6856, 29918, 29886, 15711, 29918, 2311, 29892, 6856, 29918, 2311, 29892, 7705, 2164, 29918, 3027, 29918, 2311, 29892, 2175, 29918, 1022, 29875, 29918, 12574, 29892, 2175, 29918, 1022, 29875, 29918, 355, 13, 13, 13, 1753, 679, 29918, 1022, 666, 10170, 29918, 1062, 296, 29898, 13, 1678, 2175, 29918, 326, 29892, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 11858, 362, 29922, 29900, 29889, 29900, 29892, 321, 1631, 29918, 10568, 29922, 29941, 29900, 29889, 29900, 29892, 11858, 362, 29918, 10289, 29922, 29945, 29900, 29889, 29900, 29892, 5906, 29922, 29900, 29889, 29900, 13, 1125, 13, 1678, 9995, 13, 1678, 736, 9358, 666, 10170, 3661, 2158, 773, 28094, 6929, 310, 9358, 666, 10170, 16303, 297, 2175, 1967, 29889, 13, 13, 1678, 584, 3207, 2175, 29918, 326, 29901, 2175, 1967, 13, 1678, 584, 1853, 2175, 29918, 326, 29901, 6232, 2029, 29889, 3027, 1203, 13, 1678, 584, 3207, 23216, 29918, 4299, 29918, 1563, 29901, 26224, 1904, 310, 278, 2175, 1967, 13, 1678, 584, 1853, 23216, 29918, 4299, 29918, 1563, 29901, 6232, 2029, 29889, 7720, 470, 6232, 2029, 29889, 29878, 6739, 13, 1678, 584, 3207, 23216, 29918, 4299, 29918, 1266, 29901, 26224, 1904, 310, 278, 1492, 1967, 13, 1678, 584, 1853, 23216, 29918, 4299, 29918, 1266, 29901, 6232, 2029, 29889, 7720, 470, 6232, 2029, 29889, 29878, 6739, 13, 1678, 584, 3207, 11858, 362, 29901, 11858, 362, 13, 1678, 584, 1853, 11858, 362, 29901, 6232, 2029, 29889, 6008, 29885, 470, 5785, 13, 1678, 584, 3207, 321, 1631, 29918, 10568, 29901, 9358, 666, 10170, 4331, 13, 1678, 584, 1853, 321, 1631, 29918, 10568, 29901, 5785, 13, 1678, 584, 3207, 11858, 362, 29918, 10289, 29901, 11858, 362, 4328, 1304, 304, 12678, 278, 1887, 18806, 296, 13, 1678, 584, 1853, 11858, 362, 29918, 10289, 29901, 5785, 13, 1678, 584, 3207, 5906, 29901, 3661, 2158, 5906, 313, 262, 14496, 29897, 13, 1678, 584, 1853, 5906, 584, 5785, 13, 1678, 584, 2457, 15834, 584, 518, 12957, 29918, 1195, 29892, 5066, 29918, 1195, 29892, 12957, 4236, 29892, 5066, 4236, 29962, 313, 29906, 29928, 7442, 29889, 2378, 29897, 13, 1678, 584, 29878, 1853, 12655, 29889, 2378, 13, 1678, 9995, 13, 1678, 3661, 2158, 353, 7442, 29889, 3298, 359, 4197, 29906, 29892, 29871, 29906, 2314, 13, 1678, 903, 3383, 903, 3383, 903, 3383, 2175, 29918, 1022, 29875, 29918, 12574, 29892, 2175, 29918, 1022, 29875, 29918, 355, 353, 19012, 29918, 1621, 2450, 29898, 13, 4706, 2175, 29918, 326, 29892, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 11858, 362, 29892, 321, 1631, 29918, 10568, 29892, 11858, 362, 29918, 10289, 13, 1678, 1723, 13, 1678, 3661, 2158, 29961, 29900, 29892, 584, 29962, 353, 2175, 29918, 1022, 29875, 29918, 12574, 29961, 29900, 29901, 29906, 29962, 13, 1678, 3661, 2158, 29961, 29896, 29892, 584, 29962, 353, 2175, 29918, 1022, 29875, 29918, 355, 29961, 29900, 29901, 29906, 29962, 13, 1678, 773, 29918, 479, 25730, 550, 689, 353, 7700, 13, 1678, 1180, 29918, 1563, 353, 9959, 2133, 29898, 479, 290, 29918, 4299, 29918, 1563, 29892, 1967, 29922, 1563, 29918, 326, 29897, 13, 1678, 373, 29918, 2057, 29918, 1066, 353, 1180, 29918, 1563, 29889, 11851, 29898, 6661, 2158, 7503, 29892, 29871, 29900, 1402, 3661, 2158, 7503, 29892, 29871, 29896, 1402, 29871, 29900, 29892, 773, 29918, 479, 25730, 550, 689, 29922, 4746, 29918, 479, 25730, 550, 689, 29897, 13, 1678, 518, 12957, 29918, 1195, 29892, 3405, 29918, 1195, 29892, 4770, 29962, 353, 7442, 29889, 1195, 29898, 265, 29918, 2057, 29918, 1066, 29892, 29871, 29900, 29897, 13, 1678, 518, 12957, 29918, 3317, 29892, 3405, 29918, 3317, 29892, 4770, 29962, 353, 7442, 29889, 3317, 29898, 265, 29918, 2057, 29918, 1066, 29892, 29871, 29900, 29897, 13, 1678, 736, 7442, 29889, 2378, 4197, 5066, 29918, 1195, 448, 5906, 29892, 23123, 29918, 1195, 448, 5906, 29892, 3405, 29918, 3317, 718, 5906, 29892, 23123, 29918, 3317, 718, 5906, 2314, 13, 13, 13, 1753, 11905, 29918, 629, 4841, 29898, 1022, 29875, 29918, 10568, 29892, 302, 29890, 29918, 798, 29892, 302, 29890, 29918, 1054, 1125, 13, 1678, 9995, 13, 1678, 25455, 2175, 322, 1492, 9358, 666, 10170, 867, 4841, 584, 731, 1737, 29877, 29899, 9067, 322, 24786, 848, 13, 13, 1678, 584, 3207, 321, 1631, 29918, 10568, 29901, 9358, 666, 10170, 4331, 13, 1678, 584, 3207, 302, 29890, 29918, 798, 29901, 4206, 310, 278, 6856, 13, 1678, 584, 3207, 302, 29890, 29918, 1054, 29901, 4341, 310, 278, 6856, 13, 1678, 584, 2457, 29901, 2175, 9358, 666, 10170, 6856, 29892, 1492, 9358, 666, 10170, 6856, 13, 1678, 584, 29878, 1853, 584, 12603, 552, 29898, 13653, 2029, 29889, 2940, 29892, 6232, 2029, 29889, 2940, 29897, 13, 1678, 9995, 13, 1678, 396, 25455, 2175, 322, 1492, 9358, 666, 10170, 867, 4841, 13, 1678, 2175, 29918, 7720, 353, 7084, 29898, 3027, 29918, 2084, 29922, 8516, 29897, 13, 13, 1678, 396, 26774, 584, 13, 1678, 396, 891, 784, 15526, 2159, 29892, 1948, 13733, 1919, 3978, 784, 7568, 29899, 1563, 29989, 13, 1678, 396, 891, 784, 13733, 29892, 259, 1948, 15526, 2159, 29892, 29871, 1919, 3978, 1948, 7568, 29899, 1563, 29989, 13, 1678, 2175, 29918, 7720, 29918, 24756, 29918, 9067, 353, 7442, 29889, 2378, 29898, 13, 4706, 518, 1022, 29875, 29918, 10568, 29892, 29871, 29900, 29892, 19691, 1022, 29875, 29918, 10568, 334, 29871, 29900, 29889, 29945, 511, 29871, 29900, 29892, 321, 1631, 29918, 10568, 29892, 19691, 1022, 29875, 29918, 10568, 334, 29871, 29900, 29889, 29945, 29897, 1402, 26688, 29922, 9302, 29889, 7411, 29953, 29946, 13, 1678, 1723, 13, 1678, 2175, 29918, 7720, 29889, 842, 29918, 19635, 29898, 9877, 29918, 798, 29892, 302, 29890, 29918, 1054, 29892, 29871, 29906, 29892, 2175, 29918, 7720, 29918, 24756, 29918, 9067, 29892, 1418, 23179, 29922, 9302, 29889, 7411, 29953, 29946, 29897, 13, 13, 1678, 1492, 29918, 7720, 353, 7084, 29898, 3027, 29918, 2084, 29922, 8516, 29897, 13, 1678, 1492, 29918, 7720, 29918, 24756, 29918, 9067, 353, 7442, 29889, 2378, 29898, 13, 4706, 518, 1022, 29875, 29918, 10568, 29892, 29871, 29900, 29892, 19691, 1022, 29875, 29918, 10568, 334, 29871, 29900, 29889, 29945, 511, 29871, 29900, 29892, 321, 1631, 29918, 10568, 29892, 19691, 1022, 29875, 29918, 10568, 334, 29871, 29900, 29889, 29945, 29897, 1402, 26688, 29922, 9302, 29889, 7411, 29953, 29946, 13, 1678, 1723, 13, 1678, 1492, 29918, 7720, 29889, 842, 29918, 19635, 29898, 9877, 29918, 798, 29892, 302, 29890, 29918, 1054, 29892, 29871, 29906, 29892, 1492, 29918, 7720, 29918, 24756, 29918, 9067, 29892, 1418, 23179, 29922, 9302, 29889, 7411, 29953, 29946, 29897, 13, 13, 1678, 736, 2175, 29918, 7720, 29892, 1492, 29918, 7720, 13, 13, 13, 1753, 8401, 29918, 517, 29918, 4622, 29918, 1220, 29898, 479, 290, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 1857, 29918, 1220, 29892, 2099, 29918, 1028, 9390, 29892, 11858, 362, 29892, 321, 1631, 29918, 10568, 29892, 15595, 1125, 13, 1678, 9995, 13, 1678, 14104, 292, 304, 278, 2446, 1196, 297, 9358, 666, 10170, 16303, 13, 13, 1678, 584, 3207, 23216, 29918, 4299, 29918, 1563, 29901, 26224, 1904, 310, 278, 2175, 1967, 13, 1678, 584, 1853, 23216, 29918, 4299, 29918, 1563, 29901, 6232, 2029, 29889, 7720, 470, 29871, 6232, 2029, 29889, 29878, 6739, 13, 1678, 584, 3207, 23216, 29918, 4299, 29918, 1266, 29901, 26224, 1904, 310, 278, 1492, 1967, 13, 1678, 584, 1853, 23216, 29918, 4299, 29918, 1266, 29901, 6232, 2029, 29889, 7720, 470, 29871, 6232, 2029, 29889, 29878, 6739, 13, 1678, 584, 3207, 1857, 29918, 1220, 29901, 1857, 1196, 297, 278, 2175, 9358, 666, 10170, 16303, 13, 1678, 584, 1853, 1857, 29918, 1220, 29901, 29871, 29896, 29928, 7442, 29889, 2378, 518, 798, 29892, 784, 29892, 5272, 4279, 29962, 13, 1678, 584, 3207, 2099, 29918, 1028, 9390, 29901, 2099, 29250, 310, 9358, 666, 10170, 867, 4841, 13, 1678, 584, 1853, 2099, 29918, 1028, 9390, 29901, 938, 13, 1678, 584, 3207, 11858, 362, 29901, 11858, 362, 13, 1678, 584, 1853, 11858, 362, 29901, 6232, 2029, 29889, 6008, 29885, 470, 5785, 13, 1678, 584, 3207, 321, 1631, 29918, 10568, 29901, 9358, 666, 10170, 4331, 13, 1678, 584, 1853, 321, 1631, 29918, 10568, 29901, 938, 13, 1678, 584, 3207, 15595, 29901, 9358, 666, 10170, 10696, 13, 1678, 584, 1853, 15595, 29901, 5785, 13, 1678, 584, 2457, 29901, 2175, 322, 1492, 10350, 310, 278, 2446, 1196, 297, 321, 1631, 459, 4675, 16303, 13, 1678, 584, 29878, 1853, 29901, 12603, 552, 4197, 798, 29892, 784, 29892, 5272, 4279, 1402, 518, 798, 29892, 784, 29892, 5272, 4279, 2314, 13, 1678, 9995, 13, 1678, 396, 10987, 278, 1369, 310, 2446, 1196, 297, 9358, 666, 10170, 16303, 13, 1678, 396, 13223, 4608, 28143, 304, 9358, 666, 10170, 5305, 13, 1678, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29891, 353, 321, 1631, 29918, 10568, 334, 2099, 29918, 1028, 9390, 334, 5844, 29889, 3944, 29898, 2312, 29897, 13, 1678, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29916, 353, 448, 29896, 334, 2099, 29918, 1028, 9390, 334, 321, 1631, 29918, 10568, 334, 5844, 29889, 5223, 29898, 2312, 29897, 13, 13, 1678, 2446, 29918, 1220, 29918, 2962, 29918, 1563, 353, 7442, 29889, 3298, 359, 29898, 29941, 29892, 26688, 29922, 9302, 29889, 7411, 29953, 29946, 29897, 13, 13, 1678, 2446, 29918, 1220, 29918, 2962, 29918, 1563, 29961, 29900, 29962, 353, 7442, 29889, 8552, 29898, 3784, 29918, 1220, 29961, 29900, 2314, 718, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29891, 13, 1678, 2446, 29918, 1220, 29918, 2962, 29918, 1563, 29961, 29896, 29962, 353, 7442, 29889, 8552, 29898, 3784, 29918, 1220, 29961, 29896, 2314, 718, 5190, 29918, 8111, 29918, 2072, 29877, 29918, 1022, 29875, 29918, 29916, 13, 13, 1678, 396, 10987, 278, 6590, 6257, 1298, 297, 278, 1492, 1967, 13, 1678, 2446, 29918, 1220, 29918, 2962, 29918, 1266, 353, 7442, 29889, 3298, 359, 29898, 29941, 29892, 26688, 29922, 9302, 29889, 7411, 29953, 29946, 29897, 13, 1678, 2446, 29918, 1220, 29918, 2962, 29918, 1266, 29961, 29900, 1402, 2446, 29918, 1220, 29918, 2962, 29918, 1266, 29961, 29896, 1402, 2446, 29918, 1220, 29918, 2962, 29918, 1266, 29961, 29906, 29962, 353, 28853, 29898, 13, 4706, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 2446, 29918, 1220, 29918, 2962, 29918, 1563, 29961, 29900, 1402, 2446, 29918, 1220, 29918, 2962, 29918, 1563, 29961, 29896, 1402, 11858, 362, 13, 1678, 1723, 13, 1678, 736, 2446, 29918, 1220, 29918, 2962, 29918, 1563, 29892, 2446, 29918, 1220, 29918, 2962, 29918, 1266, 13, 13, 13, 1753, 8401, 29918, 284, 549, 29918, 9012, 29898, 13, 1678, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 1857, 29918, 1563, 29918, 1111, 4339, 29892, 2099, 29918, 1028, 9390, 29892, 11858, 362, 29892, 321, 1631, 29918, 10568, 29892, 394, 16130, 13, 1125, 13, 1678, 9995, 13, 1678, 5953, 837, 457, 278, 2602, 310, 2446, 17036, 297, 278, 9358, 666, 13517, 3454, 13, 13, 1678, 584, 3207, 23216, 29918, 4299, 29918, 1563, 29901, 26224, 1904, 310, 278, 2175, 1967, 13, 1678, 584, 1853, 23216, 29918, 4299, 29918, 1563, 29901, 6232, 2029, 29889, 7720, 470, 29871, 6232, 2029, 29889, 29878, 6739, 13, 1678, 584, 3207, 23216, 29918, 4299, 29918, 1266, 29901, 26224, 1904, 310, 278, 1492, 1967, 13, 1678, 584, 1853, 23216, 29918, 4299, 29918, 1266, 29901, 6232, 2029, 29889, 7720, 470, 29871, 6232, 2029, 29889, 29878, 6739, 13, 1678, 584, 3207, 1857, 29918, 1563, 29918, 1111, 4339, 29901, 1857, 1737, 487, 571, 9223, 10350, 297, 2175, 9358, 666, 13517, 1196, 13, 1678, 584, 1853, 1857, 29918, 1563, 29918, 1111, 4339, 29901, 29871, 29906, 29928, 12655, 1409, 313, 4537, 4206, 297, 9358, 666, 10170, 16303, 29892, 518, 798, 29892, 784, 29892, 5272, 4279, 2314, 13, 1678, 584, 3207, 2099, 29918, 1028, 9390, 29901, 2099, 29250, 310, 9358, 666, 10170, 867, 4841, 13, 1678, 584, 1853, 2099, 29918, 1028, 9390, 29901, 938, 13, 1678, 584, 3207, 11858, 362, 29901, 11858, 362, 13, 1678, 584, 1853, 11858, 362, 29901, 6232, 2029, 29889, 6008, 29885, 470, 5785, 13, 1678, 584, 3207, 321, 1631, 29918, 10568, 29901, 9358, 666, 10170, 4331, 13, 1678, 584, 1853, 321, 1631, 29918, 10568, 29901, 938, 13, 1678, 584, 3207, 394, 16130, 29901, 9358, 666, 10170, 23619, 310, 1269, 1887, 9358, 666, 10170, 3454, 13, 1678, 584, 1853, 394, 16130, 29901, 2391, 13, 1678, 584, 2457, 29901, 10350, 310, 2446, 17036, 297, 2175, 9358, 666, 10170, 1196, 29892, 10350, 310, 2446, 17036, 297, 1492, 9358, 666, 10170, 1196, 13, 1678, 584, 29878, 1853, 29901, 12603, 552, 29898, 29906, 29928, 12655, 1409, 313, 4537, 4206, 297, 9358, 666, 10170, 16303, 29892, 518, 798, 29892, 784, 29892, 5272, 4279, 11724, 13, 462, 29871, 29906, 29928, 12655, 1409, 313, 4537, 4206, 297, 9358, 666, 10170, 16303, 29892, 518, 798, 29892, 784, 29892, 5272, 4279, 12622, 13, 1678, 9995, 13, 1678, 396, 5953, 837, 457, 2602, 310, 2446, 17036, 297, 278, 9358, 666, 10170, 1196, 310, 278, 2175, 1967, 313, 13529, 292, 3412, 3454, 29897, 13, 1678, 396, 13223, 4608, 18806, 296, 304, 278, 9358, 666, 10170, 1196, 13, 1678, 5190, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29891, 353, 321, 1631, 29918, 10568, 334, 2099, 29918, 1028, 9390, 334, 7442, 29889, 5223, 29898, 284, 16130, 29897, 13, 1678, 5190, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29916, 353, 321, 1631, 29918, 10568, 334, 2099, 29918, 1028, 9390, 334, 7442, 29889, 3944, 29898, 284, 16130, 29897, 13, 13, 1678, 396, 25249, 304, 278, 2446, 17036, 297, 2175, 1967, 13, 1678, 2446, 29918, 1563, 29918, 1111, 4339, 353, 7442, 29889, 8552, 29898, 3784, 29918, 1563, 29918, 1111, 4339, 29897, 13, 1678, 2446, 29918, 1563, 29918, 1111, 4339, 7503, 29892, 29871, 29900, 29962, 4619, 5190, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29891, 13, 1678, 2446, 29918, 1563, 29918, 1111, 4339, 7503, 29892, 29871, 29896, 29962, 4619, 5190, 29918, 8111, 29918, 284, 549, 29918, 1022, 29875, 29918, 29916, 13, 13, 1678, 396, 10987, 278, 6590, 2446, 17036, 297, 278, 1492, 1967, 13, 1678, 2446, 29918, 1266, 29918, 1111, 4339, 353, 7442, 29889, 3298, 359, 29898, 4622, 29918, 1563, 29918, 1111, 4339, 29889, 12181, 29892, 26688, 29922, 4622, 29918, 1563, 29918, 1111, 4339, 29889, 29881, 1853, 29897, 13, 1678, 2446, 29918, 1266, 29918, 1111, 4339, 7503, 29892, 29871, 29900, 1402, 2446, 29918, 1266, 29918, 1111, 4339, 7503, 29892, 29871, 29896, 1402, 2446, 29918, 1266, 29918, 1111, 4339, 7503, 29892, 29871, 29906, 29962, 353, 28853, 29898, 13, 4706, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 2446, 29918, 1563, 29918, 1111, 4339, 7503, 29892, 29871, 29900, 1402, 2446, 29918, 1563, 29918, 1111, 4339, 7503, 29892, 29871, 29896, 1402, 11858, 362, 13, 1678, 1723, 13, 1678, 736, 2446, 29918, 1563, 29918, 1111, 4339, 29892, 2446, 29918, 1266, 29918, 1111, 4339, 13, 13, 13, 29937, 11262, 363, 7882, 18446, 1546, 2175, 322, 1492, 848, 13, 29937, 282, 2904, 524, 29901, 11262, 29922, 348, 3880, 29899, 23516, 13, 29937, 282, 2904, 524, 29901, 11262, 29922, 517, 29877, 29899, 13011, 29899, 2997, 29879, 13, 1753, 10272, 29918, 303, 406, 487, 312, 2450, 29918, 1022, 666, 10170, 29918, 629, 4841, 29898, 13, 1678, 2175, 29918, 326, 29892, 23216, 29918, 4299, 29918, 1563, 29892, 1492, 29918, 326, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 11858, 362, 29922, 29900, 29889, 29900, 29892, 321, 1631, 29918, 10568, 29922, 29896, 29892, 11858, 362, 29918, 10289, 29922, 29945, 29900, 29889, 29900, 13, 1125, 13, 1678, 9995, 13, 1678, 11796, 29872, 269, 12358, 29877, 29899, 1621, 2450, 9358, 666, 10170, 867, 4841, 13, 13, 1678, 584, 3207, 2175, 29918, 326, 29901, 2175, 1967, 13, 1678, 584, 1853, 2175, 29918, 326, 29901, 6232, 2029, 29889, 3027, 1203, 13, 1678, 584, 3207, 23216, 29918, 4299, 29918, 1563, 29901, 26224, 1904, 310, 278, 2175, 1967, 13, 1678, 584, 1853, 23216, 29918, 4299, 29918, 1563, 29901, 6232, 2029, 29889, 7720, 470, 29871, 6232, 2029, 29889, 29878, 6739, 13, 1678, 584, 3207, 1492, 29918, 326, 29901, 1492, 1967, 13, 1678, 584, 1853, 1492, 29918, 326, 29901, 6232, 2029, 29889, 3027, 1203, 13, 1678, 584, 3207, 23216, 29918, 4299, 29918, 1266, 29901, 26224, 1904, 310, 278, 1492, 1967, 13, 1678, 584, 1853, 23216, 29918, 4299, 29918, 1266, 29901, 6232, 2029, 29889, 7720, 470, 29871, 6232, 2029, 29889, 29878, 6739, 13, 1678, 584, 3207, 11858, 362, 29901, 11858, 362, 13, 1678, 584, 1853, 11858, 362, 29901, 6232, 2029, 29889, 6008, 29885, 470, 5785, 13, 1678, 584, 3207, 321, 1631, 29918, 10568, 29901, 9358, 666, 10170, 4331, 13, 1678, 584, 1853, 321, 1631, 29918, 10568, 29901, 938, 13, 1678, 584, 3207, 11858, 362, 29918, 10289, 29901, 11858, 362, 4328, 1304, 304, 12678, 278, 1887, 18806, 296, 13, 1678, 584, 1853, 11858, 362, 29918, 10289, 29901, 5785, 13, 1678, 584, 2457, 29901, 736, 584, 13, 4706, 448, 2175, 9358, 666, 10170, 6856, 29892, 6232, 2029, 29889, 3027, 1203, 15687, 5519, 798, 12272, 9552, 29892, 784, 12272, 9552, 1402, 302, 29890, 4206, 29892, 302, 29890, 28730, 29962, 13, 4706, 448, 1492, 9358, 666, 10170, 6856, 29892, 6232, 2029, 29889, 3027, 1203, 15687, 5519, 798, 12272, 9552, 29892, 784, 12272, 9552, 1402, 302, 29890, 4206, 29892, 302, 29890, 28730, 29962, 13, 4706, 448, 1353, 310, 4206, 310, 278, 9358, 666, 10170, 1967, 29892, 938, 13, 4706, 448, 1353, 310, 4341, 310, 278, 9358, 666, 10170, 1967, 29892, 938, 13, 4706, 448, 2099, 995, 310, 278, 2362, 5570, 304, 23530, 5272, 4279, 11959, 29892, 5785, 13, 1678, 584, 29878, 1853, 29901, 12603, 552, 13, 1678, 9995, 13, 1678, 396, 4649, 29878, 2418, 867, 4841, 584, 29250, 313, 29886, 15711, 2159, 29897, 322, 2159, 13, 1678, 396, 4649, 29878, 2418, 9358, 666, 10170, 1967, 584, 2159, 322, 7568, 29899, 1563, 3978, 297, 278, 2175, 1967, 16303, 313, 2962, 292, 1298, 29897, 13, 1678, 903, 3383, 6856, 29918, 2311, 29892, 7705, 2164, 29918, 3027, 29918, 2311, 29892, 2175, 29918, 1022, 29875, 29918, 12574, 29892, 4770, 353, 19012, 29918, 1621, 2450, 29898, 13, 4706, 2175, 29918, 326, 29892, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 11858, 362, 29892, 321, 1631, 29918, 10568, 29892, 11858, 362, 29918, 10289, 13, 1678, 1723, 13, 13, 1678, 396, 4803, 278, 2099, 29250, 408, 1434, 13, 1678, 2099, 29918, 1028, 9390, 353, 29871, 29900, 29889, 29945, 334, 313, 6897, 29898, 1563, 29918, 326, 29889, 29886, 15711, 29918, 2311, 29918, 1054, 29897, 718, 6425, 29898, 1563, 29918, 326, 29889, 29886, 15711, 29918, 2311, 29918, 798, 876, 13, 13, 1678, 2175, 29918, 7720, 29892, 1492, 29918, 7720, 353, 11905, 29918, 629, 4841, 29898, 1022, 29875, 29918, 10568, 29892, 6856, 29918, 2311, 29961, 29900, 1402, 6856, 29918, 2311, 29961, 29896, 2314, 13, 13, 1678, 396, 23748, 3291, 526, 278, 7568, 29899, 1563, 3978, 310, 278, 2175, 9358, 666, 10170, 1967, 29892, 322, 372, 29915, 29879, 3928, 296, 297, 278, 1492, 1967, 13, 1678, 1369, 29918, 1563, 353, 7442, 29889, 8552, 29898, 1563, 29918, 1022, 29875, 29918, 12574, 29897, 13, 1678, 1369, 29918, 1266, 353, 7442, 29889, 3298, 359, 29898, 29941, 29892, 26688, 29922, 2962, 29918, 1563, 29889, 29881, 1853, 29897, 13, 1678, 1369, 29918, 1266, 29961, 29900, 1402, 1369, 29918, 1266, 29961, 29896, 1402, 1369, 29918, 1266, 29961, 29906, 29962, 353, 28853, 29898, 13, 4706, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 1369, 29918, 1563, 29961, 29900, 1402, 1369, 29918, 1563, 29961, 29896, 1402, 11858, 362, 13, 1678, 1723, 13, 13, 1678, 2099, 29918, 6500, 5570, 29918, 3605, 601, 353, 29871, 29900, 13, 13, 1678, 396, 11796, 29872, 278, 6257, 1298, 310, 1269, 9358, 666, 10170, 1196, 304, 367, 2221, 304, 4337, 3412, 278, 3454, 313, 1509, 1319, 304, 4608, 675, 278, 775, 29897, 13, 1678, 396, 1879, 487, 571, 9223, 10350, 310, 1269, 6257, 9358, 666, 10170, 3454, 297, 2175, 322, 1492, 1967, 13, 1678, 2175, 29918, 1022, 29875, 29918, 9012, 353, 518, 9302, 29889, 8552, 29898, 2962, 29918, 1563, 4638, 13, 1678, 1492, 29918, 1022, 29875, 29918, 9012, 353, 518, 9302, 29889, 8552, 29898, 2962, 29918, 1266, 4638, 13, 13, 1678, 396, 1152, 1269, 4206, 310, 278, 9358, 666, 10170, 16303, 29892, 4529, 2175, 322, 1492, 6257, 10350, 310, 1269, 9358, 666, 10170, 3454, 13, 1678, 363, 4770, 297, 3464, 29898, 7720, 29918, 2311, 29961, 29900, 29962, 448, 29871, 29896, 1125, 13, 4706, 396, 11474, 11796, 29872, 2175, 1887, 9358, 666, 10170, 1196, 29892, 5407, 363, 8401, 304, 278, 2446, 1196, 11474, 13, 4706, 1887, 29918, 1022, 29875, 29918, 2962, 29892, 1887, 29918, 1022, 29875, 29918, 355, 353, 10272, 29918, 2997, 29918, 1022, 666, 10170, 29918, 1220, 29898, 13, 9651, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 2175, 29918, 1022, 29875, 29918, 9012, 14352, 29896, 1402, 11858, 362, 29892, 11858, 362, 29918, 10289, 13, 4706, 1723, 13, 13, 4706, 396, 9358, 666, 10170, 10696, 773, 278, 3380, 322, 278, 1095, 310, 278, 2175, 1887, 9358, 666, 10170, 1196, 13, 4706, 15595, 353, 10272, 29918, 1022, 666, 10170, 29918, 2521, 29898, 2997, 29918, 1022, 29875, 29918, 355, 29892, 1887, 29918, 1022, 29875, 29918, 2962, 29897, 13, 4706, 396, 10987, 278, 1369, 310, 2446, 1196, 297, 9358, 666, 10170, 16303, 13, 4706, 2446, 29918, 1022, 29875, 29918, 1220, 29918, 1563, 29892, 2446, 29918, 1022, 29875, 29918, 1220, 29918, 1266, 353, 8401, 29918, 517, 29918, 4622, 29918, 1220, 29898, 13, 9651, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 2175, 29918, 1022, 29875, 29918, 9012, 14352, 29896, 1402, 2099, 29918, 1028, 9390, 29892, 11858, 362, 29892, 321, 1631, 29918, 10568, 29892, 15595, 13, 4706, 1723, 13, 13, 4706, 396, 16913, 278, 6257, 3291, 29892, 5407, 304, 367, 2221, 304, 4337, 3412, 278, 3454, 297, 278, 2446, 2425, 13, 4706, 2175, 29918, 1022, 29875, 29918, 9012, 29889, 4397, 29898, 9302, 29889, 8552, 29898, 4622, 29918, 1022, 29875, 29918, 1220, 29918, 1563, 876, 13, 4706, 1492, 29918, 1022, 29875, 29918, 9012, 29889, 4397, 29898, 9302, 29889, 8552, 29898, 4622, 29918, 1022, 29875, 29918, 1220, 29918, 1266, 876, 13, 13, 1678, 396, 19941, 322, 1492, 9358, 666, 10170, 10350, 310, 278, 1857, 1298, 13, 1678, 2175, 29918, 1022, 29875, 29918, 1111, 4339, 353, 7442, 29889, 2378, 29898, 1563, 29918, 1022, 29875, 29918, 9012, 29897, 13, 1678, 1492, 29918, 1022, 29875, 29918, 1111, 4339, 353, 7442, 29889, 2378, 29898, 1266, 29918, 1022, 29875, 29918, 9012, 29897, 13, 13, 1678, 396, 14104, 292, 3412, 9358, 666, 10170, 3454, 13, 1678, 4206, 353, 7442, 29889, 279, 927, 29898, 7720, 29918, 2311, 29961, 29900, 2314, 13, 1678, 363, 784, 297, 3464, 29898, 7720, 29918, 2311, 29961, 29896, 29962, 1125, 13, 4706, 396, 2661, 6490, 278, 12272, 9552, 1819, 310, 278, 1857, 17036, 13, 4706, 396, 4834, 6856, 2380, 304, 1737, 487, 571, 9223, 6856, 10350, 13, 4706, 1857, 29918, 1563, 29918, 7720, 353, 2175, 29918, 7720, 29889, 9067, 29918, 2248, 29918, 517, 29918, 14017, 936, 29918, 3149, 29898, 5727, 29892, 7442, 29889, 14358, 29898, 1054, 29892, 4206, 29889, 12181, 29961, 29900, 12622, 13, 4706, 1857, 29918, 1266, 29918, 7720, 353, 1492, 29918, 7720, 29889, 9067, 29918, 2248, 29918, 517, 29918, 14017, 936, 29918, 3149, 29898, 5727, 29892, 7442, 29889, 14358, 29898, 1054, 29892, 4206, 29889, 12181, 29961, 29900, 12622, 13, 13, 4706, 2175, 29918, 7720, 29889, 1272, 29961, 29900, 29892, 584, 29892, 784, 29962, 353, 2175, 29918, 1022, 29875, 29918, 1111, 4339, 7503, 29892, 29871, 29900, 29962, 448, 1857, 29918, 1563, 29918, 7720, 29961, 29900, 29962, 13, 4706, 2175, 29918, 7720, 29889, 1272, 29961, 29896, 29892, 584, 29892, 784, 29962, 353, 2175, 29918, 1022, 29875, 29918, 1111, 4339, 7503, 29892, 29871, 29896, 29962, 448, 1857, 29918, 1563, 29918, 7720, 29961, 29896, 29962, 13, 4706, 1492, 29918, 7720, 29889, 1272, 29961, 29900, 29892, 584, 29892, 784, 29962, 353, 1492, 29918, 1022, 29875, 29918, 1111, 4339, 7503, 29892, 29871, 29900, 29962, 448, 1857, 29918, 1266, 29918, 7720, 29961, 29900, 29962, 13, 4706, 1492, 29918, 7720, 29889, 1272, 29961, 29896, 29892, 584, 29892, 784, 29962, 353, 1492, 29918, 1022, 29875, 29918, 1111, 4339, 7503, 29892, 29871, 29896, 29962, 448, 1857, 29918, 1266, 29918, 7720, 29961, 29896, 29962, 13, 13, 4706, 396, 11796, 29872, 2175, 1887, 9358, 666, 10170, 1196, 29892, 5407, 304, 12678, 278, 1887, 2362, 5570, 11959, 322, 8401, 304, 278, 2446, 17036, 13, 4706, 1887, 29918, 1022, 29875, 29918, 2962, 29892, 1887, 29918, 1022, 29875, 29918, 355, 353, 10272, 29918, 2997, 29918, 1022, 666, 10170, 29918, 1220, 29898, 13, 9651, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 2175, 29918, 1022, 29875, 29918, 1111, 4339, 29892, 11858, 362, 29892, 11858, 362, 29918, 10289, 13, 4706, 1723, 13, 4706, 396, 2661, 6490, 278, 1887, 2362, 5570, 11959, 13, 4706, 1887, 29918, 6500, 5570, 29918, 3605, 601, 353, 7442, 29889, 3676, 29898, 13, 9651, 313, 2997, 29918, 1022, 29875, 29918, 355, 7503, 29892, 29871, 29896, 29962, 448, 1887, 29918, 1022, 29875, 29918, 2962, 7503, 29892, 29871, 29896, 2314, 334, 313, 2997, 29918, 1022, 29875, 29918, 355, 7503, 29892, 29871, 29896, 29962, 448, 1887, 29918, 1022, 29875, 29918, 2962, 7503, 29892, 29871, 29896, 2314, 13, 9651, 718, 313, 2997, 29918, 1022, 29875, 29918, 355, 7503, 29892, 29871, 29900, 29962, 448, 1887, 29918, 1022, 29875, 29918, 2962, 7503, 29892, 29871, 29900, 2314, 334, 313, 2997, 29918, 1022, 29875, 29918, 355, 7503, 29892, 29871, 29900, 29962, 448, 1887, 29918, 1022, 29875, 29918, 2962, 7503, 29892, 29871, 29900, 2314, 13, 4706, 1723, 847, 313, 29906, 334, 11858, 362, 29918, 10289, 29897, 13, 4706, 2099, 29918, 6500, 5570, 29918, 3605, 601, 4619, 7442, 29889, 2083, 29898, 2997, 29918, 6500, 5570, 29918, 3605, 601, 29897, 13, 13, 4706, 396, 9358, 666, 10170, 10696, 773, 278, 3380, 322, 278, 1095, 310, 278, 2175, 1887, 9358, 666, 10170, 3454, 13, 4706, 394, 16130, 353, 10272, 29918, 1022, 666, 10170, 29918, 2521, 29898, 2997, 29918, 1022, 29875, 29918, 355, 29892, 1887, 29918, 1022, 29875, 29918, 2962, 29897, 13, 13, 4706, 396, 25249, 304, 278, 2446, 17036, 297, 278, 9358, 666, 10170, 1196, 313, 13529, 292, 3412, 3454, 29897, 13, 4706, 2175, 29918, 1022, 29875, 29918, 1111, 4339, 29892, 1492, 29918, 1022, 29875, 29918, 1111, 4339, 353, 8401, 29918, 284, 549, 29918, 9012, 29898, 13, 9651, 23216, 29918, 4299, 29918, 1563, 29892, 23216, 29918, 4299, 29918, 1266, 29892, 2175, 29918, 1022, 29875, 29918, 1111, 4339, 29892, 2099, 29918, 1028, 9390, 29892, 11858, 362, 29892, 321, 1631, 29918, 10568, 29892, 394, 16130, 13, 4706, 1723, 13, 13, 1678, 396, 11796, 29872, 278, 2099, 2362, 5570, 11959, 13, 1678, 2099, 29918, 6500, 5570, 29918, 3605, 601, 847, 29922, 6856, 29918, 2311, 29961, 29900, 29962, 334, 6856, 29918, 2311, 29961, 29896, 29962, 13, 13, 1678, 736, 2175, 29918, 7720, 29892, 1492, 29918, 7720, 29892, 7705, 2164, 29918, 3027, 29918, 2311, 29961, 29900, 1402, 7705, 2164, 29918, 3027, 29918, 2311, 29961, 29896, 1402, 2099, 29918, 6500, 5570, 29918, 3605, 601, 13, 2 ]
logical_backup/pretty_print.py
ammesonb/logical-backup
0
1611141
<gh_stars>0 """ Some pretty-printing stuff """ from __future__ import annotations from enum import Enum CHECK_UNICODE = "\u2714" CROSS_UNICODE = "\u274c" class Color(Enum): """ Contains foreground colors for the command line """ BLACK = "\033[30m" RED = "\033[31m" PURPLE = "\033[35m" CYAN = "\033[36m" ERROR = "\033[91m" # Salmon-ish GREEN = "\033[92m" YELLOW = "\033[93m" BLUE = "\033[94m" MAGENTA = "\033[95m" WHITE = "\033[95m" class Background(Enum): """ Contains background colors for the command line """ BLACK = "\033[40m" RED = "\033[41m" GREEN = "\033[42m" YELLOW = "\033[43m" BLUE = "\033[44m" PURPLE = "\033[45m" CYAN = "\033[46m" WHITE = "\033[47m" class Format(Enum): """ Contains text formatting options """ END = "\033[0m" BOLD = "\033[1m" DIM = "\033[2m" UNDERLINE = "\033[4m" HIDDEN = "\033[8m" def get_success_prefix(succeeded: bool = None) -> str: """ Returns a padded string indicating success Check for True, Cross for False, spaces for None """ if succeeded is None: string = " " elif succeeded: # The check has a smaller width than the cross, so pad it string = CHECK_UNICODE + " " else: string = CROSS_UNICODE return string def print_error(message: str) -> None: """ Prints an error message """ PrettyStatusPrinter(message).with_specific_color(Color.ERROR).print_message() # pylint: disable=too-many-instance-attributes class PrettyStatusPrinter: """ Prints status messages, prettily """ def __init__(self, message: str): """ . """ self.__with_ellipsis = True self.__specific_color = None self.__result_colors = {True: Color.GREEN, False: Color.ERROR} self.__message_postfix = {True: "Completed", False: "Failed"} self.__results = {None: None, True: True, False: False} self.__background_color = None self.__styles = [] self.__message = message self.__line_ending = "\n" self.__started = False def __get_styled_message(self, result=None) -> str: """ Returns the styled message Needs to know success status to resolve color correctly """ styled_message = "" if self.__specific_color: styled_message += self.__specific_color.value elif result is not None: styled_message += ( self.__result_colors[result].value if result in self.__result_colors else self.__result_colors[self.__results[result]].value ) if self.__background_color: styled_message += self.__background_color.value if self.__styles: for style in self.__styles: styled_message += style.value styled_message += get_success_prefix(result) styled_message += self.__message if self.__started and self.__with_ellipsis: styled_message += "..." styled_message += self.__message_postfix.get( result, self.__message_postfix.get(self.__results[result], "") ) styled_message += Format.END.value return styled_message def with_custom_result(self, result, is_success: bool) -> PrettyStatusPrinter: """ Allow custom result responses Requires definition of whether it is a "success" or not DO NOT USE "0" or "1" AS VALUES - THEY WILL COLLIDE WITH TRUE/FALSE """ self.__results[result] = is_success return self def with_ellipsis(self, include: bool = True) -> PrettyStatusPrinter: """ Include ellipsis on start, or not """ self.__with_ellipsis = include return self def with_specific_color(self, color: Color) -> PrettyStatusPrinter: """ Always print in this color """ self.__specific_color = color return self # pylint: disable=bad-continuation def with_color_for_result(self, result, color: Color) -> PrettyStatusPrinter: """ Sets the output color for a given response """ self.__result_colors[result] = color return self def with_message_postfix_for_result( self, result, postfix: str ) -> PrettyStatusPrinter: """ Adds message postfix for for given result, e.g. "failed to do X" or "Y happened" """ self.__message_postfix[result] = postfix return self def with_background_color(self, background: Background) -> PrettyStatusPrinter: """ Sets the background color """ self.__background_color = background return self def with_line_ending(self, line_ending: str) -> PrettyStatusPrinter: """ Sets the line ending to print """ self.__line_ending = line_ending return self def with_styles(self, styles: list) -> PrettyStatusPrinter: """ Sets styles to print the message with """ self.__styles += styles return self def print_message(self, to_overwrite: bool = False, result=None) -> None: """ Prints the message If to overwrite, will use a carriage return instead of newline Succeeded can also be specified, to pass through for formatting """ line_ending = "\r" if to_overwrite else self.__line_ending print(self.__get_styled_message(result), end=line_ending, flush=True) def print_start(self) -> PrettyStatusPrinter: """ Prints the starting message """ self.__started = True self.print_message(True) return self def print_complete(self, succeeded: bool = True): """ Print the completed message, for a given success status """ self.print_message(result=succeeded) def readable_bytes(size: int, suffix: str = "B") -> str: """ Prints size of file Parameters ---------- size : int Bytes to format suffix='B' : str What to print after the SI prefix """ for unit in ["", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi"]: if abs(size) < 1024.0: return "%3.1f%s%s" % (size, unit, suffix) size /= 1024.0 return "%.1f%s%s" % (size, "Yi", suffix)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 13, 9526, 5051, 29899, 2158, 292, 6433, 13, 15945, 29908, 13, 3166, 4770, 29888, 9130, 1649, 1053, 25495, 13, 13, 3166, 14115, 1053, 1174, 398, 13, 13, 3210, 16658, 29918, 3904, 2965, 29949, 2287, 353, 6634, 29884, 29906, 29955, 29896, 29946, 29908, 13, 29907, 1672, 1799, 29918, 3904, 2965, 29949, 2287, 353, 6634, 29884, 29906, 29955, 29946, 29883, 29908, 13, 13, 13, 1990, 9159, 29898, 16854, 1125, 13, 1678, 9995, 13, 1678, 2866, 2708, 363, 18128, 11955, 363, 278, 1899, 1196, 13, 1678, 9995, 13, 13, 1678, 350, 29931, 11375, 353, 6634, 29900, 29941, 29941, 29961, 29941, 29900, 29885, 29908, 13, 1678, 390, 3352, 353, 6634, 29900, 29941, 29941, 29961, 29941, 29896, 29885, 29908, 13, 1678, 349, 4574, 29925, 1307, 353, 6634, 29900, 29941, 29941, 29961, 29941, 29945, 29885, 29908, 13, 1678, 315, 29979, 2190, 353, 6634, 29900, 29941, 29941, 29961, 29941, 29953, 29885, 29908, 13, 1678, 14431, 353, 6634, 29900, 29941, 29941, 29961, 29929, 29896, 29885, 29908, 29871, 396, 3956, 3712, 29899, 728, 13, 1678, 402, 1525, 1430, 353, 6634, 29900, 29941, 29941, 29961, 29929, 29906, 29885, 29908, 13, 1678, 612, 29923, 2208, 9806, 353, 6634, 29900, 29941, 29941, 29961, 29929, 29941, 29885, 29908, 13, 1678, 350, 29931, 4462, 353, 6634, 29900, 29941, 29941, 29961, 29929, 29946, 29885, 29908, 13, 1678, 341, 10051, 3919, 29909, 353, 6634, 29900, 29941, 29941, 29961, 29929, 29945, 29885, 29908, 13, 1678, 12317, 9094, 353, 6634, 29900, 29941, 29941, 29961, 29929, 29945, 29885, 29908, 13, 13, 13, 1990, 16585, 29898, 16854, 1125, 13, 1678, 9995, 13, 1678, 2866, 2708, 3239, 11955, 363, 278, 1899, 1196, 13, 1678, 9995, 13, 13, 1678, 350, 29931, 11375, 353, 6634, 29900, 29941, 29941, 29961, 29946, 29900, 29885, 29908, 13, 1678, 390, 3352, 353, 6634, 29900, 29941, 29941, 29961, 29946, 29896, 29885, 29908, 13, 1678, 402, 1525, 1430, 353, 6634, 29900, 29941, 29941, 29961, 29946, 29906, 29885, 29908, 13, 1678, 612, 29923, 2208, 9806, 353, 6634, 29900, 29941, 29941, 29961, 29946, 29941, 29885, 29908, 13, 1678, 350, 29931, 4462, 353, 6634, 29900, 29941, 29941, 29961, 29946, 29946, 29885, 29908, 13, 1678, 349, 4574, 29925, 1307, 353, 6634, 29900, 29941, 29941, 29961, 29946, 29945, 29885, 29908, 13, 1678, 315, 29979, 2190, 353, 6634, 29900, 29941, 29941, 29961, 29946, 29953, 29885, 29908, 13, 1678, 12317, 9094, 353, 6634, 29900, 29941, 29941, 29961, 29946, 29955, 29885, 29908, 13, 13, 13, 1990, 19191, 29898, 16854, 1125, 13, 1678, 9995, 13, 1678, 2866, 2708, 1426, 15998, 3987, 13, 1678, 9995, 13, 13, 1678, 11056, 353, 6634, 29900, 29941, 29941, 29961, 29900, 29885, 29908, 13, 1678, 350, 5607, 29928, 353, 6634, 29900, 29941, 29941, 29961, 29896, 29885, 29908, 13, 1678, 360, 7833, 353, 6634, 29900, 29941, 29941, 29961, 29906, 29885, 29908, 13, 1678, 501, 2797, 1001, 18521, 353, 6634, 29900, 29941, 29941, 29961, 29946, 29885, 29908, 13, 1678, 379, 1367, 29928, 1430, 353, 6634, 29900, 29941, 29941, 29961, 29947, 29885, 29908, 13, 13, 13, 1753, 679, 29918, 8698, 29918, 13506, 29898, 29879, 1682, 3947, 287, 29901, 6120, 353, 6213, 29897, 1599, 851, 29901, 13, 1678, 9995, 13, 1678, 16969, 263, 282, 23959, 1347, 23941, 2551, 13, 13, 1678, 5399, 363, 5852, 29892, 11189, 363, 7700, 29892, 8162, 363, 6213, 13, 1678, 9995, 13, 1678, 565, 14792, 338, 6213, 29901, 13, 4706, 1347, 353, 376, 29871, 376, 13, 1678, 25342, 14792, 29901, 13, 4706, 396, 450, 1423, 756, 263, 7968, 2920, 1135, 278, 4891, 29892, 577, 17132, 372, 13, 4706, 1347, 353, 23557, 29918, 3904, 2965, 29949, 2287, 718, 376, 376, 13, 1678, 1683, 29901, 13, 4706, 1347, 353, 315, 1672, 1799, 29918, 3904, 2965, 29949, 2287, 13, 13, 1678, 736, 1347, 13, 13, 13, 1753, 1596, 29918, 2704, 29898, 4906, 29901, 851, 29897, 1599, 6213, 29901, 13, 1678, 9995, 13, 1678, 1588, 9466, 385, 1059, 2643, 13, 1678, 9995, 13, 1678, 4721, 4349, 5709, 4040, 1639, 29898, 4906, 467, 2541, 29918, 14940, 29918, 2780, 29898, 3306, 29889, 11432, 467, 2158, 29918, 4906, 580, 13, 13, 13, 29937, 282, 2904, 524, 29901, 11262, 29922, 517, 29877, 29899, 13011, 29899, 8758, 29899, 15697, 13, 1990, 4721, 4349, 5709, 4040, 1639, 29901, 13, 1678, 9995, 13, 1678, 1588, 9466, 4660, 7191, 29892, 758, 698, 2354, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2643, 29901, 851, 1125, 13, 4706, 9995, 13, 4706, 869, 13, 4706, 9995, 13, 4706, 1583, 17255, 2541, 29918, 5481, 567, 275, 353, 5852, 13, 4706, 1583, 17255, 14940, 29918, 2780, 353, 6213, 13, 4706, 1583, 17255, 2914, 29918, 27703, 353, 426, 5574, 29901, 9159, 29889, 29954, 1525, 1430, 29892, 7700, 29901, 9159, 29889, 11432, 29913, 13, 4706, 1583, 17255, 4906, 29918, 2490, 5878, 353, 426, 5574, 29901, 376, 26010, 613, 7700, 29901, 376, 17776, 9092, 13, 4706, 1583, 17255, 9902, 353, 426, 8516, 29901, 6213, 29892, 5852, 29901, 5852, 29892, 7700, 29901, 7700, 29913, 13, 4706, 1583, 17255, 7042, 29918, 2780, 353, 6213, 13, 4706, 1583, 17255, 9783, 353, 5159, 13, 4706, 1583, 17255, 4906, 353, 2643, 13, 4706, 1583, 17255, 1220, 29918, 2548, 353, 6634, 29876, 29908, 13, 4706, 1583, 17255, 2962, 287, 353, 7700, 13, 13, 1678, 822, 4770, 657, 29918, 22062, 839, 29918, 4906, 29898, 1311, 29892, 1121, 29922, 8516, 29897, 1599, 851, 29901, 13, 4706, 9995, 13, 4706, 16969, 278, 15877, 839, 2643, 13, 4706, 2448, 5779, 304, 1073, 2551, 4660, 304, 8814, 2927, 5149, 13, 4706, 9995, 13, 4706, 15877, 839, 29918, 4906, 353, 5124, 13, 4706, 565, 1583, 17255, 14940, 29918, 2780, 29901, 13, 9651, 15877, 839, 29918, 4906, 4619, 1583, 17255, 14940, 29918, 2780, 29889, 1767, 13, 4706, 25342, 1121, 338, 451, 6213, 29901, 13, 9651, 15877, 839, 29918, 4906, 4619, 313, 13, 18884, 1583, 17255, 2914, 29918, 27703, 29961, 2914, 1822, 1767, 13, 18884, 565, 1121, 297, 1583, 17255, 2914, 29918, 27703, 13, 18884, 1683, 1583, 17255, 2914, 29918, 27703, 29961, 1311, 17255, 9902, 29961, 2914, 29962, 1822, 1767, 13, 9651, 1723, 13, 13, 4706, 565, 1583, 17255, 7042, 29918, 2780, 29901, 13, 9651, 15877, 839, 29918, 4906, 4619, 1583, 17255, 7042, 29918, 2780, 29889, 1767, 13, 13, 4706, 565, 1583, 17255, 9783, 29901, 13, 9651, 363, 3114, 297, 1583, 17255, 9783, 29901, 13, 18884, 15877, 839, 29918, 4906, 4619, 3114, 29889, 1767, 13, 13, 4706, 15877, 839, 29918, 4906, 4619, 679, 29918, 8698, 29918, 13506, 29898, 2914, 29897, 13, 4706, 15877, 839, 29918, 4906, 4619, 1583, 17255, 4906, 13, 13, 4706, 565, 1583, 17255, 2962, 287, 322, 1583, 17255, 2541, 29918, 5481, 567, 275, 29901, 13, 9651, 15877, 839, 29918, 4906, 4619, 376, 17794, 13, 13, 4706, 15877, 839, 29918, 4906, 4619, 1583, 17255, 4906, 29918, 2490, 5878, 29889, 657, 29898, 13, 9651, 1121, 29892, 1583, 17255, 4906, 29918, 2490, 5878, 29889, 657, 29898, 1311, 17255, 9902, 29961, 2914, 1402, 20569, 13, 4706, 1723, 13, 13, 4706, 15877, 839, 29918, 4906, 4619, 19191, 29889, 11794, 29889, 1767, 13, 13, 4706, 736, 15877, 839, 29918, 4906, 13, 13, 1678, 822, 411, 29918, 6341, 29918, 2914, 29898, 1311, 29892, 1121, 29892, 338, 29918, 8698, 29901, 6120, 29897, 1599, 4721, 4349, 5709, 4040, 1639, 29901, 13, 4706, 9995, 13, 4706, 29408, 2888, 1121, 20890, 13, 4706, 830, 339, 2658, 5023, 310, 3692, 372, 338, 263, 376, 8698, 29908, 470, 451, 13, 4706, 11662, 6058, 501, 1660, 376, 29900, 29908, 470, 376, 29896, 29908, 3339, 15673, 448, 6093, 29979, 399, 24071, 4810, 2208, 22027, 22659, 15676, 29914, 25717, 13, 4706, 9995, 13, 4706, 1583, 17255, 9902, 29961, 2914, 29962, 353, 338, 29918, 8698, 13, 4706, 736, 1583, 13, 13, 1678, 822, 411, 29918, 5481, 567, 275, 29898, 1311, 29892, 3160, 29901, 6120, 353, 5852, 29897, 1599, 4721, 4349, 5709, 4040, 1639, 29901, 13, 4706, 9995, 13, 4706, 512, 2325, 22434, 567, 275, 373, 1369, 29892, 470, 451, 13, 4706, 9995, 13, 4706, 1583, 17255, 2541, 29918, 5481, 567, 275, 353, 3160, 13, 4706, 736, 1583, 13, 13, 1678, 822, 411, 29918, 14940, 29918, 2780, 29898, 1311, 29892, 2927, 29901, 9159, 29897, 1599, 4721, 4349, 5709, 4040, 1639, 29901, 13, 4706, 9995, 13, 4706, 29849, 1596, 297, 445, 2927, 13, 4706, 9995, 13, 4706, 1583, 17255, 14940, 29918, 2780, 353, 2927, 13, 4706, 736, 1583, 13, 13, 1678, 396, 282, 2904, 524, 29901, 11262, 29922, 12313, 29899, 20621, 362, 13, 1678, 822, 411, 29918, 2780, 29918, 1454, 29918, 2914, 29898, 1311, 29892, 1121, 29892, 2927, 29901, 9159, 29897, 1599, 4721, 4349, 5709, 4040, 1639, 29901, 13, 4706, 9995, 13, 4706, 317, 1691, 278, 1962, 2927, 363, 263, 2183, 2933, 13, 4706, 9995, 13, 13, 4706, 1583, 17255, 2914, 29918, 27703, 29961, 2914, 29962, 353, 2927, 13, 4706, 736, 1583, 13, 13, 1678, 822, 411, 29918, 4906, 29918, 2490, 5878, 29918, 1454, 29918, 2914, 29898, 13, 4706, 1583, 29892, 1121, 29892, 1400, 5878, 29901, 851, 13, 1678, 1723, 1599, 4721, 4349, 5709, 4040, 1639, 29901, 13, 4706, 9995, 13, 4706, 3462, 29879, 2643, 1400, 5878, 363, 363, 2183, 1121, 29892, 321, 29889, 29887, 29889, 376, 26061, 304, 437, 1060, 29908, 470, 376, 29979, 9559, 29908, 13, 4706, 9995, 13, 4706, 1583, 17255, 4906, 29918, 2490, 5878, 29961, 2914, 29962, 353, 1400, 5878, 13, 4706, 736, 1583, 13, 13, 1678, 822, 411, 29918, 7042, 29918, 2780, 29898, 1311, 29892, 3239, 29901, 16585, 29897, 1599, 4721, 4349, 5709, 4040, 1639, 29901, 13, 4706, 9995, 13, 4706, 317, 1691, 278, 3239, 2927, 13, 4706, 9995, 13, 4706, 1583, 17255, 7042, 29918, 2780, 353, 3239, 13, 4706, 736, 1583, 13, 13, 1678, 822, 411, 29918, 1220, 29918, 2548, 29898, 1311, 29892, 1196, 29918, 2548, 29901, 851, 29897, 1599, 4721, 4349, 5709, 4040, 1639, 29901, 13, 4706, 9995, 13, 4706, 317, 1691, 278, 1196, 17140, 304, 1596, 13, 4706, 9995, 13, 4706, 1583, 17255, 1220, 29918, 2548, 353, 1196, 29918, 2548, 13, 4706, 736, 1583, 13, 13, 1678, 822, 411, 29918, 9783, 29898, 1311, 29892, 11949, 29901, 1051, 29897, 1599, 4721, 4349, 5709, 4040, 1639, 29901, 13, 4706, 9995, 13, 4706, 317, 1691, 11949, 304, 1596, 278, 2643, 411, 13, 4706, 9995, 13, 4706, 1583, 17255, 9783, 4619, 11949, 13, 4706, 736, 1583, 13, 13, 1678, 822, 1596, 29918, 4906, 29898, 1311, 29892, 304, 29918, 957, 3539, 29901, 6120, 353, 7700, 29892, 1121, 29922, 8516, 29897, 1599, 6213, 29901, 13, 4706, 9995, 13, 4706, 1588, 9466, 278, 2643, 13, 4706, 960, 304, 26556, 29892, 674, 671, 263, 23840, 736, 2012, 310, 25899, 13, 4706, 317, 1682, 3947, 287, 508, 884, 367, 6790, 29892, 304, 1209, 1549, 363, 15998, 13, 4706, 9995, 13, 4706, 1196, 29918, 2548, 353, 6634, 29878, 29908, 565, 304, 29918, 957, 3539, 1683, 1583, 17255, 1220, 29918, 2548, 13, 4706, 1596, 29898, 1311, 17255, 657, 29918, 22062, 839, 29918, 4906, 29898, 2914, 511, 1095, 29922, 1220, 29918, 2548, 29892, 28371, 29922, 5574, 29897, 13, 13, 1678, 822, 1596, 29918, 2962, 29898, 1311, 29897, 1599, 4721, 4349, 5709, 4040, 1639, 29901, 13, 4706, 9995, 13, 4706, 1588, 9466, 278, 6257, 2643, 13, 4706, 9995, 13, 4706, 1583, 17255, 2962, 287, 353, 5852, 13, 4706, 1583, 29889, 2158, 29918, 4906, 29898, 5574, 29897, 13, 4706, 736, 1583, 13, 13, 1678, 822, 1596, 29918, 8835, 29898, 1311, 29892, 14792, 29901, 6120, 353, 5852, 1125, 13, 4706, 9995, 13, 4706, 13905, 278, 8676, 2643, 29892, 363, 263, 2183, 2551, 4660, 13, 4706, 9995, 13, 4706, 1583, 29889, 2158, 29918, 4906, 29898, 2914, 29922, 29879, 1682, 3947, 287, 29897, 13, 13, 13, 1753, 19909, 29918, 13193, 29898, 2311, 29901, 938, 29892, 25557, 29901, 851, 353, 376, 29933, 1159, 1599, 851, 29901, 13, 1678, 9995, 13, 1678, 1588, 9466, 2159, 310, 934, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 2159, 584, 938, 13, 4706, 2648, 2167, 304, 3402, 13, 1678, 25557, 2433, 29933, 29915, 584, 851, 13, 4706, 1724, 304, 1596, 1156, 278, 22717, 10944, 13, 1678, 9995, 13, 1678, 363, 5190, 297, 6796, 613, 376, 29968, 29875, 613, 376, 29924, 29875, 613, 376, 26074, 613, 376, 29911, 29875, 613, 376, 12197, 613, 376, 29923, 29875, 613, 376, 29999, 29875, 3108, 29901, 13, 4706, 565, 6425, 29898, 2311, 29897, 529, 29871, 29896, 29900, 29906, 29946, 29889, 29900, 29901, 13, 9651, 736, 11860, 29941, 29889, 29896, 29888, 29995, 29879, 29995, 29879, 29908, 1273, 313, 2311, 29892, 5190, 29892, 25557, 29897, 13, 4706, 2159, 847, 29922, 29871, 29896, 29900, 29906, 29946, 29889, 29900, 13, 1678, 736, 11860, 29889, 29896, 29888, 29995, 29879, 29995, 29879, 29908, 1273, 313, 2311, 29892, 376, 29979, 29875, 613, 25557, 29897, 13, 2 ]
courses/data_analysis/deepdive/composer-exercises/subdag_example_solution.py
pranaynanda/training-data-analyst
0
26650
"""Solution for subdag_example.py. Uses a factory function to return a DAG that can be used as the subdag argument to SubDagOperator. Notice that: 1) the SubDAG's dag_id is formatted as parent_dag_id.subdag_task_id 2) the start_date and schedule_interval of the SubDAG are copied from the parent DAG. """ from airflow import DAG from airflow.contrib.operators.gcs_download_operator import GoogleCloudStorageDownloadOperator from airflow.operators.bash_operator import BashOperator from airflow.operators.dummy_operator import DummyOperator from airflow.operators.subdag_operator import SubDagOperator from datetime import datetime, timedelta YESTERDAY = datetime.combine(datetime.today() - timedelta(days=1), datetime.min.time()) default_args = { 'owner': 'airflow', 'depends_on_past': False, 'start_date': YESTERDAY, 'email_on_failure': False, 'email_on_retry': False, 'retries': 1, 'retry_delay': timedelta(minutes=5), } def shakespeare_subdag(parent_dag, subdag_task_id, play_name): with DAG('{}.{}'.format(parent_dag.dag_id, subdag_task_id), schedule_interval=parent_dag.schedule_interval, start_date=parent_dag.start_date, default_args=parent_dag.default_args) as subdag: download = GoogleCloudStorageDownloadOperator( task_id='download', bucket='smenyc2018-subdag-data', object='{}.enc'.format(play_name), filename='/home/airflow/gcs/data/{}.enc'.format(play_name)) decrypt = BashOperator( task_id='decrypt', bash_command= 'openssl enc -in /home/airflow/gcs/data/{play_name}.enc ' '-out /home/airflow/gcs/data/{play_name}.txt -d -aes-128-cbc -k "hello-nyc"' .format(play_name=play_name)) wordcount = BashOperator( task_id='wordcount', bash_command= 'wc -w /home/airflow/gcs/data/{play_name}.txt | tee /home/airflow/gcs/data/{play_name}_wordcount.txt' .format(play_name=play_name)) download >> decrypt >> wordcount return subdag with DAG('subdag_example_solution', default_args=default_args, catchup=False) as dag: start = DummyOperator(task_id='start') start >> SubDagOperator(task_id='process_romeo', subdag=shakespeare_subdag(dag, 'process_romeo', 'romeo')) start >> SubDagOperator(task_id='process_othello', subdag=shakespeare_subdag(dag, 'process_othello', 'othello')) start >> SubDagOperator(task_id='process_hamlet', subdag=shakespeare_subdag(dag, 'process_hamlet', 'hamlet')) start >> SubDagOperator(task_id='process_macbeth', subdag=shakespeare_subdag(dag, 'process_macbeth', 'macbeth'))
[ 1, 9995, 13296, 918, 363, 1014, 24157, 29918, 4773, 29889, 2272, 29889, 13, 13, 15922, 267, 263, 12529, 740, 304, 736, 263, 360, 10051, 393, 508, 367, 1304, 408, 278, 1014, 24157, 2980, 13, 517, 3323, 29928, 351, 26486, 29889, 16393, 393, 29901, 13, 29896, 29897, 278, 3323, 7698, 29954, 29915, 29879, 12136, 29918, 333, 338, 20917, 408, 3847, 29918, 24157, 29918, 333, 29889, 1491, 24157, 29918, 7662, 29918, 333, 13, 29906, 29897, 278, 1369, 29918, 1256, 322, 20410, 29918, 19207, 310, 278, 3323, 7698, 29954, 526, 13746, 515, 278, 3847, 13, 259, 360, 10051, 29889, 13, 15945, 29908, 13, 3166, 4799, 1731, 1053, 360, 10051, 13, 3166, 4799, 1731, 29889, 21570, 29889, 3372, 4097, 29889, 29887, 2395, 29918, 10382, 29918, 6891, 1053, 5087, 20442, 10486, 22954, 26486, 13, 3166, 4799, 1731, 29889, 3372, 4097, 29889, 13067, 29918, 6891, 1053, 29677, 26486, 13, 3166, 4799, 1731, 29889, 3372, 4097, 29889, 29881, 11770, 29918, 6891, 1053, 360, 11770, 26486, 13, 3166, 4799, 1731, 29889, 3372, 4097, 29889, 1491, 24157, 29918, 6891, 1053, 3323, 29928, 351, 26486, 13, 13, 3166, 12865, 1053, 12865, 29892, 5335, 287, 2554, 13, 13, 29979, 29923, 1254, 1001, 28658, 353, 12865, 29889, 17743, 457, 29898, 12673, 29889, 27765, 580, 448, 5335, 287, 2554, 29898, 16700, 29922, 29896, 511, 13, 462, 632, 12865, 29889, 1195, 29889, 2230, 3101, 13, 13, 4381, 29918, 5085, 353, 426, 13, 1678, 525, 20348, 2396, 525, 1466, 1731, 742, 13, 1678, 525, 2716, 1975, 29918, 265, 29918, 29886, 579, 2396, 7700, 29892, 13, 1678, 525, 2962, 29918, 1256, 2396, 612, 29923, 1254, 1001, 28658, 29892, 13, 1678, 525, 5269, 29918, 265, 29918, 14057, 545, 2396, 7700, 29892, 13, 1678, 525, 5269, 29918, 265, 29918, 276, 2202, 2396, 7700, 29892, 13, 1678, 525, 2267, 2722, 2396, 29871, 29896, 29892, 13, 1678, 525, 276, 2202, 29918, 18829, 2396, 5335, 287, 2554, 29898, 1195, 2667, 29922, 29945, 511, 13, 29913, 13, 13, 13, 1753, 528, 21273, 598, 29918, 1491, 24157, 29898, 3560, 29918, 24157, 29892, 1014, 24157, 29918, 7662, 29918, 333, 29892, 1708, 29918, 978, 1125, 13, 1678, 411, 360, 10051, 877, 29912, 1836, 8875, 4286, 4830, 29898, 3560, 29918, 24157, 29889, 24157, 29918, 333, 29892, 1014, 24157, 29918, 7662, 29918, 333, 511, 13, 632, 20410, 29918, 19207, 29922, 3560, 29918, 24157, 29889, 816, 11272, 29918, 19207, 29892, 13, 632, 1369, 29918, 1256, 29922, 3560, 29918, 24157, 29889, 2962, 29918, 1256, 29892, 13, 632, 2322, 29918, 5085, 29922, 3560, 29918, 24157, 29889, 4381, 29918, 5085, 29897, 408, 1014, 24157, 29901, 13, 4706, 5142, 353, 5087, 20442, 10486, 22954, 26486, 29898, 13, 9651, 3414, 29918, 333, 2433, 10382, 742, 13, 9651, 20968, 2433, 29879, 1527, 11078, 29906, 29900, 29896, 29947, 29899, 1491, 24157, 29899, 1272, 742, 13, 9651, 1203, 2433, 29912, 1836, 3977, 4286, 4830, 29898, 1456, 29918, 978, 511, 13, 9651, 10422, 2433, 29914, 5184, 29914, 1466, 1731, 29914, 29887, 2395, 29914, 1272, 19248, 1836, 3977, 4286, 4830, 29898, 1456, 29918, 978, 876, 13, 4706, 1602, 4641, 353, 29677, 26486, 29898, 13, 9651, 3414, 29918, 333, 2433, 7099, 4641, 742, 13, 9651, 10891, 29918, 6519, 29922, 13, 9651, 525, 22156, 2536, 2094, 448, 262, 847, 5184, 29914, 1466, 1731, 29914, 29887, 2395, 29914, 1272, 19248, 1456, 29918, 978, 1836, 3977, 525, 13, 9651, 17411, 449, 847, 5184, 29914, 1466, 1731, 29914, 29887, 2395, 29914, 1272, 19248, 1456, 29918, 978, 1836, 3945, 448, 29881, 448, 28628, 29899, 29896, 29906, 29947, 29899, 10702, 29883, 448, 29895, 376, 12199, 29899, 1460, 29883, 29908, 29915, 13, 9651, 869, 4830, 29898, 1456, 29918, 978, 29922, 1456, 29918, 978, 876, 13, 4706, 1734, 2798, 353, 29677, 26486, 29898, 13, 9651, 3414, 29918, 333, 2433, 1742, 2798, 742, 13, 9651, 10891, 29918, 6519, 29922, 13, 9651, 525, 29893, 29883, 448, 29893, 847, 5184, 29914, 1466, 1731, 29914, 29887, 2395, 29914, 1272, 19248, 1456, 29918, 978, 1836, 3945, 891, 734, 29872, 847, 5184, 29914, 1466, 1731, 29914, 29887, 2395, 29914, 1272, 19248, 1456, 29918, 978, 2403, 1742, 2798, 29889, 3945, 29915, 13, 9651, 869, 4830, 29898, 1456, 29918, 978, 29922, 1456, 29918, 978, 876, 13, 4706, 5142, 5099, 1602, 4641, 5099, 1734, 2798, 13, 1678, 736, 1014, 24157, 13, 13, 13, 2541, 360, 10051, 877, 1491, 24157, 29918, 4773, 29918, 2929, 918, 742, 2322, 29918, 5085, 29922, 4381, 29918, 5085, 29892, 13, 308, 4380, 786, 29922, 8824, 29897, 408, 12136, 29901, 13, 1678, 1369, 353, 360, 11770, 26486, 29898, 7662, 29918, 333, 2433, 2962, 1495, 13, 1678, 1369, 5099, 3323, 29928, 351, 26486, 29898, 7662, 29918, 333, 2433, 5014, 29918, 4871, 29877, 742, 13, 462, 9651, 1014, 24157, 29922, 845, 21273, 598, 29918, 1491, 24157, 29898, 24157, 29892, 525, 5014, 29918, 4871, 29877, 742, 13, 462, 462, 462, 418, 525, 4871, 29877, 8785, 13, 1678, 1369, 5099, 3323, 29928, 351, 26486, 29898, 7662, 29918, 333, 2433, 5014, 29918, 720, 3156, 742, 13, 462, 9651, 1014, 24157, 29922, 845, 21273, 598, 29918, 1491, 24157, 29898, 24157, 29892, 525, 5014, 29918, 720, 3156, 742, 13, 462, 462, 462, 418, 525, 720, 3156, 8785, 13, 1678, 1369, 5099, 3323, 29928, 351, 26486, 29898, 7662, 29918, 333, 2433, 5014, 29918, 3391, 1026, 742, 13, 462, 9651, 1014, 24157, 29922, 845, 21273, 598, 29918, 1491, 24157, 29898, 24157, 29892, 525, 5014, 29918, 3391, 1026, 742, 13, 462, 462, 462, 418, 525, 3391, 1026, 8785, 13, 1678, 1369, 5099, 3323, 29928, 351, 26486, 29898, 7662, 29918, 333, 2433, 5014, 29918, 8628, 29890, 621, 742, 13, 462, 9651, 1014, 24157, 29922, 845, 21273, 598, 29918, 1491, 24157, 29898, 24157, 29892, 525, 5014, 29918, 8628, 29890, 621, 742, 13, 462, 462, 462, 418, 525, 8628, 29890, 621, 8785, 13, 2 ]
core-python/Core_Python/exception/ExceptionMethods.py
theumang100/tutorials-1
9
140078
<filename>core-python/Core_Python/exception/ExceptionMethods.py ''' e. and use all methods ''' ''' also try different exception like java file,array,string,numberformat ''' ''' user define exception ''' try: raise Exception('spam,','eggs') except Exception as inst: print("Type of instance : ",type(inst)) # the exception instance print("Arguments of instance : ",inst.args) # arguments stored in .args print("Instance print : ",inst) # __str__ allows args to be printed directly,but may be overridden in exception subclasses a,b = inst.args # unpack args print("a : ",a) print("b : ",b)
[ 1, 529, 9507, 29958, 3221, 29899, 4691, 29914, 9203, 29918, 11980, 29914, 11739, 29914, 2451, 26112, 29889, 2272, 13, 12008, 321, 29889, 322, 671, 599, 3519, 14550, 13, 12008, 884, 1018, 1422, 3682, 763, 2115, 934, 29892, 2378, 29892, 1807, 29892, 4537, 4830, 14550, 13, 12008, 1404, 4529, 3682, 14550, 13, 13, 2202, 29901, 13, 1678, 12020, 8960, 877, 1028, 314, 29892, 3788, 387, 3174, 1495, 13, 19499, 8960, 408, 832, 29901, 13, 1678, 1596, 703, 1542, 310, 2777, 584, 9162, 1853, 29898, 2611, 876, 396, 278, 3682, 2777, 13, 1678, 1596, 703, 26915, 310, 2777, 584, 9162, 2611, 29889, 5085, 29897, 396, 6273, 6087, 297, 869, 5085, 13, 1678, 1596, 703, 4998, 1596, 584, 9162, 2611, 29897, 396, 4770, 710, 1649, 6511, 6389, 304, 367, 13350, 4153, 29892, 4187, 1122, 367, 20831, 1145, 297, 3682, 1014, 13203, 13, 1678, 263, 29892, 29890, 353, 832, 29889, 5085, 396, 443, 4058, 6389, 13, 1678, 1596, 703, 29874, 584, 9162, 29874, 29897, 13, 1678, 1596, 703, 29890, 584, 9162, 29890, 29897, 2 ]
DB_Repository_Subscriber.py
twelveand0/github-crawler
3
1610771
#!/usr/bin/python # -*- coding: UTF-8 -*- import github import db_operation import datetime class DB_Repository_Subscriber: """ This class represents DB_Repository_Subscriber as a class describles subscription-ship between \ github.Repository.Repository and github.NamedUser.NamedUser """ repo = None subscriber = None db = None table = "Repository_Subscriber" def __init__(self, repo, subscriber, db): self.repo = repo self.subscriber = subscriber self.db = db def open_if_connection_closed(self): try: if self.db is None: return False if self.db.open == 0: self.db = db_operation.connect_to_db_simple() if self.db is None: return False return True except Exception, e: print e return False def save(self): try: if self.open_if_connection_closed() == False: return False if self.exist(): return True sql = "insert into %s (%s, %s) values (%d, %d)"%(self.table, "repository", "subscriber", self.repo.id, self.subscriber.id) cursor = self.db.cursor() cursor.execute(sql) self.db.commit() return True except Exception as e: print e return False def exist(self): try: if self.open_if_connection_closed() == False: return False cursor = self.db.cursor() sql = "select count(*) from %s where repository=%d && subscriber=%d;"%(self.table, self.repo.id, self.subscriber.id) cursor.execute(sql) result = cursor.fetchall() if result[0][0] == 0: return False return True except Exception as e: print e return False
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 30004, 13, 29937, 448, 29930, 29899, 14137, 29901, 18351, 29899, 29947, 448, 29930, 29899, 30004, 13, 30004, 13, 5215, 18546, 30004, 13, 5215, 4833, 29918, 16453, 30004, 13, 5215, 12865, 30004, 13, 30004, 13, 30004, 13, 1990, 6535, 29918, 11481, 29918, 4035, 7588, 495, 29901, 30004, 13, 1678, 9995, 30004, 13, 4706, 910, 770, 11524, 6535, 29918, 11481, 29918, 4035, 7588, 495, 408, 263, 770, 2342, 7586, 25691, 29899, 3527, 1546, 320, 30004, 13, 4706, 18546, 29889, 11481, 29889, 11481, 322, 18546, 29889, 22175, 2659, 29889, 22175, 2659, 30004, 13, 1678, 9995, 30004, 13, 30004, 13, 1678, 13761, 353, 6213, 30004, 13, 1678, 21696, 495, 353, 6213, 30004, 13, 1678, 4833, 353, 6213, 30004, 13, 1678, 1591, 353, 376, 11481, 29918, 4035, 7588, 495, 19451, 13, 30004, 13, 30004, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 13761, 29892, 21696, 495, 29892, 4833, 1125, 30004, 13, 4706, 1583, 29889, 20095, 353, 13761, 30004, 13, 4706, 1583, 29889, 1491, 7588, 495, 353, 21696, 495, 30004, 13, 4706, 1583, 29889, 2585, 353, 4833, 30004, 13, 30004, 13, 1678, 6756, 13, 1678, 822, 1722, 29918, 361, 29918, 9965, 29918, 15603, 29898, 1311, 1125, 30004, 13, 4706, 1018, 29901, 30004, 13, 30004, 13, 9651, 565, 1583, 29889, 2585, 338, 6213, 29901, 30004, 13, 18884, 736, 7700, 30004, 13, 30004, 13, 9651, 565, 1583, 29889, 2585, 29889, 3150, 1275, 29871, 29900, 29901, 30004, 13, 18884, 1583, 29889, 2585, 353, 4833, 29918, 16453, 29889, 6915, 29918, 517, 29918, 2585, 29918, 12857, 26471, 13, 9651, 6756, 13, 18884, 565, 1583, 29889, 2585, 338, 6213, 29901, 30004, 13, 462, 1678, 736, 7700, 30004, 13, 4706, 6756, 13, 9651, 736, 5852, 30004, 13, 30004, 13, 4706, 5174, 8960, 29892, 321, 29901, 30004, 13, 9651, 1596, 321, 30004, 13, 9651, 736, 7700, 30004, 13, 30004, 13, 30004, 13, 1678, 822, 4078, 29898, 1311, 1125, 30004, 13, 4706, 1018, 29901, 30004, 13, 30004, 13, 9651, 565, 1583, 29889, 3150, 29918, 361, 29918, 9965, 29918, 15603, 580, 1275, 7700, 29901, 30004, 13, 18884, 736, 7700, 30004, 13, 9651, 6756, 13, 9651, 565, 1583, 29889, 28997, 7295, 30004, 13, 18884, 736, 5852, 30004, 13, 30004, 13, 9651, 4576, 353, 376, 7851, 964, 1273, 29879, 313, 29995, 29879, 29892, 1273, 29879, 29897, 1819, 313, 29995, 29881, 29892, 1273, 29881, 5513, 29995, 29898, 1311, 29889, 2371, 29892, 376, 19033, 613, 376, 1491, 7588, 495, 613, 1583, 29889, 20095, 29889, 333, 29892, 1583, 29889, 1491, 7588, 495, 29889, 333, 8443, 13, 30004, 13, 9651, 10677, 353, 1583, 29889, 2585, 29889, 18127, 26471, 13, 30004, 13, 9651, 10677, 29889, 7978, 29898, 2850, 8443, 13, 30004, 13, 9651, 1583, 29889, 2585, 29889, 15060, 26471, 13, 30004, 13, 9651, 736, 5852, 30004, 13, 4706, 6756, 13, 4706, 5174, 8960, 408, 321, 29901, 30004, 13, 9651, 1596, 321, 30004, 13, 9651, 736, 7700, 30004, 13, 30004, 13, 30004, 13, 1678, 822, 1863, 29898, 1311, 1125, 30004, 13, 4706, 1018, 29901, 30004, 13, 30004, 13, 9651, 565, 1583, 29889, 3150, 29918, 361, 29918, 9965, 29918, 15603, 580, 1275, 7700, 29901, 30004, 13, 18884, 736, 7700, 30004, 13, 9651, 6756, 13, 9651, 10677, 353, 1583, 29889, 2585, 29889, 18127, 26471, 13, 30004, 13, 9651, 4576, 353, 376, 2622, 2302, 22798, 515, 1273, 29879, 988, 9810, 16328, 29881, 2607, 21696, 495, 16328, 29881, 15458, 29995, 29898, 1311, 29889, 2371, 29892, 1583, 29889, 20095, 29889, 333, 29892, 1583, 29889, 1491, 7588, 495, 29889, 333, 8443, 13, 30004, 13, 9651, 10677, 29889, 7978, 29898, 2850, 8443, 13, 30004, 13, 9651, 1121, 353, 10677, 29889, 9155, 497, 26471, 13, 30004, 13, 9651, 565, 1121, 29961, 29900, 3816, 29900, 29962, 1275, 29871, 29900, 29901, 30004, 13, 18884, 736, 7700, 30004, 13, 9651, 6756, 13, 9651, 736, 5852, 30004, 13, 30004, 13, 4706, 5174, 8960, 408, 321, 29901, 30004, 13, 9651, 1596, 321, 30004, 13, 9651, 736, 7700, 2 ]
tests/auto/bindings/python/moleculetest.py
quizzmaster/chemkit
34
103884
<filename>tests/auto/bindings/python/moleculetest.py<gh_stars>10-100 ############################################################################### ## ## Copyright (C) 2009-2012 <NAME> <<EMAIL>> ## All rights reserved. ## ## This file is a part of the chemkit project. For more information ## see <http://www.chemkit.org>. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of the chemkit project nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ############################################################################### import chemkit import unittest class MoleculeTest(unittest.TestCase): def test_atom(self): molecule = chemkit.Molecule() C1 = molecule.addAtom("C") self.assertEqual(C1.atomicNumber(), 6) C2 = molecule.addAtom(6) self.assertEqual(C2.atomicNumber(), 6) C3 = molecule.addAtom(chemkit.Atom.Carbon) self.assertEqual(C3.atomicNumber(), 6) self.assertEqual(molecule.atomCount(), 3) self.assertEqual(molecule.formula(), "C3") def test_bond(self): molecule = chemkit.Molecule() self.assertEqual(molecule.bondCount(), 0) C1 = molecule.addAtom("C") C2 = molecule.addAtom("C") C3 = molecule.addAtom("C") C1_C2 = molecule.addBond(C1, C2) self.assertEqual(molecule.bondCount(), 1) C2_C3 = molecule.addBond(C2, C3, 2) self.assertEqual(molecule.bondCount(), 2) self.assertEqual(C2_C3.order(), 2) def test_formula(self): # empty molecule empty = chemkit.Molecule() self.assertEqual(empty.formula(), "") # ethanol molecule ethanol = chemkit.Molecule() C1 = ethanol.addAtom("C") C2 = ethanol.addAtom("C") O3 = ethanol.addAtom("O") ethanol.addBond(C1, C2) ethanol.addBond(C2, O3) for atom in ethanol.atoms(): while(atom.formalCharge() < 0): hydrogen = ethanol.addAtom("H") ethanol.addBond(atom, hydrogen) self.assertEqual(ethanol.formula(), "C2H6O") def test_rings(self): # benzene molecule benzene = chemkit.Molecule("c1ccccc1", "smiles") self.assertEqual(benzene.formula(), "C6H6") self.assertEqual(benzene.ringCount(), 1) ring = benzene.ring(0) self.assertEqual(ring.size(), 6) if __name__ == '__main__': unittest.main()
[ 1, 529, 9507, 29958, 21150, 29914, 6921, 29914, 5355, 886, 29914, 4691, 29914, 29885, 1772, 4979, 1026, 342, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 13383, 13383, 13383, 13383, 7346, 4136, 2277, 29937, 13, 2277, 13, 2277, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29900, 29929, 29899, 29906, 29900, 29896, 29906, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 2277, 2178, 10462, 21676, 29889, 13, 2277, 13, 2277, 910, 934, 338, 263, 760, 310, 278, 8950, 7354, 2060, 29889, 1152, 901, 2472, 13, 2277, 1074, 529, 1124, 597, 1636, 29889, 14969, 7354, 29889, 990, 15513, 13, 2277, 13, 2277, 4367, 391, 3224, 322, 671, 297, 2752, 322, 7581, 7190, 29892, 411, 470, 1728, 13, 2277, 21733, 29892, 526, 21905, 4944, 393, 278, 1494, 5855, 13, 2277, 526, 1539, 29901, 13, 2277, 13, 2277, 259, 334, 4367, 391, 3224, 29879, 310, 2752, 775, 1818, 11551, 278, 2038, 3509, 1266, 13, 2277, 268, 8369, 29892, 445, 1051, 310, 5855, 322, 278, 1494, 2313, 433, 4193, 29889, 13, 2277, 259, 334, 4367, 391, 3224, 29879, 297, 7581, 883, 1818, 18532, 278, 2038, 3509, 1266, 13, 2277, 268, 8369, 29892, 445, 1051, 310, 5855, 322, 278, 1494, 2313, 433, 4193, 297, 278, 13, 2277, 268, 5106, 322, 29914, 272, 916, 17279, 4944, 411, 278, 4978, 29889, 13, 2277, 259, 334, 2448, 2121, 278, 1024, 310, 278, 8950, 7354, 2060, 3643, 278, 2983, 310, 967, 13, 2277, 268, 17737, 29560, 1122, 367, 1304, 304, 1095, 272, 344, 470, 27391, 9316, 10723, 13, 2277, 268, 515, 445, 7047, 1728, 2702, 7536, 3971, 10751, 29889, 13, 2277, 13, 2277, 3446, 3235, 7791, 7818, 12982, 1525, 8519, 13756, 13044, 3352, 6770, 6093, 315, 4590, 29979, 22789, 3912, 379, 5607, 8032, 29903, 5300, 8707, 29911, 3960, 29933, 2692, 24125, 13, 2277, 376, 3289, 8519, 29908, 5300, 13764, 29979, 8528, 15094, 1799, 6323, 306, 3580, 5265, 3352, 399, 1718, 29934, 13566, 29059, 29892, 2672, 6154, 15789, 4214, 29892, 350, 2692, 6058, 13, 2277, 27848, 3352, 7495, 29892, 6093, 306, 3580, 5265, 3352, 399, 1718, 29934, 13566, 29059, 8079, 341, 1001, 3210, 13566, 2882, 6227, 11937, 5300, 383, 1806, 8186, 1799, 15842, 13, 2277, 319, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 319, 1525, 28657, 13875, 8890, 29928, 29889, 2672, 11698, 382, 29963, 3919, 24972, 9818, 6093, 315, 4590, 29979, 22789, 3912, 13, 2277, 438, 29956, 13865, 6323, 8707, 29911, 3960, 29933, 2692, 24125, 20700, 17705, 6181, 15842, 13764, 29979, 22471, 26282, 29892, 2672, 4571, 26282, 29892, 2672, 29907, 1367, 3919, 1964, 29892, 13, 2277, 317, 4162, 8426, 1964, 29892, 8528, 29923, 3580, 29931, 19926, 29892, 6323, 8707, 1660, 13356, 3919, 25758, 21330, 1529, 1692, 29903, 313, 1177, 6154, 15789, 4214, 29892, 350, 2692, 6058, 13, 2277, 27848, 3352, 7495, 29892, 13756, 29907, 11499, 13780, 8079, 27092, 1254, 1806, 26027, 21947, 29949, 8452, 6323, 26996, 29963, 2965, 2890, 29936, 11247, 1799, 8079, 501, 1660, 29892, 13, 2277, 360, 8254, 29892, 6323, 13756, 29943, 1806, 29903, 29936, 6323, 350, 3308, 8895, 1799, 2672, 4945, 29934, 4897, 29911, 2725, 29897, 29832, 8851, 5348, 12766, 17171, 29928, 5300, 6732, 13764, 29979, 13, 2277, 6093, 18929, 8079, 17705, 2882, 6227, 11937, 29892, 12317, 2544, 4448, 2672, 8707, 29911, 4717, 1783, 29892, 6850, 3960, 1783, 17705, 2882, 6227, 11937, 29892, 6323, 323, 8476, 13, 2277, 313, 1177, 6154, 15789, 4214, 405, 11787, 5265, 24647, 4741, 6323, 438, 29911, 4448, 22119, 1660, 29897, 9033, 3235, 4214, 2672, 13764, 29979, 399, 29909, 29979, 19474, 8079, 6093, 501, 1660, 13, 2277, 8079, 3446, 3235, 7791, 7818, 12982, 1525, 29892, 382, 29963, 1430, 10762, 11033, 18118, 1660, 29928, 8079, 6093, 21521, 1799, 8979, 6227, 11937, 8079, 20134, 3210, 21330, 1529, 1692, 29889, 13, 2277, 13, 13383, 13383, 13383, 13383, 7346, 4136, 2277, 29937, 13, 13, 5215, 8950, 7354, 13, 5215, 443, 27958, 13, 13, 1990, 341, 1772, 29883, 1297, 3057, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 8678, 29898, 1311, 1125, 13, 4706, 13206, 29883, 1297, 353, 8950, 7354, 29889, 29924, 1772, 29883, 1297, 580, 13, 4706, 315, 29896, 353, 13206, 29883, 1297, 29889, 1202, 4178, 290, 703, 29907, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29907, 29896, 29889, 21641, 4557, 3285, 29871, 29953, 29897, 13, 4706, 315, 29906, 353, 13206, 29883, 1297, 29889, 1202, 4178, 290, 29898, 29953, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29907, 29906, 29889, 21641, 4557, 3285, 29871, 29953, 29897, 13, 4706, 315, 29941, 353, 13206, 29883, 1297, 29889, 1202, 4178, 290, 29898, 14969, 7354, 29889, 4178, 290, 29889, 8179, 6718, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29907, 29941, 29889, 21641, 4557, 3285, 29871, 29953, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29885, 1772, 29883, 1297, 29889, 8678, 3981, 3285, 29871, 29941, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29885, 1772, 29883, 1297, 29889, 689, 2497, 3285, 376, 29907, 29941, 1159, 13, 13, 1678, 822, 1243, 29918, 29890, 898, 29898, 1311, 1125, 13, 4706, 13206, 29883, 1297, 353, 8950, 7354, 29889, 29924, 1772, 29883, 1297, 580, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29885, 1772, 29883, 1297, 29889, 29890, 898, 3981, 3285, 29871, 29900, 29897, 13, 4706, 315, 29896, 353, 13206, 29883, 1297, 29889, 1202, 4178, 290, 703, 29907, 1159, 13, 4706, 315, 29906, 353, 13206, 29883, 1297, 29889, 1202, 4178, 290, 703, 29907, 1159, 13, 4706, 315, 29941, 353, 13206, 29883, 1297, 29889, 1202, 4178, 290, 703, 29907, 1159, 13, 4706, 315, 29896, 29918, 29907, 29906, 353, 13206, 29883, 1297, 29889, 1202, 29933, 898, 29898, 29907, 29896, 29892, 315, 29906, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29885, 1772, 29883, 1297, 29889, 29890, 898, 3981, 3285, 29871, 29896, 29897, 13, 4706, 315, 29906, 29918, 29907, 29941, 353, 13206, 29883, 1297, 29889, 1202, 29933, 898, 29898, 29907, 29906, 29892, 315, 29941, 29892, 29871, 29906, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29885, 1772, 29883, 1297, 29889, 29890, 898, 3981, 3285, 29871, 29906, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29907, 29906, 29918, 29907, 29941, 29889, 2098, 3285, 29871, 29906, 29897, 13, 13, 1678, 822, 1243, 29918, 689, 2497, 29898, 1311, 1125, 13, 4706, 396, 4069, 13206, 29883, 1297, 13, 4706, 4069, 353, 8950, 7354, 29889, 29924, 1772, 29883, 1297, 580, 13, 4706, 1583, 29889, 9294, 9843, 29898, 6310, 29889, 689, 2497, 3285, 20569, 13, 13, 4706, 396, 11314, 273, 324, 13206, 29883, 1297, 13, 4706, 11314, 273, 324, 353, 8950, 7354, 29889, 29924, 1772, 29883, 1297, 580, 13, 4706, 315, 29896, 353, 11314, 273, 324, 29889, 1202, 4178, 290, 703, 29907, 1159, 13, 4706, 315, 29906, 353, 11314, 273, 324, 29889, 1202, 4178, 290, 703, 29907, 1159, 13, 4706, 438, 29941, 353, 11314, 273, 324, 29889, 1202, 4178, 290, 703, 29949, 1159, 13, 4706, 11314, 273, 324, 29889, 1202, 29933, 898, 29898, 29907, 29896, 29892, 315, 29906, 29897, 13, 4706, 11314, 273, 324, 29889, 1202, 29933, 898, 29898, 29907, 29906, 29892, 438, 29941, 29897, 13, 13, 4706, 363, 12301, 297, 11314, 273, 324, 29889, 271, 4835, 7295, 13, 9651, 1550, 29898, 8678, 29889, 689, 284, 5914, 479, 580, 529, 29871, 29900, 1125, 13, 18884, 17546, 1885, 353, 11314, 273, 324, 29889, 1202, 4178, 290, 703, 29950, 1159, 13, 18884, 11314, 273, 324, 29889, 1202, 29933, 898, 29898, 8678, 29892, 17546, 1885, 29897, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 621, 273, 324, 29889, 689, 2497, 3285, 376, 29907, 29906, 29950, 29953, 29949, 1159, 13, 13, 1678, 822, 1243, 29918, 29878, 886, 29898, 1311, 1125, 13, 4706, 396, 3856, 29920, 1600, 13206, 29883, 1297, 13, 4706, 3856, 29920, 1600, 353, 8950, 7354, 29889, 29924, 1772, 29883, 1297, 703, 29883, 29896, 617, 26854, 29896, 613, 376, 3844, 5475, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1785, 29920, 1600, 29889, 689, 2497, 3285, 376, 29907, 29953, 29950, 29953, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1785, 29920, 1600, 29889, 5393, 3981, 3285, 29871, 29896, 29897, 13, 4706, 9228, 353, 3856, 29920, 1600, 29889, 5393, 29898, 29900, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5393, 29889, 2311, 3285, 29871, 29953, 29897, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 2 ]
ckan_cloud_operator/drivers/kubectl/driver.py
MuhammadIsmailShahzad/ckan-cloud-operator
14
32763
from ckan_cloud_operator import kubectl def get(what, *args, required=True, namespace=None, get_cmd=None, **kwargs): return kubectl.get(what, *args, required=required, namespace=namespace, get_cmd=get_cmd, **kwargs)
[ 1, 515, 274, 11052, 29918, 9274, 29918, 6891, 1053, 413, 431, 522, 29880, 13, 13, 13, 1753, 679, 29898, 5816, 29892, 334, 5085, 29892, 3734, 29922, 5574, 29892, 7397, 29922, 8516, 29892, 679, 29918, 9006, 29922, 8516, 29892, 3579, 19290, 1125, 13, 1678, 736, 413, 431, 522, 29880, 29889, 657, 29898, 5816, 29892, 334, 5085, 29892, 3734, 29922, 12403, 29892, 7397, 29922, 22377, 29892, 679, 29918, 9006, 29922, 657, 29918, 9006, 29892, 3579, 19290, 29897, 13, 2 ]
python/testData/resolve/multiFile/keywordArgument/KeywordArgument.py
jnthn/intellij-community
2
1616609
from a import A print(A()) # <ref>
[ 1, 515, 263, 1053, 319, 13, 13, 2158, 29898, 29909, 3101, 13, 29937, 268, 529, 999, 29958, 13, 13, 2 ]
python/database/recover_database.py
coreyjadams/harvard_production
0
1616918
#!/usr/bin/env python import glob import os from database import DBUtil # This script traverses a list of files and recovers the sqlite3 database # It's not meant as a permanent solution, just a quick fix to a problem # that should go away soon. def recover_stage(top_dir, stage_name, dataset_name, root_pattern, ana_pattern, job_id, db_file): db = DBUtil(db_file) # walk through the directory list print("Search pattern: " + top_dir + "/{0}_*/".format(job_id)) list_of_directories = glob.glob(top_dir + "/{0}.*/".format(job_id)) print("Found {0} directories".format(len(list_of_directories))) for _dir in list_of_directories: # Get the root files and ana files: root_file = glob.glob(_dir + root_pattern) ana_file = glob.glob(_dir + ana_pattern) if len(root_file) < 1: print "Continuing" continue else: root_file = root_file[0] db.declare_file(dataset=dataset_name, filename=os.path.basename(root_file), location=_dir, stage=stage_name, status = 0, ftype=0, nevents=100) if len(ana_file) < 1: print "Continuing" continue else: ana_file = ana_file[0] db.declare_file(dataset=dataset_name, filename=os.path.basename(ana_file), location=_dir, stage=stage_name, status = 0, ftype=1, nevents=100) if __name__ == "__main__": top_dir = "/n/holylfs/LABS/guenette_lab/data/production/mcc8.6/single_pion/generation/" stage_name = "generation" dataset_name = "mcc8.6_single_pion" root_pattern = "prod_pions_0-2.0GeV_isotropic_uboone*_reco2.root" ana_pattern = "reco_stage_2_hist.root" job_id = 36597655 db_file = "/n/holylfs/LABS/guenette_lab/data/production/mcc8.6/single_pion/work/mcc8.6_single_pion.db" recover_stage(top_dir=top_dir, stage_name=stage_name, dataset_name=dataset_name, root_pattern = root_pattern, ana_pattern = ana_pattern, job_id = job_id, db_file = db_file)
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 5215, 13149, 13, 5215, 2897, 13, 13, 3166, 2566, 1053, 6535, 7270, 13, 13, 29937, 910, 2471, 13310, 267, 263, 1051, 310, 2066, 322, 337, 1111, 874, 278, 21120, 29941, 2566, 13, 29937, 739, 29915, 29879, 451, 6839, 408, 263, 17667, 1650, 29892, 925, 263, 4996, 2329, 304, 263, 1108, 13, 29937, 393, 881, 748, 3448, 4720, 29889, 13, 13, 1753, 9792, 29918, 19190, 29898, 3332, 29918, 3972, 29892, 7408, 29918, 978, 29892, 8783, 29918, 978, 29892, 13, 462, 29871, 3876, 29918, 11037, 29892, 385, 29874, 29918, 11037, 29892, 4982, 29918, 333, 29892, 13, 462, 29871, 4833, 29918, 1445, 1125, 13, 13, 1678, 4833, 353, 6535, 7270, 29898, 2585, 29918, 1445, 29897, 13, 13, 1678, 396, 6686, 1549, 278, 3884, 1051, 13, 1678, 1596, 703, 7974, 4766, 29901, 376, 718, 2246, 29918, 3972, 718, 5591, 29912, 29900, 2403, 3877, 1642, 4830, 29898, 9057, 29918, 333, 876, 13, 1678, 1051, 29918, 974, 29918, 11851, 3842, 353, 13149, 29889, 23705, 29898, 3332, 29918, 3972, 718, 5591, 29912, 29900, 1836, 3877, 1642, 4830, 29898, 9057, 29918, 333, 876, 13, 13, 1678, 1596, 703, 9692, 426, 29900, 29913, 17525, 1642, 4830, 29898, 2435, 29898, 1761, 29918, 974, 29918, 11851, 3842, 4961, 13, 13, 13, 1678, 363, 903, 3972, 297, 1051, 29918, 974, 29918, 11851, 3842, 29901, 13, 4706, 396, 3617, 278, 3876, 2066, 322, 385, 29874, 2066, 29901, 13, 4706, 3876, 29918, 1445, 353, 13149, 29889, 23705, 7373, 3972, 718, 3876, 29918, 11037, 29897, 13, 4706, 385, 29874, 29918, 1445, 29871, 353, 13149, 29889, 23705, 7373, 3972, 718, 385, 29874, 29918, 11037, 29897, 13, 13, 4706, 565, 7431, 29898, 4632, 29918, 1445, 29897, 529, 29871, 29896, 29901, 13, 9651, 1596, 376, 1323, 8675, 292, 29908, 13, 9651, 6773, 13, 4706, 1683, 29901, 13, 9651, 3876, 29918, 1445, 353, 3876, 29918, 1445, 29961, 29900, 29962, 13, 13, 4706, 4833, 29889, 7099, 8663, 29918, 1445, 29898, 24713, 29922, 24713, 29918, 978, 29892, 10422, 29922, 359, 29889, 2084, 29889, 6500, 3871, 29898, 4632, 29918, 1445, 511, 13, 462, 4706, 4423, 29922, 29918, 3972, 29892, 7408, 29922, 19190, 29918, 978, 29892, 4660, 353, 29871, 29900, 29892, 285, 1853, 29922, 29900, 29892, 452, 794, 29879, 29922, 29896, 29900, 29900, 29897, 13, 13, 13, 4706, 565, 7431, 29898, 1648, 29918, 1445, 29897, 529, 29871, 29896, 29901, 13, 9651, 1596, 376, 1323, 8675, 292, 29908, 13, 9651, 6773, 13, 4706, 1683, 29901, 13, 9651, 385, 29874, 29918, 1445, 353, 385, 29874, 29918, 1445, 29961, 29900, 29962, 13, 4706, 4833, 29889, 7099, 8663, 29918, 1445, 29898, 24713, 29922, 24713, 29918, 978, 29892, 10422, 29922, 359, 29889, 2084, 29889, 6500, 3871, 29898, 1648, 29918, 1445, 511, 13, 462, 4706, 4423, 29922, 29918, 3972, 29892, 7408, 29922, 19190, 29918, 978, 29892, 4660, 353, 29871, 29900, 29892, 285, 1853, 29922, 29896, 29892, 452, 794, 29879, 29922, 29896, 29900, 29900, 29897, 13, 13, 13, 13, 13, 361, 4770, 978, 1649, 1275, 29871, 376, 1649, 3396, 1649, 1115, 13, 13, 1678, 2246, 29918, 3972, 353, 5591, 29876, 29914, 5391, 2904, 5847, 29914, 24461, 29903, 29914, 2543, 264, 2353, 29918, 8205, 29914, 1272, 29914, 24601, 29914, 29885, 617, 29947, 29889, 29953, 29914, 14369, 29918, 29886, 291, 29914, 4738, 362, 12975, 13, 1678, 7408, 29918, 978, 353, 376, 4738, 362, 29908, 13, 1678, 8783, 29918, 978, 353, 376, 29885, 617, 29947, 29889, 29953, 29918, 14369, 29918, 29886, 291, 29908, 13, 1678, 3876, 29918, 11037, 353, 376, 10633, 29918, 29886, 1080, 29918, 29900, 29899, 29906, 29889, 29900, 7999, 29963, 29918, 275, 28467, 293, 29918, 431, 29877, 650, 29930, 29918, 276, 1111, 29906, 29889, 4632, 29908, 13, 1678, 385, 29874, 29918, 11037, 353, 376, 276, 1111, 29918, 19190, 29918, 29906, 29918, 29882, 391, 29889, 4632, 29908, 13, 1678, 4982, 29918, 333, 353, 29871, 29941, 29953, 29945, 29929, 29955, 29953, 29945, 29945, 13, 1678, 4833, 29918, 1445, 353, 5591, 29876, 29914, 5391, 2904, 5847, 29914, 24461, 29903, 29914, 2543, 264, 2353, 29918, 8205, 29914, 1272, 29914, 24601, 29914, 29885, 617, 29947, 29889, 29953, 29914, 14369, 29918, 29886, 291, 29914, 1287, 29914, 29885, 617, 29947, 29889, 29953, 29918, 14369, 29918, 29886, 291, 29889, 2585, 29908, 13, 13, 1678, 9792, 29918, 19190, 29898, 3332, 29918, 3972, 29922, 3332, 29918, 3972, 29892, 7408, 29918, 978, 29922, 19190, 29918, 978, 29892, 13, 4706, 8783, 29918, 978, 29922, 24713, 29918, 978, 29892, 3876, 29918, 11037, 353, 3876, 29918, 11037, 29892, 13, 4706, 385, 29874, 29918, 11037, 353, 385, 29874, 29918, 11037, 29892, 4982, 29918, 333, 353, 4982, 29918, 333, 29892, 13, 4706, 4833, 29918, 1445, 353, 4833, 29918, 1445, 29897, 13, 2 ]
openstack_dashboard/dashboards/admin/group_types/specs/tests.py
nicozhang/horizon
1
84844
<gh_stars>1-10 # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from django.urls import reverse from openstack_dashboard import api from openstack_dashboard.test import helpers as test class GroupTypeSpecTests(test.BaseAdminViewTests): @test.create_mocks({api.cinder: ('group_type_spec_list', 'group_type_get')}) def test_list_specs_when_none_exists(self): group_type = self.cinder_group_types.first() specs = [api.cinder.GroupTypeSpec(group_type.id, 'k1', 'v1')] self.mock_group_type_get.return_value = group_type self.mock_group_type_spec_list.return_value = specs url = reverse('horizon:admin:group_types:specs:index', args=[group_type.id]) resp = self.client.get(url) self.assertEqual(resp.status_code, 200) self.assertTemplateUsed(resp, "admin/group_types/specs/index.html") self.mock_group_type_get.assert_called_once_with( test.IsHttpRequest(), group_type.id) self.mock_group_type_spec_list.assert_called_once_with( test.IsHttpRequest(), group_type.id) @test.create_mocks({api.cinder: ('group_type_spec_list', 'group_type_get')}) def test_specs_view_with_exception(self): group_type = self.cinder_group_types.first() self.mock_group_type_get.return_value = group_type self.mock_group_type_spec_list.side_effect = self.exceptions.cinder url = reverse('horizon:admin:group_types:specs:index', args=[group_type.id]) resp = self.client.get(url) self.assertEqual(len(resp.context['specs_table'].data), 0) self.assertMessageCount(resp, error=1) self.mock_group_type_get.assert_called_once_with( test.IsHttpRequest(), group_type.id) self.mock_group_type_spec_list.assert_called_once_with( test.IsHttpRequest(), group_type.id) @test.create_mocks({api.cinder: ('group_type_spec_list', 'group_type_spec_set', )}) def test_spec_create_post(self): group_type = self.cinder_group_types.first() create_url = reverse( 'horizon:admin:group_types:specs:create', args=[group_type.id]) index_url = reverse( 'horizon:admin:group_types:index') data = {'key': u'k1', 'value': u'v1'} self.mock_group_type_spec_set.return_value = None resp = self.client.post(create_url, data) self.assertNoFormErrors(resp) self.assertMessageCount(success=1) self.assertRedirectsNoFollow(resp, index_url) self.mock_group_type_spec_set.assert_called_once_with( test.IsHttpRequest(), group_type.id, {data['key']: data['value']}) @test.create_mocks({api.cinder: ('group_type_get', )}) def test_spec_create_get(self): group_type = self.cinder_group_types.first() create_url = reverse( 'horizon:admin:group_types:specs:create', args=[group_type.id]) self.mock_group_type_get.return_value = group_type resp = self.client.get(create_url) self.assertEqual(resp.status_code, 200) self.assertTemplateUsed( resp, 'admin/group_types/specs/create.html') self.mock_group_type_get.assert_called_once_with( test.IsHttpRequest(), group_type.id) @test.create_mocks({api.cinder: ('group_type_spec_list', 'group_type_spec_set',)}) def test_spec_edit(self): group_type = self.cinder_group_types.first() key = 'foo' edit_url = reverse('horizon:admin:group_types:specs:edit', args=[group_type.id, key]) index_url = reverse('horizon:admin:group_types:index') data = {'value': u'v1'} specs = {key: data['value']} self.mock_group_type_spec_list.return_value = specs self.mock_group_type_spec_set.return_value = None resp = self.client.post(edit_url, data) self.assertNoFormErrors(resp) self.assertMessageCount(success=1) self.assertRedirectsNoFollow(resp, index_url) self.mock_group_type_spec_list.assert_called_once_with( test.IsHttpRequest(), group_type.id, raw=True) self.mock_group_type_spec_set.assert_called_once_with( test.IsHttpRequest(), group_type.id, specs) @test.create_mocks({api.cinder: ('group_type_spec_list', 'group_type_spec_unset')}) def test_spec_delete(self): group_type = self.cinder_group_types.first() specs = [api.cinder.GroupTypeSpec(group_type.id, 'k1', 'v1')] formData = {'action': 'specs__delete__k1'} index_url = reverse('horizon:admin:group_types:specs:index', args=[group_type.id]) self.mock_group_type_spec_list.return_value = specs self.mock_group_type_spec_unset.return_value = group_type res = self.client.post(index_url, formData) redirect = reverse('horizon:admin:group_types:index') self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, redirect) self.mock_group_type_spec_list.assert_called_once_with( test.IsHttpRequest(), group_type.id) self.mock_group_type_spec_unset.assert_called_once_with( test.IsHttpRequest(), group_type.id, ['k1'])
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 366, 1122, 13, 29937, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 887, 1122, 4017, 13, 29937, 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, 399, 1806, 8187, 2692, 13, 29937, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 2823, 278, 13, 29937, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 27028, 13, 29937, 1090, 278, 19245, 29889, 13, 13, 3166, 9557, 29889, 26045, 1053, 11837, 13, 13, 3166, 1722, 1429, 29918, 14592, 3377, 1053, 7882, 13, 3166, 1722, 1429, 29918, 14592, 3377, 29889, 1688, 1053, 1371, 414, 408, 1243, 13, 13, 13, 1990, 6431, 1542, 10299, 24376, 29898, 1688, 29889, 5160, 12754, 1043, 24376, 1125, 13, 13, 1678, 732, 1688, 29889, 3258, 29918, 17640, 29879, 3319, 2754, 29889, 29883, 4995, 29901, 6702, 2972, 29918, 1853, 29918, 6550, 29918, 1761, 742, 13, 462, 462, 268, 525, 2972, 29918, 1853, 29918, 657, 1495, 1800, 13, 1678, 822, 1243, 29918, 1761, 29918, 5965, 2395, 29918, 8256, 29918, 9290, 29918, 9933, 29898, 1311, 1125, 13, 4706, 2318, 29918, 1853, 353, 1583, 29889, 29883, 4995, 29918, 2972, 29918, 8768, 29889, 4102, 580, 13, 4706, 1580, 29879, 353, 518, 2754, 29889, 29883, 4995, 29889, 4782, 1542, 10299, 29898, 2972, 29918, 1853, 29889, 333, 29892, 525, 29895, 29896, 742, 525, 29894, 29896, 1495, 29962, 13, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 657, 29889, 2457, 29918, 1767, 353, 2318, 29918, 1853, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 1761, 29889, 2457, 29918, 1767, 353, 1580, 29879, 13, 4706, 3142, 353, 11837, 877, 2015, 18162, 29901, 6406, 29901, 2972, 29918, 8768, 29901, 5965, 2395, 29901, 2248, 742, 13, 462, 418, 6389, 11759, 2972, 29918, 1853, 29889, 333, 2314, 13, 4706, 4613, 353, 1583, 29889, 4645, 29889, 657, 29898, 2271, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13713, 29889, 4882, 29918, 401, 29892, 29871, 29906, 29900, 29900, 29897, 13, 4706, 1583, 29889, 9294, 6733, 29965, 8485, 29898, 13713, 29892, 13, 462, 18884, 376, 6406, 29914, 2972, 29918, 8768, 29914, 5965, 2395, 29914, 2248, 29889, 1420, 1159, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 657, 29889, 9294, 29918, 13998, 29918, 10646, 29918, 2541, 29898, 13, 9651, 1243, 29889, 3624, 26021, 3285, 2318, 29918, 1853, 29889, 333, 29897, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 1761, 29889, 9294, 29918, 13998, 29918, 10646, 29918, 2541, 29898, 13, 9651, 1243, 29889, 3624, 26021, 3285, 2318, 29918, 1853, 29889, 333, 29897, 13, 13, 1678, 732, 1688, 29889, 3258, 29918, 17640, 29879, 3319, 2754, 29889, 29883, 4995, 29901, 6702, 2972, 29918, 1853, 29918, 6550, 29918, 1761, 742, 13, 462, 462, 268, 525, 2972, 29918, 1853, 29918, 657, 1495, 1800, 13, 1678, 822, 1243, 29918, 5965, 2395, 29918, 1493, 29918, 2541, 29918, 11739, 29898, 1311, 1125, 13, 4706, 2318, 29918, 1853, 353, 1583, 29889, 29883, 4995, 29918, 2972, 29918, 8768, 29889, 4102, 580, 13, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 657, 29889, 2457, 29918, 1767, 353, 2318, 29918, 1853, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 1761, 29889, 2975, 29918, 15987, 353, 1583, 29889, 11739, 29879, 29889, 29883, 4995, 13, 4706, 3142, 353, 11837, 877, 2015, 18162, 29901, 6406, 29901, 2972, 29918, 8768, 29901, 5965, 2395, 29901, 2248, 742, 13, 462, 418, 6389, 11759, 2972, 29918, 1853, 29889, 333, 2314, 13, 4706, 4613, 353, 1583, 29889, 4645, 29889, 657, 29898, 2271, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 13713, 29889, 4703, 1839, 5965, 2395, 29918, 2371, 13359, 1272, 511, 29871, 29900, 29897, 13, 4706, 1583, 29889, 9294, 3728, 3981, 29898, 13713, 29892, 1059, 29922, 29896, 29897, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 657, 29889, 9294, 29918, 13998, 29918, 10646, 29918, 2541, 29898, 13, 9651, 1243, 29889, 3624, 26021, 3285, 2318, 29918, 1853, 29889, 333, 29897, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 1761, 29889, 9294, 29918, 13998, 29918, 10646, 29918, 2541, 29898, 13, 9651, 1243, 29889, 3624, 26021, 3285, 2318, 29918, 1853, 29889, 333, 29897, 13, 13, 1678, 732, 1688, 29889, 3258, 29918, 17640, 29879, 3319, 2754, 29889, 29883, 4995, 29901, 6702, 2972, 29918, 1853, 29918, 6550, 29918, 1761, 742, 13, 462, 462, 268, 525, 2972, 29918, 1853, 29918, 6550, 29918, 842, 742, 1723, 1800, 13, 1678, 822, 1243, 29918, 6550, 29918, 3258, 29918, 2490, 29898, 1311, 1125, 13, 4706, 2318, 29918, 1853, 353, 1583, 29889, 29883, 4995, 29918, 2972, 29918, 8768, 29889, 4102, 580, 13, 4706, 1653, 29918, 2271, 353, 11837, 29898, 13, 9651, 525, 2015, 18162, 29901, 6406, 29901, 2972, 29918, 8768, 29901, 5965, 2395, 29901, 3258, 742, 13, 9651, 6389, 11759, 2972, 29918, 1853, 29889, 333, 2314, 13, 4706, 2380, 29918, 2271, 353, 11837, 29898, 13, 9651, 525, 2015, 18162, 29901, 6406, 29901, 2972, 29918, 8768, 29901, 2248, 1495, 13, 13, 4706, 848, 353, 11117, 1989, 2396, 318, 29915, 29895, 29896, 742, 13, 18884, 525, 1767, 2396, 318, 29915, 29894, 29896, 10827, 13, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 842, 29889, 2457, 29918, 1767, 353, 6213, 13, 4706, 4613, 353, 1583, 29889, 4645, 29889, 2490, 29898, 3258, 29918, 2271, 29892, 848, 29897, 13, 4706, 1583, 29889, 9294, 3782, 2500, 22463, 29898, 13713, 29897, 13, 4706, 1583, 29889, 9294, 3728, 3981, 29898, 8698, 29922, 29896, 29897, 13, 4706, 1583, 29889, 9294, 24735, 29879, 3782, 29943, 2952, 29898, 13713, 29892, 2380, 29918, 2271, 29897, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 842, 29889, 9294, 29918, 13998, 29918, 10646, 29918, 2541, 29898, 13, 9651, 1243, 29889, 3624, 26021, 3285, 13, 9651, 2318, 29918, 1853, 29889, 333, 29892, 13, 9651, 426, 1272, 1839, 1989, 2033, 29901, 848, 1839, 1767, 2033, 1800, 13, 13, 1678, 732, 1688, 29889, 3258, 29918, 17640, 29879, 3319, 2754, 29889, 29883, 4995, 29901, 6702, 2972, 29918, 1853, 29918, 657, 742, 1723, 1800, 13, 1678, 822, 1243, 29918, 6550, 29918, 3258, 29918, 657, 29898, 1311, 1125, 13, 4706, 2318, 29918, 1853, 353, 1583, 29889, 29883, 4995, 29918, 2972, 29918, 8768, 29889, 4102, 580, 13, 4706, 1653, 29918, 2271, 353, 11837, 29898, 13, 9651, 525, 2015, 18162, 29901, 6406, 29901, 2972, 29918, 8768, 29901, 5965, 2395, 29901, 3258, 742, 13, 9651, 6389, 11759, 2972, 29918, 1853, 29889, 333, 2314, 13, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 657, 29889, 2457, 29918, 1767, 353, 2318, 29918, 1853, 13, 4706, 4613, 353, 1583, 29889, 4645, 29889, 657, 29898, 3258, 29918, 2271, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13713, 29889, 4882, 29918, 401, 29892, 29871, 29906, 29900, 29900, 29897, 13, 4706, 1583, 29889, 9294, 6733, 29965, 8485, 29898, 13, 9651, 4613, 29892, 525, 6406, 29914, 2972, 29918, 8768, 29914, 5965, 2395, 29914, 3258, 29889, 1420, 1495, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 657, 29889, 9294, 29918, 13998, 29918, 10646, 29918, 2541, 29898, 13, 9651, 1243, 29889, 3624, 26021, 3285, 2318, 29918, 1853, 29889, 333, 29897, 13, 13, 1678, 732, 1688, 29889, 3258, 29918, 17640, 29879, 3319, 2754, 29889, 29883, 4995, 29901, 6702, 2972, 29918, 1853, 29918, 6550, 29918, 1761, 742, 13, 462, 462, 268, 525, 2972, 29918, 1853, 29918, 6550, 29918, 842, 742, 26972, 13, 1678, 822, 1243, 29918, 6550, 29918, 5628, 29898, 1311, 1125, 13, 4706, 2318, 29918, 1853, 353, 1583, 29889, 29883, 4995, 29918, 2972, 29918, 8768, 29889, 4102, 580, 13, 4706, 1820, 353, 525, 5431, 29915, 13, 4706, 3863, 29918, 2271, 353, 11837, 877, 2015, 18162, 29901, 6406, 29901, 2972, 29918, 8768, 29901, 5965, 2395, 29901, 5628, 742, 13, 462, 965, 6389, 11759, 2972, 29918, 1853, 29889, 333, 29892, 1820, 2314, 13, 4706, 2380, 29918, 2271, 353, 11837, 877, 2015, 18162, 29901, 6406, 29901, 2972, 29918, 8768, 29901, 2248, 1495, 13, 13, 4706, 848, 353, 11117, 1767, 2396, 318, 29915, 29894, 29896, 10827, 13, 4706, 1580, 29879, 353, 426, 1989, 29901, 848, 1839, 1767, 2033, 29913, 13, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 1761, 29889, 2457, 29918, 1767, 353, 1580, 29879, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 842, 29889, 2457, 29918, 1767, 353, 6213, 13, 13, 4706, 4613, 353, 1583, 29889, 4645, 29889, 2490, 29898, 5628, 29918, 2271, 29892, 848, 29897, 13, 4706, 1583, 29889, 9294, 3782, 2500, 22463, 29898, 13713, 29897, 13, 4706, 1583, 29889, 9294, 3728, 3981, 29898, 8698, 29922, 29896, 29897, 13, 4706, 1583, 29889, 9294, 24735, 29879, 3782, 29943, 2952, 29898, 13713, 29892, 2380, 29918, 2271, 29897, 13, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 1761, 29889, 9294, 29918, 13998, 29918, 10646, 29918, 2541, 29898, 13, 9651, 1243, 29889, 3624, 26021, 3285, 2318, 29918, 1853, 29889, 333, 29892, 10650, 29922, 5574, 29897, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 842, 29889, 9294, 29918, 13998, 29918, 10646, 29918, 2541, 29898, 13, 9651, 1243, 29889, 3624, 26021, 3285, 2318, 29918, 1853, 29889, 333, 29892, 1580, 29879, 29897, 13, 13, 1678, 732, 1688, 29889, 3258, 29918, 17640, 29879, 3319, 2754, 29889, 29883, 4995, 29901, 6702, 2972, 29918, 1853, 29918, 6550, 29918, 1761, 742, 13, 462, 462, 268, 525, 2972, 29918, 1853, 29918, 6550, 29918, 348, 842, 1495, 1800, 13, 1678, 822, 1243, 29918, 6550, 29918, 8143, 29898, 1311, 1125, 13, 4706, 2318, 29918, 1853, 353, 1583, 29889, 29883, 4995, 29918, 2972, 29918, 8768, 29889, 4102, 580, 13, 4706, 1580, 29879, 353, 518, 2754, 29889, 29883, 4995, 29889, 4782, 1542, 10299, 29898, 2972, 29918, 1853, 29889, 333, 29892, 525, 29895, 29896, 742, 525, 29894, 29896, 1495, 29962, 13, 4706, 883, 1469, 353, 11117, 2467, 2396, 525, 5965, 2395, 1649, 8143, 1649, 29895, 29896, 10827, 13, 4706, 2380, 29918, 2271, 353, 11837, 877, 2015, 18162, 29901, 6406, 29901, 2972, 29918, 8768, 29901, 5965, 2395, 29901, 2248, 742, 13, 462, 9651, 6389, 11759, 2972, 29918, 1853, 29889, 333, 2314, 13, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 1761, 29889, 2457, 29918, 1767, 353, 1580, 29879, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 348, 842, 29889, 2457, 29918, 1767, 353, 2318, 29918, 1853, 13, 13, 4706, 620, 353, 1583, 29889, 4645, 29889, 2490, 29898, 2248, 29918, 2271, 29892, 883, 1469, 29897, 13, 13, 4706, 6684, 353, 11837, 877, 2015, 18162, 29901, 6406, 29901, 2972, 29918, 8768, 29901, 2248, 1495, 13, 4706, 1583, 29889, 9294, 3782, 2500, 22463, 29898, 690, 29897, 13, 4706, 1583, 29889, 9294, 24735, 29879, 3782, 29943, 2952, 29898, 690, 29892, 6684, 29897, 13, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 1761, 29889, 9294, 29918, 13998, 29918, 10646, 29918, 2541, 29898, 13, 9651, 1243, 29889, 3624, 26021, 3285, 2318, 29918, 1853, 29889, 333, 29897, 13, 4706, 1583, 29889, 17640, 29918, 2972, 29918, 1853, 29918, 6550, 29918, 348, 842, 29889, 9294, 29918, 13998, 29918, 10646, 29918, 2541, 29898, 13, 9651, 1243, 29889, 3624, 26021, 3285, 2318, 29918, 1853, 29889, 333, 29892, 6024, 29895, 29896, 11287, 13, 2 ]
update.py
spascou/ps2.liquidwarp.net
4
81990
<gh_stars>1-10 import os from typing import Optional from generate import ( clean_bucket, clean_site, copy_misc, copy_statics, generate_css, generate_pages, update_all_data_files, upload_to_bucket, ) BUCKET_NAME = "ps2.liquidwarp.net" CENSUS_SERVICE_ID: Optional[str] = os.environ.get("CENSUS_SERVICE_ID") if not CENSUS_SERVICE_ID: raise ValueError("No CENSUS_SERVICE_ID envvar found") if __name__ == "__main__": import argparse parser = argparse.ArgumentParser() # Main action_group = parser.add_mutually_exclusive_group(required=True) action_group.add_argument("--update", action="store_true") action_group.add_argument("--upload", action="store_true") action_group.add_argument("--generate", action="store_true") action_group.add_argument("--copy-statics", action="store_true") action_group.add_argument("--copy-misc", action="store_true") action_group.add_argument("--generate-css", action="store_true") action_group.add_argument("--clean-local", action="store_true") action_group.add_argument("--clean-remote", action="store_true") # Other parser.add_argument("--no-simulations", action="store_true") parser.add_argument("--upload-prefix", type=str, default="") # Parse args = parser.parse_args() # Run if args.update or args.clean_local: clean_site() if args.update or args.generate or args.generate_css: generate_css() if args.update or args.generate: update_all_data_files(census_service_id=CENSUS_SERVICE_ID) generate_pages(update_simulations=not args.no_simulations) if args.update or args.generate or args.copy_statics: copy_statics() if args.update or args.generate or args.copy_misc: copy_misc() if args.clean_remote: clean_bucket(bucket_name=BUCKET_NAME) if args.update or args.upload: upload_to_bucket(bucket_name=BUCKET_NAME, prefix=args.upload_prefix)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 2897, 13, 3166, 19229, 1053, 28379, 13, 13, 3166, 5706, 1053, 313, 13, 1678, 5941, 29918, 21454, 29892, 13, 1678, 5941, 29918, 2746, 29892, 13, 1678, 3509, 29918, 29885, 10669, 29892, 13, 1678, 3509, 29918, 6112, 1199, 29892, 13, 1678, 5706, 29918, 4268, 29892, 13, 1678, 5706, 29918, 12292, 29892, 13, 1678, 2767, 29918, 497, 29918, 1272, 29918, 5325, 29892, 13, 1678, 6441, 29918, 517, 29918, 21454, 29892, 13, 29897, 13, 13, 7838, 7077, 2544, 29918, 5813, 353, 376, 567, 29906, 29889, 28378, 333, 4495, 29886, 29889, 1212, 29908, 13, 13, 29907, 1430, 29903, 3308, 29918, 6304, 19059, 29918, 1367, 29901, 28379, 29961, 710, 29962, 353, 2897, 29889, 21813, 29889, 657, 703, 29907, 1430, 29903, 3308, 29918, 6304, 19059, 29918, 1367, 1159, 13, 13, 361, 451, 315, 1430, 29903, 3308, 29918, 6304, 19059, 29918, 1367, 29901, 13, 1678, 12020, 7865, 2392, 703, 3782, 315, 1430, 29903, 3308, 29918, 6304, 19059, 29918, 1367, 8829, 1707, 1476, 1159, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1053, 1852, 5510, 13, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 580, 13, 13, 1678, 396, 4241, 13, 1678, 3158, 29918, 2972, 353, 13812, 29889, 1202, 29918, 6149, 1474, 29918, 735, 7009, 573, 29918, 2972, 29898, 12403, 29922, 5574, 29897, 13, 1678, 3158, 29918, 2972, 29889, 1202, 29918, 23516, 703, 489, 5504, 613, 3158, 543, 8899, 29918, 3009, 1159, 13, 1678, 3158, 29918, 2972, 29889, 1202, 29918, 23516, 703, 489, 9009, 613, 3158, 543, 8899, 29918, 3009, 1159, 13, 13, 1678, 3158, 29918, 2972, 29889, 1202, 29918, 23516, 703, 489, 17158, 613, 3158, 543, 8899, 29918, 3009, 1159, 13, 1678, 3158, 29918, 2972, 29889, 1202, 29918, 23516, 703, 489, 8552, 29899, 6112, 1199, 613, 3158, 543, 8899, 29918, 3009, 1159, 13, 1678, 3158, 29918, 2972, 29889, 1202, 29918, 23516, 703, 489, 8552, 29899, 29885, 10669, 613, 3158, 543, 8899, 29918, 3009, 1159, 13, 1678, 3158, 29918, 2972, 29889, 1202, 29918, 23516, 703, 489, 17158, 29899, 4268, 613, 3158, 543, 8899, 29918, 3009, 1159, 13, 13, 1678, 3158, 29918, 2972, 29889, 1202, 29918, 23516, 703, 489, 14941, 29899, 2997, 613, 3158, 543, 8899, 29918, 3009, 1159, 13, 1678, 3158, 29918, 2972, 29889, 1202, 29918, 23516, 703, 489, 14941, 29899, 16674, 613, 3158, 543, 8899, 29918, 3009, 1159, 13, 13, 1678, 396, 5901, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 1217, 29899, 3601, 8250, 613, 3158, 543, 8899, 29918, 3009, 1159, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 9009, 29899, 13506, 613, 1134, 29922, 710, 29892, 2322, 543, 1159, 13, 13, 1678, 396, 20969, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 13, 1678, 396, 7525, 13, 1678, 565, 6389, 29889, 5504, 470, 6389, 29889, 14941, 29918, 2997, 29901, 13, 13, 4706, 5941, 29918, 2746, 580, 13, 13, 1678, 565, 6389, 29889, 5504, 470, 6389, 29889, 17158, 470, 6389, 29889, 17158, 29918, 4268, 29901, 13, 13, 4706, 5706, 29918, 4268, 580, 13, 13, 1678, 565, 6389, 29889, 5504, 470, 6389, 29889, 17158, 29901, 13, 13, 4706, 2767, 29918, 497, 29918, 1272, 29918, 5325, 29898, 29883, 8841, 29918, 5509, 29918, 333, 29922, 29907, 1430, 29903, 3308, 29918, 6304, 19059, 29918, 1367, 29897, 13, 4706, 5706, 29918, 12292, 29898, 5504, 29918, 3601, 8250, 29922, 1333, 6389, 29889, 1217, 29918, 3601, 8250, 29897, 13, 13, 1678, 565, 6389, 29889, 5504, 470, 6389, 29889, 17158, 470, 6389, 29889, 8552, 29918, 6112, 1199, 29901, 13, 13, 4706, 3509, 29918, 6112, 1199, 580, 13, 13, 1678, 565, 6389, 29889, 5504, 470, 6389, 29889, 17158, 470, 6389, 29889, 8552, 29918, 29885, 10669, 29901, 13, 13, 4706, 3509, 29918, 29885, 10669, 580, 13, 13, 1678, 565, 6389, 29889, 14941, 29918, 16674, 29901, 13, 13, 4706, 5941, 29918, 21454, 29898, 21454, 29918, 978, 29922, 7838, 7077, 2544, 29918, 5813, 29897, 13, 13, 1678, 565, 6389, 29889, 5504, 470, 6389, 29889, 9009, 29901, 13, 13, 4706, 6441, 29918, 517, 29918, 21454, 29898, 21454, 29918, 978, 29922, 7838, 7077, 2544, 29918, 5813, 29892, 10944, 29922, 5085, 29889, 9009, 29918, 13506, 29897, 13, 2 ]
examples/example2.py
robinechuca/ContextPrinter
1
180408
#!/usr/bin/env python3 """ Example of a section shared between several methods and modules. Example2 is doing stuff █ Example1 is starting to do stuff █ █ Example1 is done doing stuff █ Example2 is done doing stuff """ from context_printer import ContextPrinter as Ctp from example1 import Example1 class Example2: def __init__(self): self.sub_routine = None def start_stuff(self): Ctp.enter_section("Example2 is doing stuff", color='blue') self.sub_routine = Example1() self.sub_routine.start_stuff() def end_stuff(self): self.sub_routine.end_stuff() Ctp.print("Example2 is done doing stuff") Ctp.exit_section() if __name__ == '__main__': ex = Example2() ex.start_stuff() ex.end_stuff()
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 15945, 29908, 13, 14023, 310, 263, 4004, 7258, 1546, 3196, 3519, 322, 10585, 29889, 13, 13, 14023, 29906, 338, 2599, 6433, 13, 30208, 8741, 29896, 338, 6257, 304, 437, 6433, 13, 30208, 29871, 30208, 8741, 29896, 338, 2309, 2599, 6433, 13, 30208, 8741, 29906, 338, 2309, 2599, 6433, 13, 15945, 29908, 13, 13, 3166, 3030, 29918, 558, 1639, 1053, 15228, 4040, 1639, 408, 315, 9392, 13, 3166, 1342, 29896, 1053, 8741, 29896, 13, 13, 13, 1990, 8741, 29906, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 1491, 29918, 14608, 457, 353, 6213, 13, 1678, 822, 1369, 29918, 303, 3096, 29898, 1311, 1125, 13, 4706, 315, 9392, 29889, 5893, 29918, 2042, 703, 14023, 29906, 338, 2599, 6433, 613, 2927, 2433, 9539, 1495, 13, 4706, 1583, 29889, 1491, 29918, 14608, 457, 353, 8741, 29896, 580, 13, 4706, 1583, 29889, 1491, 29918, 14608, 457, 29889, 2962, 29918, 303, 3096, 580, 13, 1678, 822, 1095, 29918, 303, 3096, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1491, 29918, 14608, 457, 29889, 355, 29918, 303, 3096, 580, 13, 4706, 315, 9392, 29889, 2158, 703, 14023, 29906, 338, 2309, 2599, 6433, 1159, 13, 4706, 315, 9392, 29889, 13322, 29918, 2042, 580, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 429, 353, 8741, 29906, 580, 13, 1678, 429, 29889, 2962, 29918, 303, 3096, 580, 13, 1678, 429, 29889, 355, 29918, 303, 3096, 580, 13, 2 ]
code/test.py
saedrna/DA-U-Net
7
135560
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Mon Jan 14 2020 @author: Chenlin """ import os import cv2 import numpy as np import tensorflow as tf from model import da_u_net # os.environ["CUDA_VISIBLE_DEVICES"] = "3" # if test image size= 512* 512, size= 512 over_lap= 0 # if test image size=1024*1024, size=1024 over_lap= 0 # if test image size>1024*1024, size= 512 over_lap=256 batch_size=1 size = 512 over_lap = 256 img=tf.placeholder(tf.float32,[batch_size,size,size,3]) pred = tf.nn.sigmoid(da_u_net(img,is_training=False)) saver = tf.train.Saver(var_list=tf.global_variables()) img_path = '../data/img/test.tif' pre_path = '../results/pre.tif' def restore_model(): tf.global_variables_initializer().run() checkpoint_dir = '../data/checkpoint/' ckpt = tf.train.get_checkpoint_state(checkpoint_dir) if ckpt and ckpt.model_checkpoint_path: ckpt_name = os.path.basename(ckpt.model_checkpoint_path) saver.restore(sess, os.path.join(checkpoint_dir, ckpt_name)) def total_image_predict(ori_image_path): restore_model() print('Loading Checkpoint Success !') ori_image = np.uint8(cv2.imread(ori_image_path)) print(ori_image.shape) ori_image = ori_image[..., 0:3] print(ori_image.shape) print('Start to cutting {}'.format(ori_image_path)) image_list = [] predict_list = [] oh,ow=ori_image.shape[0],ori_image.shape[1] dert=size-over_lap h_n=(oh - size) // dert h_step=h_n+1 w_n=(ow - size) // dert w_step=w_n+1 h_rest=oh-size-h_n*dert w_rest=ow-size-w_n*dert for h in range(h_step): for w in range(w_step): image_sample=ori_image[(h * dert):(h * dert + size), (w * dert):(w * dert + size), :] image_list.append(image_sample) image_list.append(ori_image[(h * dert):(h * dert + size), -size:, :]) for w in range(w_step): image_list.append(ori_image[-size:, (w * dert):(w * dert + size), :]) image_list.append(ori_image[-size:, -size:, :]) print(len(image_list)) print('Start to predict {}'.format(ori_image_path)) for x_batch1 in image_list: x_batch = np.expand_dims(x_batch1, axis=0) / 255.0 predict = sess.run(pred, feed_dict={img: x_batch}) predict = np.squeeze(predict) predict[predict > 0.5] = 1 predict[predict <= 0.5] = 0 predict_list.append(predict) count_temp = 0 tmp = np.ones([ori_image.shape[0], ori_image.shape[1]]).astype(np.uint8) big_w = size - over_lap // 2 small_w=over_lap//2 print('Start to cut {}'.format(ori_image_path)) for h in range(h_step): for w in range(w_step): if h==0 or h==h_step-1: dh=size-over_lap//2 else: dh=dert if w==0 or w==w_step-1: dw=size-over_lap//2 else: dw=dert tmp[(h-1) * over_lap+(big_w if h>0 else over_lap):(h-1) * over_lap+(big_w if h>0 else over_lap)+dh, (w-1)* over_lap+(big_w if w>0 else over_lap):(w-1)* over_lap+(big_w if w>0 else over_lap)+dw] \ = predict_list[count_temp][small_w*int(h>0):dh+small_w*int(h>0),small_w*int(w>0):dw+small_w*int(w>0)] count_temp += 1 tmp[(h-1) * over_lap + (big_w if h>0 else over_lap):(h-1) * over_lap + (big_w if h>0 else over_lap)+dh, -w_rest:] \ = predict_list[count_temp][small_w if h>0 else 0:(small_w if h>0 else 0)+dh, -w_rest:] count_temp += 1 for w in range(w_step): tmp[-h_rest:, (w-1) * over_lap + (big_w if h>0 else over_lap):(w-1) * over_lap + (big_w if h>0 else over_lap)+dw] \ = predict_list[count_temp][-h_rest:,small_w if w>0 else 0:+(small_w if w>0 else 0)+dw] count_temp += 1 tmp[-h_rest:, -w_rest:] = predict_list[count_temp][-h_rest:, -w_rest:] tmp[tmp==1]=255 cv2.imwrite(pre_path, tmp) with tf.Session() as sess: total_image_predict(img_path)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 20399, 373, 2598, 2627, 29871, 29896, 29946, 29871, 29906, 29900, 29906, 29900, 13, 13, 29992, 8921, 29901, 21589, 1915, 13, 15945, 29908, 13, 5215, 2897, 13, 5215, 13850, 29906, 13, 5215, 12655, 408, 7442, 13, 13, 5215, 26110, 408, 15886, 13, 3166, 1904, 1053, 1146, 29918, 29884, 29918, 1212, 13, 29937, 2897, 29889, 21813, 3366, 29907, 29965, 7698, 29918, 28607, 8979, 1307, 29918, 2287, 29963, 2965, 2890, 3108, 353, 376, 29941, 29908, 13, 13, 29937, 565, 1243, 1967, 2159, 29922, 29871, 29945, 29896, 29906, 29930, 29871, 29945, 29896, 29906, 29892, 2159, 29922, 29871, 29945, 29896, 29906, 975, 29918, 6984, 29922, 259, 29900, 13, 29937, 565, 1243, 1967, 2159, 29922, 29896, 29900, 29906, 29946, 29930, 29896, 29900, 29906, 29946, 29892, 2159, 29922, 29896, 29900, 29906, 29946, 975, 29918, 6984, 29922, 259, 29900, 13, 29937, 565, 1243, 1967, 2159, 29958, 29896, 29900, 29906, 29946, 29930, 29896, 29900, 29906, 29946, 29892, 2159, 29922, 29871, 29945, 29896, 29906, 975, 29918, 6984, 29922, 29906, 29945, 29953, 13, 16175, 29918, 2311, 29922, 29896, 13, 2311, 353, 29871, 29945, 29896, 29906, 13, 957, 29918, 6984, 353, 29871, 29906, 29945, 29953, 13, 2492, 29922, 13264, 29889, 27074, 29898, 13264, 29889, 7411, 29941, 29906, 17094, 16175, 29918, 2311, 29892, 2311, 29892, 2311, 29892, 29941, 2314, 13, 11965, 353, 15886, 29889, 15755, 29889, 18816, 29885, 3398, 29898, 1388, 29918, 29884, 29918, 1212, 29898, 2492, 29892, 275, 29918, 26495, 29922, 8824, 876, 13, 4977, 369, 353, 15886, 29889, 14968, 29889, 29903, 12483, 29898, 1707, 29918, 1761, 29922, 13264, 29889, 10945, 29918, 20897, 3101, 13, 2492, 29918, 2084, 353, 525, 6995, 1272, 29914, 2492, 29914, 1688, 29889, 29873, 361, 29915, 13, 1457, 29918, 2084, 353, 525, 6995, 9902, 29914, 1457, 29889, 29873, 361, 29915, 13, 13, 1753, 17749, 29918, 4299, 7295, 13, 1678, 15886, 29889, 10945, 29918, 20897, 29918, 11228, 3950, 2141, 3389, 580, 13, 1678, 1423, 3149, 29918, 3972, 353, 525, 6995, 1272, 29914, 3198, 3149, 22208, 13, 1678, 274, 29895, 415, 353, 15886, 29889, 14968, 29889, 657, 29918, 3198, 3149, 29918, 3859, 29898, 3198, 3149, 29918, 3972, 29897, 13, 1678, 565, 274, 29895, 415, 322, 274, 29895, 415, 29889, 4299, 29918, 3198, 3149, 29918, 2084, 29901, 13, 4706, 274, 29895, 415, 29918, 978, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 384, 415, 29889, 4299, 29918, 3198, 3149, 29918, 2084, 29897, 13, 4706, 872, 369, 29889, 5060, 487, 29898, 29879, 404, 29892, 2897, 29889, 2084, 29889, 7122, 29898, 3198, 3149, 29918, 3972, 29892, 274, 29895, 415, 29918, 978, 876, 13, 13, 1753, 3001, 29918, 3027, 29918, 27711, 29898, 4170, 29918, 3027, 29918, 2084, 1125, 13, 1678, 17749, 29918, 4299, 580, 13, 1678, 1596, 877, 23456, 5399, 3149, 21397, 1738, 1495, 13, 1678, 470, 29875, 29918, 3027, 353, 7442, 29889, 13470, 29947, 29898, 11023, 29906, 29889, 326, 949, 29898, 4170, 29918, 3027, 29918, 2084, 876, 13, 1678, 1596, 29898, 4170, 29918, 3027, 29889, 12181, 29897, 13, 1678, 470, 29875, 29918, 3027, 353, 470, 29875, 29918, 3027, 29961, 16361, 29871, 29900, 29901, 29941, 29962, 13, 1678, 1596, 29898, 4170, 29918, 3027, 29889, 12181, 29897, 13, 1678, 1596, 877, 4763, 304, 28967, 6571, 4286, 4830, 29898, 4170, 29918, 3027, 29918, 2084, 876, 13, 1678, 1967, 29918, 1761, 353, 5159, 13, 1678, 8500, 29918, 1761, 353, 5159, 13, 1678, 9360, 29892, 340, 29922, 4170, 29918, 3027, 29889, 12181, 29961, 29900, 1402, 4170, 29918, 3027, 29889, 12181, 29961, 29896, 29962, 13, 1678, 589, 29873, 29922, 2311, 29899, 957, 29918, 6984, 13, 1678, 298, 29918, 29876, 7607, 1148, 448, 2159, 29897, 849, 589, 29873, 13, 1678, 298, 29918, 10568, 29922, 29882, 29918, 29876, 29974, 29896, 13, 1678, 281, 29918, 29876, 7607, 340, 448, 2159, 29897, 849, 589, 29873, 13, 1678, 281, 29918, 10568, 29922, 29893, 29918, 29876, 29974, 29896, 13, 1678, 298, 29918, 5060, 29922, 1148, 29899, 2311, 29899, 29882, 29918, 29876, 29930, 672, 29873, 13, 1678, 281, 29918, 5060, 29922, 340, 29899, 2311, 29899, 29893, 29918, 29876, 29930, 672, 29873, 13, 13, 1678, 363, 298, 297, 3464, 29898, 29882, 29918, 10568, 1125, 13, 9651, 363, 281, 297, 3464, 29898, 29893, 29918, 10568, 1125, 13, 18884, 1967, 29918, 11249, 29922, 4170, 29918, 3027, 15625, 29882, 334, 589, 29873, 1125, 29898, 29882, 334, 589, 29873, 718, 2159, 511, 313, 29893, 334, 589, 29873, 1125, 29898, 29893, 334, 589, 29873, 718, 2159, 511, 584, 29962, 13, 18884, 1967, 29918, 1761, 29889, 4397, 29898, 3027, 29918, 11249, 29897, 13, 9651, 1967, 29918, 1761, 29889, 4397, 29898, 4170, 29918, 3027, 15625, 29882, 334, 589, 29873, 1125, 29898, 29882, 334, 589, 29873, 718, 2159, 511, 448, 2311, 29901, 29892, 584, 2314, 13, 1678, 363, 281, 297, 3464, 29898, 29893, 29918, 10568, 1125, 13, 9651, 1967, 29918, 1761, 29889, 4397, 29898, 4170, 29918, 3027, 14352, 2311, 29901, 29892, 313, 29893, 334, 589, 29873, 1125, 29898, 29893, 334, 589, 29873, 718, 2159, 511, 584, 2314, 13, 1678, 1967, 29918, 1761, 29889, 4397, 29898, 4170, 29918, 3027, 14352, 2311, 29901, 29892, 448, 2311, 29901, 29892, 584, 2314, 13, 1678, 1596, 29898, 2435, 29898, 3027, 29918, 1761, 876, 13, 13, 1678, 1596, 877, 4763, 304, 8500, 6571, 4286, 4830, 29898, 4170, 29918, 3027, 29918, 2084, 876, 13, 13, 1678, 363, 921, 29918, 16175, 29896, 297, 1967, 29918, 1761, 29901, 13, 9651, 921, 29918, 16175, 353, 7442, 29889, 18837, 29918, 6229, 29879, 29898, 29916, 29918, 16175, 29896, 29892, 9685, 29922, 29900, 29897, 847, 29871, 29906, 29945, 29945, 29889, 29900, 13, 9651, 8500, 353, 27937, 29889, 3389, 29898, 11965, 29892, 8343, 29918, 8977, 3790, 2492, 29901, 921, 29918, 16175, 1800, 13, 9651, 8500, 353, 7442, 29889, 29879, 802, 29872, 911, 29898, 27711, 29897, 13, 9651, 8500, 29961, 27711, 1405, 29871, 29900, 29889, 29945, 29962, 353, 29871, 29896, 13, 9651, 8500, 29961, 27711, 5277, 29871, 29900, 29889, 29945, 29962, 353, 29871, 29900, 13, 9651, 8500, 29918, 1761, 29889, 4397, 29898, 27711, 29897, 13, 1678, 2302, 29918, 7382, 353, 29871, 29900, 13, 1678, 13128, 353, 7442, 29889, 2873, 4197, 4170, 29918, 3027, 29889, 12181, 29961, 29900, 1402, 470, 29875, 29918, 3027, 29889, 12181, 29961, 29896, 5262, 467, 579, 668, 29898, 9302, 29889, 13470, 29947, 29897, 13, 1678, 4802, 29918, 29893, 353, 2159, 448, 975, 29918, 6984, 849, 29871, 29906, 13, 1678, 2319, 29918, 29893, 29922, 957, 29918, 6984, 458, 29906, 13, 1678, 1596, 877, 4763, 304, 5700, 6571, 4286, 4830, 29898, 4170, 29918, 3027, 29918, 2084, 876, 13, 1678, 363, 298, 297, 3464, 29898, 29882, 29918, 10568, 1125, 13, 9651, 363, 281, 297, 3464, 29898, 29893, 29918, 10568, 1125, 13, 18884, 565, 298, 1360, 29900, 470, 298, 1360, 29882, 29918, 10568, 29899, 29896, 29901, 13, 462, 1678, 270, 29882, 29922, 2311, 29899, 957, 29918, 6984, 458, 29906, 13, 18884, 1683, 29901, 13, 462, 1678, 270, 29882, 29922, 672, 29873, 13, 18884, 565, 281, 1360, 29900, 470, 281, 1360, 29893, 29918, 10568, 29899, 29896, 29901, 13, 462, 1678, 11988, 29922, 2311, 29899, 957, 29918, 6984, 458, 29906, 13, 18884, 1683, 29901, 13, 462, 1678, 11988, 29922, 672, 29873, 13, 13, 18884, 13128, 15625, 29882, 29899, 29896, 29897, 334, 975, 29918, 6984, 17108, 3752, 29918, 29893, 565, 298, 29958, 29900, 1683, 975, 29918, 6984, 1125, 29898, 29882, 29899, 29896, 29897, 334, 975, 29918, 6984, 17108, 3752, 29918, 29893, 565, 298, 29958, 29900, 1683, 975, 29918, 6984, 7240, 12744, 29892, 313, 29893, 29899, 29896, 11877, 975, 29918, 6984, 17108, 3752, 29918, 29893, 565, 281, 29958, 29900, 1683, 975, 29918, 6984, 1125, 29898, 29893, 29899, 29896, 11877, 975, 29918, 6984, 17108, 3752, 29918, 29893, 565, 281, 29958, 29900, 1683, 975, 29918, 6984, 7240, 28012, 29962, 320, 13, 462, 1678, 353, 8500, 29918, 1761, 29961, 2798, 29918, 7382, 3816, 9278, 29918, 29893, 29930, 524, 29898, 29882, 29958, 29900, 1125, 12744, 29974, 9278, 29918, 29893, 29930, 524, 29898, 29882, 29958, 29900, 511, 9278, 29918, 29893, 29930, 524, 29898, 29893, 29958, 29900, 1125, 28012, 29974, 9278, 29918, 29893, 29930, 524, 29898, 29893, 29958, 29900, 4638, 13, 18884, 2302, 29918, 7382, 4619, 29871, 29896, 13, 9651, 13128, 15625, 29882, 29899, 29896, 29897, 334, 975, 29918, 6984, 718, 313, 3752, 29918, 29893, 565, 298, 29958, 29900, 1683, 975, 29918, 6984, 1125, 29898, 29882, 29899, 29896, 29897, 334, 975, 29918, 6984, 718, 313, 3752, 29918, 29893, 565, 298, 29958, 29900, 1683, 975, 29918, 6984, 7240, 12744, 29892, 448, 29893, 29918, 5060, 17531, 320, 13, 18884, 353, 8500, 29918, 1761, 29961, 2798, 29918, 7382, 3816, 9278, 29918, 29893, 565, 298, 29958, 29900, 1683, 29871, 29900, 5919, 9278, 29918, 29893, 565, 298, 29958, 29900, 1683, 29871, 29900, 7240, 12744, 29892, 448, 29893, 29918, 5060, 17531, 13, 9651, 2302, 29918, 7382, 4619, 29871, 29896, 13, 1678, 363, 281, 297, 3464, 29898, 29893, 29918, 10568, 1125, 13, 9651, 13128, 14352, 29882, 29918, 5060, 29901, 29892, 313, 29893, 29899, 29896, 29897, 334, 975, 29918, 6984, 718, 313, 3752, 29918, 29893, 565, 298, 29958, 29900, 1683, 975, 29918, 6984, 1125, 29898, 29893, 29899, 29896, 29897, 334, 975, 29918, 6984, 718, 313, 3752, 29918, 29893, 565, 298, 29958, 29900, 1683, 975, 29918, 6984, 7240, 28012, 29962, 320, 13, 18884, 353, 8500, 29918, 1761, 29961, 2798, 29918, 7382, 3816, 29899, 29882, 29918, 5060, 29901, 29892, 9278, 29918, 29893, 565, 281, 29958, 29900, 1683, 29871, 29900, 29901, 17108, 9278, 29918, 29893, 565, 281, 29958, 29900, 1683, 29871, 29900, 7240, 28012, 29962, 13, 9651, 2302, 29918, 7382, 4619, 29871, 29896, 13, 1678, 13128, 14352, 29882, 29918, 5060, 29901, 29892, 448, 29893, 29918, 5060, 17531, 353, 8500, 29918, 1761, 29961, 2798, 29918, 7382, 3816, 29899, 29882, 29918, 5060, 29901, 29892, 448, 29893, 29918, 5060, 17531, 13, 13, 1678, 13128, 29961, 7050, 1360, 29896, 13192, 29906, 29945, 29945, 13, 1678, 13850, 29906, 29889, 326, 3539, 29898, 1457, 29918, 2084, 29892, 13128, 29897, 13, 13, 2541, 15886, 29889, 7317, 580, 408, 27937, 29901, 13, 1678, 3001, 29918, 3027, 29918, 27711, 29898, 2492, 29918, 2084, 29897, 13, 13, 13, 2 ]
examples/wait_for_tokens.py
tarunbhardwaj/limitlion
17
169539
<filename>examples/wait_for_tokens.py<gh_stars>10-100 #!/usr/bin/env python """ Waiting throttle example. Uses the throttle_wait helper that will sleep until work is allowed. """ import datetime import redis from limitlion import throttle_configure, throttle_wait redis = redis.Redis('localhost', 6379) throttle_configure(redis) throttle = throttle_wait('test_wait', rps=5) while True: # May sleep forever if tokens never become available throttle() print('{} Doing work'.format(datetime.datetime.now()))
[ 1, 529, 9507, 29958, 19057, 29914, 10685, 29918, 1454, 29918, 517, 12360, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 15945, 29908, 13, 15716, 292, 20961, 698, 280, 1342, 29889, 13, 13, 15922, 267, 278, 20961, 698, 280, 29918, 10685, 16876, 393, 674, 8709, 2745, 664, 338, 6068, 29889, 13, 15945, 29908, 13, 13, 5215, 12865, 13, 13, 5215, 29825, 13, 13, 3166, 4046, 29880, 291, 1053, 20961, 698, 280, 29918, 17591, 29892, 20961, 698, 280, 29918, 10685, 13, 13, 1127, 275, 353, 29825, 29889, 9039, 275, 877, 7640, 742, 29871, 29953, 29941, 29955, 29929, 29897, 13, 13, 386, 26970, 280, 29918, 17591, 29898, 1127, 275, 29897, 13, 386, 26970, 280, 353, 20961, 698, 280, 29918, 10685, 877, 1688, 29918, 10685, 742, 364, 567, 29922, 29945, 29897, 13, 13, 8000, 5852, 29901, 13, 1678, 396, 2610, 8709, 22296, 565, 18897, 2360, 4953, 3625, 13, 1678, 20961, 698, 280, 580, 13, 1678, 1596, 877, 8875, 1938, 292, 664, 4286, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 22130, 13, 2 ]
hio-yocto-bsp/sources/poky/scripts/lib/mic/3rdparty/pykickstart/commands/group.py
qiangzai00001/hio-prj
0
101839
# # <NAME> <<EMAIL>> # # Copyright 2009 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2. This program is distributed in the hope that it # will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the # implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat # trademarks that are incorporated in the source code or documentation are not # subject to the GNU General Public License and may only be used or replicated # with the express permission of Red Hat, Inc. # from pykickstart.base import * from pykickstart.constants import * from pykickstart.errors import * from pykickstart.options import * import gettext import warnings _ = lambda x: gettext.ldgettext("pykickstart", x) class F12_GroupData(BaseData): removedKeywords = BaseData.removedKeywords removedAttrs = BaseData.removedAttrs def __init__(self, *args, **kwargs): BaseData.__init__(self, *args, **kwargs) self.name = kwargs.get("name", "") self.gid = kwargs.get("gid", None) def __eq__(self, y): return self.name == y.name def __str__(self): retval = BaseData.__str__(self) retval += "group" if self.name: retval += " --name=%s" % self.name if self.gid: retval += " --gid=%s" % self.gid return retval + "\n" class F12_Group(KickstartCommand): removedKeywords = KickstartCommand.removedKeywords removedAttrs = KickstartCommand.removedAttrs def __init__(self, writePriority=0, *args, **kwargs): KickstartCommand.__init__(self, writePriority, *args, **kwargs) self.op = self._getParser() self.groupList = kwargs.get("groupList", []) def __str__(self): retval = "" for user in self.groupList: retval += user.__str__() return retval def _getParser(self): op = KSOptionParser() op.add_option("--name", required=1) op.add_option("--gid", type="int") return op def parse(self, args): gd = self.handler.GroupData() (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) self._setToObj(self.op, opts, gd) gd.lineno = self.lineno # Check for duplicates in the data list. if gd in self.dataList(): warnings.warn(_("A group with the name %s has already been defined.") % gd.name) return gd def dataList(self): return self.groupList
[ 1, 396, 13, 29937, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 29937, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29900, 29929, 4367, 25966, 29892, 9266, 29889, 13, 29937, 13, 29937, 910, 3509, 1266, 287, 5518, 338, 1754, 3625, 304, 5019, 6398, 292, 304, 671, 29892, 6623, 29892, 13, 29937, 3509, 29892, 470, 2654, 391, 2666, 372, 4967, 304, 278, 4958, 322, 5855, 310, 278, 15143, 13, 29937, 4593, 5236, 19245, 325, 29889, 29906, 29889, 29871, 910, 1824, 338, 13235, 297, 278, 4966, 393, 372, 13, 29937, 674, 367, 5407, 29892, 541, 399, 1806, 8187, 2692, 13764, 29979, 399, 1718, 29934, 13566, 29979, 13384, 470, 2411, 2957, 29892, 3704, 278, 13, 29937, 2411, 2957, 1370, 21867, 583, 310, 341, 1001, 3210, 13566, 2882, 6227, 11937, 470, 383, 1806, 8186, 1799, 15842, 319, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 29889, 13, 29937, 2823, 278, 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, 411, 13, 29937, 445, 1824, 29936, 565, 451, 29892, 2436, 304, 278, 12362, 18540, 10606, 29892, 9266, 1696, 29871, 29945, 29896, 13, 29937, 21504, 7103, 29892, 29008, 386, 383, 10102, 29892, 12115, 29892, 14861, 29871, 29900, 29906, 29896, 29896, 29900, 29899, 29896, 29941, 29900, 29896, 29892, 8278, 29889, 29871, 3139, 4367, 25966, 13, 29937, 1020, 2310, 17862, 393, 526, 11039, 630, 297, 278, 2752, 775, 470, 5106, 526, 451, 13, 29937, 4967, 304, 278, 15143, 4593, 5236, 19245, 322, 1122, 871, 367, 1304, 470, 1634, 9169, 13, 29937, 411, 278, 4653, 10751, 310, 4367, 25966, 29892, 9266, 29889, 29871, 13, 29937, 13, 3166, 11451, 29895, 860, 2962, 29889, 3188, 1053, 334, 13, 3166, 11451, 29895, 860, 2962, 29889, 3075, 1934, 1053, 334, 13, 3166, 11451, 29895, 860, 2962, 29889, 12523, 1053, 334, 13, 3166, 11451, 29895, 860, 2962, 29889, 6768, 1053, 334, 13, 13, 5215, 679, 726, 13, 5215, 18116, 13, 29918, 353, 14013, 921, 29901, 679, 726, 29889, 430, 657, 726, 703, 2272, 29895, 860, 2962, 613, 921, 29897, 13, 13, 1990, 383, 29896, 29906, 29918, 4782, 1469, 29898, 5160, 1469, 1125, 13, 1678, 6206, 2558, 9303, 353, 7399, 1469, 29889, 1745, 8238, 2558, 9303, 13, 1678, 6206, 25098, 29879, 353, 7399, 1469, 29889, 1745, 8238, 25098, 29879, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 7399, 1469, 17255, 2344, 12035, 1311, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 4706, 1583, 29889, 978, 353, 9049, 5085, 29889, 657, 703, 978, 613, 20569, 13, 4706, 1583, 29889, 29887, 333, 353, 9049, 5085, 29889, 657, 703, 29887, 333, 613, 6213, 29897, 13, 13, 1678, 822, 4770, 1837, 12035, 1311, 29892, 343, 1125, 13, 4706, 736, 1583, 29889, 978, 1275, 343, 29889, 978, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 3240, 791, 353, 7399, 1469, 17255, 710, 12035, 1311, 29897, 13, 4706, 3240, 791, 4619, 376, 2972, 29908, 13, 13, 4706, 565, 1583, 29889, 978, 29901, 13, 9651, 3240, 791, 4619, 376, 1192, 978, 16328, 29879, 29908, 1273, 1583, 29889, 978, 13, 4706, 565, 1583, 29889, 29887, 333, 29901, 13, 9651, 3240, 791, 4619, 376, 1192, 29887, 333, 16328, 29879, 29908, 1273, 1583, 29889, 29887, 333, 13, 13, 4706, 736, 3240, 791, 718, 6634, 29876, 29908, 13, 13, 1990, 383, 29896, 29906, 29918, 4782, 29898, 29968, 860, 2962, 6255, 1125, 13, 1678, 6206, 2558, 9303, 353, 476, 860, 2962, 6255, 29889, 1745, 8238, 2558, 9303, 13, 1678, 6206, 25098, 29879, 353, 476, 860, 2962, 6255, 29889, 1745, 8238, 25098, 29879, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2436, 29925, 21766, 29922, 29900, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 476, 860, 2962, 6255, 17255, 2344, 12035, 1311, 29892, 2436, 29925, 21766, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 4706, 1583, 29889, 459, 353, 1583, 3032, 657, 11726, 580, 13, 13, 4706, 1583, 29889, 2972, 1293, 353, 9049, 5085, 29889, 657, 703, 2972, 1293, 613, 518, 2314, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 3240, 791, 353, 5124, 13, 4706, 363, 1404, 297, 1583, 29889, 2972, 1293, 29901, 13, 9651, 3240, 791, 4619, 1404, 17255, 710, 1649, 580, 13, 13, 4706, 736, 3240, 791, 13, 13, 1678, 822, 903, 657, 11726, 29898, 1311, 1125, 13, 4706, 1015, 353, 476, 6156, 683, 11726, 580, 13, 4706, 1015, 29889, 1202, 29918, 3385, 703, 489, 978, 613, 3734, 29922, 29896, 29897, 13, 4706, 1015, 29889, 1202, 29918, 3385, 703, 489, 29887, 333, 613, 1134, 543, 524, 1159, 13, 4706, 736, 1015, 13, 13, 1678, 822, 6088, 29898, 1311, 29892, 6389, 1125, 13, 4706, 330, 29881, 353, 1583, 29889, 13789, 29889, 4782, 1469, 580, 13, 4706, 313, 25707, 29892, 4805, 29897, 353, 1583, 29889, 459, 29889, 5510, 29918, 5085, 29898, 5085, 29922, 5085, 29892, 6276, 8154, 29922, 1311, 29889, 1915, 8154, 29897, 13, 4706, 1583, 3032, 842, 1762, 9930, 29898, 1311, 29889, 459, 29892, 29111, 29892, 330, 29881, 29897, 13, 4706, 330, 29881, 29889, 1915, 8154, 353, 1583, 29889, 1915, 8154, 13, 13, 4706, 396, 5399, 363, 20955, 297, 278, 848, 1051, 29889, 13, 4706, 565, 330, 29881, 297, 1583, 29889, 1272, 1293, 7295, 13, 9651, 18116, 29889, 25442, 7373, 703, 29909, 2318, 411, 278, 1024, 1273, 29879, 756, 2307, 1063, 3342, 23157, 1273, 330, 29881, 29889, 978, 29897, 13, 13, 4706, 736, 330, 29881, 13, 13, 1678, 822, 848, 1293, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 2972, 1293, 13, 2 ]
month02/day11/exer_tcp_server2.py
Amiao-miao/all-codes
1
106191
""" 练习4: 自动对话 客户端可以向服务端发送问题 服务端扮演机器客服角色,根据客户端的提问 回复相应的答案 要求可以同时多个客户端提问 """ from socket import * qus_dict={ "你好":"你好啊", "叫什么":"我叫小美", "几岁":"我2岁啦", "男生女生":"我是机器人" } def response(connfd): data = connfd.recv(1024).decode() #遍历字典,查看关键词是否在问题中 for key in qus_dict: if key in data: connfd.send(qus_dict[key].encode()) break else: connfd.send("人家还小,不知道啦".encode()) connfd.close() def main(): tcp_socket=socket() tcp_socket.bind(("0.0.0.0",8888)) tcp_socket.listen(5) while True: connfd,addr=tcp_socket.accept() response(connfd) if __name__ == '__main__': main()
[ 1, 9995, 13, 234, 190, 134, 231, 188, 163, 29946, 30383, 29871, 30688, 30846, 30783, 31852, 13, 31915, 31229, 234, 174, 178, 30682, 30651, 31331, 31520, 31358, 234, 174, 178, 30910, 31545, 31658, 31596, 13, 31520, 31358, 234, 174, 178, 233, 140, 177, 233, 191, 151, 31429, 30943, 31915, 31520, 31432, 31085, 30214, 31393, 30763, 31915, 31229, 234, 174, 178, 30210, 31302, 31658, 13, 30742, 31810, 30990, 31370, 30210, 234, 176, 151, 233, 164, 139, 13, 30698, 31376, 30682, 30651, 30980, 30594, 30923, 30502, 31915, 31229, 234, 174, 178, 31302, 31658, 13, 15945, 29908, 13, 3166, 9909, 1053, 334, 13, 13, 339, 29879, 29918, 8977, 3790, 13, 1678, 376, 30919, 31076, 4710, 30919, 31076, 232, 152, 141, 613, 13, 1678, 376, 232, 146, 174, 231, 190, 131, 31882, 4710, 30672, 232, 146, 174, 30446, 30630, 613, 13, 1678, 376, 232, 138, 163, 232, 181, 132, 4710, 30672, 29906, 232, 181, 132, 232, 152, 169, 613, 13, 1678, 376, 31203, 30486, 30647, 30486, 4710, 30672, 30392, 31429, 30943, 30313, 29908, 13, 29913, 13, 13, 1753, 2933, 29898, 13082, 11512, 1125, 13, 1678, 848, 353, 11009, 11512, 29889, 3757, 29894, 29898, 29896, 29900, 29906, 29946, 467, 13808, 580, 13, 1678, 396, 236, 132, 144, 232, 145, 137, 30578, 31259, 30214, 31213, 31811, 31057, 236, 151, 177, 235, 178, 144, 30392, 31191, 30505, 31658, 31596, 30275, 13, 1678, 363, 1820, 297, 439, 29879, 29918, 8977, 29901, 13, 4706, 565, 1820, 297, 848, 29901, 13, 9651, 11009, 11512, 29889, 6717, 29898, 339, 29879, 29918, 8977, 29961, 1989, 1822, 12508, 3101, 13, 9651, 2867, 13, 1678, 1683, 29901, 13, 4706, 11009, 11512, 29889, 6717, 703, 30313, 30613, 31994, 30446, 30214, 30413, 31043, 30397, 232, 152, 169, 1642, 12508, 3101, 13, 1678, 11009, 11512, 29889, 5358, 580, 13, 13, 1753, 1667, 7295, 13, 1678, 22729, 29918, 11514, 29922, 11514, 580, 13, 1678, 22729, 29918, 11514, 29889, 5355, 29898, 703, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 613, 29947, 29947, 29947, 29947, 876, 13, 1678, 22729, 29918, 11514, 29889, 20631, 29898, 29945, 29897, 13, 13, 1678, 1550, 5852, 29901, 13, 4706, 11009, 11512, 29892, 10030, 29922, 23981, 29918, 11514, 29889, 16044, 580, 13, 4706, 2933, 29898, 13082, 11512, 29897, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1667, 580, 2 ]
src/baseboard/helpers.py
cmheisel/django-baseboard
1
155118
"""Common functions shared across the baseboard project.""" import socket from baseboard.models import Project, RSSFeed def run_instance_update_method(queryset, method_name, debug, timeout=20): """Loops through every object in queryset, and calls method_name. If debug is true, it prints error messages to stdout Optional timeout value is used to keep long-running network operations from stalling the entire process. """ exceptions = [] error_msgs = [] old_timeout = socket.getdefaulttimeout() #Be kind socket.setdefaulttimeout(float(timeout)) for obj in queryset: method = getattr(obj, method_name) try: if debug == 2: print "Updating %s" % (obj, ) method() if hasattr(obj, 'update_error'): obj.update_error = '' obj.save() except Exception, err: if hasattr(obj, 'update_error'): obj.update_error = str(err) obj.save() msg = "ERROR updating %s => %s" % (obj, str(err)) if debug == 2: print msg exceptions.append(err) error_msgs.append(msg) socket.setdefaulttimeout(old_timeout) #Rewind if error_msgs and debug: print '\n'.join(error_msgs) if exceptions: return False return True def update_summaries(debug, timeout=20): """Calls update_summary on all Project objects in the database.""" return run_instance_update_method(Project.objects.all(), 'update_summary', debug, timeout) def update_feeds(debug, timeout=20): """Calls update_feed on all RSSFeed objects in the database.""" return run_instance_update_method(RSSFeed.objects.all(), 'update_feed', debug, timeout)
[ 1, 9995, 18877, 3168, 7258, 4822, 278, 2967, 3377, 2060, 1213, 15945, 13, 5215, 9909, 13, 13, 3166, 2967, 3377, 29889, 9794, 1053, 8010, 29892, 390, 1799, 29737, 13, 13, 1753, 1065, 29918, 8758, 29918, 5504, 29918, 5696, 29898, 1972, 842, 29892, 1158, 29918, 978, 29892, 4744, 29892, 11815, 29922, 29906, 29900, 1125, 13, 1678, 9995, 3410, 3554, 1549, 1432, 1203, 297, 2346, 842, 29892, 322, 5717, 1158, 29918, 978, 29889, 13, 1678, 960, 4744, 338, 1565, 29892, 372, 14677, 1059, 7191, 304, 27591, 13, 1678, 28379, 11815, 995, 338, 1304, 304, 3013, 1472, 29899, 21094, 3564, 6931, 515, 380, 27855, 13, 1678, 278, 4152, 1889, 29889, 13, 1678, 9995, 13, 13, 1678, 15283, 353, 5159, 13, 1678, 1059, 29918, 1516, 3174, 353, 5159, 13, 1678, 13, 1678, 2030, 29918, 15619, 353, 9909, 29889, 657, 4381, 15619, 580, 396, 3629, 2924, 13, 1678, 9909, 29889, 842, 4381, 15619, 29898, 7411, 29898, 15619, 876, 13, 1678, 363, 5446, 297, 2346, 842, 29901, 13, 4706, 1158, 353, 679, 5552, 29898, 5415, 29892, 1158, 29918, 978, 29897, 13, 4706, 1018, 29901, 13, 9651, 565, 4744, 1275, 29871, 29906, 29901, 13, 18884, 1596, 376, 3373, 26747, 1273, 29879, 29908, 1273, 313, 5415, 29892, 1723, 13, 9651, 1158, 580, 13, 9651, 565, 756, 5552, 29898, 5415, 29892, 525, 5504, 29918, 2704, 29374, 13, 18884, 5446, 29889, 5504, 29918, 2704, 353, 6629, 13, 18884, 5446, 29889, 7620, 580, 13, 4706, 5174, 8960, 29892, 4589, 29901, 13, 9651, 565, 756, 5552, 29898, 5415, 29892, 525, 5504, 29918, 2704, 29374, 13, 18884, 5446, 29889, 5504, 29918, 2704, 353, 851, 29898, 3127, 29897, 13, 18884, 5446, 29889, 7620, 580, 13, 13, 9651, 10191, 353, 376, 11432, 13271, 1273, 29879, 1149, 1273, 29879, 29908, 1273, 313, 5415, 29892, 851, 29898, 3127, 876, 13, 9651, 565, 4744, 1275, 29871, 29906, 29901, 13, 18884, 1596, 10191, 13, 9651, 15283, 29889, 4397, 29898, 3127, 29897, 13, 9651, 1059, 29918, 1516, 3174, 29889, 4397, 29898, 7645, 29897, 13, 13, 1678, 9909, 29889, 842, 4381, 15619, 29898, 1025, 29918, 15619, 29897, 396, 29934, 809, 513, 13, 13, 1678, 565, 1059, 29918, 1516, 3174, 322, 4744, 29901, 13, 4706, 1596, 11297, 29876, 4286, 7122, 29898, 2704, 29918, 1516, 3174, 29897, 13, 308, 13, 1678, 565, 15283, 29901, 13, 4706, 736, 7700, 13, 13, 1678, 736, 5852, 13, 13, 1753, 2767, 29918, 2083, 3034, 583, 29898, 8382, 29892, 11815, 29922, 29906, 29900, 1125, 13, 1678, 9995, 29907, 4293, 2767, 29918, 7727, 373, 599, 8010, 3618, 297, 278, 2566, 1213, 15945, 13, 1678, 736, 1065, 29918, 8758, 29918, 5504, 29918, 5696, 29898, 7653, 29889, 12650, 29889, 497, 3285, 525, 5504, 29918, 7727, 742, 4744, 29892, 11815, 29897, 13, 13, 1753, 2767, 29918, 1725, 5779, 29898, 8382, 29892, 11815, 29922, 29906, 29900, 1125, 13, 1678, 9995, 29907, 4293, 2767, 29918, 18798, 373, 599, 390, 1799, 29737, 3618, 297, 278, 2566, 1213, 15945, 13, 1678, 736, 1065, 29918, 8758, 29918, 5504, 29918, 5696, 29898, 29934, 1799, 29737, 29889, 12650, 29889, 497, 3285, 525, 5504, 29918, 18798, 742, 4744, 29892, 11815, 29897, 13, 2 ]
114_Flatten_Binary_Tree_to_Linked_List.py
joshlyman/Josh-LeetCode
0
190037
<reponame>joshlyman/Josh-LeetCode # refer from: # https://leetcode.com/problems/flatten-binary-tree-to-linked-list/solution/ # 2. Iterative Morris traversal class Solution: def flatten(self, root: TreeNode) -> None: """ Do not return anything, modify root in-place instead. """ # Handle the null scenario if not root: return None node = root while node: # If the node has a left child if node.left: # Find the rightmost node rightmost = node.left while rightmost.right: rightmost = rightmost.right # rewire the connections rightmost.right = node.right node.right = node.left node.left = None # move on to the right side of the tree node = node.right # Time: O(N) # Space:O(1) # 3.Use reversed preorder traversal # find rightmost node first, then back to left from bottom to top # preorder is root -> left -> right, here is right -> left -> root def __init__(self): self.prev = None def flatten(self, root): if not root: return None self.flatten(root.right) self.flatten(root.left) root.right = self.prev root.left = None self.prev = root # Time: O(N) # Space:O(1)
[ 1, 529, 276, 1112, 420, 29958, 29926, 10578, 368, 1171, 29914, 29967, 10578, 29899, 3226, 300, 3399, 13, 29937, 2737, 515, 29901, 13, 29937, 2045, 597, 280, 300, 401, 29889, 510, 29914, 17199, 29879, 29914, 1579, 8606, 29899, 19541, 29899, 8336, 29899, 517, 29899, 2324, 287, 29899, 1761, 29914, 2929, 918, 29914, 13, 13, 29937, 29871, 29906, 29889, 20504, 1230, 23112, 13310, 284, 259, 13, 1990, 24380, 29901, 13, 268, 13, 1678, 822, 1652, 8606, 29898, 1311, 29892, 3876, 29901, 15472, 4247, 29897, 1599, 6213, 29901, 13, 4706, 9995, 13, 4706, 1938, 451, 736, 3099, 29892, 6623, 3876, 297, 29899, 6689, 2012, 29889, 13, 4706, 9995, 13, 308, 13, 4706, 396, 29273, 278, 1870, 10483, 13, 4706, 565, 451, 3876, 29901, 13, 9651, 736, 6213, 13, 308, 13, 4706, 2943, 353, 3876, 13, 4706, 1550, 2943, 29901, 13, 632, 13, 9651, 396, 960, 278, 2943, 756, 263, 2175, 2278, 13, 9651, 565, 2943, 29889, 1563, 29901, 13, 462, 13, 18884, 396, 10987, 278, 1492, 3242, 2943, 13, 18884, 1492, 3242, 353, 2943, 29889, 1563, 13, 18884, 1550, 1492, 3242, 29889, 1266, 29901, 13, 462, 1678, 1492, 3242, 353, 1492, 3242, 29889, 1266, 13, 462, 13, 18884, 396, 337, 22376, 278, 12368, 13, 18884, 1492, 3242, 29889, 1266, 353, 2943, 29889, 1266, 13, 18884, 2943, 29889, 1266, 353, 2943, 29889, 1563, 13, 18884, 2943, 29889, 1563, 353, 6213, 13, 632, 13, 9651, 396, 4337, 373, 304, 278, 1492, 2625, 310, 278, 5447, 13, 9651, 2943, 353, 2943, 29889, 1266, 13, 13, 29937, 5974, 29901, 438, 29898, 29940, 29897, 13, 29937, 14121, 29901, 29949, 29898, 29896, 29897, 965, 13, 13, 29937, 29871, 29941, 29889, 11403, 18764, 287, 758, 2098, 13310, 284, 29871, 13, 29937, 1284, 1492, 3242, 2943, 937, 29892, 769, 1250, 304, 2175, 515, 5970, 304, 2246, 13, 29937, 758, 2098, 338, 3876, 1599, 2175, 1599, 1492, 29892, 1244, 338, 1492, 1599, 2175, 1599, 3876, 29871, 13, 13, 1753, 4770, 2344, 12035, 1311, 1125, 13, 1678, 1583, 29889, 16304, 353, 6213, 13, 268, 13, 1753, 1652, 8606, 29898, 1311, 29892, 3876, 1125, 13, 1678, 565, 451, 3876, 29901, 13, 4706, 736, 6213, 13, 1678, 1583, 29889, 1579, 8606, 29898, 4632, 29889, 1266, 29897, 13, 1678, 1583, 29889, 1579, 8606, 29898, 4632, 29889, 1563, 29897, 13, 268, 13, 1678, 3876, 29889, 1266, 353, 1583, 29889, 16304, 13, 1678, 3876, 29889, 1563, 353, 6213, 13, 1678, 1583, 29889, 16304, 353, 3876, 13, 13, 13, 13, 29937, 5974, 29901, 438, 29898, 29940, 29897, 13, 29937, 14121, 29901, 29949, 29898, 29896, 29897, 2 ]
qbot/plugins/cmc_xkcd.py
landmaj/qbot
3
113871
import logging from qbot.core import registry from qbot.db import plugin_storage from qbot.message import Image, OutgoingMessage, Text, send_message from qbot.plugins.cmc import comic PLUGIN_NAME = "xkcd" LATEST_COMIC_KEY = "latest_comic" logger = logging.getLogger(__name__) @comic async def xkcd(): last_seen_comic = await registry.database.fetch_val( plugin_storage.select().where( (plugin_storage.c.plugin == PLUGIN_NAME) & (plugin_storage.c.key == LATEST_COMIC_KEY) ), column=plugin_storage.c.data, ) try: resp = await registry.http_client.get("https://xkcd.com/info.0.json") except Exception: logger.exception("Failed to retrieve latest XKCD comic.") return if not 200 <= resp.status_code < 400: logger.error(f"Incorrect response from XKCD. Status: {resp.status_code}") return data = resp.json() if data["num"] != last_seen_comic: thread_ts = await send_message( OutgoingMessage( channel=registry.CHANNEL_COMICS, thread_ts=None, blocks=[ Text(f"https://xkcd.com - {data['safe_title']}"), Image(image_url=data["img"], alt_text="XKCD"), ], ) ) await send_message( OutgoingMessage( channel=registry.CHANNEL_COMICS, thread_ts=thread_ts, blocks=[Text(data["alt"])], ) ) if last_seen_comic is None: await registry.database.execute( plugin_storage.insert(), values={ "plugin": PLUGIN_NAME, "key": LATEST_COMIC_KEY, "data": data["num"], }, ) else: await registry.database.execute( plugin_storage.update().where( (plugin_storage.c.plugin == PLUGIN_NAME) & (plugin_storage.c.key == LATEST_COMIC_KEY) ), values={"data": data["num"]}, )
[ 1, 1053, 12183, 13, 13, 3166, 3855, 7451, 29889, 3221, 1053, 21235, 13, 3166, 3855, 7451, 29889, 2585, 1053, 7079, 29918, 12925, 13, 3166, 3855, 7451, 29889, 4906, 1053, 7084, 29892, 4451, 17696, 3728, 29892, 3992, 29892, 3638, 29918, 4906, 13, 3166, 3855, 7451, 29889, 12800, 29889, 4912, 29883, 1053, 419, 293, 13, 13, 7390, 23338, 1177, 29918, 5813, 353, 376, 29916, 29895, 2252, 29908, 13, 29931, 3040, 1254, 29918, 19795, 2965, 29918, 10818, 353, 376, 12333, 29918, 510, 293, 29908, 13, 13, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 13, 29992, 510, 293, 13, 12674, 822, 921, 29895, 2252, 7295, 13, 1678, 1833, 29918, 28026, 29918, 510, 293, 353, 7272, 21235, 29889, 9803, 29889, 9155, 29918, 791, 29898, 13, 4706, 7079, 29918, 12925, 29889, 2622, 2141, 3062, 29898, 13, 9651, 313, 8582, 29918, 12925, 29889, 29883, 29889, 8582, 1275, 16507, 23338, 1177, 29918, 5813, 29897, 13, 9651, 669, 313, 8582, 29918, 12925, 29889, 29883, 29889, 1989, 1275, 365, 3040, 1254, 29918, 19795, 2965, 29918, 10818, 29897, 13, 4706, 10353, 13, 4706, 1897, 29922, 8582, 29918, 12925, 29889, 29883, 29889, 1272, 29892, 13, 1678, 1723, 13, 1678, 1018, 29901, 13, 4706, 4613, 353, 7272, 21235, 29889, 1124, 29918, 4645, 29889, 657, 703, 991, 597, 29916, 29895, 2252, 29889, 510, 29914, 3888, 29889, 29900, 29889, 3126, 1159, 13, 1678, 5174, 8960, 29901, 13, 4706, 17927, 29889, 11739, 703, 17776, 304, 10563, 9281, 1060, 29968, 6530, 419, 293, 23157, 13, 4706, 736, 13, 1678, 565, 451, 29871, 29906, 29900, 29900, 5277, 4613, 29889, 4882, 29918, 401, 529, 29871, 29946, 29900, 29900, 29901, 13, 4706, 17927, 29889, 2704, 29898, 29888, 29908, 797, 15728, 2933, 515, 1060, 29968, 6530, 29889, 16034, 29901, 426, 13713, 29889, 4882, 29918, 401, 27195, 13, 4706, 736, 13, 1678, 848, 353, 4613, 29889, 3126, 580, 13, 1678, 565, 848, 3366, 1949, 3108, 2804, 1833, 29918, 28026, 29918, 510, 293, 29901, 13, 4706, 3244, 29918, 1372, 353, 7272, 3638, 29918, 4906, 29898, 13, 9651, 4451, 17696, 3728, 29898, 13, 18884, 8242, 29922, 1727, 6020, 29889, 3210, 2190, 29940, 6670, 29918, 19795, 2965, 29903, 29892, 13, 18884, 3244, 29918, 1372, 29922, 8516, 29892, 13, 18884, 10930, 11759, 13, 462, 1678, 3992, 29898, 29888, 29908, 991, 597, 29916, 29895, 2252, 29889, 510, 448, 426, 1272, 1839, 11177, 29918, 3257, 2033, 29913, 4968, 13, 462, 1678, 7084, 29898, 3027, 29918, 2271, 29922, 1272, 3366, 2492, 12436, 5272, 29918, 726, 543, 29990, 29968, 6530, 4968, 13, 18884, 21251, 13, 9651, 1723, 13, 4706, 1723, 13, 4706, 7272, 3638, 29918, 4906, 29898, 13, 9651, 4451, 17696, 3728, 29898, 13, 18884, 8242, 29922, 1727, 6020, 29889, 3210, 2190, 29940, 6670, 29918, 19795, 2965, 29903, 29892, 13, 18884, 3244, 29918, 1372, 29922, 7097, 29918, 1372, 29892, 13, 18884, 10930, 11759, 1626, 29898, 1272, 3366, 1997, 20068, 1402, 13, 9651, 1723, 13, 4706, 1723, 13, 4706, 565, 1833, 29918, 28026, 29918, 510, 293, 338, 6213, 29901, 13, 9651, 7272, 21235, 29889, 9803, 29889, 7978, 29898, 13, 18884, 7079, 29918, 12925, 29889, 7851, 3285, 13, 18884, 1819, 3790, 13, 462, 1678, 376, 8582, 1115, 16507, 23338, 1177, 29918, 5813, 29892, 13, 462, 1678, 376, 1989, 1115, 365, 3040, 1254, 29918, 19795, 2965, 29918, 10818, 29892, 13, 462, 1678, 376, 1272, 1115, 848, 3366, 1949, 12436, 13, 18884, 2981, 13, 9651, 1723, 13, 4706, 1683, 29901, 13, 9651, 7272, 21235, 29889, 9803, 29889, 7978, 29898, 13, 18884, 7079, 29918, 12925, 29889, 5504, 2141, 3062, 29898, 13, 462, 1678, 313, 8582, 29918, 12925, 29889, 29883, 29889, 8582, 1275, 16507, 23338, 1177, 29918, 5813, 29897, 13, 462, 1678, 669, 313, 8582, 29918, 12925, 29889, 29883, 29889, 1989, 1275, 365, 3040, 1254, 29918, 19795, 2965, 29918, 10818, 29897, 13, 18884, 10353, 13, 18884, 1819, 3790, 29908, 1272, 1115, 848, 3366, 1949, 3108, 1118, 13, 9651, 1723, 13, 2 ]
django_de/news/views.py
django-de/django-de-v3
1
157746
<filename>django_de/news/views.py<gh_stars>1-10 from django.db.models.query import Q from django.http import HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from . import models def news_list(request, year=None, month=None, day=None): """ A simple index view that can be restricted to a certain year, year+month or year+month+day. """ query = models.NewsItem.objects filter_ = Q() if year is not None: filter_ &= Q(pub_date__year=int(year)) if month is not None: filter_ &= Q(pub_date__month=int(month)) if day is not None: filter_ &= Q(pub_date__day=int(day)) if filter_ is not None: query = query.filter(filter_) return render(request, 'news/list.html', { 'object_list': query, 'months': models.NewsItem.objects.dates('pub_date', 'month', order='DESC'), }) def news_detail(request, pk, slug=None): """ Presents a single newsitem. """ item = get_object_or_404(models.NewsItem.objects, pk=pk) return render(request, 'news/detail.html', { 'object': item, }) def news_shortcut(request, pk): item = get_object_or_404(models.NewsItem.objects, pk=pk) return HttpResponseRedirect(item.get_absolute_url())
[ 1, 529, 9507, 29958, 14095, 29918, 311, 29914, 15753, 29914, 7406, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 9557, 29889, 2585, 29889, 9794, 29889, 1972, 1053, 660, 13, 3166, 9557, 29889, 1124, 1053, 9056, 5103, 24735, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 4050, 29892, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 13, 13, 3166, 869, 1053, 4733, 13, 13, 13, 1753, 9763, 29918, 1761, 29898, 3827, 29892, 1629, 29922, 8516, 29892, 4098, 29922, 8516, 29892, 2462, 29922, 8516, 1125, 13, 1678, 9995, 13, 1678, 319, 2560, 2380, 1776, 393, 508, 367, 22078, 304, 263, 3058, 1629, 29892, 1629, 29974, 10874, 470, 13, 1678, 1629, 29974, 10874, 29974, 3250, 29889, 13, 1678, 9995, 13, 1678, 2346, 353, 4733, 29889, 29328, 2001, 29889, 12650, 13, 1678, 4175, 29918, 353, 660, 580, 13, 1678, 565, 1629, 338, 451, 6213, 29901, 13, 4706, 4175, 29918, 7878, 660, 29898, 5467, 29918, 1256, 1649, 6360, 29922, 524, 29898, 6360, 876, 13, 1678, 565, 4098, 338, 451, 6213, 29901, 13, 4706, 4175, 29918, 7878, 660, 29898, 5467, 29918, 1256, 1649, 10874, 29922, 524, 29898, 10874, 876, 13, 1678, 565, 2462, 338, 451, 6213, 29901, 13, 4706, 4175, 29918, 7878, 660, 29898, 5467, 29918, 1256, 1649, 3250, 29922, 524, 29898, 3250, 876, 13, 1678, 565, 4175, 29918, 338, 451, 6213, 29901, 13, 4706, 2346, 353, 2346, 29889, 4572, 29898, 4572, 19925, 13, 13, 1678, 736, 4050, 29898, 3827, 29892, 525, 15753, 29914, 1761, 29889, 1420, 742, 426, 13, 4706, 525, 3318, 29918, 1761, 2396, 2346, 29892, 13, 4706, 525, 10874, 29879, 2396, 4733, 29889, 29328, 2001, 29889, 12650, 29889, 15190, 877, 5467, 29918, 1256, 742, 525, 10874, 742, 13, 462, 462, 18884, 1797, 2433, 2287, 7187, 5477, 13, 1678, 5615, 13, 13, 13, 1753, 9763, 29918, 16432, 29898, 3827, 29892, 282, 29895, 29892, 2243, 688, 29922, 8516, 1125, 13, 1678, 9995, 13, 1678, 4360, 1237, 263, 2323, 9763, 667, 29889, 13, 1678, 9995, 13, 1678, 2944, 353, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29898, 9794, 29889, 29328, 2001, 29889, 12650, 29892, 282, 29895, 29922, 20571, 29897, 13, 13, 1678, 736, 4050, 29898, 3827, 29892, 525, 15753, 29914, 16432, 29889, 1420, 742, 426, 13, 4706, 525, 3318, 2396, 2944, 29892, 13, 1678, 5615, 13, 13, 13, 1753, 9763, 29918, 12759, 7582, 29898, 3827, 29892, 282, 29895, 1125, 13, 1678, 2944, 353, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29898, 9794, 29889, 29328, 2001, 29889, 12650, 29892, 282, 29895, 29922, 20571, 29897, 13, 1678, 736, 9056, 5103, 24735, 29898, 667, 29889, 657, 29918, 23552, 29918, 2271, 3101, 13, 2 ]
sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/operation_status.py
pjquirk/azure-sdk-for-python
1
64917
# 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. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from msrest.serialization import Model class OperationStatus(Model): """Operation status object. Operation refers to the asynchronous backend task including taking a snapshot and applying a snapshot. All required parameters must be populated in order to send to Azure. :param status: Required. Operation status: notstarted, running, succeeded, failed. If the operation is requested and waiting to perform, the status is notstarted. If the operation is ongoing in backend, the status is running. Status succeeded means the operation is completed successfully, specifically for snapshot taking operation, it illustrates the snapshot is well taken and ready to apply, and for snapshot applying operation, it presents the target object has finished creating by the snapshot and ready to be used. Status failed is often caused by editing the source object while taking the snapshot or editing the target object while applying the snapshot before completion, see the field "message" to check the failure reason. Possible values include: 'notstarted', 'running', 'succeeded', 'failed' :type status: str or ~azure.cognitiveservices.vision.face.models.OperationStatusType :param created_time: Required. A combined UTC date and time string that describes the time when the operation (take or apply a snapshot) is requested. E.g. 2018-12-25T11:41:02.2331413Z. :type created_time: datetime :param last_action_time: A combined UTC date and time string that describes the last time the operation (take or apply a snapshot) is actively migrating data. The lastActionTime will keep increasing until the operation finishes. E.g. 2018-12-25T11:51:27.8705696Z. :type last_action_time: datetime :param resource_location: When the operation succeeds successfully, for snapshot taking operation the snapshot id will be included in this field, and for snapshot applying operation, the path to get the target object will be returned in this field. :type resource_location: str :param message: Show failure message when operation fails (omitted when operation succeeds). :type message: str """ _validation = { 'status': {'required': True}, 'created_time': {'required': True}, } _attribute_map = { 'status': {'key': 'status', 'type': 'OperationStatusType'}, 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, 'last_action_time': {'key': 'lastActionTime', 'type': 'iso-8601'}, 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, } def __init__(self, **kwargs): super(OperationStatus, self).__init__(**kwargs) self.status = kwargs.get('status', None) self.created_time = kwargs.get('created_time', None) self.last_action_time = kwargs.get('last_action_time', None) self.resource_location = kwargs.get('resource_location', None) self.message = kwargs.get('message', None)
[ 1, 396, 14137, 29922, 9420, 29899, 29947, 13, 29937, 448, 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, 13, 29937, 5920, 5759, 491, 7783, 313, 29934, 29897, 11133, 15078, 5920, 3251, 1061, 29889, 13, 29937, 678, 6916, 1122, 4556, 10240, 6030, 322, 674, 367, 5714, 565, 278, 775, 338, 13, 29937, 1072, 759, 630, 29889, 13, 29937, 448, 2683, 2683, 2683, 2683, 1378, 29899, 13, 13, 3166, 10887, 5060, 29889, 15550, 2133, 1053, 8125, 13, 13, 13, 1990, 20462, 5709, 29898, 3195, 1125, 13, 1678, 9995, 10925, 4660, 1203, 29889, 20462, 14637, 304, 278, 20489, 14998, 3414, 13, 1678, 3704, 5622, 263, 22395, 322, 15399, 263, 22395, 29889, 13, 13, 1678, 2178, 3734, 4128, 1818, 367, 24146, 297, 1797, 304, 3638, 304, 12634, 29889, 13, 13, 1678, 584, 3207, 4660, 29901, 830, 5958, 29889, 20462, 4660, 29901, 451, 2962, 287, 29892, 2734, 29892, 14792, 29892, 13, 268, 5229, 29889, 960, 278, 5858, 338, 13877, 322, 10534, 304, 2189, 29892, 278, 4660, 13, 268, 338, 451, 2962, 287, 29889, 960, 278, 5858, 338, 373, 17696, 297, 14998, 29892, 278, 4660, 338, 13, 268, 2734, 29889, 16034, 14792, 2794, 278, 5858, 338, 8676, 8472, 29892, 13, 268, 10816, 363, 22395, 5622, 5858, 29892, 372, 8632, 1078, 278, 22395, 338, 13, 268, 1532, 4586, 322, 7960, 304, 3394, 29892, 322, 363, 22395, 15399, 5858, 29892, 372, 13, 268, 22981, 278, 3646, 1203, 756, 7743, 4969, 491, 278, 22395, 322, 7960, 13, 268, 304, 367, 1304, 29889, 16034, 5229, 338, 4049, 8581, 491, 16278, 278, 2752, 1203, 13, 268, 1550, 5622, 278, 22395, 470, 16278, 278, 3646, 1203, 1550, 15399, 278, 13, 268, 22395, 1434, 13285, 29892, 1074, 278, 1746, 376, 4906, 29908, 304, 1423, 278, 10672, 13, 268, 2769, 29889, 20049, 1819, 3160, 29901, 525, 1333, 2962, 287, 742, 525, 21094, 742, 525, 29879, 1682, 3947, 287, 742, 13, 268, 525, 26061, 29915, 13, 1678, 584, 1853, 4660, 29901, 851, 470, 13, 268, 3695, 17688, 29889, 29883, 3811, 277, 3145, 6972, 1575, 29889, 4924, 29889, 2161, 29889, 9794, 29889, 10925, 5709, 1542, 13, 1678, 584, 3207, 2825, 29918, 2230, 29901, 830, 5958, 29889, 319, 12420, 17998, 2635, 322, 931, 1347, 393, 13, 268, 16612, 278, 931, 746, 278, 5858, 313, 19730, 470, 3394, 263, 22395, 29897, 338, 13, 268, 13877, 29889, 382, 29889, 29887, 29889, 29871, 29906, 29900, 29896, 29947, 29899, 29896, 29906, 29899, 29906, 29945, 29911, 29896, 29896, 29901, 29946, 29896, 29901, 29900, 29906, 29889, 29906, 29941, 29941, 29896, 29946, 29896, 29941, 29999, 29889, 13, 1678, 584, 1853, 2825, 29918, 2230, 29901, 12865, 13, 1678, 584, 3207, 1833, 29918, 2467, 29918, 2230, 29901, 319, 12420, 17998, 2635, 322, 931, 1347, 393, 13, 268, 16612, 278, 1833, 931, 278, 5858, 313, 19730, 470, 3394, 263, 22395, 29897, 338, 13, 268, 1044, 3598, 9725, 1218, 848, 29889, 450, 1833, 4276, 2481, 674, 3013, 10231, 2745, 278, 13, 268, 5858, 8341, 267, 29889, 382, 29889, 29887, 29889, 29871, 29906, 29900, 29896, 29947, 29899, 29896, 29906, 29899, 29906, 29945, 29911, 29896, 29896, 29901, 29945, 29896, 29901, 29906, 29955, 29889, 29947, 29955, 29900, 29945, 29953, 29929, 29953, 29999, 29889, 13, 1678, 584, 1853, 1833, 29918, 2467, 29918, 2230, 29901, 12865, 13, 1678, 584, 3207, 6503, 29918, 5479, 29901, 1932, 278, 5858, 9269, 29879, 8472, 29892, 363, 13, 268, 22395, 5622, 5858, 278, 22395, 1178, 674, 367, 5134, 297, 445, 1746, 29892, 13, 268, 322, 363, 22395, 15399, 5858, 29892, 278, 2224, 304, 679, 278, 3646, 1203, 13, 268, 674, 367, 4133, 297, 445, 1746, 29889, 13, 1678, 584, 1853, 6503, 29918, 5479, 29901, 851, 13, 1678, 584, 3207, 2643, 29901, 7704, 10672, 2643, 746, 5858, 8465, 313, 290, 4430, 746, 13, 268, 5858, 9269, 29879, 467, 13, 1678, 584, 1853, 2643, 29901, 851, 13, 1678, 9995, 13, 13, 1678, 903, 18157, 353, 426, 13, 4706, 525, 4882, 2396, 11117, 12403, 2396, 5852, 1118, 13, 4706, 525, 11600, 29918, 2230, 2396, 11117, 12403, 2396, 5852, 1118, 13, 1678, 500, 13, 13, 1678, 903, 12715, 29918, 1958, 353, 426, 13, 4706, 525, 4882, 2396, 11117, 1989, 2396, 525, 4882, 742, 525, 1853, 2396, 525, 10925, 5709, 1542, 16675, 13, 4706, 525, 11600, 29918, 2230, 2396, 11117, 1989, 2396, 525, 11600, 2481, 742, 525, 1853, 2396, 525, 10718, 29899, 29947, 29953, 29900, 29896, 16675, 13, 4706, 525, 4230, 29918, 2467, 29918, 2230, 2396, 11117, 1989, 2396, 525, 4230, 4276, 2481, 742, 525, 1853, 2396, 525, 10718, 29899, 29947, 29953, 29900, 29896, 16675, 13, 4706, 525, 10314, 29918, 5479, 2396, 11117, 1989, 2396, 525, 10314, 6508, 742, 525, 1853, 2396, 525, 710, 16675, 13, 4706, 525, 4906, 2396, 11117, 1989, 2396, 525, 4906, 742, 525, 1853, 2396, 525, 710, 16675, 13, 1678, 500, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3579, 19290, 1125, 13, 4706, 2428, 29898, 10925, 5709, 29892, 1583, 467, 1649, 2344, 12035, 1068, 19290, 29897, 13, 4706, 1583, 29889, 4882, 353, 9049, 5085, 29889, 657, 877, 4882, 742, 6213, 29897, 13, 4706, 1583, 29889, 11600, 29918, 2230, 353, 9049, 5085, 29889, 657, 877, 11600, 29918, 2230, 742, 6213, 29897, 13, 4706, 1583, 29889, 4230, 29918, 2467, 29918, 2230, 353, 9049, 5085, 29889, 657, 877, 4230, 29918, 2467, 29918, 2230, 742, 6213, 29897, 13, 4706, 1583, 29889, 10314, 29918, 5479, 353, 9049, 5085, 29889, 657, 877, 10314, 29918, 5479, 742, 6213, 29897, 13, 4706, 1583, 29889, 4906, 353, 9049, 5085, 29889, 657, 877, 4906, 742, 6213, 29897, 13, 2 ]
silx/gui/plot/test/testPlotTools.py
PiRK/silx
0
97273
<gh_stars>0 # coding: utf-8 # /*########################################################################## # # Copyright (c) 2016-2017 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # # ###########################################################################*/ """Basic tests for PlotTools""" __authors__ = ["<NAME>"] __license__ = "MIT" __date__ = "05/12/2016" import numpy import unittest from silx.test.utils import ParametricTestCase, TestLogging from silx.gui.test.utils import ( qWaitForWindowExposedAndActivate, TestCaseQt, getQToolButtonFromAction) from silx.gui import qt from silx.gui.plot import Plot2D, PlotWindow, PlotTools # Makes sure a QApplication exists _qapp = qt.QApplication.instance() or qt.QApplication([]) def _tearDownDocTest(docTest): """Tear down to use for test from docstring. Checks that plot widget is displayed """ plot = docTest.globs['plot'] qWaitForWindowExposedAndActivate(plot) plot.setAttribute(qt.Qt.WA_DeleteOnClose) plot.close() del plot # Disable doctest because of # "NameError: name 'numpy' is not defined" # # import doctest # positionInfoTestSuite = doctest.DocTestSuite( # PlotTools, tearDown=_tearDownDocTest, # optionflags=doctest.ELLIPSIS) # """Test suite of tests from PlotTools docstrings. # # Test PositionInfo and ProfileToolBar docstrings. # """ class TestPositionInfo(TestCaseQt): """Tests for PositionInfo widget.""" def setUp(self): super(TestPositionInfo, self).setUp() self.plot = PlotWindow() self.plot.show() self.qWaitForWindowExposed(self.plot) self.mouseMove(self.plot, pos=(1, 1)) self.qapp.processEvents() self.qWait(100) def tearDown(self): self.plot.setAttribute(qt.Qt.WA_DeleteOnClose) self.plot.close() del self.plot super(TestPositionInfo, self).tearDown() def _test(self, positionWidget, converterNames, **kwargs): """General test of PositionInfo. - Add it to a toolbar and - Move mouse around the center of the PlotWindow. """ toolBar = qt.QToolBar() self.plot.addToolBar(qt.Qt.BottomToolBarArea, toolBar) toolBar.addWidget(positionWidget) converters = positionWidget.getConverters() self.assertEqual(len(converters), len(converterNames)) for index, name in enumerate(converterNames): self.assertEqual(converters[index][0], name) with TestLogging(PlotTools.__name__, **kwargs): # Move mouse to center self.mouseMove(self.plot) self.mouseMove(self.plot, pos=(1, 1)) self.qapp.processEvents() self.qWait(100) def testDefaultConverters(self): """Test PositionInfo with default converters""" positionWidget = PlotTools.PositionInfo(plot=self.plot) self._test(positionWidget, ('X', 'Y')) def testCustomConverters(self): """Test PositionInfo with custom converters""" converters = [ ('Coords', lambda x, y: (int(x), int(y))), ('Radius', lambda x, y: numpy.sqrt(x * x + y * y)), ('Angle', lambda x, y: numpy.degrees(numpy.arctan2(y, x))) ] positionWidget = PlotTools.PositionInfo(plot=self.plot, converters=converters) self._test(positionWidget, ('Coords', 'Radius', 'Angle')) def testFailingConverters(self): """Test PositionInfo with failing custom converters""" def raiseException(x, y): raise RuntimeError() positionWidget = PlotTools.PositionInfo( plot=self.plot, converters=[('Exception', raiseException)]) self._test(positionWidget, ['Exception'], error=2) class TestPixelIntensitiesHisto(TestCaseQt, ParametricTestCase): """Tests for ProfileToolBar widget.""" def setUp(self): super(TestPixelIntensitiesHisto, self).setUp() self.image = numpy.random.rand(100, 100) self.plotImage = Plot2D() self.plotImage.getIntensityHistogramAction().setVisible(True) def tearDown(self): del self.plotImage super(TestPixelIntensitiesHisto, self).tearDown() def testShowAndHide(self): """Simple test that the plot is showing and hiding when activating the action""" self.plotImage.addImage(self.image, origin=(0, 0), legend='sino') self.plotImage.show() histoAction = self.plotImage.getIntensityHistogramAction() # test the pixel intensity diagram is showing button = getQToolButtonFromAction(histoAction) self.assertIsNot(button, None) self.mouseMove(button) self.mouseClick(button, qt.Qt.LeftButton) self.qapp.processEvents() self.assertTrue(histoAction.getHistogramPlotWidget().isVisible()) # test the pixel intensity diagram is hiding self.qapp.setActiveWindow(self.plotImage) self.qapp.processEvents() self.mouseMove(button) self.mouseClick(button, qt.Qt.LeftButton) self.qapp.processEvents() self.assertFalse(histoAction.getHistogramPlotWidget().isVisible()) def testImageFormatInput(self): """Test multiple type as image input""" typesToTest = [numpy.uint8, numpy.int8, numpy.int16, numpy.int32, numpy.float32, numpy.float64] self.plotImage.addImage(self.image, origin=(0, 0), legend='sino') self.plotImage.show() button = getQToolButtonFromAction( self.plotImage.getIntensityHistogramAction()) self.mouseMove(button) self.mouseClick(button, qt.Qt.LeftButton) self.qapp.processEvents() for typeToTest in typesToTest: with self.subTest(typeToTest=typeToTest): self.plotImage.addImage(self.image.astype(typeToTest), origin=(0, 0), legend='sino') def suite(): test_suite = unittest.TestSuite() # test_suite.addTest(positionInfoTestSuite) for testClass in (TestPositionInfo, TestPixelIntensitiesHisto): test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase( testClass)) return test_suite if __name__ == '__main__': unittest.main(defaultTest='suite')
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 29937, 4949, 13383, 13383, 13383, 13383, 7346, 2277, 13, 29937, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29953, 29899, 29906, 29900, 29896, 29955, 7824, 10829, 305, 307, 509, 265, 4957, 11685, 14184, 1793, 13, 29937, 13, 29937, 20894, 2333, 338, 1244, 1609, 16896, 29892, 3889, 310, 8323, 29892, 304, 738, 2022, 4017, 292, 263, 3509, 13, 29937, 310, 445, 7047, 322, 6942, 5106, 2066, 313, 1552, 376, 6295, 14093, 4968, 304, 5376, 13, 29937, 297, 278, 18540, 1728, 24345, 29892, 3704, 1728, 29485, 278, 10462, 13, 29937, 304, 671, 29892, 3509, 29892, 6623, 29892, 10366, 29892, 9805, 29892, 1320, 2666, 29892, 269, 803, 1947, 29892, 322, 29914, 272, 19417, 13, 29937, 14591, 310, 278, 18540, 29892, 322, 304, 14257, 12407, 304, 6029, 278, 18540, 338, 13, 29937, 15252, 3276, 304, 437, 577, 29892, 4967, 304, 278, 1494, 5855, 29901, 13, 29937, 13, 29937, 450, 2038, 3509, 1266, 8369, 322, 445, 10751, 8369, 4091, 367, 5134, 297, 13, 29937, 599, 14591, 470, 23228, 2011, 1080, 310, 278, 18540, 29889, 13, 29937, 13, 29937, 6093, 7791, 7818, 12982, 1525, 8519, 13756, 13044, 3352, 376, 3289, 8519, 613, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29979, 8079, 13764, 29979, 476, 22255, 29892, 8528, 15094, 1799, 6323, 13, 29937, 306, 3580, 5265, 3352, 29892, 2672, 6154, 15789, 4214, 350, 2692, 6058, 27848, 3352, 7495, 6093, 399, 1718, 29934, 13566, 29059, 8079, 341, 1001, 3210, 13566, 2882, 6227, 11937, 29892, 13, 29937, 383, 1806, 8186, 1799, 15842, 319, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 5300, 405, 1164, 1177, 15860, 1177, 1692, 13780, 29889, 2672, 11698, 382, 29963, 3919, 24972, 9818, 6093, 13, 29937, 26524, 29950, 24125, 6323, 315, 4590, 29979, 22789, 3912, 379, 5607, 8032, 29903, 20700, 17705, 6181, 15842, 13764, 29979, 315, 4375, 7833, 29892, 21330, 1529, 1692, 29903, 6323, 438, 29911, 4448, 13, 29937, 17705, 2882, 6227, 11937, 29892, 12317, 2544, 4448, 2672, 13764, 319, 9838, 8079, 8707, 29911, 4717, 1783, 29892, 323, 8476, 6323, 438, 29911, 4448, 22119, 1660, 29892, 9033, 3235, 4214, 3895, 29892, 13, 29937, 19474, 8079, 6323, 2672, 8707, 8186, 9838, 22659, 6093, 7791, 7818, 12982, 1525, 6323, 6093, 501, 1660, 6323, 438, 29911, 4448, 5012, 1964, 4214, 29903, 2672, 13, 29937, 6093, 7791, 7818, 12982, 1525, 29889, 13, 29937, 13, 29937, 835, 13383, 13383, 13383, 13383, 7346, 3877, 13, 15945, 29908, 16616, 6987, 363, 18399, 24183, 15945, 29908, 13, 13, 1649, 5150, 943, 1649, 353, 6796, 29966, 5813, 29958, 3108, 13, 1649, 506, 1947, 1649, 353, 376, 26349, 29908, 13, 1649, 1256, 1649, 353, 376, 29900, 29945, 29914, 29896, 29906, 29914, 29906, 29900, 29896, 29953, 29908, 13, 13, 13, 5215, 12655, 13, 5215, 443, 27958, 13, 13, 3166, 4047, 29916, 29889, 1688, 29889, 13239, 1053, 12662, 300, 2200, 3057, 8259, 29892, 4321, 3403, 3460, 13, 3166, 4047, 29916, 29889, 23569, 29889, 1688, 29889, 13239, 1053, 313, 13, 1678, 3855, 15716, 2831, 5907, 1252, 4752, 2855, 21786, 403, 29892, 4321, 8259, 17303, 29892, 679, 29984, 12229, 3125, 4591, 4276, 29897, 13, 3166, 4047, 29916, 29889, 23569, 1053, 3855, 29873, 13, 3166, 4047, 29916, 29889, 23569, 29889, 5317, 1053, 18399, 29906, 29928, 29892, 18399, 5907, 29892, 18399, 24183, 13, 13, 13, 29937, 341, 6926, 1854, 263, 660, 4873, 4864, 13, 29918, 29939, 932, 353, 3855, 29873, 29889, 29984, 4873, 29889, 8758, 580, 470, 3855, 29873, 29889, 29984, 4873, 4197, 2314, 13, 13, 13, 1753, 903, 371, 279, 6767, 14526, 3057, 29898, 1514, 3057, 1125, 13, 1678, 9995, 29911, 799, 1623, 304, 671, 363, 1243, 515, 1574, 1807, 29889, 13, 13, 1678, 5399, 29879, 393, 6492, 11109, 338, 8833, 13, 1678, 9995, 13, 1678, 6492, 353, 1574, 3057, 29889, 23705, 29879, 1839, 5317, 2033, 13, 1678, 3855, 15716, 2831, 5907, 1252, 4752, 2855, 21786, 403, 29898, 5317, 29897, 13, 1678, 6492, 29889, 27434, 29898, 17915, 29889, 17303, 29889, 12982, 29918, 12498, 2951, 11123, 29897, 13, 1678, 6492, 29889, 5358, 580, 13, 1678, 628, 6492, 13, 13, 29937, 3295, 519, 437, 312, 342, 1363, 310, 13, 29937, 376, 1170, 2392, 29901, 1024, 525, 23749, 29915, 338, 451, 3342, 29908, 13, 29937, 13, 29937, 1053, 437, 312, 342, 13, 29937, 2602, 3401, 3057, 5091, 568, 353, 437, 312, 342, 29889, 14526, 3057, 5091, 568, 29898, 13, 29937, 268, 18399, 24183, 29892, 734, 279, 6767, 29922, 29918, 371, 279, 6767, 14526, 3057, 29892, 13, 29937, 268, 2984, 15764, 29922, 1867, 312, 342, 29889, 29923, 2208, 5690, 29903, 3235, 29897, 13, 29937, 9995, 3057, 9460, 310, 6987, 515, 18399, 24183, 1574, 19651, 29889, 13, 29937, 13, 29937, 4321, 20627, 3401, 322, 20802, 12229, 4297, 1574, 19651, 29889, 13, 29937, 9995, 13, 13, 13, 1990, 4321, 8003, 3401, 29898, 3057, 8259, 17303, 1125, 13, 1678, 9995, 24376, 363, 20627, 3401, 11109, 1213, 15945, 13, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 2428, 29898, 3057, 8003, 3401, 29892, 1583, 467, 842, 3373, 580, 13, 4706, 1583, 29889, 5317, 353, 18399, 5907, 580, 13, 4706, 1583, 29889, 5317, 29889, 4294, 580, 13, 4706, 1583, 29889, 29939, 15716, 2831, 5907, 1252, 4752, 29898, 1311, 29889, 5317, 29897, 13, 4706, 1583, 29889, 15769, 16619, 29898, 1311, 29889, 5317, 29892, 926, 7607, 29896, 29892, 29871, 29896, 876, 13, 4706, 1583, 29889, 29939, 932, 29889, 5014, 13634, 580, 13, 4706, 1583, 29889, 29939, 15716, 29898, 29896, 29900, 29900, 29897, 13, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 13, 4706, 1583, 29889, 5317, 29889, 27434, 29898, 17915, 29889, 17303, 29889, 12982, 29918, 12498, 2951, 11123, 29897, 13, 4706, 1583, 29889, 5317, 29889, 5358, 580, 13, 4706, 628, 1583, 29889, 5317, 13, 13, 4706, 2428, 29898, 3057, 8003, 3401, 29892, 1583, 467, 371, 279, 6767, 580, 13, 13, 1678, 822, 903, 1688, 29898, 1311, 29892, 2602, 8801, 29892, 29105, 8659, 29892, 3579, 19290, 1125, 13, 4706, 9995, 15263, 1243, 310, 20627, 3401, 29889, 13, 13, 4706, 448, 3462, 372, 304, 263, 29840, 322, 13, 4706, 448, 25249, 9495, 2820, 278, 4818, 310, 278, 18399, 5907, 29889, 13, 4706, 9995, 13, 4706, 5780, 4297, 353, 3855, 29873, 29889, 29984, 12229, 4297, 580, 13, 4706, 1583, 29889, 5317, 29889, 1202, 12229, 4297, 29898, 17915, 29889, 17303, 29889, 15342, 12229, 4297, 13799, 29892, 5780, 4297, 29897, 13, 13, 4706, 5780, 4297, 29889, 1202, 8801, 29898, 3283, 8801, 29897, 13, 13, 4706, 5486, 2153, 353, 2602, 8801, 29889, 657, 1168, 369, 2153, 580, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 535, 369, 2153, 511, 7431, 29898, 535, 13549, 8659, 876, 13, 4706, 363, 2380, 29892, 1024, 297, 26985, 29898, 535, 13549, 8659, 1125, 13, 9651, 1583, 29889, 9294, 9843, 29898, 535, 369, 2153, 29961, 2248, 3816, 29900, 1402, 1024, 29897, 13, 13, 4706, 411, 4321, 3403, 3460, 29898, 20867, 24183, 17255, 978, 1649, 29892, 3579, 19290, 1125, 13, 9651, 396, 25249, 9495, 304, 4818, 13, 9651, 1583, 29889, 15769, 16619, 29898, 1311, 29889, 5317, 29897, 13, 9651, 1583, 29889, 15769, 16619, 29898, 1311, 29889, 5317, 29892, 926, 7607, 29896, 29892, 29871, 29896, 876, 13, 9651, 1583, 29889, 29939, 932, 29889, 5014, 13634, 580, 13, 9651, 1583, 29889, 29939, 15716, 29898, 29896, 29900, 29900, 29897, 13, 13, 1678, 822, 1243, 4592, 1168, 369, 2153, 29898, 1311, 1125, 13, 4706, 9995, 3057, 20627, 3401, 411, 2322, 5486, 2153, 15945, 29908, 13, 4706, 2602, 8801, 353, 18399, 24183, 29889, 8003, 3401, 29898, 5317, 29922, 1311, 29889, 5317, 29897, 13, 4706, 1583, 3032, 1688, 29898, 3283, 8801, 29892, 6702, 29990, 742, 525, 29979, 8785, 13, 13, 1678, 822, 1243, 7281, 1168, 369, 2153, 29898, 1311, 1125, 13, 4706, 9995, 3057, 20627, 3401, 411, 2888, 5486, 2153, 15945, 29908, 13, 4706, 5486, 2153, 353, 518, 13, 9651, 6702, 7967, 4339, 742, 14013, 921, 29892, 343, 29901, 313, 524, 29898, 29916, 511, 938, 29898, 29891, 876, 511, 13, 9651, 6702, 20494, 742, 14013, 921, 29892, 343, 29901, 12655, 29889, 3676, 29898, 29916, 334, 921, 718, 343, 334, 343, 8243, 13, 9651, 6702, 19582, 742, 14013, 921, 29892, 343, 29901, 12655, 29889, 311, 7979, 267, 29898, 23749, 29889, 27014, 273, 29906, 29898, 29891, 29892, 921, 4961, 13, 4706, 4514, 13, 4706, 2602, 8801, 353, 18399, 24183, 29889, 8003, 3401, 29898, 5317, 29922, 1311, 29889, 5317, 29892, 13, 462, 462, 18884, 5486, 2153, 29922, 535, 369, 2153, 29897, 13, 4706, 1583, 3032, 1688, 29898, 3283, 8801, 29892, 6702, 7967, 4339, 742, 525, 20494, 742, 525, 19582, 8785, 13, 13, 1678, 822, 1243, 16243, 292, 1168, 369, 2153, 29898, 1311, 1125, 13, 4706, 9995, 3057, 20627, 3401, 411, 17581, 2888, 5486, 2153, 15945, 29908, 13, 4706, 822, 12020, 2451, 29898, 29916, 29892, 343, 1125, 13, 9651, 12020, 24875, 2392, 580, 13, 13, 4706, 2602, 8801, 353, 18399, 24183, 29889, 8003, 3401, 29898, 13, 9651, 6492, 29922, 1311, 29889, 5317, 29892, 13, 9651, 5486, 2153, 11759, 877, 2451, 742, 12020, 2451, 29897, 2314, 13, 4706, 1583, 3032, 1688, 29898, 3283, 8801, 29892, 6024, 2451, 7464, 1059, 29922, 29906, 29897, 13, 13, 13, 1990, 4321, 29637, 2928, 575, 1907, 29950, 5137, 29898, 3057, 8259, 17303, 29892, 12662, 300, 2200, 3057, 8259, 1125, 13, 1678, 9995, 24376, 363, 20802, 12229, 4297, 11109, 1213, 15945, 13, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 2428, 29898, 3057, 29637, 2928, 575, 1907, 29950, 5137, 29892, 1583, 467, 842, 3373, 580, 13, 4706, 1583, 29889, 3027, 353, 12655, 29889, 8172, 29889, 9502, 29898, 29896, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 29897, 13, 4706, 1583, 29889, 5317, 2940, 353, 18399, 29906, 29928, 580, 13, 4706, 1583, 29889, 5317, 2940, 29889, 657, 2928, 575, 537, 29950, 391, 13342, 4276, 2141, 842, 12911, 29898, 5574, 29897, 13, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 13, 4706, 628, 1583, 29889, 5317, 2940, 13, 4706, 2428, 29898, 3057, 29637, 2928, 575, 1907, 29950, 5137, 29892, 1583, 467, 371, 279, 6767, 580, 13, 13, 1678, 822, 1243, 8964, 2855, 29950, 680, 29898, 1311, 1125, 13, 4706, 9995, 15427, 1243, 393, 278, 6492, 338, 6445, 322, 25508, 746, 5039, 1218, 278, 13, 4706, 3158, 15945, 29908, 13, 4706, 1583, 29889, 5317, 2940, 29889, 1202, 2940, 29898, 1311, 29889, 3027, 29892, 3978, 7607, 29900, 29892, 29871, 29900, 511, 15983, 2433, 29879, 1789, 1495, 13, 4706, 1583, 29889, 5317, 2940, 29889, 4294, 580, 13, 13, 4706, 298, 5137, 4276, 353, 1583, 29889, 5317, 2940, 29889, 657, 2928, 575, 537, 29950, 391, 13342, 4276, 580, 13, 13, 4706, 396, 1243, 278, 15526, 26171, 13722, 338, 6445, 13, 4706, 2826, 353, 679, 29984, 12229, 3125, 4591, 4276, 29898, 29882, 5137, 4276, 29897, 13, 4706, 1583, 29889, 9294, 3624, 3664, 29898, 3092, 29892, 6213, 29897, 13, 4706, 1583, 29889, 15769, 16619, 29898, 3092, 29897, 13, 4706, 1583, 29889, 15769, 4164, 29898, 3092, 29892, 3855, 29873, 29889, 17303, 29889, 8091, 3125, 29897, 13, 4706, 1583, 29889, 29939, 932, 29889, 5014, 13634, 580, 13, 4706, 1583, 29889, 9294, 5574, 29898, 29882, 5137, 4276, 29889, 657, 29950, 391, 13342, 20867, 8801, 2141, 275, 12911, 3101, 13, 13, 4706, 396, 1243, 278, 15526, 26171, 13722, 338, 25508, 13, 4706, 1583, 29889, 29939, 932, 29889, 842, 9966, 5907, 29898, 1311, 29889, 5317, 2940, 29897, 13, 4706, 1583, 29889, 29939, 932, 29889, 5014, 13634, 580, 13, 4706, 1583, 29889, 15769, 16619, 29898, 3092, 29897, 13, 4706, 1583, 29889, 15769, 4164, 29898, 3092, 29892, 3855, 29873, 29889, 17303, 29889, 8091, 3125, 29897, 13, 4706, 1583, 29889, 29939, 932, 29889, 5014, 13634, 580, 13, 4706, 1583, 29889, 9294, 8824, 29898, 29882, 5137, 4276, 29889, 657, 29950, 391, 13342, 20867, 8801, 2141, 275, 12911, 3101, 13, 13, 1678, 822, 1243, 2940, 5809, 4290, 29898, 1311, 1125, 13, 4706, 9995, 3057, 2999, 1134, 408, 1967, 1881, 15945, 29908, 13, 4706, 4072, 1762, 3057, 353, 518, 23749, 29889, 13470, 29947, 29892, 12655, 29889, 524, 29947, 29892, 12655, 29889, 524, 29896, 29953, 29892, 12655, 29889, 524, 29941, 29906, 29892, 13, 462, 539, 12655, 29889, 7411, 29941, 29906, 29892, 12655, 29889, 7411, 29953, 29946, 29962, 13, 4706, 1583, 29889, 5317, 2940, 29889, 1202, 2940, 29898, 1311, 29889, 3027, 29892, 3978, 7607, 29900, 29892, 29871, 29900, 511, 15983, 2433, 29879, 1789, 1495, 13, 4706, 1583, 29889, 5317, 2940, 29889, 4294, 580, 13, 4706, 2826, 353, 679, 29984, 12229, 3125, 4591, 4276, 29898, 13, 9651, 1583, 29889, 5317, 2940, 29889, 657, 2928, 575, 537, 29950, 391, 13342, 4276, 3101, 13, 4706, 1583, 29889, 15769, 16619, 29898, 3092, 29897, 13, 4706, 1583, 29889, 15769, 4164, 29898, 3092, 29892, 3855, 29873, 29889, 17303, 29889, 8091, 3125, 29897, 13, 4706, 1583, 29889, 29939, 932, 29889, 5014, 13634, 580, 13, 4706, 363, 1134, 1762, 3057, 297, 4072, 1762, 3057, 29901, 13, 9651, 411, 1583, 29889, 1491, 3057, 29898, 1853, 1762, 3057, 29922, 1853, 1762, 3057, 1125, 13, 18884, 1583, 29889, 5317, 2940, 29889, 1202, 2940, 29898, 1311, 29889, 3027, 29889, 579, 668, 29898, 1853, 1762, 3057, 511, 13, 462, 462, 4706, 3978, 7607, 29900, 29892, 29871, 29900, 511, 15983, 2433, 29879, 1789, 1495, 13, 13, 13, 1753, 9460, 7295, 13, 1678, 1243, 29918, 13495, 353, 443, 27958, 29889, 3057, 5091, 568, 580, 13, 1678, 396, 1243, 29918, 13495, 29889, 1202, 3057, 29898, 3283, 3401, 3057, 5091, 568, 29897, 13, 1678, 363, 1243, 2385, 297, 313, 3057, 8003, 3401, 29892, 4321, 29637, 2928, 575, 1907, 29950, 5137, 1125, 13, 4706, 1243, 29918, 13495, 29889, 1202, 3057, 29898, 348, 27958, 29889, 4381, 3057, 10036, 29889, 1359, 24376, 4591, 3057, 8259, 29898, 13, 9651, 1243, 2385, 876, 13, 1678, 736, 1243, 29918, 13495, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 443, 27958, 29889, 3396, 29898, 4381, 3057, 2433, 13495, 1495, 13, 2 ]
scronsole/widgets/main_screen.py
bastianh/screeps_console_mod
2
18131
import urwid from scronsole.config_manager import ConfigManager from scronsole.plugin_manager import PluginManager from scronsole.widgets.main_menu import MainMenu from scronsole.widgets.server_screen import ServerScreen class MainScreen(urwid.WidgetPlaceholder): def __init__(self): super().__init__(urwid.SolidFill(u'/')) self.config = ConfigManager() self.show_main_menu() self.plugins = PluginManager(self) self.plugins.load_plugins() def show_server_screen(self, server_data): self.original_widget = ServerScreen(self, server_data) def show_main_menu(self): self.original_widget = MainMenu(self)
[ 1, 1053, 5065, 9163, 13, 13, 3166, 885, 1617, 2170, 29889, 2917, 29918, 12847, 1053, 12782, 3260, 13, 3166, 885, 1617, 2170, 29889, 8582, 29918, 12847, 1053, 1858, 3851, 3260, 13, 3166, 885, 1617, 2170, 29889, 8030, 29879, 29889, 3396, 29918, 6510, 1053, 4241, 6823, 13, 3166, 885, 1617, 2170, 29889, 8030, 29879, 29889, 2974, 29918, 10525, 1053, 5656, 11357, 13, 13, 13, 1990, 4241, 11357, 29898, 332, 9163, 29889, 8801, 22150, 7694, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 332, 9163, 29889, 13296, 333, 20876, 29898, 29884, 29915, 29914, 8785, 13, 4706, 1583, 29889, 2917, 353, 12782, 3260, 580, 13, 4706, 1583, 29889, 4294, 29918, 3396, 29918, 6510, 580, 13, 4706, 1583, 29889, 12800, 353, 1858, 3851, 3260, 29898, 1311, 29897, 13, 4706, 1583, 29889, 12800, 29889, 1359, 29918, 12800, 580, 13, 13, 1678, 822, 1510, 29918, 2974, 29918, 10525, 29898, 1311, 29892, 1923, 29918, 1272, 1125, 13, 4706, 1583, 29889, 13492, 29918, 8030, 353, 5656, 11357, 29898, 1311, 29892, 1923, 29918, 1272, 29897, 13, 13, 1678, 822, 1510, 29918, 3396, 29918, 6510, 29898, 1311, 1125, 13, 4706, 1583, 29889, 13492, 29918, 8030, 353, 4241, 6823, 29898, 1311, 29897, 13, 2 ]
python_modules/libraries/dagster-gcp/dagster_gcp/gcs/object_store.py
bitdotioinc/dagster
1
193744
import logging import sys from io import BytesIO, StringIO from google.api_core.exceptions import TooManyRequests from google.cloud import storage from dagster import check from dagster.core.storage.object_store import ObjectStore from dagster.core.types.marshal import SerializationStrategy from dagster.utils.backoff import backoff class GCSObjectStore(ObjectStore): def __init__(self, bucket, client=None): self.bucket = check.str_param(bucket, "bucket") self.client = client or storage.Client() self.bucket_obj = self.client.get_bucket(bucket) assert self.bucket_obj.exists() super(GCSObjectStore, self).__init__("gs", sep="/") def set_object(self, key, obj, serialization_strategy=None): check.str_param(key, "key") logging.info("Writing GCS object at: " + self.uri_for_key(key)) # cannot check obj since could be arbitrary Python object check.inst_param( serialization_strategy, "serialization_strategy", SerializationStrategy ) # cannot be none here if self.has_object(key): logging.warning("Removing existing GCS key: {key}".format(key=key)) backoff(self.rm_object, args=[key], retry_on=(TooManyRequests,)) with ( BytesIO() if serialization_strategy.write_mode == "wb" or sys.version_info < (3, 0) else StringIO() ) as file_like: serialization_strategy.serialize(obj, file_like) file_like.seek(0) backoff( self.bucket_obj.blob(key).upload_from_file, args=[file_like], retry_on=(TooManyRequests,), ) return self.uri_for_key(key) def get_object(self, key, serialization_strategy=None): check.str_param(key, "key") check.param_invariant(len(key) > 0, "key") check.inst_param( serialization_strategy, "serialization_strategy", SerializationStrategy ) # cannot be none here if serialization_strategy.read_mode == "rb": file_obj = BytesIO() self.bucket_obj.blob(key).download_to_file(file_obj) else: file_obj = StringIO( self.bucket_obj.blob(key) .download_as_string() .decode(serialization_strategy.encoding) ) file_obj.seek(0) obj = serialization_strategy.deserialize(file_obj) return obj, self.uri_for_key(key) def has_object(self, key): check.str_param(key, "key") check.param_invariant(len(key) > 0, "key") blobs = self.client.list_blobs(self.bucket, prefix=key) return len(list(blobs)) > 0 def rm_object(self, key): check.str_param(key, "key") check.param_invariant(len(key) > 0, "key") if self.bucket_obj.blob(key).exists(): self.bucket_obj.blob(key).delete() return self.uri_for_key(key) def cp_object(self, src, dst): check.str_param(src, "src") check.str_param(dst, "dst") source_blob = self.bucket_obj.blob(src) self.bucket_obj.copy_blob(source_blob, self.bucket_obj, dst) return ( self.uri_for_key(src), self.uri_for_key(dst), ) def uri_for_key(self, key, protocol=None): check.str_param(key, "key") protocol = check.opt_str_param(protocol, "protocol", default="gs://") return protocol + self.bucket + "/" + "{key}".format(key=key)
[ 1, 1053, 12183, 13, 5215, 10876, 13, 3166, 12013, 1053, 2648, 2167, 5971, 29892, 1714, 5971, 13, 13, 3166, 5386, 29889, 2754, 29918, 3221, 29889, 11739, 29879, 1053, 1763, 29877, 14804, 3089, 29879, 13, 3166, 5386, 29889, 9274, 1053, 8635, 13, 13, 3166, 12136, 2475, 1053, 1423, 13, 3166, 12136, 2475, 29889, 3221, 29889, 12925, 29889, 3318, 29918, 8899, 1053, 4669, 9044, 13, 3166, 12136, 2475, 29889, 3221, 29889, 8768, 29889, 3034, 23258, 1053, 18896, 2133, 26910, 13, 3166, 12136, 2475, 29889, 13239, 29889, 1627, 2696, 1053, 1250, 2696, 13, 13, 13, 1990, 402, 9295, 2061, 9044, 29898, 2061, 9044, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 20968, 29892, 3132, 29922, 8516, 1125, 13, 4706, 1583, 29889, 21454, 353, 1423, 29889, 710, 29918, 3207, 29898, 21454, 29892, 376, 21454, 1159, 13, 4706, 1583, 29889, 4645, 353, 3132, 470, 8635, 29889, 4032, 580, 13, 4706, 1583, 29889, 21454, 29918, 5415, 353, 1583, 29889, 4645, 29889, 657, 29918, 21454, 29898, 21454, 29897, 13, 4706, 4974, 1583, 29889, 21454, 29918, 5415, 29889, 9933, 580, 13, 4706, 2428, 29898, 8766, 29903, 2061, 9044, 29892, 1583, 467, 1649, 2344, 1649, 703, 3174, 613, 16345, 13802, 1159, 13, 13, 1678, 822, 731, 29918, 3318, 29898, 1311, 29892, 1820, 29892, 5446, 29892, 7797, 2133, 29918, 710, 8963, 29922, 8516, 1125, 13, 4706, 1423, 29889, 710, 29918, 3207, 29898, 1989, 29892, 376, 1989, 1159, 13, 13, 4706, 12183, 29889, 3888, 703, 29956, 768, 292, 402, 9295, 1203, 472, 29901, 376, 718, 1583, 29889, 5338, 29918, 1454, 29918, 1989, 29898, 1989, 876, 13, 13, 4706, 396, 2609, 1423, 5446, 1951, 1033, 367, 11472, 5132, 1203, 13, 4706, 1423, 29889, 2611, 29918, 3207, 29898, 13, 9651, 7797, 2133, 29918, 710, 8963, 29892, 376, 15550, 2133, 29918, 710, 8963, 613, 18896, 2133, 26910, 13, 4706, 1723, 29871, 396, 2609, 367, 5642, 1244, 13, 13, 4706, 565, 1583, 29889, 5349, 29918, 3318, 29898, 1989, 1125, 13, 9651, 12183, 29889, 27392, 703, 7301, 21081, 5923, 402, 9295, 1820, 29901, 426, 1989, 29913, 1642, 4830, 29898, 1989, 29922, 1989, 876, 13, 9651, 1250, 2696, 29898, 1311, 29889, 1758, 29918, 3318, 29892, 6389, 11759, 1989, 1402, 337, 2202, 29918, 265, 7607, 1762, 29877, 14804, 3089, 29879, 29892, 876, 13, 13, 4706, 411, 313, 13, 9651, 2648, 2167, 5971, 580, 13, 9651, 565, 7797, 2133, 29918, 710, 8963, 29889, 3539, 29918, 8513, 1275, 376, 29893, 29890, 29908, 470, 10876, 29889, 3259, 29918, 3888, 529, 313, 29941, 29892, 29871, 29900, 29897, 13, 9651, 1683, 1714, 5971, 580, 13, 4706, 1723, 408, 934, 29918, 4561, 29901, 13, 9651, 7797, 2133, 29918, 710, 8963, 29889, 643, 6646, 29898, 5415, 29892, 934, 29918, 4561, 29897, 13, 9651, 934, 29918, 4561, 29889, 344, 1416, 29898, 29900, 29897, 13, 9651, 1250, 2696, 29898, 13, 18884, 1583, 29889, 21454, 29918, 5415, 29889, 10054, 29898, 1989, 467, 9009, 29918, 3166, 29918, 1445, 29892, 13, 18884, 6389, 11759, 1445, 29918, 4561, 1402, 13, 18884, 337, 2202, 29918, 265, 7607, 1762, 29877, 14804, 3089, 29879, 29892, 511, 13, 9651, 1723, 13, 13, 4706, 736, 1583, 29889, 5338, 29918, 1454, 29918, 1989, 29898, 1989, 29897, 13, 13, 1678, 822, 679, 29918, 3318, 29898, 1311, 29892, 1820, 29892, 7797, 2133, 29918, 710, 8963, 29922, 8516, 1125, 13, 4706, 1423, 29889, 710, 29918, 3207, 29898, 1989, 29892, 376, 1989, 1159, 13, 4706, 1423, 29889, 3207, 29918, 262, 19365, 29898, 2435, 29898, 1989, 29897, 1405, 29871, 29900, 29892, 376, 1989, 1159, 13, 4706, 1423, 29889, 2611, 29918, 3207, 29898, 13, 9651, 7797, 2133, 29918, 710, 8963, 29892, 376, 15550, 2133, 29918, 710, 8963, 613, 18896, 2133, 26910, 13, 4706, 1723, 29871, 396, 2609, 367, 5642, 1244, 13, 13, 4706, 565, 7797, 2133, 29918, 710, 8963, 29889, 949, 29918, 8513, 1275, 376, 6050, 1115, 13, 9651, 934, 29918, 5415, 353, 2648, 2167, 5971, 580, 13, 9651, 1583, 29889, 21454, 29918, 5415, 29889, 10054, 29898, 1989, 467, 10382, 29918, 517, 29918, 1445, 29898, 1445, 29918, 5415, 29897, 13, 4706, 1683, 29901, 13, 9651, 934, 29918, 5415, 353, 1714, 5971, 29898, 13, 18884, 1583, 29889, 21454, 29918, 5415, 29889, 10054, 29898, 1989, 29897, 13, 18884, 869, 10382, 29918, 294, 29918, 1807, 580, 13, 18884, 869, 13808, 29898, 15550, 2133, 29918, 710, 8963, 29889, 22331, 29897, 13, 9651, 1723, 13, 13, 4706, 934, 29918, 5415, 29889, 344, 1416, 29898, 29900, 29897, 13, 13, 4706, 5446, 353, 7797, 2133, 29918, 710, 8963, 29889, 2783, 261, 6646, 29898, 1445, 29918, 5415, 29897, 13, 4706, 736, 5446, 29892, 1583, 29889, 5338, 29918, 1454, 29918, 1989, 29898, 1989, 29897, 13, 13, 1678, 822, 756, 29918, 3318, 29898, 1311, 29892, 1820, 1125, 13, 4706, 1423, 29889, 710, 29918, 3207, 29898, 1989, 29892, 376, 1989, 1159, 13, 4706, 1423, 29889, 3207, 29918, 262, 19365, 29898, 2435, 29898, 1989, 29897, 1405, 29871, 29900, 29892, 376, 1989, 1159, 13, 4706, 23755, 29879, 353, 1583, 29889, 4645, 29889, 1761, 29918, 10054, 29879, 29898, 1311, 29889, 21454, 29892, 10944, 29922, 1989, 29897, 13, 4706, 736, 7431, 29898, 1761, 29898, 10054, 29879, 876, 1405, 29871, 29900, 13, 13, 1678, 822, 20241, 29918, 3318, 29898, 1311, 29892, 1820, 1125, 13, 4706, 1423, 29889, 710, 29918, 3207, 29898, 1989, 29892, 376, 1989, 1159, 13, 4706, 1423, 29889, 3207, 29918, 262, 19365, 29898, 2435, 29898, 1989, 29897, 1405, 29871, 29900, 29892, 376, 1989, 1159, 13, 13, 4706, 565, 1583, 29889, 21454, 29918, 5415, 29889, 10054, 29898, 1989, 467, 9933, 7295, 13, 9651, 1583, 29889, 21454, 29918, 5415, 29889, 10054, 29898, 1989, 467, 8143, 580, 13, 13, 4706, 736, 1583, 29889, 5338, 29918, 1454, 29918, 1989, 29898, 1989, 29897, 13, 13, 1678, 822, 21447, 29918, 3318, 29898, 1311, 29892, 4765, 29892, 29743, 1125, 13, 4706, 1423, 29889, 710, 29918, 3207, 29898, 4351, 29892, 376, 4351, 1159, 13, 4706, 1423, 29889, 710, 29918, 3207, 29898, 22992, 29892, 376, 22992, 1159, 13, 13, 4706, 2752, 29918, 10054, 353, 1583, 29889, 21454, 29918, 5415, 29889, 10054, 29898, 4351, 29897, 13, 4706, 1583, 29889, 21454, 29918, 5415, 29889, 8552, 29918, 10054, 29898, 4993, 29918, 10054, 29892, 1583, 29889, 21454, 29918, 5415, 29892, 29743, 29897, 13, 13, 4706, 736, 313, 13, 9651, 1583, 29889, 5338, 29918, 1454, 29918, 1989, 29898, 4351, 511, 13, 9651, 1583, 29889, 5338, 29918, 1454, 29918, 1989, 29898, 22992, 511, 13, 4706, 1723, 13, 13, 1678, 822, 21333, 29918, 1454, 29918, 1989, 29898, 1311, 29892, 1820, 29892, 9608, 29922, 8516, 1125, 13, 4706, 1423, 29889, 710, 29918, 3207, 29898, 1989, 29892, 376, 1989, 1159, 13, 4706, 9608, 353, 1423, 29889, 3670, 29918, 710, 29918, 3207, 29898, 20464, 29892, 376, 20464, 613, 2322, 543, 3174, 597, 1159, 13, 4706, 736, 9608, 718, 1583, 29889, 21454, 718, 5591, 29908, 718, 29850, 1989, 29913, 1642, 4830, 29898, 1989, 29922, 1989, 29897, 13, 2 ]
api/views.py
rukbotto/reviews-django
0
27725
<gh_stars>0 from django.http import Http404 from django.shortcuts import render from rest_framework import status from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.views import APIView from api.models import Review from api.serializers import ReviewSerializer class ReviewListView(APIView): permission_classes = (IsAuthenticated,) def get(self, request, *args, **kwargs): serializer = ReviewSerializer(request.user.reviews.all(), many=True) return Response(serializer.data) def post(self, request, *args, **kwargs): data = request.data data['ip_address'] = request.META.get('REMOTE_ADDR') serializer = ReviewSerializer(data=data) if serializer.is_valid(): serializer.save(user=request.user) return Response(serializer.data, status.HTTP_201_CREATED) return Response(serializer.errors, status.HTTP_400_BAD_REQUEST) class ReviewDetailView(APIView): def get(self, request, *args, **kwargs): try: review = Review.objects.get(pk=kwargs['pk']) if request.user != review.user: return Response({}, status.HTTP_403_FORBIDDEN) except Review.DoesNotExist: raise Http404 serializer = ReviewSerializer(review) return Response(serializer.data)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 9557, 29889, 1124, 1053, 9056, 29946, 29900, 29946, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 4050, 13, 3166, 1791, 29918, 4468, 1053, 4660, 13, 3166, 1791, 29918, 4468, 29889, 17858, 6847, 1053, 1317, 6444, 4173, 630, 13, 3166, 1791, 29918, 4468, 29889, 5327, 1053, 13291, 13, 3166, 1791, 29918, 4468, 29889, 7406, 1053, 3450, 1043, 13, 13, 3166, 7882, 29889, 9794, 1053, 13957, 13, 3166, 7882, 29889, 15550, 19427, 1053, 13957, 17679, 13, 13, 13, 1990, 13957, 15660, 29898, 8787, 1043, 1125, 13, 1678, 10751, 29918, 13203, 353, 313, 3624, 6444, 4173, 630, 29892, 29897, 13, 13, 1678, 822, 679, 29898, 1311, 29892, 2009, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 7797, 3950, 353, 13957, 17679, 29898, 3827, 29889, 1792, 29889, 276, 7406, 29889, 497, 3285, 1784, 29922, 5574, 29897, 13, 4706, 736, 13291, 29898, 15550, 3950, 29889, 1272, 29897, 13, 13, 1678, 822, 1400, 29898, 1311, 29892, 2009, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 848, 353, 2009, 29889, 1272, 13, 4706, 848, 1839, 666, 29918, 7328, 2033, 353, 2009, 29889, 2303, 6040, 29889, 657, 877, 1525, 29924, 2891, 29923, 29918, 3035, 8353, 1495, 13, 4706, 7797, 3950, 353, 13957, 17679, 29898, 1272, 29922, 1272, 29897, 13, 4706, 565, 7797, 3950, 29889, 275, 29918, 3084, 7295, 13, 9651, 7797, 3950, 29889, 7620, 29898, 1792, 29922, 3827, 29889, 1792, 29897, 13, 9651, 736, 13291, 29898, 15550, 3950, 29889, 1272, 29892, 4660, 29889, 10493, 29918, 29906, 29900, 29896, 29918, 27045, 29928, 29897, 13, 4706, 736, 13291, 29898, 15550, 3950, 29889, 12523, 29892, 4660, 29889, 10493, 29918, 29946, 29900, 29900, 29918, 29933, 3035, 29918, 16244, 29897, 13, 13, 13, 1990, 13957, 16570, 1043, 29898, 8787, 1043, 1125, 13, 1678, 822, 679, 29898, 1311, 29892, 2009, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 1018, 29901, 13, 9651, 9076, 353, 13957, 29889, 12650, 29889, 657, 29898, 20571, 29922, 19290, 1839, 20571, 11287, 13, 9651, 565, 2009, 29889, 1792, 2804, 9076, 29889, 1792, 29901, 13, 18884, 736, 13291, 3319, 1118, 4660, 29889, 10493, 29918, 29946, 29900, 29941, 29918, 22051, 29933, 1367, 29928, 1430, 29897, 13, 4706, 5174, 13957, 29889, 25125, 3664, 1252, 391, 29901, 13, 9651, 12020, 9056, 29946, 29900, 29946, 13, 4706, 7797, 3950, 353, 13957, 17679, 29898, 27828, 29897, 13, 4706, 736, 13291, 29898, 15550, 3950, 29889, 1272, 29897, 13, 2 ]
Python/CCC - Mouse Move.py
RobinNash/Solutions-to-Competition-Problems
0
192569
<reponame>RobinNash/Solutions-to-Competition-Problems # Mouse Move # # November 12, 2018 # By <NAME> [c,r] = [int(i) for i in input().split(" ") if i != " "] x,y = 0,0 while True: pair = [int(i) for i in input().split(" ") if i != " "] if pair == [0,0]: break x += pair[0] y += pair[1] pair = [x,y] for i in range(2): if pair[i] > [c,r][i]: pair[i] = [c,r][i] if pair[i] < 0: pair[i] = 0 [x,y] = pair print(x,y) #1541983052.0
[ 1, 529, 276, 1112, 420, 29958, 21860, 262, 29940, 1161, 29914, 13296, 17925, 29899, 517, 29899, 6843, 300, 654, 29899, 26604, 29879, 13, 29937, 25992, 25249, 396, 30004, 13, 29937, 3979, 29871, 29896, 29906, 29892, 29871, 29906, 29900, 29896, 29947, 30004, 13, 29937, 2648, 529, 5813, 3238, 13, 30004, 13, 29961, 29883, 29892, 29878, 29962, 353, 518, 524, 29898, 29875, 29897, 363, 474, 297, 1881, 2141, 5451, 703, 16521, 565, 474, 2804, 376, 376, 29962, 30004, 13, 29916, 29892, 29891, 353, 29871, 29900, 29892, 29900, 30004, 13, 30004, 13, 8000, 5852, 29901, 30004, 13, 1678, 5101, 353, 518, 524, 29898, 29875, 29897, 363, 474, 297, 1881, 2141, 5451, 703, 16521, 565, 474, 2804, 376, 376, 29962, 30004, 13, 1678, 565, 5101, 1275, 518, 29900, 29892, 29900, 5387, 30004, 13, 4706, 2867, 30004, 13, 1678, 921, 4619, 5101, 29961, 29900, 29962, 30004, 13, 1678, 343, 4619, 5101, 29961, 29896, 29962, 30004, 13, 1678, 5101, 353, 518, 29916, 29892, 29891, 29962, 30004, 13, 1678, 363, 474, 297, 3464, 29898, 29906, 1125, 30004, 13, 4706, 565, 5101, 29961, 29875, 29962, 1405, 518, 29883, 29892, 29878, 3816, 29875, 5387, 30004, 13, 9651, 5101, 29961, 29875, 29962, 353, 518, 29883, 29892, 29878, 3816, 29875, 29962, 30004, 13, 4706, 565, 5101, 29961, 29875, 29962, 529, 29871, 29900, 29901, 30004, 13, 9651, 5101, 29961, 29875, 29962, 353, 29871, 29900, 30004, 13, 1678, 518, 29916, 29892, 29891, 29962, 353, 5101, 30004, 13, 1678, 1596, 29898, 29916, 29892, 29891, 8443, 13, 29937, 29896, 29945, 29946, 29896, 29929, 29947, 29941, 29900, 29945, 29906, 29889, 29900, 2 ]
ocr.py
tunc2112/uet-img-processing
0
17795
<gh_stars>0 from PIL import Image import cv2 import pytesseract import tesserocr from pyocr import pyocr from pyocr import builders import sys import os def get_image_filename(img_id): filename = "img_src/src{0:0>3}".format(img_id) for ext in [".png", ".jpg", ".jpeg"]: if os.path.exists(os.path.join(os.getcwd(), filename + ext)): return filename + ext def write_output(libname, img_id, text): filename = "./output/output_{1}_{0:0>3}.txt".format(img_id, libname) with open(filename, "w") as f: f.write(text) def ocr_pytesseract(img_id): img_filename = './' + get_image_filename(img_id) img = cv2.imread(img_filename, cv2.IMREAD_COLOR) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) gray = cv2.bilateralFilter(gray, 11, 17, 17) original = pytesseract.image_to_string(gray, config='') write_output(img, original) def ocr_pyocr(img_id): img_filename = './' + get_image_filename(img_id) img = cv2.imread(img_filename, cv2.IMREAD_COLOR) tools = pyocr.get_available_tools() if len(tools) == 0: print("No OCR tool found") sys.exit(1) tool = tools[0] langs = tool.get_available_languages() lang = langs[0] txt = tool.image_to_string( Image.open(img_filename), lang=lang, builder=pyocr.tesseract.builders.TextBuilder() ) write_output(img_id, txt) def ocr_tesseract(img_id): img_filename = './' + get_image_filename(img_id) txt = tesserocr.image_to_text(Image.open(img_filename)) write_output(img_id, txt)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 349, 6227, 1053, 7084, 13, 5215, 13850, 29906, 13, 5215, 282, 3637, 16136, 627, 13, 5215, 260, 16136, 8415, 13, 3166, 11451, 8415, 1053, 11451, 8415, 13, 3166, 11451, 8415, 1053, 2048, 414, 13, 5215, 10876, 13, 5215, 2897, 13, 13, 13, 1753, 679, 29918, 3027, 29918, 9507, 29898, 2492, 29918, 333, 1125, 13, 1678, 10422, 353, 376, 2492, 29918, 4351, 29914, 4351, 29912, 29900, 29901, 29900, 29958, 29941, 29913, 1642, 4830, 29898, 2492, 29918, 333, 29897, 13, 1678, 363, 1294, 297, 518, 1642, 2732, 613, 11393, 6173, 613, 11393, 26568, 3108, 29901, 13, 4706, 565, 2897, 29889, 2084, 29889, 9933, 29898, 359, 29889, 2084, 29889, 7122, 29898, 359, 29889, 657, 29883, 9970, 3285, 10422, 718, 1294, 22164, 13, 9651, 736, 10422, 718, 1294, 13, 13, 13, 1753, 2436, 29918, 4905, 29898, 1982, 978, 29892, 10153, 29918, 333, 29892, 1426, 1125, 13, 1678, 10422, 353, 376, 6904, 4905, 29914, 4905, 648, 29896, 3227, 29900, 29901, 29900, 29958, 29941, 1836, 3945, 1642, 4830, 29898, 2492, 29918, 333, 29892, 4303, 978, 29897, 13, 1678, 411, 1722, 29898, 9507, 29892, 376, 29893, 1159, 408, 285, 29901, 13, 4706, 285, 29889, 3539, 29898, 726, 29897, 13, 13, 13, 1753, 288, 7283, 29918, 2272, 29873, 16136, 627, 29898, 2492, 29918, 333, 1125, 13, 1678, 10153, 29918, 9507, 353, 19283, 29915, 718, 679, 29918, 3027, 29918, 9507, 29898, 2492, 29918, 333, 29897, 13, 1678, 10153, 353, 13850, 29906, 29889, 326, 949, 29898, 2492, 29918, 9507, 29892, 13850, 29906, 29889, 7833, 16310, 29918, 15032, 1955, 29897, 13, 1678, 16749, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 2492, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29954, 22800, 29897, 13, 1678, 16749, 353, 13850, 29906, 29889, 18152, 1008, 284, 5072, 29898, 21012, 29892, 29871, 29896, 29896, 29892, 29871, 29896, 29955, 29892, 29871, 29896, 29955, 29897, 13, 13, 1678, 2441, 353, 282, 3637, 16136, 627, 29889, 3027, 29918, 517, 29918, 1807, 29898, 21012, 29892, 2295, 2433, 1495, 13, 1678, 2436, 29918, 4905, 29898, 2492, 29892, 2441, 29897, 13, 13, 13, 1753, 288, 7283, 29918, 2272, 8415, 29898, 2492, 29918, 333, 1125, 13, 1678, 10153, 29918, 9507, 353, 19283, 29915, 718, 679, 29918, 3027, 29918, 9507, 29898, 2492, 29918, 333, 29897, 13, 1678, 10153, 353, 13850, 29906, 29889, 326, 949, 29898, 2492, 29918, 9507, 29892, 13850, 29906, 29889, 7833, 16310, 29918, 15032, 1955, 29897, 13, 1678, 8492, 353, 11451, 8415, 29889, 657, 29918, 16515, 29918, 8504, 580, 13, 1678, 565, 7431, 29898, 8504, 29897, 1275, 29871, 29900, 29901, 13, 4706, 1596, 703, 3782, 438, 11341, 5780, 1476, 1159, 13, 4706, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 1678, 5780, 353, 8492, 29961, 29900, 29962, 13, 1678, 6361, 29879, 353, 5780, 29889, 657, 29918, 16515, 29918, 29880, 8737, 580, 13, 1678, 6361, 353, 6361, 29879, 29961, 29900, 29962, 13, 1678, 13872, 353, 5780, 29889, 3027, 29918, 517, 29918, 1807, 29898, 13, 4706, 7084, 29889, 3150, 29898, 2492, 29918, 9507, 511, 13, 4706, 6361, 29922, 3893, 29892, 13, 4706, 12856, 29922, 2272, 8415, 29889, 29873, 16136, 627, 29889, 4282, 414, 29889, 1626, 5627, 580, 13, 1678, 1723, 13, 1678, 2436, 29918, 4905, 29898, 2492, 29918, 333, 29892, 13872, 29897, 13, 13, 13, 1753, 288, 7283, 29918, 29873, 16136, 627, 29898, 2492, 29918, 333, 1125, 13, 1678, 10153, 29918, 9507, 353, 19283, 29915, 718, 679, 29918, 3027, 29918, 9507, 29898, 2492, 29918, 333, 29897, 13, 1678, 13872, 353, 260, 16136, 8415, 29889, 3027, 29918, 517, 29918, 726, 29898, 2940, 29889, 3150, 29898, 2492, 29918, 9507, 876, 13, 1678, 2436, 29918, 4905, 29898, 2492, 29918, 333, 29892, 13872, 29897, 13, 2 ]
Handling Images and Pixels/Image processing - sharpen operation.py
ahmadhabib5/Computer_Vision_Bootcamp_with_Python_OpenCV_YOLO_SSD
0
64955
import numpy as np import cv2 image = cv2.imread('images/unsharp_bird.jpg') kernel = np.array([ [0, -1, 0], [-1, 5, -1], [0, -1, 0] ]) sharpen_iamge = cv2.filter2D(image, -1, kernel) cv2.imshow("original image", image) cv2.imshow("sharpen image", sharpen_iamge) cv2.waitKey(0) cv2.destroyAllWindows()
[ 1, 1053, 12655, 408, 7442, 13, 5215, 13850, 29906, 13, 13, 3027, 353, 13850, 29906, 29889, 326, 949, 877, 8346, 29914, 348, 22064, 29918, 18513, 29889, 6173, 1495, 13, 13, 17460, 353, 7442, 29889, 2378, 4197, 13, 9651, 518, 29900, 29892, 448, 29896, 29892, 259, 29900, 1402, 13, 9651, 21069, 29896, 29892, 29871, 29945, 29892, 448, 29896, 1402, 13, 9651, 518, 29900, 29892, 448, 29896, 29892, 259, 29900, 29962, 13, 308, 2314, 13, 13, 845, 279, 2238, 29918, 2829, 479, 353, 13850, 29906, 29889, 4572, 29906, 29928, 29898, 3027, 29892, 448, 29896, 29892, 8466, 29897, 13, 13, 11023, 29906, 29889, 326, 4294, 703, 13492, 1967, 613, 1967, 29897, 13, 11023, 29906, 29889, 326, 4294, 703, 845, 279, 2238, 1967, 613, 528, 279, 2238, 29918, 2829, 479, 29897, 13, 11023, 29906, 29889, 10685, 2558, 29898, 29900, 29897, 13, 11023, 29906, 29889, 20524, 3596, 7685, 580, 2 ]
scrapy_tfg/scrapy_tfg/spiders/mdeportivo_spider.py
jochoaserna/footballnews
0
98699
# -*- coding: utf-8 -*- import scrapy import re import json import urllib.parse import datetime import random class MundodeportivoSpider(scrapy.Spider): name = "md" start_urls = [ 'http://www.mundodeportivo.com/futbol/atletico-madrid', 'http://www.mundodeportivo.com/futbol/real-madrid', 'http://www.mundodeportivo.com/futbol/fc-barcelona' ] # ------------------------------------------------------------- # ORDENES # $ scrapy crawl md -a team=atletico-madrid -o md-atm.json # $ scrapy crawl md -a team=real-madrid -o md-rma.json # $ scrapy crawl md -a team=fc-barcelona -o md-bar.json # ------------------------------------------------------------- # def __init__(self, team='atletico_madrid'): # self.start_urls = ['http://www.mundodeportivo.com/futbol/%s' % team] def parse(self, response): # follow links to each news item for href in response.css('h3.story-header-title a::attr(href)').extract(): yield scrapy.Request(href, callback=self.parse_news) def parse_news(self, response): headline = response.css('h1.story-leaf-title::text')[0].extract() articleBody = ''.join(response.css('div.story-leaf-txt-p p::text ,div.story-leaf-txt-p p b::text ,div.story-leaf-txt-p p a::text').extract()) #author = response.css('div.story-leaf-author-text span::text')[0].extract() #articleSection = response.css('span.section-type::text')[0].extract() #commentCount = response.css('div.fyre-comment-count span::text')[0].extract() datePublished = response.css('div.story-leaf-body.story-leaf-indent time::attr(datetime)')[0].extract() images = response.css('div.container figure img::attr(src)')[1].extract() videos = response.css('div.html-box-center iframe::attr(src)').extract() keywords = response.css('li.story-leaf-topics-item a::text').extract() #comments = ' - '.join(response.css('div.comentario strong.numero_comentario a::text, div.comentario p.nombre span.nombre_usuario::text, div.comentario p.nombre span.nick::text, div.comentario span.fecha::text, div.comentario span+p::text, div.comentario p.nombre img::attr(src)').extract()) dateCreated = datetime.datetime.now().isoformat() url = response.url _id = str(random.randint(0,10000)) + dateCreated team = "" if bool(re.search("atletico-madrid", url)): team = "atletico" elif bool(re.search("real-madrid", url)): team = "madrid" elif bool(re.search("fc-barcelona", url)): team = "barca" else: return item = {'@context':'http://schema.org', 'headline':headline, 'articleBody':articleBody, # "author" COMMENTED BECAUSE IS MISSING IN SOME ARTICLES AND WE ARE NOT USING IT LATER #'author':author, #'articleSection':articleSection, #'commentCount':commentCount, 'datePublished':datePublished, 'images':images, 'videos':videos, 'keywords':keywords, #'comments':comments, 'dateCreated':dateCreated, 'newspaper': "md", 'url': url, 'team': team, 'id':_id } yield item return
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 24559, 2272, 13, 5215, 337, 13, 5215, 4390, 13, 5215, 3142, 1982, 29889, 5510, 13, 5215, 12865, 13, 5215, 4036, 13, 13, 1990, 341, 870, 356, 637, 4243, 5592, 1241, 29898, 1557, 336, 2272, 29889, 5592, 1241, 1125, 13, 1678, 1024, 353, 376, 3487, 29908, 13, 1678, 1369, 29918, 26045, 353, 518, 13, 4706, 525, 1124, 597, 1636, 29889, 15282, 356, 637, 4243, 29889, 510, 29914, 29888, 329, 2095, 29914, 271, 1026, 1417, 29899, 19581, 2429, 742, 13, 4706, 525, 1124, 597, 1636, 29889, 15282, 356, 637, 4243, 29889, 510, 29914, 29888, 329, 2095, 29914, 6370, 29899, 19581, 2429, 742, 13, 4706, 525, 1124, 597, 1636, 29889, 15282, 356, 637, 4243, 29889, 510, 29914, 29888, 329, 2095, 29914, 13801, 29899, 1646, 2242, 2681, 29915, 308, 13, 1678, 4514, 13, 13, 1678, 396, 448, 2683, 2683, 2683, 9072, 13, 1678, 396, 6323, 29928, 1430, 2890, 13, 1678, 396, 395, 24559, 2272, 29349, 29880, 22821, 448, 29874, 3815, 29922, 271, 1026, 1417, 29899, 19581, 2429, 448, 29877, 22821, 29899, 271, 29885, 29889, 3126, 13, 1678, 396, 395, 24559, 2272, 29349, 29880, 22821, 448, 29874, 3815, 29922, 6370, 29899, 19581, 2429, 448, 29877, 22821, 29899, 29878, 655, 29889, 3126, 13, 1678, 396, 395, 24559, 2272, 29349, 29880, 22821, 448, 29874, 3815, 29922, 13801, 29899, 1646, 2242, 2681, 448, 29877, 22821, 29899, 1646, 29889, 3126, 13, 1678, 396, 448, 2683, 2683, 2683, 9072, 13, 13, 1678, 396, 822, 4770, 2344, 12035, 1311, 29892, 3815, 2433, 271, 1026, 1417, 29918, 19581, 2429, 29374, 13, 1678, 396, 268, 1583, 29889, 2962, 29918, 26045, 353, 6024, 1124, 597, 1636, 29889, 15282, 356, 637, 4243, 29889, 510, 29914, 29888, 329, 2095, 22584, 29879, 29915, 1273, 3815, 29962, 13, 13, 1678, 822, 6088, 29898, 1311, 29892, 2933, 1125, 13, 4706, 396, 1101, 2988, 304, 1269, 9763, 2944, 13, 4706, 363, 2822, 297, 2933, 29889, 4268, 877, 29882, 29941, 29889, 24098, 29899, 6672, 29899, 3257, 263, 1057, 5552, 29898, 12653, 29897, 2824, 21111, 7295, 13, 9651, 7709, 24559, 2272, 29889, 3089, 29898, 12653, 29892, 6939, 29922, 1311, 29889, 5510, 29918, 15753, 29897, 268, 13, 13, 1678, 822, 6088, 29918, 15753, 29898, 1311, 29892, 2933, 1125, 13, 4706, 2343, 1220, 353, 2933, 29889, 4268, 877, 29882, 29896, 29889, 24098, 29899, 29500, 29899, 3257, 1057, 726, 29861, 29900, 1822, 21111, 580, 13, 4706, 4274, 8434, 353, 525, 4286, 7122, 29898, 5327, 29889, 4268, 877, 4563, 29889, 24098, 29899, 29500, 29899, 3945, 29899, 29886, 282, 1057, 726, 1919, 4563, 29889, 24098, 29899, 29500, 29899, 3945, 29899, 29886, 282, 289, 1057, 726, 1919, 4563, 29889, 24098, 29899, 29500, 29899, 3945, 29899, 29886, 282, 263, 1057, 726, 2824, 21111, 3101, 13, 4706, 396, 8921, 353, 2933, 29889, 4268, 877, 4563, 29889, 24098, 29899, 29500, 29899, 8921, 29899, 726, 10638, 1057, 726, 29861, 29900, 1822, 21111, 580, 13, 4706, 396, 7914, 13438, 353, 2933, 29889, 4268, 877, 9653, 29889, 2042, 29899, 1853, 1057, 726, 29861, 29900, 1822, 21111, 580, 13, 4706, 396, 9342, 3981, 353, 2933, 29889, 4268, 877, 4563, 29889, 29888, 29891, 276, 29899, 9342, 29899, 2798, 10638, 1057, 726, 29861, 29900, 1822, 21111, 580, 13, 4706, 2635, 21076, 3726, 353, 2933, 29889, 4268, 877, 4563, 29889, 24098, 29899, 29500, 29899, 2587, 29889, 24098, 29899, 29500, 29899, 12860, 931, 1057, 5552, 29898, 12673, 29897, 29861, 29900, 1822, 21111, 580, 13, 4706, 4558, 353, 2933, 29889, 4268, 877, 4563, 29889, 7611, 4377, 10153, 1057, 5552, 29898, 4351, 29897, 29861, 29896, 1822, 21111, 580, 13, 4706, 19707, 353, 2933, 29889, 4268, 877, 4563, 29889, 1420, 29899, 1884, 29899, 5064, 22014, 1057, 5552, 29898, 4351, 29897, 2824, 21111, 580, 13, 4706, 29361, 353, 2933, 29889, 4268, 877, 492, 29889, 24098, 29899, 29500, 29899, 3332, 1199, 29899, 667, 263, 1057, 726, 2824, 21111, 580, 13, 4706, 396, 21032, 353, 525, 448, 15300, 7122, 29898, 5327, 29889, 4268, 877, 4563, 29889, 510, 296, 2628, 4549, 29889, 1949, 1489, 29918, 510, 296, 2628, 263, 1057, 726, 29892, 1933, 29889, 510, 296, 2628, 282, 29889, 11522, 1030, 10638, 29889, 11522, 1030, 29918, 375, 22223, 1057, 726, 29892, 1933, 29889, 510, 296, 2628, 282, 29889, 11522, 1030, 10638, 29889, 19254, 1057, 726, 29892, 1933, 29889, 510, 296, 2628, 10638, 29889, 1725, 5815, 1057, 726, 29892, 1933, 29889, 510, 296, 2628, 10638, 29974, 29886, 1057, 726, 29892, 1933, 29889, 510, 296, 2628, 282, 29889, 11522, 1030, 10153, 1057, 5552, 29898, 4351, 29897, 2824, 21111, 3101, 13, 4706, 2635, 20399, 353, 12865, 29889, 12673, 29889, 3707, 2141, 10718, 4830, 580, 13, 4706, 3142, 353, 2933, 29889, 2271, 13, 4706, 903, 333, 353, 851, 29898, 8172, 29889, 9502, 524, 29898, 29900, 29892, 29896, 29900, 29900, 29900, 29900, 876, 718, 2635, 20399, 13, 4706, 3815, 353, 5124, 13, 4706, 565, 6120, 29898, 276, 29889, 4478, 703, 271, 1026, 1417, 29899, 19581, 2429, 613, 3142, 22164, 13, 9651, 3815, 353, 376, 271, 1026, 1417, 29908, 13, 4706, 25342, 6120, 29898, 276, 29889, 4478, 703, 6370, 29899, 19581, 2429, 613, 3142, 22164, 13, 9651, 3815, 353, 376, 19581, 2429, 29908, 13, 4706, 25342, 6120, 29898, 276, 29889, 4478, 703, 13801, 29899, 1646, 2242, 2681, 613, 3142, 22164, 13, 9651, 3815, 353, 376, 1646, 1113, 29908, 13, 4706, 1683, 29901, 13, 3986, 736, 632, 13, 4706, 2944, 353, 11117, 29992, 4703, 22099, 1124, 597, 11010, 29889, 990, 742, 13, 18884, 525, 2813, 1220, 2396, 2813, 1220, 29892, 13, 18884, 525, 7914, 8434, 2396, 7914, 8434, 29892, 13, 18884, 396, 376, 8921, 29908, 4810, 7428, 3919, 3352, 20700, 5454, 17171, 8519, 341, 29902, 1799, 4214, 2672, 7791, 2303, 9033, 29911, 2965, 17101, 5300, 399, 29923, 319, 1525, 6058, 3148, 4214, 13315, 365, 1299, 1001, 13, 18884, 396, 29915, 8921, 2396, 8921, 29892, 13, 18884, 396, 29915, 7914, 13438, 2396, 7914, 13438, 29892, 13, 18884, 396, 29915, 9342, 3981, 2396, 9342, 3981, 29892, 13, 18884, 525, 1256, 21076, 3726, 2396, 1256, 21076, 3726, 29892, 13, 18884, 525, 8346, 2396, 8346, 29892, 13, 18884, 525, 29894, 7958, 2396, 29894, 7958, 29892, 13, 18884, 525, 1989, 9303, 2396, 1989, 9303, 29892, 13, 18884, 396, 29915, 21032, 2396, 21032, 29892, 13, 18884, 525, 1256, 20399, 2396, 1256, 20399, 29892, 13, 18884, 525, 1482, 1028, 7202, 2396, 376, 3487, 613, 13, 18884, 525, 2271, 2396, 3142, 29892, 13, 18884, 525, 14318, 2396, 3815, 29892, 13, 18884, 525, 333, 2396, 29918, 333, 13, 18884, 500, 13, 13, 4706, 7709, 2944, 13, 4706, 736, 13, 13, 308, 2 ]
ged2json.py
FlominatorTM/tam
1
154329
""" converts a GEDCOM file into a JSON file for use in Topographic Attribute Maps (https://github.com/rpreiner/tam) this is just a proof of concept and might contain serious mistakes and problems """ import argparse import json import re __author__ = "<NAME>" def add_child(parentId, childId, idsWithNodes, nodesWithFamily, res): if parentId != "" and childId in idsWithNodes: nodesWithFamily.append(parentId) link = {"source" : parentId, "target" : childId, "directed": True} res["links"].append(link) if childId not in nodesWithFamily: nodesWithFamily.append(childId) def fill_missing_years(childNode, res): for parentId in (x for x in res['links'] if x['target'] == childNode['id']): parentNode = next((x for x in res["nodes"] if x['id'] == parentId['source']), None) if parentNode is not None and 'value' not in parentNode and 'value' in childNode: estimatedBirth = childNode['value'] - 20 print("estimated birth for " + parentNode['id'] + " (" + parentNode['name'] + "): " + str(estimatedBirth)) parentNode['value'] = estimatedBirth fill_missing_years(parentNode, res) parser = argparse.ArgumentParser(description='convert GEDCOM file to JSON file for use in Topographic Attribute Maps') parser.add_argument('gedcom', type=str, help='path to GEDCOM file') parser.add_argument('json', type=str, help='path to JSON file') args = parser.parse_args() res = {} nodesWithFamily = [] res["nodes"] = [] res["links"] = [] with open(args.gedcom, encoding='utf8', errors='ignore') as f: lines = f.readlines() node = {} husb = "" wife = "" idsWithNodes = [] for i in range(len(lines)): line = lines[i] if " INDI" in line: if "id" in node: res["nodes"].append(node) idsWithNodes.append(node["id"]) lineParts = line.split() node = {"id" : lineParts[1]} elif " FAM" in line and "id" in node: #last INDI before FAMs start res["nodes"].append(node) idsWithNodes.append(node["id"]) node = {} elif "1 NAME" in line: node["name"] = line[7:].strip().replace('/', '') elif "1 BIRT" in line and "2 DATE" in lines[i+1]: birthRow = lines[i+1] match = re.match(r'.*([1-3][0-9]{3})', birthRow) if match is not None: node["value"] = int(match.group(1)) elif "1 HUSB " in line: husb = line[7:].strip() if husb not in idsWithNodes: husb = "" elif "1 WIFE " in line: wife = line[7:].strip() if wife not in idsWithNodes: wife = "" elif "1 CHIL " in line: child = line[7:].strip() add_child(husb, child, idsWithNodes, nodesWithFamily, res) add_child(wife, child, idsWithNodes, nodesWithFamily, res) elif "0 " in line and " FAM" in line: husb = "" wife = "" nodesWithoutParents = [] for oneNode in res["nodes"]: if oneNode["id"] not in nodesWithFamily: nodesWithoutParents.append(oneNode) for orphanNode in nodesWithoutParents: try: print ("removing orphan " + orphanNode["id"] + ": " + orphanNode["name"]) except: print ("removing orphan " + orphanNode["id"] + " which cannot be displayed properly") res["nodes"].remove(orphanNode) for oneNode in res["nodes"]: fill_missing_years(oneNode, res) with open(args.json, 'w', encoding="utf8") as outfile: json.dump(res, outfile, indent=3)
[ 1, 9995, 29436, 263, 402, 3352, 19795, 934, 964, 263, 4663, 934, 363, 671, 297, 7488, 12122, 23833, 25846, 29871, 13, 29898, 991, 597, 3292, 29889, 510, 29914, 29878, 1457, 4983, 29914, 29873, 314, 29897, 13, 13, 1366, 338, 925, 263, 5296, 310, 6964, 322, 1795, 1712, 10676, 28947, 322, 4828, 13, 15945, 29908, 13, 5215, 1852, 5510, 13, 5215, 4390, 13, 5215, 337, 13, 1649, 8921, 1649, 353, 9872, 5813, 11903, 13, 13, 1753, 788, 29918, 5145, 29898, 3560, 1204, 29892, 2278, 1204, 29892, 18999, 3047, 20284, 29892, 7573, 3047, 27104, 29892, 620, 1125, 13, 1678, 565, 3847, 1204, 2804, 5124, 322, 2278, 1204, 297, 18999, 3047, 20284, 29901, 13, 4706, 7573, 3047, 27104, 29889, 4397, 29898, 3560, 1204, 29897, 13, 4706, 1544, 353, 8853, 4993, 29908, 584, 3847, 1204, 29892, 376, 5182, 29908, 584, 2278, 1204, 29892, 376, 11851, 287, 1115, 5852, 29913, 13, 4706, 620, 3366, 4965, 16862, 4397, 29898, 2324, 29897, 13, 4706, 565, 2278, 1204, 451, 297, 7573, 3047, 27104, 29901, 259, 13, 9651, 7573, 3047, 27104, 29889, 4397, 29898, 5145, 1204, 29897, 13, 13, 1753, 5445, 29918, 27259, 29918, 6360, 29879, 29898, 5145, 4247, 29892, 620, 1125, 13, 1678, 363, 3847, 1204, 297, 313, 29916, 363, 921, 297, 620, 1839, 4965, 2033, 565, 921, 1839, 5182, 2033, 1275, 2278, 4247, 1839, 333, 2033, 1125, 13, 4706, 3847, 4247, 353, 2446, 3552, 29916, 363, 921, 297, 620, 3366, 18010, 3108, 565, 921, 1839, 333, 2033, 1275, 3847, 1204, 1839, 4993, 2033, 511, 6213, 29897, 13, 4706, 565, 3847, 4247, 338, 451, 6213, 322, 525, 1767, 29915, 451, 297, 3847, 4247, 322, 525, 1767, 29915, 297, 2278, 4247, 29901, 13, 9651, 15899, 29933, 7515, 353, 2278, 4247, 1839, 1767, 2033, 448, 29871, 29906, 29900, 13, 9651, 1596, 703, 342, 326, 630, 12060, 363, 376, 718, 3847, 4247, 1839, 333, 2033, 718, 376, 4852, 718, 3847, 4247, 1839, 978, 2033, 718, 376, 1125, 376, 718, 851, 29898, 342, 326, 630, 29933, 7515, 876, 13, 9651, 3847, 4247, 1839, 1767, 2033, 353, 15899, 29933, 7515, 13, 9651, 5445, 29918, 27259, 29918, 6360, 29879, 29898, 3560, 4247, 29892, 620, 29897, 13, 268, 13, 16680, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 13441, 402, 3352, 19795, 934, 304, 4663, 934, 363, 671, 297, 7488, 12122, 23833, 25846, 1495, 13, 16680, 29889, 1202, 29918, 23516, 877, 3192, 510, 742, 1134, 29922, 710, 29892, 1371, 2433, 2084, 304, 402, 3352, 19795, 934, 1495, 13, 16680, 29889, 1202, 29918, 23516, 877, 3126, 742, 1134, 29922, 710, 29892, 1371, 2433, 2084, 304, 4663, 934, 1495, 13, 5085, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 690, 353, 6571, 13, 18010, 3047, 27104, 353, 5159, 13, 690, 3366, 18010, 3108, 353, 5159, 13, 690, 3366, 4965, 3108, 353, 5159, 13, 13, 2541, 1722, 29898, 5085, 29889, 3192, 510, 29892, 8025, 2433, 9420, 29947, 742, 4436, 2433, 17281, 1495, 408, 285, 29901, 13, 1678, 3454, 353, 285, 29889, 949, 9012, 580, 13, 1678, 2943, 353, 6571, 13, 1678, 8646, 29890, 353, 5124, 13, 1678, 6532, 353, 5124, 13, 1678, 18999, 3047, 20284, 353, 5159, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 9012, 22164, 13, 4706, 1196, 353, 3454, 29961, 29875, 29962, 13, 4706, 565, 376, 2672, 4571, 29908, 297, 1196, 29901, 13, 9651, 565, 376, 333, 29908, 297, 2943, 29901, 13, 18884, 620, 3366, 18010, 16862, 4397, 29898, 3177, 29897, 13, 18884, 18999, 3047, 20284, 29889, 4397, 29898, 3177, 3366, 333, 20068, 13, 9651, 1196, 29925, 5708, 353, 1196, 29889, 5451, 580, 13, 9651, 2943, 353, 8853, 333, 29908, 584, 1196, 29925, 5708, 29961, 29896, 12258, 13, 4706, 25342, 376, 383, 5194, 29908, 297, 1196, 322, 376, 333, 29908, 297, 2943, 29901, 13, 9651, 396, 4230, 2672, 4571, 1434, 383, 5194, 29879, 1369, 13, 9651, 620, 3366, 18010, 16862, 4397, 29898, 3177, 29897, 13, 9651, 18999, 3047, 20284, 29889, 4397, 29898, 3177, 3366, 333, 20068, 13, 9651, 2943, 353, 6571, 13, 4706, 25342, 376, 29896, 27085, 29908, 297, 1196, 29901, 13, 9651, 2943, 3366, 978, 3108, 353, 1196, 29961, 29955, 29901, 1822, 17010, 2141, 6506, 11219, 742, 27255, 13, 4706, 25342, 376, 29896, 350, 8193, 29911, 29908, 297, 1196, 322, 376, 29906, 20231, 29908, 297, 3454, 29961, 29875, 29974, 29896, 5387, 13, 9651, 12060, 4301, 353, 3454, 29961, 29875, 29974, 29896, 29962, 13, 9651, 1993, 353, 337, 29889, 4352, 29898, 29878, 4286, 29930, 4197, 29896, 29899, 29941, 3816, 29900, 29899, 29929, 3199, 29941, 1800, 742, 12060, 4301, 29897, 13, 9651, 565, 1993, 338, 451, 6213, 29901, 13, 18884, 2943, 3366, 1767, 3108, 353, 938, 29898, 4352, 29889, 2972, 29898, 29896, 876, 13, 4706, 25342, 376, 29896, 379, 29965, 1744, 376, 297, 1196, 29901, 13, 9651, 8646, 29890, 353, 1196, 29961, 29955, 29901, 1822, 17010, 580, 13, 9651, 565, 8646, 29890, 451, 297, 18999, 3047, 20284, 29901, 13, 18884, 8646, 29890, 353, 5124, 13, 4706, 25342, 376, 29896, 399, 6545, 29923, 376, 297, 1196, 29901, 13, 9651, 6532, 353, 1196, 29961, 29955, 29901, 1822, 17010, 580, 13, 9651, 565, 6532, 451, 297, 18999, 3047, 20284, 29901, 13, 18884, 6532, 353, 5124, 13, 4706, 25342, 376, 29896, 5868, 6227, 376, 297, 1196, 29901, 13, 9651, 2278, 353, 1196, 29961, 29955, 29901, 1822, 17010, 580, 13, 9651, 788, 29918, 5145, 29898, 14116, 29890, 29892, 2278, 29892, 18999, 3047, 20284, 29892, 7573, 3047, 27104, 29892, 620, 29897, 13, 9651, 788, 29918, 5145, 29898, 29893, 1607, 29892, 2278, 29892, 18999, 3047, 20284, 29892, 7573, 3047, 27104, 29892, 620, 29897, 13, 4706, 25342, 376, 29900, 376, 297, 1196, 322, 376, 383, 5194, 29908, 297, 1196, 29901, 13, 9651, 8646, 29890, 353, 5124, 13, 9651, 6532, 353, 5124, 13, 13, 18010, 3047, 449, 2177, 1237, 353, 5159, 13, 1454, 697, 4247, 297, 620, 3366, 18010, 3108, 29901, 13, 1678, 565, 697, 4247, 3366, 333, 3108, 451, 297, 7573, 3047, 27104, 29901, 13, 4706, 7573, 3047, 449, 2177, 1237, 29889, 4397, 29898, 650, 4247, 29897, 13, 13, 1454, 470, 16711, 4247, 297, 7573, 3047, 449, 2177, 1237, 29901, 13, 1678, 1018, 29901, 13, 4706, 1596, 4852, 1745, 21081, 470, 16711, 376, 718, 470, 16711, 4247, 3366, 333, 3108, 718, 29242, 376, 718, 470, 16711, 4247, 3366, 978, 20068, 13, 1678, 5174, 29901, 13, 4706, 1596, 4852, 1745, 21081, 470, 16711, 376, 718, 470, 16711, 4247, 3366, 333, 3108, 718, 376, 607, 2609, 367, 8833, 6284, 1159, 13, 1678, 620, 3366, 18010, 16862, 5992, 29898, 5676, 273, 4247, 29897, 13, 13, 1454, 697, 4247, 297, 620, 3366, 18010, 3108, 29901, 13, 1678, 5445, 29918, 27259, 29918, 6360, 29879, 29898, 650, 4247, 29892, 620, 29897, 13, 13, 2541, 1722, 29898, 5085, 29889, 3126, 29892, 525, 29893, 742, 8025, 543, 9420, 29947, 1159, 408, 714, 1445, 29901, 13, 1678, 4390, 29889, 15070, 29898, 690, 29892, 714, 1445, 29892, 29536, 29922, 29941, 29897, 13, 13, 13, 2 ]
mtl/extractors/lbirnn.py
vandurme/TFMTL
10
176763
<reponame>vandurme/TFMTL<filename>mtl/extractors/lbirnn.py<gh_stars>1-10 # Copyright 2018 Johns Hopkins University. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from six.moves import xrange import mtl.util.registry as registry from mtl.util.common import (validate_extractor_inputs, listify, unlistify) def get_multi_cell(cell_type, cell_size, num_layers): if cell_type == tf.contrib.rnn.GRUCell: cell = cell_type(cell_size, kernel_initializer=tf.contrib.layers.xavier_initializer()) elif cell_type == tf.contrib.rnn.LSTMCell: cell = cell_type(cell_size, initializer=tf.contrib.layers.xavier_initializer()) # TODO initializer??? elif cell_type == tf.contrib.rnn.SRUCell: cell = cell_type(cell_size, initializer=tf.contrib.layers.xavier_initializer()) # TODO layer num??? # elif cell_type == RANCell: # cell = cell_type(num_units=cell_size) else: cell = cell_type(cell_size) if num_layers > 1: return tf.contrib.rnn.MultiRNNCell([cell] * num_layers) else: return cell def fill_initial_state(initial_states, cells, batch_size): # replace None values with zero states initial_states = list(initial_states) # ensure mutability for i, c in enumerate(initial_states): if c is None: initial_states[i] = cells.zero_state(batch_size, tf.float32) initial_states = tuple(initial_states) # restore immutability return initial_states def get_idx(indices, batch_size): # row index [[0], [1], ..., [N]] r = tf.range(batch_size) r = tf.cast(r, dtype=tf.int64) r = tf.expand_dims(r, 1) # make sure indices are able to be concatenated with range # i.e., of the form [[idx_0], [idx_1], ..., [idx_N]] rank = len(indices.get_shape().as_list()) if rank == 1: indices = tf.expand_dims(indices, 1) elif rank == 2: pass else: raise ValueError("indices doesn't have rank 1 or 2: rank=%d" % (rank)) idx = tf.concat([r, indices], axis=1) return idx def _lbirnn_helper(inputs, lengths, is_training, indices=None, num_layers=2, cell_type=tf.contrib.rnn.LSTMCell, cell_size=64, initial_state_fwd=None, initial_state_bwd=None, scope=None, **kwargs): """Stacked linear chain bi-directional RNN Inputs _____ inputs: batch of size [batch_size, batch_len, embed_size] lengths: batch of size [batch_size] indices: which token index in each batch example should be output shape: [batch_size] or [batch_size, 1] num_layers: number of stacked layers in the bi-RNN cell_type: type of RNN cell to use (e.g., LSTM, GRU) cell_size: cell's output size initial_state_fwd: initial state for forward direction initial_state_bwd: initial state for backward direction Outputs _______ If the input word vectors have dimension D and indices is None, the output is a Tensor of size [batch_size, batch_len, cell_size_fwd + cell_size_bwd] = [batch_size, batch_len, 2*cell_size]. If indices is not None, the output is a Tensor of size [batch_size, cell_size_fwd + cell_size_bwd] = [batch_size, 2*cell_size] """ if scope is not None: scope_name = scope else: scope_name = "lbirnn" with tf.variable_scope(scope_name, reuse=tf.AUTO_REUSE) as varscope: # print("_lbirnn_helper scope={}".format(varscope)) # reverse each batch example up through its length, maintaining right-padding inputs_rev = tf.reverse_sequence(inputs, lengths, batch_axis=0, seq_axis=1) cells_fwd = get_multi_cell(cell_type, cell_size, num_layers) cells_bwd = get_multi_cell(cell_type, cell_size, num_layers) if is_training and ("output_keep_prob" in kwargs) and ( kwargs["output_keep_prob"] < 1.0): cells_fwd = tf.contrib.rnn.DropoutWrapper(cell=cells_fwd, output_keep_prob=kwargs[ "output_keep_prob"]) cells_bwd = tf.contrib.rnn.DropoutWrapper(cell=cells_bwd, output_keep_prob=kwargs[ "output_keep_prob"]) else: pass if "attention" in kwargs and kwargs["attention"] == True: if "attn_length" in kwargs: attn_length = kwargs["attn_length"] else: attn_length = 10 cells_fwd = tf.contrib.rnn.AttentionCellWrapper(cells_fwd, attn_length=attn_length) cells_bwd = tf.contrib.rnn.AttentionCellWrapper(cells_bwd, attn_length=attn_length) batch_size = tf.shape(inputs)[0] initial_state_fwd = fill_initial_state(listify(initial_state_fwd), cells_fwd, batch_size) initial_state_fwd = unlistify(initial_state_fwd) initial_state_bwd = fill_initial_state(listify(initial_state_bwd), cells_bwd, batch_size) initial_state_bwd = unlistify(initial_state_bwd) # if initial_state_fwd is None: # #initial_state_fwd = [None] # initial_state_fwd = fill_initial_state([None], cells_fwd, batch_size)#[0] # else: # initial_state_fwd = fill_initial_state(initial_state_fwd, cells_fwd, batch_size) # # if initial_state_bwd is None: # #initial_state_bwd = [None] # initial_state_bwd = fill_initial_state([None], cells_bwd, batch_size)#[0] # else: # initial_state_bwd = fill_initial_state(initial_state_bwd, cells_bwd, batch_size) code_fwd, last_state_fwd = tf.nn.dynamic_rnn(cells_fwd, inputs, sequence_length=lengths, initial_state=initial_state_fwd, time_major=False, scope="rnn_fwd") tmp, last_state_bwd = tf.nn.dynamic_rnn(cells_bwd, inputs_rev, sequence_length=lengths, initial_state=initial_state_bwd, time_major=False, scope="rnn_bwd") # reverse backward-pass outputs so they align with the forward-pass outputs code_bwd = tf.reverse_sequence(tmp, lengths, batch_axis=0, seq_axis=1) if indices is not None: idx = get_idx(indices, batch_size) # get the (indices[i])-th token's output from row i code_fwd = tf.gather_nd(code_fwd, idx) code_bwd = tf.gather_nd(code_bwd, idx) return (code_fwd, code_bwd), (last_state_fwd, last_state_bwd) """ def lbirnn(inputs, lengths, is_training, indices=None, num_layers=2, cell_type=tf.contrib.rnn.LSTMCell, cell_size=64, initial_state_fwd=None, initial_state_bwd=None, **kwargs): with tf.variable_scope("single-stage-lbirnn", reuse=tf.AUTO_REUSE) as varscope: o, _ = _lbirnn_helper(inputs, lengths, is_training=is_training, indices=indices, num_layers=num_layers, cell_type=cell_type, cell_size=cell_size, initial_state_fwd=initial_state_fwd, initial_state_bwd=initial_state_bwd, scope=varscope, **kwargs) (code_fwd, code_bwd) = o code = tf.concat([code_fwd, code_bwd], axis=-1) outputs = code return outputs """ def lbirnn(inputs, lengths, is_training, indices=None, num_layers=2, cell_type=tf.contrib.rnn.GRUCell, cell_size=64, initial_state_fwd=None, initial_state_bwd=None, **kwargs): """Serial stacked linear chain bi-directional RNN If `indices` is specified for the last stage, the outputs of the tokens in the last stage as specified by `indices` will be returned. If `indices` is None for the last stage, the encodings for all tokens in the sequence are returned. Inputs _____ All arguments denoted with (*) should be given as lists, one element per stage in the series. The specifications given below are for a single stage. inputs (*): Tensor of size [batch_size, batch_len, embed_size] lengths (*): Tensor of size [batch_size] indices: Tensor of which token index in each batch item should be output; shape: [batch_size] or [batch_size, 1] num_layers: number of stacked layers in the bi-RNN cell_type: type of RNN cell to use (e.g., LSTM, GRU) cell_size: cell's output size initial_state_fwd: initial state for forward direction, may be None initial_state_bwd: initial state for backward direction, may be None Outputs _______ If the input word vectors have dimension D and the series has N stages: if `indices` is not None: the output is a Tensor of size [batch_size, cell_size] if `indices` is None: the output is a Tensor of size [batch_size, batch_len, cell_size] """ validate_extractor_inputs(inputs, lengths) num_stages = len(inputs) fwd_ = initial_state_fwd bwd_ = initial_state_bwd prev_varscope = None for n_stage in xrange(num_stages): # with tf.variable_scope("serial_lbirnn", reuse=tf.AUTO_REUSE) as varscope: with tf.variable_scope( "serial-lbirnn-seq{}".format(n_stage)) as varscope: if prev_varscope is not None: prev_varscope.reuse_variables() if n_stage == num_stages - 1: # Use the user-specified indices on the last stage indices_ = indices else: indices_ = None o, s = _lbirnn_helper(inputs[n_stage], lengths[n_stage], is_training=is_training, indices=indices_, num_layers=num_layers, cell_type=cell_type, cell_size=cell_size, initial_state_fwd=fwd_, initial_state_bwd=bwd_, scope=varscope, **kwargs) (code_fwd, code_bwd), (last_state_fwd, last_state_bwd) = o, s # Update arguments for next stage fwd_ = last_state_fwd bwd_ = last_state_bwd prev_varscope = varscope code = tf.concat([code_fwd, code_bwd], axis=-1) outputs = code return outputs def _lbirnn_stock_helper(inputs, lengths, is_training, num_layers=2, cell_type=tf.contrib.rnn.GRUCell, cell_size=64, initial_state_fwd=None, initial_state_bwd=None, scope=None, **kwargs): scope_name = scope if scope is not None else "stock-lbirnn" with tf.variable_scope(scope_name) as varscope: cells_fwd = get_multi_cell(cell_type, cell_size, num_layers) cells_bwd = get_multi_cell(cell_type, cell_size, num_layers) if "skip_connections" in kwargs and kwargs["skip_connections"]: cells_fwd = tf.contrib.rnn.ResidualWrapper(cells_fwd) cells_bwd = tf.contrib.rnn.ResidualWrapper(cells_bwd) if is_training and ("output_keep_prob" in kwargs) and ( kwargs["output_keep_prob"] < 1.0): cells_fwd = tf.contrib.rnn.DropoutWrapper(cell=cells_fwd, output_keep_prob=kwargs[ "output_keep_prob"]) cells_bwd = tf.contrib.rnn.DropoutWrapper(cell=cells_bwd, output_keep_prob=kwargs[ "output_keep_prob"]) else: pass if "attention" in kwargs and kwargs["attention"] == True: if "attn_length" in kwargs: attn_length = kwargs["attn_length"] else: attn_length = 10 cells_fwd = tf.contrib.rnn.AttentionCellWrapper(cells_fwd, attn_length=attn_length) cells_bwd = tf.contrib.rnn.AttentionCellWrapper(cells_bwd, attn_length=attn_length) outputs, last_states = tf.nn.bidirectional_dynamic_rnn(cells_fwd, cells_bwd, inputs, sequence_length=lengths, initial_state_fw=initial_state_fwd, initial_state_bw=initial_state_bwd, dtype=tf.float32) return outputs, last_states def lbirnn_stock(inputs, lengths, is_training, num_layers=2, cell_type=tf.contrib.rnn.GRUCell, cell_size=64, initial_state_fwd=None, initial_state_bwd=None, **kwargs): validate_extractor_inputs(inputs, lengths) num_stages = len(inputs) fwd_ = initial_state_fwd bwd_ = initial_state_bwd prev_varscope = None for n_stage in xrange(num_stages): with tf.variable_scope( "serial-lbirnn-stock-seq{}".format(n_stage)) as varscope: if prev_varscope is not None: prev_varscope.reuse_variables() code, states = _lbirnn_stock_helper(inputs[n_stage], lengths[n_stage], is_training=is_training, num_layers=num_layers, cell_type=cell_type, cell_size=cell_size, initial_state_fwd=fwd_, initial_state_bwd=bwd_, scope=varscope, **kwargs) fwd_ = states[0] bwd_ = states[1] prev_varscope = varscope # concatenate hx_fwd and hx_bwd of top layer # `states` = ((cx_fwd, hx_fwd), (cx_bwd, hx_bwd)) # TODO for GRU if num_layers > 1: # shape states: [2, num_layers, 2] # (cf. https://github.com/coastalcph/mtl-disparate/blob/master/mtl/nn.py#L43) if cell_type == tf.contrib.rnn.GRUCell: # TODO pass elif cell_type == tf.contrib.rnn.LSTMCell: output = tf.concat([states[0][-1][1], states[1][-1][1]], 1) else: # shape states: [2, 2] # (cf. https://github.com/coastalcph/mtl-disparate/blob/master/mtl/nn.py#L40) # if cell_type == tf.contrib.rnn.GRUCell or cell_type == RANCell: if cell_type == tf.contrib.rnn.GRUCell: output = tf.concat([states[0], states[1]], 1) elif cell_type == tf.contrib.rnn.LSTMCell: output = tf.concat([states[0][1], states[1][1]], 1) return output @registry.register_hparams def sRUDER_NAACL18_HPARAMS(): hp = tf.contrib.training.HParams( cell_type='lstm', cell_size=100, num_layers=1, keep_prob=0.5 ) return hp @registry.register_encoder def ruder_encoder(inputs, lengths, is_training, hp=None): assert type(inputs) is list assert type(lengths) is list assert len(inputs) == len(lengths) assert len(inputs) == 2 assert hp is not None num_input_dim = len(inputs[0].get_shape().as_list()) assert num_input_dim == 3 # BATCH X TIME X EMBED num_length_dim = len(lengths[0].get_shape().as_list()) assert num_length_dim == 1 if hp.cell_type == 'gru': cell_type = tf.contrib.rnn.GRUCell elif hp.cell_type == 'lstm': cell_type = tf.contrib.rnn.LSTMCell else: raise ValueError(hp.cell_type) keep_prob = hp.keep_prob if is_training else 1.0 code = lbirnn_stock(inputs, lengths, is_training=is_training, num_layers=hp.num_layers, cell_type=cell_type, cell_size=hp.cell_size) assert len(code.get_shape().as_list()) == 2 return code
[ 1, 529, 276, 1112, 420, 29958, 29894, 392, 332, 1004, 29914, 8969, 11490, 29931, 29966, 9507, 29958, 4378, 29880, 29914, 21111, 943, 29914, 29880, 20397, 15755, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29947, 1861, 1983, 20727, 11335, 3014, 29889, 2178, 26863, 2538, 9841, 29889, 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, 1678, 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, 29871, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 29937, 1275, 9166, 9166, 9166, 9166, 4936, 1360, 13, 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, 13, 5215, 26110, 408, 15886, 13, 3166, 4832, 29889, 13529, 267, 1053, 921, 3881, 13, 13, 5215, 286, 15206, 29889, 4422, 29889, 1727, 6020, 408, 21235, 13, 3166, 286, 15206, 29889, 4422, 29889, 9435, 1053, 313, 15480, 29918, 21111, 272, 29918, 2080, 29879, 29892, 13, 462, 632, 1051, 1598, 29892, 13, 462, 632, 443, 1761, 1598, 29897, 13, 13, 13, 1753, 679, 29918, 9910, 29918, 3729, 29898, 3729, 29918, 1853, 29892, 3038, 29918, 2311, 29892, 954, 29918, 29277, 1125, 13, 1678, 565, 3038, 29918, 1853, 1275, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 14345, 29965, 4617, 29901, 13, 4706, 3038, 353, 3038, 29918, 1853, 29898, 3729, 29918, 2311, 29892, 13, 462, 308, 8466, 29918, 11228, 3950, 29922, 13264, 29889, 21570, 29889, 29277, 29889, 29916, 18852, 29918, 11228, 3950, 3101, 13, 1678, 25342, 3038, 29918, 1853, 1275, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 29931, 1254, 29924, 4617, 29901, 13, 4706, 3038, 353, 3038, 29918, 1853, 29898, 3729, 29918, 2311, 29892, 13, 462, 308, 2847, 3950, 29922, 13264, 29889, 21570, 29889, 29277, 29889, 29916, 18852, 29918, 11228, 3950, 3101, 13, 1678, 396, 14402, 2847, 3950, 28772, 13, 1678, 25342, 3038, 29918, 1853, 1275, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 14098, 29965, 4617, 29901, 13, 4706, 3038, 353, 3038, 29918, 1853, 29898, 3729, 29918, 2311, 29892, 13, 462, 308, 2847, 3950, 29922, 13264, 29889, 21570, 29889, 29277, 29889, 29916, 18852, 29918, 11228, 3950, 3101, 13, 1678, 396, 14402, 7546, 954, 28772, 13, 1678, 396, 25342, 3038, 29918, 1853, 1275, 390, 2190, 4617, 29901, 13, 1678, 396, 268, 3038, 353, 3038, 29918, 1853, 29898, 1949, 29918, 348, 1169, 29922, 3729, 29918, 2311, 29897, 13, 1678, 1683, 29901, 13, 4706, 3038, 353, 3038, 29918, 1853, 29898, 3729, 29918, 2311, 29897, 13, 13, 1678, 565, 954, 29918, 29277, 1405, 29871, 29896, 29901, 13, 4706, 736, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 15329, 29934, 10262, 4617, 4197, 3729, 29962, 334, 954, 29918, 29277, 29897, 13, 1678, 1683, 29901, 13, 4706, 736, 3038, 13, 13, 13, 1753, 5445, 29918, 11228, 29918, 3859, 29898, 11228, 29918, 28631, 29892, 9101, 29892, 9853, 29918, 2311, 1125, 13, 1678, 396, 5191, 6213, 1819, 411, 5225, 5922, 13, 1678, 2847, 29918, 28631, 353, 1051, 29898, 11228, 29918, 28631, 29897, 29871, 396, 9801, 5478, 3097, 13, 1678, 363, 474, 29892, 274, 297, 26985, 29898, 11228, 29918, 28631, 1125, 13, 4706, 565, 274, 338, 6213, 29901, 13, 9651, 2847, 29918, 28631, 29961, 29875, 29962, 353, 9101, 29889, 9171, 29918, 3859, 29898, 16175, 29918, 2311, 29892, 13, 462, 462, 462, 15886, 29889, 7411, 29941, 29906, 29897, 13, 1678, 2847, 29918, 28631, 353, 18761, 29898, 11228, 29918, 28631, 29897, 29871, 396, 17749, 5198, 329, 3097, 13, 13, 1678, 736, 2847, 29918, 28631, 13, 13, 13, 1753, 679, 29918, 13140, 29898, 513, 1575, 29892, 9853, 29918, 2311, 1125, 13, 1678, 396, 1948, 2380, 5519, 29900, 1402, 518, 29896, 1402, 2023, 29892, 518, 29940, 5262, 13, 1678, 364, 353, 15886, 29889, 3881, 29898, 16175, 29918, 2311, 29897, 13, 1678, 364, 353, 15886, 29889, 4384, 29898, 29878, 29892, 26688, 29922, 13264, 29889, 524, 29953, 29946, 29897, 13, 1678, 364, 353, 15886, 29889, 18837, 29918, 6229, 29879, 29898, 29878, 29892, 29871, 29896, 29897, 13, 13, 1678, 396, 1207, 1854, 16285, 526, 2221, 304, 367, 16125, 630, 411, 3464, 13, 1678, 396, 474, 29889, 29872, 1696, 310, 278, 883, 5519, 13140, 29918, 29900, 1402, 518, 13140, 29918, 29896, 1402, 2023, 29892, 518, 13140, 29918, 29940, 5262, 13, 1678, 7115, 353, 7431, 29898, 513, 1575, 29889, 657, 29918, 12181, 2141, 294, 29918, 1761, 3101, 13, 1678, 565, 7115, 1275, 29871, 29896, 29901, 13, 4706, 16285, 353, 15886, 29889, 18837, 29918, 6229, 29879, 29898, 513, 1575, 29892, 29871, 29896, 29897, 13, 1678, 25342, 7115, 1275, 29871, 29906, 29901, 13, 4706, 1209, 13, 1678, 1683, 29901, 13, 4706, 12020, 7865, 2392, 703, 513, 1575, 1838, 29915, 29873, 505, 7115, 29871, 29896, 470, 29871, 29906, 29901, 7115, 16328, 29881, 29908, 1273, 313, 10003, 876, 13, 13, 1678, 22645, 353, 15886, 29889, 17685, 4197, 29878, 29892, 16285, 1402, 9685, 29922, 29896, 29897, 13, 13, 1678, 736, 22645, 13, 13, 13, 1753, 903, 29880, 20397, 15755, 29918, 20907, 29898, 2080, 29879, 29892, 13, 462, 259, 27497, 29892, 13, 462, 259, 338, 29918, 26495, 29892, 13, 462, 259, 16285, 29922, 8516, 29892, 13, 462, 259, 954, 29918, 29277, 29922, 29906, 29892, 13, 462, 259, 3038, 29918, 1853, 29922, 13264, 29889, 21570, 29889, 29878, 15755, 29889, 29931, 1254, 29924, 4617, 29892, 13, 462, 259, 3038, 29918, 2311, 29922, 29953, 29946, 29892, 13, 462, 259, 2847, 29918, 3859, 29918, 29888, 9970, 29922, 8516, 29892, 13, 462, 259, 2847, 29918, 3859, 29918, 29890, 9970, 29922, 8516, 29892, 13, 462, 259, 6874, 29922, 8516, 29892, 13, 462, 259, 3579, 19290, 1125, 13, 1678, 9995, 7264, 287, 5608, 9704, 4768, 29899, 20845, 284, 390, 10262, 13, 13, 1678, 10567, 29879, 13, 1678, 903, 7652, 13, 418, 10970, 29901, 9853, 310, 2159, 518, 16175, 29918, 2311, 29892, 9853, 29918, 2435, 29892, 8297, 29918, 2311, 29962, 13, 418, 27497, 29901, 9853, 310, 2159, 518, 16175, 29918, 2311, 29962, 13, 418, 16285, 29901, 607, 5993, 2380, 297, 1269, 9853, 1342, 881, 367, 1962, 13, 1669, 8267, 29901, 518, 16175, 29918, 2311, 29962, 470, 518, 16175, 29918, 2311, 29892, 29871, 29896, 29962, 13, 418, 954, 29918, 29277, 29901, 1353, 310, 5096, 287, 15359, 297, 278, 4768, 29899, 29934, 10262, 13, 418, 3038, 29918, 1853, 29901, 1134, 310, 390, 10262, 3038, 304, 671, 313, 29872, 29889, 29887, 1696, 365, 1254, 29924, 29892, 18016, 29965, 29897, 13, 418, 3038, 29918, 2311, 29901, 3038, 29915, 29879, 1962, 2159, 13, 418, 2847, 29918, 3859, 29918, 29888, 9970, 29901, 2847, 2106, 363, 6375, 5305, 13, 418, 2847, 29918, 3859, 29918, 29890, 9970, 29901, 2847, 2106, 363, 1250, 1328, 5305, 13, 13, 1678, 10604, 29879, 13, 1678, 903, 7652, 1649, 13, 418, 960, 278, 1881, 1734, 12047, 505, 9927, 360, 322, 16285, 338, 6213, 29892, 13, 418, 278, 1962, 338, 263, 323, 6073, 310, 2159, 13, 4706, 518, 16175, 29918, 2311, 29892, 9853, 29918, 2435, 29892, 3038, 29918, 2311, 29918, 29888, 9970, 718, 3038, 29918, 2311, 29918, 29890, 9970, 29962, 13, 3986, 353, 518, 16175, 29918, 2311, 29892, 9853, 29918, 2435, 29892, 29871, 29906, 29930, 3729, 29918, 2311, 1822, 13, 13, 418, 960, 16285, 338, 451, 6213, 29892, 278, 1962, 338, 263, 323, 6073, 310, 2159, 13, 4706, 518, 16175, 29918, 2311, 29892, 3038, 29918, 2311, 29918, 29888, 9970, 718, 3038, 29918, 2311, 29918, 29890, 9970, 29962, 13, 3986, 353, 518, 16175, 29918, 2311, 29892, 29871, 29906, 29930, 3729, 29918, 2311, 29962, 13, 1678, 9995, 13, 13, 1678, 565, 6874, 338, 451, 6213, 29901, 13, 4706, 6874, 29918, 978, 353, 6874, 13, 1678, 1683, 29901, 13, 4706, 6874, 29918, 978, 353, 376, 29880, 20397, 15755, 29908, 13, 1678, 411, 15886, 29889, 11918, 29918, 6078, 29898, 6078, 29918, 978, 29892, 24270, 29922, 13264, 29889, 20656, 29949, 29918, 1525, 17171, 29897, 408, 722, 6078, 29901, 13, 4706, 396, 1596, 703, 29918, 29880, 20397, 15755, 29918, 20907, 6874, 3790, 29913, 1642, 4830, 29898, 16908, 4338, 876, 13, 4706, 396, 11837, 1269, 9853, 1342, 701, 1549, 967, 3309, 29892, 7344, 292, 1492, 29899, 12791, 13, 4706, 10970, 29918, 13478, 353, 15886, 29889, 24244, 29918, 16506, 29898, 2080, 29879, 29892, 27497, 29892, 9853, 29918, 8990, 29922, 29900, 29892, 13, 462, 462, 308, 19359, 29918, 8990, 29922, 29896, 29897, 13, 13, 4706, 9101, 29918, 29888, 9970, 353, 679, 29918, 9910, 29918, 3729, 29898, 3729, 29918, 1853, 29892, 3038, 29918, 2311, 29892, 954, 29918, 29277, 29897, 13, 4706, 9101, 29918, 29890, 9970, 353, 679, 29918, 9910, 29918, 3729, 29898, 3729, 29918, 1853, 29892, 3038, 29918, 2311, 29892, 954, 29918, 29277, 29897, 13, 13, 4706, 565, 338, 29918, 26495, 322, 4852, 4905, 29918, 17462, 29918, 22795, 29908, 297, 9049, 5085, 29897, 322, 313, 13, 9651, 9049, 5085, 3366, 4905, 29918, 17462, 29918, 22795, 3108, 529, 29871, 29896, 29889, 29900, 1125, 13, 9651, 9101, 29918, 29888, 9970, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 15063, 449, 15646, 29898, 3729, 29922, 3729, 29879, 29918, 29888, 9970, 29892, 13, 462, 462, 462, 418, 1962, 29918, 17462, 29918, 22795, 29922, 19290, 29961, 13, 462, 462, 462, 3986, 376, 4905, 29918, 17462, 29918, 22795, 20068, 13, 9651, 9101, 29918, 29890, 9970, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 15063, 449, 15646, 29898, 3729, 29922, 3729, 29879, 29918, 29890, 9970, 29892, 13, 462, 462, 462, 418, 1962, 29918, 17462, 29918, 22795, 29922, 19290, 29961, 13, 462, 462, 462, 3986, 376, 4905, 29918, 17462, 29918, 22795, 20068, 13, 4706, 1683, 29901, 13, 9651, 1209, 13, 13, 4706, 565, 376, 1131, 2509, 29908, 297, 9049, 5085, 322, 9049, 5085, 3366, 1131, 2509, 3108, 1275, 5852, 29901, 13, 9651, 565, 376, 1131, 29876, 29918, 2848, 29908, 297, 9049, 5085, 29901, 13, 18884, 1098, 29876, 29918, 2848, 353, 9049, 5085, 3366, 1131, 29876, 29918, 2848, 3108, 13, 9651, 1683, 29901, 13, 18884, 1098, 29876, 29918, 2848, 353, 29871, 29896, 29900, 13, 9651, 9101, 29918, 29888, 9970, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 4165, 2509, 4617, 15646, 29898, 3729, 29879, 29918, 29888, 9970, 29892, 13, 462, 462, 462, 9651, 1098, 29876, 29918, 2848, 29922, 1131, 29876, 29918, 2848, 29897, 13, 9651, 9101, 29918, 29890, 9970, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 4165, 2509, 4617, 15646, 29898, 3729, 29879, 29918, 29890, 9970, 29892, 13, 462, 462, 462, 9651, 1098, 29876, 29918, 2848, 29922, 1131, 29876, 29918, 2848, 29897, 13, 13, 4706, 9853, 29918, 2311, 353, 15886, 29889, 12181, 29898, 2080, 29879, 9601, 29900, 29962, 13, 13, 4706, 2847, 29918, 3859, 29918, 29888, 9970, 353, 5445, 29918, 11228, 29918, 3859, 29898, 1761, 1598, 29898, 11228, 29918, 3859, 29918, 29888, 9970, 511, 13, 462, 462, 1669, 9101, 29918, 29888, 9970, 29892, 13, 462, 462, 1669, 9853, 29918, 2311, 29897, 13, 4706, 2847, 29918, 3859, 29918, 29888, 9970, 353, 443, 1761, 1598, 29898, 11228, 29918, 3859, 29918, 29888, 9970, 29897, 13, 13, 4706, 2847, 29918, 3859, 29918, 29890, 9970, 353, 5445, 29918, 11228, 29918, 3859, 29898, 1761, 1598, 29898, 11228, 29918, 3859, 29918, 29890, 9970, 511, 13, 462, 462, 1669, 9101, 29918, 29890, 9970, 29892, 13, 462, 462, 1669, 9853, 29918, 2311, 29897, 13, 4706, 2847, 29918, 3859, 29918, 29890, 9970, 353, 443, 1761, 1598, 29898, 11228, 29918, 3859, 29918, 29890, 9970, 29897, 13, 13, 4706, 396, 565, 2847, 29918, 3859, 29918, 29888, 9970, 338, 6213, 29901, 13, 4706, 396, 259, 396, 11228, 29918, 3859, 29918, 29888, 9970, 353, 518, 8516, 29962, 13, 4706, 396, 259, 2847, 29918, 3859, 29918, 29888, 9970, 353, 5445, 29918, 11228, 29918, 3859, 4197, 8516, 1402, 9101, 29918, 29888, 9970, 29892, 9853, 29918, 2311, 29897, 29937, 29961, 29900, 29962, 13, 4706, 396, 1683, 29901, 13, 4706, 396, 259, 2847, 29918, 3859, 29918, 29888, 9970, 353, 5445, 29918, 11228, 29918, 3859, 29898, 11228, 29918, 3859, 29918, 29888, 9970, 29892, 9101, 29918, 29888, 9970, 29892, 9853, 29918, 2311, 29897, 13, 4706, 396, 13, 4706, 396, 565, 2847, 29918, 3859, 29918, 29890, 9970, 338, 6213, 29901, 13, 4706, 396, 259, 396, 11228, 29918, 3859, 29918, 29890, 9970, 353, 518, 8516, 29962, 13, 4706, 396, 259, 2847, 29918, 3859, 29918, 29890, 9970, 353, 5445, 29918, 11228, 29918, 3859, 4197, 8516, 1402, 9101, 29918, 29890, 9970, 29892, 9853, 29918, 2311, 29897, 29937, 29961, 29900, 29962, 13, 4706, 396, 1683, 29901, 13, 4706, 396, 259, 2847, 29918, 3859, 29918, 29890, 9970, 353, 5445, 29918, 11228, 29918, 3859, 29898, 11228, 29918, 3859, 29918, 29890, 9970, 29892, 9101, 29918, 29890, 9970, 29892, 9853, 29918, 2311, 29897, 13, 13, 4706, 775, 29918, 29888, 9970, 29892, 1833, 29918, 3859, 29918, 29888, 9970, 353, 15886, 29889, 15755, 29889, 16626, 29918, 29878, 15755, 29898, 3729, 29879, 29918, 29888, 9970, 29892, 13, 462, 462, 462, 268, 10970, 29892, 13, 462, 462, 462, 268, 5665, 29918, 2848, 29922, 2848, 29879, 29892, 13, 462, 462, 462, 268, 2847, 29918, 3859, 29922, 11228, 29918, 3859, 29918, 29888, 9970, 29892, 13, 462, 462, 462, 268, 931, 29918, 21355, 29922, 8824, 29892, 13, 462, 462, 462, 268, 6874, 543, 29878, 15755, 29918, 29888, 9970, 1159, 13, 13, 4706, 13128, 29892, 1833, 29918, 3859, 29918, 29890, 9970, 353, 15886, 29889, 15755, 29889, 16626, 29918, 29878, 15755, 29898, 3729, 29879, 29918, 29890, 9970, 29892, 13, 462, 462, 18884, 10970, 29918, 13478, 29892, 13, 462, 462, 18884, 5665, 29918, 2848, 29922, 2848, 29879, 29892, 13, 462, 462, 18884, 2847, 29918, 3859, 29922, 11228, 29918, 3859, 29918, 29890, 9970, 29892, 13, 462, 462, 18884, 931, 29918, 21355, 29922, 8824, 29892, 13, 462, 462, 18884, 6874, 543, 29878, 15755, 29918, 29890, 9970, 1159, 13, 4706, 396, 11837, 1250, 1328, 29899, 3364, 14391, 577, 896, 7595, 411, 278, 6375, 29899, 3364, 14391, 13, 4706, 775, 29918, 29890, 9970, 353, 15886, 29889, 24244, 29918, 16506, 29898, 7050, 29892, 27497, 29892, 9853, 29918, 8990, 29922, 29900, 29892, 19359, 29918, 8990, 29922, 29896, 29897, 13, 13, 4706, 565, 16285, 338, 451, 6213, 29901, 13, 9651, 22645, 353, 679, 29918, 13140, 29898, 513, 1575, 29892, 9853, 29918, 2311, 29897, 13, 13, 9651, 396, 679, 278, 313, 513, 1575, 29961, 29875, 2314, 29899, 386, 5993, 29915, 29879, 1962, 515, 1948, 474, 13, 9651, 775, 29918, 29888, 9970, 353, 15886, 29889, 29887, 1624, 29918, 299, 29898, 401, 29918, 29888, 9970, 29892, 22645, 29897, 13, 9651, 775, 29918, 29890, 9970, 353, 15886, 29889, 29887, 1624, 29918, 299, 29898, 401, 29918, 29890, 9970, 29892, 22645, 29897, 13, 13, 4706, 736, 313, 401, 29918, 29888, 9970, 29892, 775, 29918, 29890, 9970, 511, 313, 4230, 29918, 3859, 29918, 29888, 9970, 29892, 1833, 29918, 3859, 29918, 29890, 9970, 29897, 13, 13, 13, 15945, 29908, 13, 1753, 301, 20397, 15755, 29898, 2080, 29879, 29892, 13, 965, 27497, 29892, 13, 965, 338, 29918, 26495, 29892, 13, 965, 16285, 29922, 8516, 29892, 13, 965, 954, 29918, 29277, 29922, 29906, 29892, 13, 965, 3038, 29918, 1853, 29922, 13264, 29889, 21570, 29889, 29878, 15755, 29889, 29931, 1254, 29924, 4617, 29892, 13, 965, 3038, 29918, 2311, 29922, 29953, 29946, 29892, 13, 965, 2847, 29918, 3859, 29918, 29888, 9970, 29922, 8516, 29892, 13, 965, 2847, 29918, 3859, 29918, 29890, 9970, 29922, 8516, 29892, 13, 965, 3579, 19290, 1125, 13, 29871, 411, 15886, 29889, 11918, 29918, 6078, 703, 14369, 29899, 19190, 29899, 29880, 20397, 15755, 613, 24270, 29922, 13264, 29889, 20656, 29949, 29918, 1525, 17171, 29897, 408, 722, 6078, 29901, 13, 1678, 288, 29892, 903, 353, 903, 29880, 20397, 15755, 29918, 20907, 29898, 2080, 29879, 29892, 13, 462, 3986, 27497, 29892, 13, 462, 3986, 338, 29918, 26495, 29922, 275, 29918, 26495, 29892, 13, 462, 3986, 16285, 29922, 513, 1575, 29892, 13, 462, 3986, 954, 29918, 29277, 29922, 1949, 29918, 29277, 29892, 13, 462, 3986, 3038, 29918, 1853, 29922, 3729, 29918, 1853, 29892, 13, 462, 3986, 3038, 29918, 2311, 29922, 3729, 29918, 2311, 29892, 13, 462, 3986, 2847, 29918, 3859, 29918, 29888, 9970, 29922, 11228, 29918, 3859, 29918, 29888, 9970, 29892, 13, 462, 3986, 2847, 29918, 3859, 29918, 29890, 9970, 29922, 11228, 29918, 3859, 29918, 29890, 9970, 29892, 13, 462, 3986, 6874, 29922, 16908, 4338, 29892, 13, 462, 3986, 3579, 19290, 29897, 13, 1678, 313, 401, 29918, 29888, 9970, 29892, 775, 29918, 29890, 9970, 29897, 353, 288, 13, 13, 1678, 775, 353, 15886, 29889, 17685, 4197, 401, 29918, 29888, 9970, 29892, 775, 29918, 29890, 9970, 1402, 9685, 10457, 29896, 29897, 13, 1678, 14391, 353, 775, 13, 13, 1678, 736, 14391, 13, 15945, 29908, 13, 13, 13, 1753, 301, 20397, 15755, 29898, 2080, 29879, 29892, 13, 965, 27497, 29892, 13, 965, 338, 29918, 26495, 29892, 13, 965, 16285, 29922, 8516, 29892, 13, 965, 954, 29918, 29277, 29922, 29906, 29892, 13, 965, 3038, 29918, 1853, 29922, 13264, 29889, 21570, 29889, 29878, 15755, 29889, 14345, 29965, 4617, 29892, 13, 965, 3038, 29918, 2311, 29922, 29953, 29946, 29892, 13, 965, 2847, 29918, 3859, 29918, 29888, 9970, 29922, 8516, 29892, 13, 965, 2847, 29918, 3859, 29918, 29890, 9970, 29922, 8516, 29892, 13, 965, 3579, 19290, 1125, 13, 1678, 9995, 9125, 5096, 287, 5608, 9704, 4768, 29899, 20845, 284, 390, 10262, 13, 13, 1678, 960, 421, 513, 1575, 29952, 338, 6790, 363, 278, 1833, 7408, 29892, 278, 14391, 310, 278, 18897, 13, 1678, 297, 278, 1833, 7408, 408, 6790, 491, 421, 513, 1575, 29952, 674, 367, 4133, 29889, 13, 1678, 960, 421, 513, 1575, 29952, 338, 6213, 363, 278, 1833, 7408, 29892, 278, 2094, 397, 886, 363, 599, 18897, 13, 1678, 297, 278, 5665, 526, 4133, 29889, 13, 13, 1678, 10567, 29879, 13, 1678, 903, 7652, 13, 418, 2178, 6273, 27291, 411, 3070, 29897, 881, 367, 2183, 408, 8857, 29892, 13, 418, 697, 1543, 639, 7408, 297, 278, 3652, 29889, 450, 2702, 800, 2183, 13, 418, 2400, 526, 363, 263, 2323, 7408, 29889, 13, 13, 418, 10970, 3070, 1125, 323, 6073, 310, 2159, 518, 16175, 29918, 2311, 29892, 9853, 29918, 2435, 29892, 8297, 29918, 2311, 29962, 13, 418, 27497, 3070, 1125, 323, 6073, 310, 2159, 518, 16175, 29918, 2311, 29962, 13, 418, 16285, 29901, 323, 6073, 310, 607, 5993, 2380, 297, 1269, 9853, 2944, 881, 367, 1962, 29936, 13, 1669, 8267, 29901, 518, 16175, 29918, 2311, 29962, 470, 518, 16175, 29918, 2311, 29892, 29871, 29896, 29962, 13, 418, 954, 29918, 29277, 29901, 1353, 310, 5096, 287, 15359, 297, 278, 4768, 29899, 29934, 10262, 13, 418, 3038, 29918, 1853, 29901, 1134, 310, 390, 10262, 3038, 304, 671, 313, 29872, 29889, 29887, 1696, 365, 1254, 29924, 29892, 18016, 29965, 29897, 13, 418, 3038, 29918, 2311, 29901, 3038, 29915, 29879, 1962, 2159, 13, 418, 2847, 29918, 3859, 29918, 29888, 9970, 29901, 2847, 2106, 363, 6375, 5305, 29892, 1122, 367, 6213, 13, 418, 2847, 29918, 3859, 29918, 29890, 9970, 29901, 2847, 2106, 363, 1250, 1328, 5305, 29892, 1122, 367, 6213, 13, 13, 1678, 10604, 29879, 13, 1678, 903, 7652, 1649, 13, 1678, 960, 278, 1881, 1734, 12047, 505, 9927, 360, 322, 278, 3652, 756, 405, 22950, 29901, 13, 1678, 565, 421, 513, 1575, 29952, 338, 451, 6213, 29901, 13, 418, 278, 1962, 338, 263, 323, 6073, 310, 2159, 518, 16175, 29918, 2311, 29892, 3038, 29918, 2311, 29962, 13, 1678, 565, 421, 513, 1575, 29952, 338, 6213, 29901, 13, 418, 278, 1962, 338, 263, 323, 6073, 310, 2159, 518, 16175, 29918, 2311, 29892, 9853, 29918, 2435, 29892, 3038, 29918, 2311, 29962, 13, 1678, 9995, 13, 13, 1678, 12725, 29918, 21111, 272, 29918, 2080, 29879, 29898, 2080, 29879, 29892, 27497, 29897, 13, 13, 1678, 954, 29918, 303, 1179, 353, 7431, 29898, 2080, 29879, 29897, 13, 13, 1678, 285, 9970, 29918, 353, 2847, 29918, 3859, 29918, 29888, 9970, 13, 1678, 289, 9970, 29918, 353, 2847, 29918, 3859, 29918, 29890, 9970, 13, 13, 1678, 12379, 29918, 16908, 4338, 353, 6213, 13, 1678, 363, 302, 29918, 19190, 297, 921, 3881, 29898, 1949, 29918, 303, 1179, 1125, 13, 4706, 396, 411, 15886, 29889, 11918, 29918, 6078, 703, 15550, 29918, 29880, 20397, 15755, 613, 24270, 29922, 13264, 29889, 20656, 29949, 29918, 1525, 17171, 29897, 408, 722, 6078, 29901, 13, 4706, 411, 15886, 29889, 11918, 29918, 6078, 29898, 13, 9651, 376, 15550, 29899, 29880, 20397, 15755, 29899, 11762, 8875, 1642, 4830, 29898, 29876, 29918, 19190, 876, 408, 722, 6078, 29901, 13, 9651, 565, 12379, 29918, 16908, 4338, 338, 451, 6213, 29901, 13, 18884, 12379, 29918, 16908, 4338, 29889, 276, 1509, 29918, 20897, 580, 13, 9651, 565, 302, 29918, 19190, 1275, 954, 29918, 303, 1179, 448, 29871, 29896, 29901, 13, 18884, 396, 4803, 278, 1404, 29899, 6550, 2164, 16285, 373, 278, 1833, 7408, 13, 18884, 16285, 29918, 353, 16285, 13, 9651, 1683, 29901, 13, 18884, 16285, 29918, 353, 6213, 13, 13, 9651, 288, 29892, 269, 353, 903, 29880, 20397, 15755, 29918, 20907, 29898, 2080, 29879, 29961, 29876, 29918, 19190, 1402, 13, 462, 462, 29871, 27497, 29961, 29876, 29918, 19190, 1402, 13, 462, 462, 29871, 338, 29918, 26495, 29922, 275, 29918, 26495, 29892, 13, 462, 462, 29871, 16285, 29922, 513, 1575, 3383, 13, 462, 462, 29871, 954, 29918, 29277, 29922, 1949, 29918, 29277, 29892, 13, 462, 462, 29871, 3038, 29918, 1853, 29922, 3729, 29918, 1853, 29892, 13, 462, 462, 29871, 3038, 29918, 2311, 29922, 3729, 29918, 2311, 29892, 13, 462, 462, 29871, 2847, 29918, 3859, 29918, 29888, 9970, 29922, 29888, 9970, 3383, 13, 462, 462, 29871, 2847, 29918, 3859, 29918, 29890, 9970, 29922, 29890, 9970, 3383, 13, 462, 462, 29871, 6874, 29922, 16908, 4338, 29892, 13, 462, 462, 29871, 3579, 19290, 29897, 13, 9651, 313, 401, 29918, 29888, 9970, 29892, 775, 29918, 29890, 9970, 511, 313, 4230, 29918, 3859, 29918, 29888, 9970, 29892, 1833, 29918, 3859, 29918, 29890, 9970, 29897, 353, 288, 29892, 269, 13, 9651, 396, 10318, 6273, 363, 2446, 7408, 13, 9651, 285, 9970, 29918, 353, 1833, 29918, 3859, 29918, 29888, 9970, 13, 9651, 289, 9970, 29918, 353, 1833, 29918, 3859, 29918, 29890, 9970, 13, 9651, 12379, 29918, 16908, 4338, 353, 722, 6078, 13, 13, 1678, 775, 353, 15886, 29889, 17685, 4197, 401, 29918, 29888, 9970, 29892, 775, 29918, 29890, 9970, 1402, 9685, 10457, 29896, 29897, 13, 1678, 14391, 353, 775, 13, 13, 1678, 736, 14391, 13, 13, 13, 1753, 903, 29880, 20397, 15755, 29918, 17712, 29918, 20907, 29898, 2080, 29879, 29892, 13, 462, 308, 27497, 29892, 13, 462, 308, 338, 29918, 26495, 29892, 13, 462, 308, 954, 29918, 29277, 29922, 29906, 29892, 13, 462, 308, 3038, 29918, 1853, 29922, 13264, 29889, 21570, 29889, 29878, 15755, 29889, 14345, 29965, 4617, 29892, 13, 462, 308, 3038, 29918, 2311, 29922, 29953, 29946, 29892, 13, 462, 308, 2847, 29918, 3859, 29918, 29888, 9970, 29922, 8516, 29892, 13, 462, 308, 2847, 29918, 3859, 29918, 29890, 9970, 29922, 8516, 29892, 13, 462, 308, 6874, 29922, 8516, 29892, 13, 462, 308, 3579, 19290, 1125, 13, 1678, 6874, 29918, 978, 353, 6874, 565, 6874, 338, 451, 6213, 1683, 376, 17712, 29899, 29880, 20397, 15755, 29908, 13, 1678, 411, 15886, 29889, 11918, 29918, 6078, 29898, 6078, 29918, 978, 29897, 408, 722, 6078, 29901, 13, 4706, 9101, 29918, 29888, 9970, 353, 679, 29918, 9910, 29918, 3729, 29898, 3729, 29918, 1853, 29892, 3038, 29918, 2311, 29892, 954, 29918, 29277, 29897, 13, 4706, 9101, 29918, 29890, 9970, 353, 679, 29918, 9910, 29918, 3729, 29898, 3729, 29918, 1853, 29892, 3038, 29918, 2311, 29892, 954, 29918, 29277, 29897, 13, 13, 4706, 565, 376, 11014, 29918, 11958, 1953, 29908, 297, 9049, 5085, 322, 9049, 5085, 3366, 11014, 29918, 11958, 1953, 3108, 29901, 13, 9651, 9101, 29918, 29888, 9970, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 1666, 333, 950, 15646, 29898, 3729, 29879, 29918, 29888, 9970, 29897, 13, 9651, 9101, 29918, 29890, 9970, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 1666, 333, 950, 15646, 29898, 3729, 29879, 29918, 29890, 9970, 29897, 13, 13, 4706, 565, 338, 29918, 26495, 322, 4852, 4905, 29918, 17462, 29918, 22795, 29908, 297, 9049, 5085, 29897, 322, 313, 13, 9651, 9049, 5085, 3366, 4905, 29918, 17462, 29918, 22795, 3108, 529, 29871, 29896, 29889, 29900, 1125, 13, 9651, 9101, 29918, 29888, 9970, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 15063, 449, 15646, 29898, 3729, 29922, 3729, 29879, 29918, 29888, 9970, 29892, 13, 462, 462, 462, 418, 1962, 29918, 17462, 29918, 22795, 29922, 19290, 29961, 13, 462, 462, 462, 3986, 376, 4905, 29918, 17462, 29918, 22795, 20068, 13, 9651, 9101, 29918, 29890, 9970, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 15063, 449, 15646, 29898, 3729, 29922, 3729, 29879, 29918, 29890, 9970, 29892, 13, 462, 462, 462, 418, 1962, 29918, 17462, 29918, 22795, 29922, 19290, 29961, 13, 462, 462, 462, 3986, 376, 4905, 29918, 17462, 29918, 22795, 20068, 13, 4706, 1683, 29901, 13, 9651, 1209, 13, 13, 4706, 565, 376, 1131, 2509, 29908, 297, 9049, 5085, 322, 9049, 5085, 3366, 1131, 2509, 3108, 1275, 5852, 29901, 13, 9651, 565, 376, 1131, 29876, 29918, 2848, 29908, 297, 9049, 5085, 29901, 13, 18884, 1098, 29876, 29918, 2848, 353, 9049, 5085, 3366, 1131, 29876, 29918, 2848, 3108, 13, 9651, 1683, 29901, 13, 18884, 1098, 29876, 29918, 2848, 353, 29871, 29896, 29900, 13, 9651, 9101, 29918, 29888, 9970, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 4165, 2509, 4617, 15646, 29898, 3729, 29879, 29918, 29888, 9970, 29892, 13, 462, 462, 462, 9651, 1098, 29876, 29918, 2848, 29922, 1131, 29876, 29918, 2848, 29897, 13, 9651, 9101, 29918, 29890, 9970, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 4165, 2509, 4617, 15646, 29898, 3729, 29879, 29918, 29890, 9970, 29892, 13, 462, 462, 462, 9651, 1098, 29876, 29918, 2848, 29922, 1131, 29876, 29918, 2848, 29897, 13, 13, 4706, 14391, 29892, 1833, 29918, 28631, 353, 15886, 29889, 15755, 29889, 23883, 8684, 284, 29918, 16626, 29918, 29878, 15755, 29898, 3729, 29879, 29918, 29888, 9970, 29892, 13, 462, 462, 462, 1669, 9101, 29918, 29890, 9970, 29892, 13, 462, 462, 462, 1669, 10970, 29892, 13, 462, 462, 462, 1669, 5665, 29918, 2848, 29922, 2848, 29879, 29892, 13, 462, 462, 462, 1669, 2847, 29918, 3859, 29918, 25051, 29922, 11228, 29918, 3859, 29918, 29888, 9970, 29892, 13, 462, 462, 462, 1669, 2847, 29918, 3859, 29918, 29890, 29893, 29922, 11228, 29918, 3859, 29918, 29890, 9970, 29892, 13, 462, 462, 462, 1669, 26688, 29922, 13264, 29889, 7411, 29941, 29906, 29897, 13, 13, 4706, 736, 14391, 29892, 1833, 29918, 28631, 13, 13, 13, 1753, 301, 20397, 15755, 29918, 17712, 29898, 2080, 29879, 29892, 13, 462, 27497, 29892, 13, 462, 338, 29918, 26495, 29892, 13, 462, 954, 29918, 29277, 29922, 29906, 29892, 13, 462, 3038, 29918, 1853, 29922, 13264, 29889, 21570, 29889, 29878, 15755, 29889, 14345, 29965, 4617, 29892, 13, 462, 3038, 29918, 2311, 29922, 29953, 29946, 29892, 13, 462, 2847, 29918, 3859, 29918, 29888, 9970, 29922, 8516, 29892, 13, 462, 2847, 29918, 3859, 29918, 29890, 9970, 29922, 8516, 29892, 13, 462, 3579, 19290, 1125, 13, 1678, 12725, 29918, 21111, 272, 29918, 2080, 29879, 29898, 2080, 29879, 29892, 27497, 29897, 13, 13, 1678, 954, 29918, 303, 1179, 353, 7431, 29898, 2080, 29879, 29897, 13, 13, 1678, 285, 9970, 29918, 353, 2847, 29918, 3859, 29918, 29888, 9970, 13, 1678, 289, 9970, 29918, 353, 2847, 29918, 3859, 29918, 29890, 9970, 13, 13, 1678, 12379, 29918, 16908, 4338, 353, 6213, 13, 1678, 363, 302, 29918, 19190, 297, 921, 3881, 29898, 1949, 29918, 303, 1179, 1125, 13, 4706, 411, 15886, 29889, 11918, 29918, 6078, 29898, 13, 9651, 376, 15550, 29899, 29880, 20397, 15755, 29899, 17712, 29899, 11762, 8875, 1642, 4830, 29898, 29876, 29918, 19190, 876, 408, 722, 6078, 29901, 13, 9651, 565, 12379, 29918, 16908, 4338, 338, 451, 6213, 29901, 13, 18884, 12379, 29918, 16908, 4338, 29889, 276, 1509, 29918, 20897, 580, 13, 9651, 775, 29892, 5922, 353, 903, 29880, 20397, 15755, 29918, 17712, 29918, 20907, 29898, 2080, 29879, 29961, 29876, 29918, 19190, 1402, 13, 462, 462, 18884, 27497, 29961, 29876, 29918, 19190, 1402, 13, 462, 462, 18884, 338, 29918, 26495, 29922, 275, 29918, 26495, 29892, 13, 462, 462, 18884, 954, 29918, 29277, 29922, 1949, 29918, 29277, 29892, 13, 462, 462, 18884, 3038, 29918, 1853, 29922, 3729, 29918, 1853, 29892, 13, 462, 462, 18884, 3038, 29918, 2311, 29922, 3729, 29918, 2311, 29892, 13, 462, 462, 18884, 2847, 29918, 3859, 29918, 29888, 9970, 29922, 29888, 9970, 3383, 13, 462, 462, 18884, 2847, 29918, 3859, 29918, 29890, 9970, 29922, 29890, 9970, 3383, 13, 462, 462, 18884, 6874, 29922, 16908, 4338, 29892, 13, 462, 462, 18884, 3579, 19290, 29897, 13, 9651, 285, 9970, 29918, 353, 5922, 29961, 29900, 29962, 13, 9651, 289, 9970, 29918, 353, 5922, 29961, 29896, 29962, 13, 9651, 12379, 29918, 16908, 4338, 353, 722, 6078, 13, 13, 1678, 396, 16125, 403, 298, 29916, 29918, 29888, 9970, 322, 298, 29916, 29918, 29890, 9970, 310, 2246, 7546, 13, 1678, 396, 421, 28631, 29952, 353, 5135, 18904, 29918, 29888, 9970, 29892, 298, 29916, 29918, 29888, 9970, 511, 313, 18904, 29918, 29890, 9970, 29892, 298, 29916, 29918, 29890, 9970, 876, 13, 13, 1678, 396, 14402, 363, 18016, 29965, 13, 13, 1678, 565, 954, 29918, 29277, 1405, 29871, 29896, 29901, 13, 4706, 396, 8267, 5922, 29901, 518, 29906, 29892, 954, 29918, 29277, 29892, 29871, 29906, 29962, 13, 4706, 396, 313, 6854, 29889, 2045, 597, 3292, 29889, 510, 29914, 1111, 579, 284, 29883, 561, 29914, 4378, 29880, 29899, 2218, 862, 403, 29914, 10054, 29914, 6207, 29914, 4378, 29880, 29914, 15755, 29889, 2272, 29937, 29931, 29946, 29941, 29897, 13, 4706, 565, 3038, 29918, 1853, 1275, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 14345, 29965, 4617, 29901, 13, 9651, 396, 14402, 13, 9651, 1209, 13, 4706, 25342, 3038, 29918, 1853, 1275, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 29931, 1254, 29924, 4617, 29901, 13, 9651, 1962, 353, 15886, 29889, 17685, 4197, 28631, 29961, 29900, 3816, 29899, 29896, 3816, 29896, 1402, 5922, 29961, 29896, 3816, 29899, 29896, 3816, 29896, 20526, 29871, 29896, 29897, 13, 1678, 1683, 29901, 13, 4706, 396, 8267, 5922, 29901, 518, 29906, 29892, 29871, 29906, 29962, 13, 4706, 396, 313, 6854, 29889, 2045, 597, 3292, 29889, 510, 29914, 1111, 579, 284, 29883, 561, 29914, 4378, 29880, 29899, 2218, 862, 403, 29914, 10054, 29914, 6207, 29914, 4378, 29880, 29914, 15755, 29889, 2272, 29937, 29931, 29946, 29900, 29897, 13, 4706, 396, 565, 3038, 29918, 1853, 1275, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 14345, 29965, 4617, 470, 3038, 29918, 1853, 1275, 390, 2190, 4617, 29901, 13, 4706, 565, 3038, 29918, 1853, 1275, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 14345, 29965, 4617, 29901, 13, 18884, 1962, 353, 15886, 29889, 17685, 4197, 28631, 29961, 29900, 1402, 5922, 29961, 29896, 20526, 29871, 29896, 29897, 13, 4706, 25342, 3038, 29918, 1853, 1275, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 29931, 1254, 29924, 4617, 29901, 13, 9651, 1962, 353, 15886, 29889, 17685, 4197, 28631, 29961, 29900, 3816, 29896, 1402, 5922, 29961, 29896, 3816, 29896, 20526, 29871, 29896, 29897, 13, 13, 1678, 736, 1962, 13, 13, 13, 29992, 1727, 6020, 29889, 9573, 29918, 29882, 7529, 13, 1753, 269, 28283, 8032, 29918, 3521, 2477, 29931, 29896, 29947, 29918, 3954, 1718, 29909, 4345, 7295, 13, 1678, 298, 29886, 353, 15886, 29889, 21570, 29889, 26495, 29889, 29950, 9629, 29898, 13, 4706, 3038, 29918, 1853, 2433, 20155, 29885, 742, 13, 4706, 3038, 29918, 2311, 29922, 29896, 29900, 29900, 29892, 13, 4706, 954, 29918, 29277, 29922, 29896, 29892, 13, 4706, 3013, 29918, 22795, 29922, 29900, 29889, 29945, 13, 1678, 1723, 13, 1678, 736, 298, 29886, 13, 13, 13, 29992, 1727, 6020, 29889, 9573, 29918, 3977, 6119, 13, 1753, 364, 18309, 29918, 3977, 6119, 29898, 2080, 29879, 29892, 27497, 29892, 338, 29918, 26495, 29892, 298, 29886, 29922, 8516, 1125, 13, 1678, 4974, 1134, 29898, 2080, 29879, 29897, 338, 1051, 13, 1678, 4974, 1134, 29898, 2848, 29879, 29897, 338, 1051, 13, 1678, 4974, 7431, 29898, 2080, 29879, 29897, 1275, 7431, 29898, 2848, 29879, 29897, 13, 1678, 4974, 7431, 29898, 2080, 29879, 29897, 1275, 29871, 29906, 13, 1678, 4974, 298, 29886, 338, 451, 6213, 13, 13, 1678, 954, 29918, 2080, 29918, 6229, 353, 7431, 29898, 2080, 29879, 29961, 29900, 1822, 657, 29918, 12181, 2141, 294, 29918, 1761, 3101, 13, 1678, 4974, 954, 29918, 2080, 29918, 6229, 1275, 29871, 29941, 29871, 396, 350, 14789, 1060, 323, 8890, 1060, 382, 9486, 3352, 13, 1678, 954, 29918, 2848, 29918, 6229, 353, 7431, 29898, 2848, 29879, 29961, 29900, 1822, 657, 29918, 12181, 2141, 294, 29918, 1761, 3101, 13, 1678, 4974, 954, 29918, 2848, 29918, 6229, 1275, 29871, 29896, 13, 13, 1678, 565, 298, 29886, 29889, 3729, 29918, 1853, 1275, 525, 7108, 2396, 13, 4706, 3038, 29918, 1853, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 14345, 29965, 4617, 13, 1678, 25342, 298, 29886, 29889, 3729, 29918, 1853, 1275, 525, 20155, 29885, 2396, 13, 4706, 3038, 29918, 1853, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 29931, 1254, 29924, 4617, 13, 1678, 1683, 29901, 13, 4706, 12020, 7865, 2392, 29898, 28887, 29889, 3729, 29918, 1853, 29897, 13, 13, 1678, 3013, 29918, 22795, 353, 298, 29886, 29889, 17462, 29918, 22795, 565, 338, 29918, 26495, 1683, 29871, 29896, 29889, 29900, 13, 13, 1678, 775, 353, 301, 20397, 15755, 29918, 17712, 29898, 2080, 29879, 29892, 13, 462, 4706, 27497, 29892, 13, 462, 4706, 338, 29918, 26495, 29922, 275, 29918, 26495, 29892, 13, 462, 4706, 954, 29918, 29277, 29922, 28887, 29889, 1949, 29918, 29277, 29892, 13, 462, 4706, 3038, 29918, 1853, 29922, 3729, 29918, 1853, 29892, 13, 462, 4706, 3038, 29918, 2311, 29922, 28887, 29889, 3729, 29918, 2311, 29897, 13, 13, 1678, 4974, 7431, 29898, 401, 29889, 657, 29918, 12181, 2141, 294, 29918, 1761, 3101, 1275, 29871, 29906, 13, 1678, 736, 775, 13, 2 ]
featurize/__init__.py
featurize/featurize-cli
0
101372
<gh_stars>0 import sys import os from json import JSONDecodeError from .featurize_client import FeaturizeClient def _find_token(): token_from_env = os.getenv('FEATURIZE_API_TOKEN') cfg_file = os.getenv('FEATURIZE_CFG_FILE', '/etc/featurize_token.txt') if token_from_env: return token_from_env try: with open(cfg_file, 'r') as f: return f.read() except FileNotFoundError: return None except JSONDecodeError: sys.exit(f'config file {cfg_file} parse error') def _find_instance_id(): return os.getenv('FEATURIZE_INSTANCE_ID') def create_client_from_env(): token = _find_token() instance_id = _find_instance_id() if token is None: sys.exit('Token is missed') return FeaturizeClient(token=token, instance_id=instance_id) __version__ = '0.0.22' __all__ = ['FeaturizeClient', 'create_client_from_env']
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 10876, 13, 5215, 2897, 13, 3166, 4390, 1053, 4663, 2772, 401, 2392, 13, 3166, 869, 1725, 1337, 675, 29918, 4645, 1053, 5169, 1337, 675, 4032, 13, 13, 13, 1753, 903, 2886, 29918, 6979, 7295, 13, 1678, 5993, 29918, 3166, 29918, 6272, 353, 2897, 29889, 657, 6272, 877, 16359, 1299, 15551, 10721, 29918, 8787, 29918, 4986, 29968, 1430, 1495, 13, 1678, 274, 16434, 29918, 1445, 353, 2897, 29889, 657, 6272, 877, 16359, 1299, 15551, 10721, 29918, 9207, 29954, 29918, 7724, 742, 8207, 7070, 29914, 1725, 1337, 675, 29918, 6979, 29889, 3945, 1495, 13, 1678, 565, 5993, 29918, 3166, 29918, 6272, 29901, 13, 4706, 736, 5993, 29918, 3166, 29918, 6272, 13, 1678, 1018, 29901, 13, 4706, 411, 1722, 29898, 16859, 29918, 1445, 29892, 525, 29878, 1495, 408, 285, 29901, 13, 9651, 736, 285, 29889, 949, 580, 13, 1678, 5174, 3497, 17413, 2392, 29901, 13, 4706, 736, 6213, 13, 1678, 5174, 4663, 2772, 401, 2392, 29901, 13, 4706, 10876, 29889, 13322, 29898, 29888, 29915, 2917, 934, 426, 16859, 29918, 1445, 29913, 6088, 1059, 1495, 13, 13, 13, 1753, 903, 2886, 29918, 8758, 29918, 333, 7295, 13, 1678, 736, 2897, 29889, 657, 6272, 877, 16359, 1299, 15551, 10721, 29918, 25580, 23219, 29918, 1367, 1495, 13, 13, 13, 1753, 1653, 29918, 4645, 29918, 3166, 29918, 6272, 7295, 13, 1678, 5993, 353, 903, 2886, 29918, 6979, 580, 13, 1678, 2777, 29918, 333, 353, 903, 2886, 29918, 8758, 29918, 333, 580, 13, 1678, 565, 5993, 338, 6213, 29901, 13, 4706, 10876, 29889, 13322, 877, 6066, 338, 13726, 1495, 13, 1678, 736, 5169, 1337, 675, 4032, 29898, 6979, 29922, 6979, 29892, 2777, 29918, 333, 29922, 8758, 29918, 333, 29897, 13, 13, 13, 1649, 3259, 1649, 353, 525, 29900, 29889, 29900, 29889, 29906, 29906, 29915, 13, 1649, 497, 1649, 353, 6024, 8263, 1337, 675, 4032, 742, 525, 3258, 29918, 4645, 29918, 3166, 29918, 6272, 2033, 13, 2 ]
python/0258. addDigits.py
whtahy/leetcode
1
157654
<reponame>whtahy/leetcode class Solution: def addDigits(self, num: int) -> int: while num > 9: num = sum(int(ch) for ch in str(num)) return num
[ 1, 529, 276, 1112, 420, 29958, 29893, 400, 801, 29891, 29914, 280, 300, 401, 13, 1990, 24380, 29901, 13, 1678, 822, 788, 14991, 1169, 29898, 1311, 29892, 954, 29901, 938, 29897, 1599, 938, 29901, 13, 4706, 1550, 954, 1405, 29871, 29929, 29901, 13, 9651, 954, 353, 2533, 29898, 524, 29898, 305, 29897, 363, 521, 297, 851, 29898, 1949, 876, 13, 4706, 736, 954, 13, 2 ]
motor_watch/status.py
pcdshub/motor_watch
0
137463
def process(status): status_info = {} status_info['name'] = status.pos.name status_info['target'] = status.target return status_info
[ 1, 822, 1889, 29898, 4882, 1125, 13, 1678, 4660, 29918, 3888, 353, 6571, 13, 1678, 4660, 29918, 3888, 1839, 978, 2033, 353, 4660, 29889, 1066, 29889, 978, 13, 1678, 4660, 29918, 3888, 1839, 5182, 2033, 353, 4660, 29889, 5182, 13, 1678, 736, 4660, 29918, 3888, 13, 2 ]
flask-gunicorn-mysql-nginx-compose/gunicorn.conf.py
xmmmmmovo/docker-config
0
1614212
import multiprocessing workers = multiprocessing.cpu_count() * 2 + 1 worker_class = "gevent" bind = "0.0.0.0:8888"
[ 1, 1053, 6674, 307, 985, 292, 13, 13, 1287, 414, 353, 6674, 307, 985, 292, 29889, 21970, 29918, 2798, 580, 334, 29871, 29906, 718, 29871, 29896, 13, 24602, 29918, 1990, 353, 376, 479, 794, 29908, 13, 5355, 353, 376, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 29901, 29947, 29947, 29947, 29947, 29908, 13, 2 ]
O365/calendar.py
PhoenixAlx/py-o365
0
189296
import logging from enum import Enum from dateutil.parser import parse import datetime as dt import pytz import calendar from bs4 import BeautifulSoup as bs from O365.utils import Pagination, NEXT_LINK_KEYWORD, ApiComponent, Attachments, Attachment, \ AttachableMixin, ImportanceLevel, TrackerSet from O365.message import HandleRecipientsMixin log = logging.getLogger(__name__) MONTH_NAMES = [calendar.month_name[x] for x in range(1, 13)] class EventResponse(Enum): Organizer = 'organizer' TentativelyAccepted = 'tentativelyAccepted' Accepted = 'accepted' Declined = 'declined' NotResponded = 'notResponded' class AttendeeType(Enum): Required = 'required' Optional = 'optional' Resource = 'resource' class EventSensitivity(Enum): Normal = 'normal' Personal = 'personal' Private = 'private' Confidential = 'confidential' class EventShowAs(Enum): Free = 'free' Tentative = 'tentative' Busy = 'busy' Oof = 'oof' WorkingElsewhere = 'workingElsewhere' Unknown = 'unknown' class CalendarColors(Enum): LightBlue = 0 LightGreen = 1 LightOrange = 2 LightGray = 3 LightYellow = 4 LightTeal = 5 LightPink = 6 LightBrown = 7 LightRed = 8 MaxColor = 9 Auto = -1 class EventAttachment(Attachment): _endpoints = {'attach': '/events/{id}/attachments'} class EventAttachments(Attachments): _endpoints = {'attachments': '/events/{id}/attachments'} class DailyEventFrequency: def __init__(self, recurrence_type, interval): self.recurrence_type = recurrence_type self.interval = interval class EventRecurrence(ApiComponent): """ A representation of an event recurrence properties """ def __init__(self, event, recurrence=None): super().__init__(protocol=event.protocol, main_resource=event.main_resource) self._event = event recurrence = recurrence or {} # recurrence pattern recurrence_pattern = recurrence.get(self._cc('pattern'), {}) self.__interval = recurrence_pattern.get(self._cc('interval'), None) self.__days_of_week = recurrence_pattern.get(self._cc('daysOfWeek'), set()) self.__first_day_of_week = recurrence_pattern.get(self._cc('firstDayOfWeek'), None) self.__day_of_month = recurrence_pattern.get(self._cc('dayOfMonth'), None) self.__month = recurrence_pattern.get(self._cc('month'), None) self.__index = recurrence_pattern.get(self._cc('index'), 'first') # recurrence range recurrence_range = recurrence.get(self._cc('range'), {}) self.__ocurrences = recurrence_range.get(self._cc('numberOfOccurrences'), None) self.__start_date = recurrence_range.get(self._cc('startDate'), None) self.__end_date = recurrence_range.get(self._cc('endDate'), None) self.__recurrence_time_zone = recurrence_range.get(self._cc('recurrenceTimeZone'), self.protocol.get_windows_tz()) # time and time zones are not considered in recurrence ranges... # I don't know why 'recurrenceTimeZone' is present here # Sending a startDate datetime to the server results in an Error: # "Cannot convert the literal 'datetime' to the expected type 'Edm.Date'" if recurrence_range: self.__start_date = parse(self.__start_date).date() if self.__start_date else None self.__end_date = parse(self.__end_date).date() if self.__end_date else None def __str__(self): if self.__interval: pattern = 'Daily: every {} day/s'.format(self.__interval) if self.__days_of_week: days = ' or '.join(list(self.__days_of_week)) pattern = 'Relative Monthly: {} {} every {} month/s'.format(self.__index, days, self.__interval) if self.__first_day_of_week: pattern = 'Weekly: every {} week/s on {}'.format(self.__interval, days) elif self.__month: pattern = 'Relative Yearly: {} {} every {} year/s on {}'.format(self.__index, days, self.__interval, MONTH_NAMES[self.__month - 1]) elif self.__day_of_month: pattern = 'Absolute Monthly: on day {} every {} month/s'.format(self.__day_of_month, self.__interval) if self.__month: pattern = 'Absolute Yearly: on {} {} every {} year/s'.format(MONTH_NAMES[self.__month - 1], self.__day_of_month, self.__interval) r_range = '' if self.__start_date: r_range = 'Starting on {}'.format(self.__start_date) ends_on = 'with no end' if self.__end_date: ends_on = 'ending on {}'.format(self.__end_date) elif self.__ocurrences: ends_on = 'up to {} ocurrences'.format(self.__ocurrences) r_range = '{} {}'.format(r_range, ends_on) return '{}. {}'.format(pattern, r_range) else: return 'No recurrence enabled' def __repr__(self): return self.__str__() def __bool__(self): return bool(self.__interval) def _track_changes(self): """ Update the track_changes on the event to reflect a needed update on this field """ self._event._track_changes.add('recurrence') @property def interval(self): return self.__interval @interval.setter def interval(self, value): self.__interval = value self._track_changes() @property def days_of_week(self): return self.__days_of_week @days_of_week.setter def days_of_week(self, value): self.__days_of_week = value self._track_changes() @property def first_day_of_week(self): return self.__first_day_of_week @first_day_of_week.setter def first_day_of_week(self, value): self.__first_day_of_week = value self._track_changes() @property def day_of_month(self): return self.__day_of_month @day_of_month.setter def day_of_month(self, value): self.__day_of_month = value self._track_changes() @property def month(self): return self.__month @month.setter def month(self, value): self.__month = value self._track_changes() @property def index(self): return self.__index @index.setter def index(self, value): self.__index = value self._track_changes() @property def ocurrences(self): return self.__ocurrences @ocurrences.setter def ocurrences(self, value): self.__ocurrences = value self._track_changes() @property def recurrence_time_zone(self): return self.__recurrence_time_zone @recurrence_time_zone.setter def recurrence_time_zone(self, value): self.__recurrence_time_zone = value self._track_changes() @property def start_date(self): return self.__start_date @start_date.setter def start_date(self, value): if not isinstance(value, dt.date): raise ValueError('start_date value must be a valid date object') if isinstance(value, dt.datetime): value = value.date() self.__start_date = value self._track_changes() @property def end_date(self): return self.__start_date @end_date.setter def end_date(self, value): if not isinstance(value, dt.date): raise ValueError('end_date value must be a valid date object') if isinstance(value, dt.datetime): value = value.date() self.__end_date = value self._track_changes() def to_api_data(self): data = {} # recurrence pattern if self.__interval and isinstance(self.__interval, int): recurrence_pattern = data[self._cc('pattern')] = {} recurrence_pattern[self._cc('type')] = 'daily' recurrence_pattern[self._cc('interval')] = self.__interval if self.__days_of_week and isinstance(self.__days_of_week, (list, tuple, set)): recurrence_pattern[self._cc('type')] = 'relativeMonthly' recurrence_pattern[self._cc('daysOfWeek')] = list(self.__days_of_week) if self.__first_day_of_week: recurrence_pattern[self._cc('type')] = 'weekly' recurrence_pattern[self._cc('firstDayOfWeek')] = self.__first_day_of_week elif self.__month and isinstance(self.__month, int): recurrence_pattern[self._cc('type')] = 'relativeYearly' recurrence_pattern[self._cc('month')] = self.__month if self.__index: recurrence_pattern[self._cc('index')] = self.__index else: if self.__index: recurrence_pattern[self._cc('index')] = self.__index elif self.__day_of_month and isinstance(self.__day_of_month, int): recurrence_pattern[self._cc('type')] = 'absoluteMonthly' recurrence_pattern[self._cc('dayOfMonth')] = self.__day_of_month if self.__month and isinstance(self.__month, int): recurrence_pattern[self._cc('type')] = 'absoluteYearly' recurrence_pattern[self._cc('month')] = self.__month # recurrence range if self.__start_date: recurrence_range = data[self._cc('range')] = {} recurrence_range[self._cc('type')] = 'noEnd' recurrence_range[self._cc('startDate')] = self.__start_date.isoformat() recurrence_range[self._cc('recurrenceTimeZone')] = self.__recurrence_time_zone if self.__end_date: recurrence_range[self._cc('type')] = 'endDate' recurrence_range[self._cc('endDate')] = self.__end_date.isoformat() elif self.__ocurrences is not None and isinstance(self.__ocurrences, int): recurrence_range[self._cc('type')] = 'numbered' recurrence_range[self._cc('numberOfOccurrences')] = self.__ocurrences return data def _clear_pattern(self): """ Clears this event recurrence """ # pattern group self.__interval = None self.__days_of_week = set() self.__first_day_of_week = None self.__day_of_month = None self.__month = None self.__index = 'first' # range group self.__start_date = None self.__end_date = None self.__ocurrences = None def set_range(self, start=None, end=None, ocurrences=None): if start is None: if self.__start_date is None: self.__start_date = dt.date.today() else: self.start_date = start if end: self.end_date = end elif ocurrences: self.__ocurrences = ocurrences self._track_changes() def set_daily(self, interval, **kwargs): self._clear_pattern() self.__interval = interval self.set_range(**kwargs) def set_weekly(self, interval, *, days_of_week, first_day_of_week, **kwargs): self.set_daily(interval, **kwargs) self.__days_of_week = set(days_of_week) self.__first_day_of_week = first_day_of_week def set_monthly(self, interval, *, day_of_month=None, days_of_week=None, index=None, **kwargs): if not day_of_month and not days_of_week: raise ValueError('Must provide day_of_month or days_of_week values') if day_of_month and days_of_week: raise ValueError('Must provide only one of the two options') self.set_daily(interval, **kwargs) if day_of_month: self.__day_of_month = day_of_month elif days_of_week: self.__days_of_week = set(days_of_week) if index: self.__index = index def set_yearly(self, interval, month, *, day_of_month=None, days_of_week=None, index=None, **kwargs): self.set_monthly(interval, day_of_month=day_of_month, days_of_week=days_of_week, index=index, **kwargs) self.__month = month class ResponseStatus(ApiComponent): """ An event response status (status, time) """ def __init__(self, parent, response_status): super().__init__(protocol=parent.protocol, main_resource=parent.main_resource) self.status = response_status.get(self._cc('response'), None) self.status = None if self.status == 'none' else self.status if self.status: self.response_time = response_status.get(self._cc('time'), None) if self.response_time: self.response_time = parse(self.response_time).astimezone(self.protocol.timezone) else: self.response_time = None def __str__(self): return self.status def __repr__(self): return self.__str__() class Attendee: """ A Event attendee """ def __init__(self, address, *, name=None, attendee_type=None, response_status=None, event=None): self._address = address self._name = name self._event = event if isinstance(response_status, ResponseStatus): self.__response_status = response_status else: self.__response_status = None self.__attendee_type = AttendeeType.Required if attendee_type: self.attendee_type = attendee_type def __str__(self): if self.name: return '{}: {} ({})'.format(self.attendee_type.name, self.name, self.address) else: return '{}: {}'.format(self.attendee_type.name, self.address) def __repr__(self): return self.__str__() @property def address(self): return self._address @address.setter def address(self, value): self._address = value self._name = '' self._track_changes() @property def name(self): return self._name @name.setter def name(self, value): self._name = value self._track_changes() def _track_changes(self): """ Update the track_changes on the event to reflect a needed update on this field """ self._event._track_changes.add('attendees') @property def response_status(self): return self.__response_status @property def attendee_type(self): return self.__attendee_type @attendee_type.setter def attendee_type(self, value): if isinstance(value, AttendeeType): self.__attendee_type = value else: self.__attendee_type = AttendeeType(value) self._track_changes() class Attendees(ApiComponent): """ A Collection of Attendees """ def __init__(self, event, attendees=None): super().__init__(protocol=event.protocol, main_resource=event.main_resource) self._event = event self.__attendees = [] if attendees: self.add(attendees) def __iter__(self): return iter(self.__attendees) def __getitem__(self, key): return self.__attendees[key] def __contains__(self, item): return item in {attendee.email for attendee in self.__attendees} def __len__(self): return len(self.__attendees) def __str__(self): return 'Attendees Count: {}'.format(len(self.__attendees)) def __repr__(self): return self.__str__() def clear(self): self.__attendees = [] self._track_changes() def _track_changes(self): """ Update the track_changes on the event to reflect a needed update on this field """ self._event._track_changes.add('attendees') def add(self, attendees): """ Add attendees to the parent event """ if attendees: if isinstance(attendees, str): self.__attendees.append(Attendee(address=attendees, event=self._event)) self._track_changes() elif isinstance(attendees, Attendee): self.__attendees.append(attendees) self._track_changes() elif isinstance(attendees, tuple): name, address = attendees if address: self.__attendees.append(Attendee(address=address, name=name, event=self._event)) self._track_changes() elif isinstance(attendees, list): for attendee in attendees: self.add(attendee) elif isinstance(attendees, dict) and self._cloud_data_key in attendees: attendees = attendees.get(self._cloud_data_key) for attendee in attendees: email = attendee.get(self._cc('emailAddress'), {}) address = email.get(self._cc('address'), None) if address: name = email.get(self._cc('name'), None) attendee_type = attendee.get(self._cc('type'), 'required') # default value self.__attendees.append( Attendee(address=address, name=name, attendee_type=attendee_type, event=self._event, response_status=ResponseStatus(parent=self, response_status=attendee.get(self._cc('status'), {})))) else: raise ValueError('Attendees must be an address string, an' ' Attendee instance, a (name, address) tuple or a list') def remove(self, attendees): """ Remove the provided attendees from the event """ if isinstance(attendees, (list, tuple)): attendees = {attendee.address if isinstance(attendee, Attendee) else attendee for attendee in attendees} elif isinstance(attendees, str): attendees = {attendees} elif isinstance(attendees, Attendee): attendees = {attendees.address} else: raise ValueError('Incorrect parameter type for attendees') new_attendees = [] for attendee in self.__attendees: if attendee.address not in attendees: new_attendees.append(attendee) self.__attendees = new_attendees self._track_changes() def to_api_data(self): data = [] for attendee in self.__attendees: if attendee.address: att_data = { self._cc('emailAddress'): { self._cc('address'): attendee.address, self._cc('name'): attendee.name }, self._cc('type'): attendee.attendee_type.value } data.append(att_data) return data class Event(ApiComponent, AttachableMixin, HandleRecipientsMixin): """ A Calendar event """ _endpoints = { 'calendar': '/calendars/{id}', 'event': '/events/{id}', 'event_default': '/calendar/events', 'event_calendar': '/calendars/{id}/events' } def __init__(self, *, parent=None, con=None, **kwargs): assert parent or con, 'Need a parent or a connection' self.con = parent.con if parent else con # Choose the main_resource passed in kwargs over the parent main_resource main_resource = kwargs.pop('main_resource', None) or getattr(parent, 'main_resource', None) if parent else None super().__init__(protocol=parent.protocol if parent else kwargs.get('protocol'), main_resource=main_resource) cc = self._cc # alias self._track_changes = TrackerSet(casing=cc) # internal to know which properties need to be updated on the server self.calendar_id = kwargs.get('calendar_id', None) download_attachments = kwargs.get('download_attachments') cloud_data = kwargs.get(self._cloud_data_key, {}) self.object_id = cloud_data.get(cc('id'), None) self.__subject = cloud_data.get(cc('subject'), kwargs.get('subject', '') or '') body = cloud_data.get(cc('body'), {}) self.__body = body.get(cc('content'), '') self.body_type = body.get(cc('contentType'), 'HTML') # default to HTML for new messages self.__attendees = Attendees(event=self, attendees={self._cloud_data_key: cloud_data.get(cc('attendees'), [])}) self.__categories = cloud_data.get(cc('categories'), []) self.__created = cloud_data.get(cc('createdDateTime'), None) self.__modified = cloud_data.get(cc('lastModifiedDateTime'), None) local_tz = self.protocol.timezone self.__created = parse(self.__created).astimezone(local_tz) if self.__created else None self.__modified = parse(self.__modified).astimezone(local_tz) if self.__modified else None start_obj = cloud_data.get(cc('start'), {}) if isinstance(start_obj, dict): try: timezone = pytz.timezone(self.protocol.get_iana_tz(start_obj.get(self._cc('timeZone'), 'UTC'))) except pytz.UnknownTimeZoneError: timezone = local_tz start = start_obj.get(cc('dateTime'), None) start = timezone.localize(parse(start)) if start else None if start and timezone != local_tz: start = start.astimezone(local_tz) else: # Outlook v1.0 api compatibility start = local_tz.localize(parse(start_obj)) if start_obj else None self.__start = start end_obj = cloud_data.get(cc('end'), {}) if isinstance(end_obj, dict): try: timezone = pytz.timezone(self.protocol.get_iana_tz(end_obj.get(self._cc('timeZone'), 'UTC'))) except pytz.UnknownTimeZoneError: timezone = local_tz end = end_obj.get(cc('dateTime'), None) end = timezone.localize(parse(end)) if end else None if end and timezone != local_tz: end = end.astimezone(local_tz) else: # Outlook v1.0 api compatibility end = local_tz.localize(parse(end_obj)) if end_obj else None self.__end = end self.has_attachments = cloud_data.get(cc('hasAttachments'), False) self.__attachments = EventAttachments(parent=self, attachments=[]) if self.has_attachments and download_attachments: self.attachments.download_attachments() self.__categories = cloud_data.get(cc('categories'), []) self.ical_uid = cloud_data.get(cc('iCalUId'), None) self.__importance = ImportanceLevel(cloud_data.get(cc('importance'), 'normal') or 'normal') self.__is_all_day = cloud_data.get(cc('isAllDay'), False) self.is_cancelled = cloud_data.get(cc('isCancelled'), False) self.is_organizer = cloud_data.get(cc('isOrganizer'), True) self.__location = cloud_data.get(cc('location'), {}).get(cc('displayName'), '') self.locations = cloud_data.get(cc('locations'), []) # TODO self.online_meeting_url = cloud_data.get(cc('onlineMeetingUrl'), None) self.__organizer = self._recipient_from_cloud(cloud_data.get(cc('organizer'), None), field='organizer') self.__recurrence = EventRecurrence(event=self, recurrence=cloud_data.get(cc('recurrence'), None)) self.__is_reminder_on = cloud_data.get(cc('isReminderOn'), True) self.__remind_before_minutes = cloud_data.get(cc('reminderMinutesBeforeStart'), 15) self.__response_requested = cloud_data.get(cc('responseRequested'), True) self.__response_status = ResponseStatus(parent=self, response_status=cloud_data.get(cc('responseStatus'), {})) self.__sensitivity = EventSensitivity(cloud_data.get(cc('sensitivity'), 'normal')) self.series_master_id = cloud_data.get(cc('seriesMasterId'), None) self.__show_as = EventShowAs(cloud_data.get(cc('showAs'), 'busy')) self.event_type = cloud_data.get(cc('type'), None) def __str__(self): return 'Subject: {}'.format(self.subject) def __repr__(self): return self.__str__() def to_api_data(self, restrict_keys=None): """ Returns a dict to comunicate with the server :param restrict_keys: a set of keys to restrict the returned data to. """ cc = self._cc # alias data = { cc('subject'): self.__subject, cc('body'): { cc('contentType'): self.body_type, cc('content'): self.__body}, cc('start'): { cc('dateTime'): self.__start.strftime('%Y-%m-%dT%H:%M:%S'), cc('timeZone'): self.protocol.get_windows_tz(self.__start.tzinfo.zone) }, cc('end'): { cc('dateTime'): self.__end.strftime('%Y-%m-%dT%H:%M:%S'), cc('timeZone'): self.protocol.get_windows_tz(self.__end.tzinfo.zone) }, cc('attendees'): self.__attendees.to_api_data(), cc('location'): {cc('displayName'): self.__location}, cc('categories'): self.__categories, cc('isAllDay'): self.__is_all_day, cc('importance'): self.__importance.value, cc('isReminderOn'): self.__is_reminder_on, cc('reminderMinutesBeforeStart'): self.__remind_before_minutes, cc('responseRequested'): self.__response_requested, cc('sensitivity'): self.__sensitivity.value, cc('showAs'): self.__show_as.value, } if self.__recurrence: data[cc('recurrence')] = self.__recurrence.to_api_data() if self.has_attachments: data[cc('attachments')] = self.__attachments.to_api_data() if restrict_keys: for key in list(data.keys()): if key not in restrict_keys: del data[key] return data @property def created(self): return self.__created @property def modified(self): return self.__modified @property def body(self): return self.__body @body.setter def body(self, value): self.__body = value self._track_changes.add('body') @property def subject(self): return self.__subject @subject.setter def subject(self, value): self.__subject = value self._track_changes.add('subject') @property def start(self): return self.__start @start.setter def start(self, value): if not isinstance(value, dt.date): raise ValueError("'start' must be a valid datetime object") if not isinstance(value, dt.datetime): # force datetime value = dt.datetime(value.year, value.month, value.day) if value.tzinfo is None: # localize datetime value = self.protocol.timezone.localize(value) elif value.tzinfo != self.protocol.timezone: value = value.astimezone(self.protocol.timezone) self.__start = value if not self.end: self.end = self.__start + dt.timedelta(minutes=30) self._track_changes.add('start') @property def end(self): return self.__end @end.setter def end(self, value): if not isinstance(value, dt.date): raise ValueError("'end' must be a valid datetime object") if not isinstance(value, dt.datetime): # force datetime value = dt.datetime(value.year, value.month, value.day) if value.tzinfo is None: # localize datetime value = self.protocol.timezone.localize(value) elif value.tzinfo != self.protocol.timezone: value = value.astimezone(self.protocol.timezone) self.__end = value self._track_changes.add('end') @property def importance(self): return self.__importance @importance.setter def importance(self, value): self.__importance = value if isinstance(value, ImportanceLevel) else ImportanceLevel(value) self._track_changes.add('importance') @property def is_all_day(self): return self.__is_all_day @is_all_day.setter def is_all_day(self, value): self.__is_all_day = value if value: # Api requirement: start and end must be set to midnight # is_all_day needs event.start included in the request on updates # is_all_day needs event.end included in the request on updates start = self.__start or dt.date.today() end = self.__end or dt.date.today() if (start + dt.timedelta(hours=24)) > end: # Api requires that under is_all_day=True start and end must be at least 24 hours away end = start + dt.timedelta(hours=24) # set to midnight start = dt.datetime(start.year, start.month, start.day) end = dt.datetime(end.year, end.month, end.day) self.start = start self.end = end self._track_changes.add('isAllDay') @property def location(self): return self.__location @location.setter def location(self, value): self.__location = value self._track_changes.add('location') @property def is_reminder_on(self): return self.__is_reminder_on @is_reminder_on.setter def is_reminder_on(self, value): self.__is_reminder_on = value self._track_changes.add('isReminderOn') self._track_changes.add('reminderMinutesBeforeStart') @property def remind_before_minutes(self): return self.__remind_before_minutes @remind_before_minutes.setter def remind_before_minutes(self, value): self.__is_reminder_on = True self.__remind_before_minutes = int(value) self._track_changes.add('isReminderOn') self._track_changes.add('reminderMinutesBeforeStart') @property def response_requested(self): return self.__response_requested @response_requested.setter def response_requested(self, value): self.__response_requested = value self._track_changes.add('responseRequested') @property def recurrence(self): return self.__recurrence @property def organizer(self): return self.__organizer @property def show_as(self): return self.__show_as @show_as.setter def show_as(self, value): self.__show_as = value if isinstance(value, EventShowAs) else EventShowAs(value) self._track_changes.add('showAs') @property def sensitivity(self): return self.__sensitivity @sensitivity.setter def sensitivity(self, value): self.__sensitivity = value if isinstance(value, EventSensitivity) else EventSensitivity(value) self._track_changes.add('sensitivity') @property def response_status(self): return self.__response_status @property def attachments(self): return self.__attachments @property def attendees(self): return self.__attendees @property def categories(self): return self.__categories @categories.setter def categories(self, value): if isinstance(value, list): self.__categories = value elif isinstance(value, str): self.__categories = [value] elif isinstance(value, tuple): self.__categories = list(value) else: raise ValueError('categories must be a list') self._track_changes.add('categories') def delete(self): """ Deletes a stored event """ if self.object_id is None: raise RuntimeError('Attempting to delete an unsaved event') url = self.build_url(self._endpoints.get('event').format(id=self.object_id)) try: response = self.con.delete(url) except Exception as e: log.error('Event (id: {}) could not be deleted. Error: {}'.format(self.object_id, str(e))) return False if response.status_code != 204: log.debug('Event (id: {}) could not be deleted. Reason: {}'.format(self.object_id, response.reason)) return False return True def save(self): """ Create a new event or update an existing one by checking what values have changed and update them on the server """ if self.object_id: # update event if not self._track_changes: return True # there's nothing to update url = self.build_url(self._endpoints.get('event').format(id=self.object_id)) method = self.con.patch data = self.to_api_data(restrict_keys=self._track_changes) else: # new event if self.calendar_id: url = self.build_url(self._endpoints.get('event_calendar').format(id=self.calendar_id)) else: url = self.build_url(self._endpoints.get('event_default')) method = self.con.post data = self.to_api_data() try: log.debug('Saving event properties: {}'.format(data.keys())) response = method(url, data=data) except Exception as e: log.error('Error while saving event. Error: {error}'.format(error=str(e))) return False if response.status_code not in (200, 201): # 200 updated, 201 created log.debug('Saving event Request failed: {}'.format(response.reason)) return False if not self.object_id: # new event event = response.json() self.object_id = event.get(self._cc('id'), None) self.__created = event.get(self._cc('createdDateTime'), None) self.__modified = event.get(self._cc('lastModifiedDateTime'), None) self.__created = parse(self.__created).astimezone(self.protocol.timezone) if self.__created else None self.__modified = parse(self.__modified).astimezone(self.protocol.timezone) if self.__modified else None else: self.__modified = self.protocol.timezone.localize(dt.datetime.now()) return True def accept_event(self, comment=None, *, send_response=True, tentatively=False): if not self.object_id: raise RuntimeError("Can't accept event that doesn't exist") url = self.build_url(self._endpoints.get('event').format(id=self.object_id)) url = url + '/tentativelyAccept' if tentatively else '/accept' data = {} if comment and isinstance(comment, str): data[self._cc('comment')] = comment if send_response is False: data[self._cc('sendResponse')] = send_response try: response = self.con.post(url, data=data or None) except Exception as e: log.error('Error while accepting event. Error: {error}'.format(error=str(e))) return False if response.status_code != 202: log.debug('Accepting event Request failed: {}'.format(response.reason)) return False return True def decline_event(self, comment=None, *, send_response=True): if not self.object_id: raise RuntimeError("Can't accept event that doesn't exist") url = self.build_url(self._endpoints.get('event').format(id=self.object_id)) url = url + '/decline' data = {} if comment and isinstance(comment, str): data[self._cc('comment')] = comment if send_response is False: data[self._cc('sendResponse')] = send_response try: response = self.con.post(url, data=data or None) except Exception as e: log.error('Error while declining event. Error: {error}'.format(error=str(e))) return False if response.status_code != 202: log.debug('Declining event Request failed: {}'.format(response.reason)) return False return True def get_body_text(self): """ Parse the body html and returns the body text using bs4 """ if self.body_type != 'HTML': return self.body try: soup = bs(self.body, 'html.parser') except Exception as e: return self.body else: return soup.body.text def get_body_soup(self): """ Returns the beautifulsoup4 of the html body""" if self.body_type != 'HTML': return None else: return bs(self.body, 'html.parser') class Calendar(ApiComponent, HandleRecipientsMixin): """ A Calendar Representation """ _endpoints = { 'calendar': '/calendars/{id}', 'get_events': '/calendars/{id}/events', 'get_event': '/calendars/{id}/events/{ide}' } event_constructor = Event def __init__(self, *, parent=None, con=None, **kwargs): assert parent or con, 'Need a parent or a connection' self.con = parent.con if parent else con # Choose the main_resource passed in kwargs over the parent main_resource main_resource = kwargs.pop('main_resource', None) or getattr(parent, 'main_resource', None) if parent else None super().__init__(protocol=parent.protocol if parent else kwargs.get('protocol'), main_resource=main_resource) cloud_data = kwargs.get(self._cloud_data_key, {}) self.name = cloud_data.get(self._cc('name'), '') self.calendar_id = cloud_data.get(self._cc('id'), None) self.__owner = self._recipient_from_cloud(cloud_data.get(self._cc('owner'), {}), field='owner') color = cloud_data.get(self._cc('color'), -1) if isinstance(color, str): color = -1 if color == 'auto' else color # TODO: other string colors? self.color = CalendarColors(color) self.can_edit = cloud_data.get(self._cc('canEdit'), False) self.can_share = cloud_data.get(self._cc('canShare'), False) self.can_view_private_items = cloud_data.get(self._cc('canViewPrivateItems'), False) def __str__(self): return 'Calendar: {} from {}'.format(self.name, self.owner) def __repr__(self): return self.__str__() @property def owner(self): return self.__owner def update(self): """ Updates this calendar. Only name and color can be changed. """ if not self.calendar_id: return False url = self.build_url(self._endpoints.get('calendar')) data = { self._cc('name'): self.name, self._cc('color'): self.color.value if isinstance(self.color, CalendarColors) else self.color } try: response = self.con.patch(url, data=data) except Exception as e: log.error('Error updating calendar {}. Error: {}'.format(self.calendar_id, str(e))) return False if response.status_code != 201: log.debug('Updating calendar (id: {}) Request failed: {}'.format(self.calendar_id, response.reason)) return False return True def delete(self): """ Deletes this calendar """ if not self.calendar_id: return False url = self.build_url(self._endpoints.get('calendar').format(id=self.calendar_id)) try: response = self.con.delete(url) except Exception as e: log.error('Error deleting calendar {}. Error: {}'.format(self.name, str(e))) return False if response.status_code != 204: log.debug('Deleting calendar Request failed: {}'.format(response.reason)) return False self.calendar_id = None return True def get_events(self, limit=25, *, query=None, order_by=None, batch=None, download_attachments=False): """ Get events from the default Calendar :param limit: limits the result set. Over 999 uses batch. :param query: applies a filter to the request such as 'displayName:HelloFolder' :param order_by: orders the result set based on this condition :param batch: Returns a custom iterator that retrieves items in batches allowing to retrieve more items than the limit. Download_attachments is ignored. :param download_attachments: downloads event attachments """ url = self.build_url(self._endpoints.get('get_events').format(id=self.calendar_id)) if limit is None or limit > self.protocol.max_top_value: batch = self.protocol.max_top_value if batch: download_attachments = False params = {'$top': batch if batch else limit} if order_by: params['$orderby'] = order_by if query: if isinstance(query, str): params['$filter'] = query else: params.update(query.as_params()) try: response = self.con.get(url, params=params, headers={'Prefer': 'outlook.timezone="UTC"'}) except Exception as e: log.error('Error donwloading events. Error {}'.format(e)) return [] if response.status_code != 200: log.debug('Getting events Request failed: {}'.format(response.reason)) return [] data = response.json() # Everything received from the cloud must be passed with self._cloud_data_key events = [self.event_constructor(parent=self, download_attachments=download_attachments, **{self._cloud_data_key: event}) for event in data.get('value', [])] if batch: return Pagination(parent=self, data=events, constructor=self.event_constructor, next_link=data.get(NEXT_LINK_KEYWORD, None), limit=limit) else: return events def new_event(self, subject=None): """ Returns a new (unsaved) Event object """ return self.event_constructor(parent=self, subject=subject, calendar_id=self.calendar_id) def get_event(self, param): """Returns an Event instance by it's id :param param: an event_id or a Query instance """ if param is None: return None if isinstance(param, str): url = self.build_url(self._endpoints.get('get_event').format(id=self.calendar_id, ide=param)) params = None else: url = self.build_url(self._endpoints.get('get_events').format(id=self.calendar_id)) params = {'$top': 1} params.update(param.as_params()) try: response = self.con.get(url, params=params, headers={'Prefer': 'outlook.timezone="UTC"'}) except Exception as e: log.error('Error getting event: {}. Error {}'.format(param, e)) return None if response.status_code != 200: log.debug('Getting event Request failed: {}'.format(response.reason)) return None if isinstance(param, str): event = response.json() else: event = response.json().get('value', []) if event: event = event[0] else: return None return self.event_constructor(parent=self, **{self._cloud_data_key: event}) class Schedule(ApiComponent): """ A Wrapper around calendars and events""" _endpoints = { 'root_calendars': '/calendars', 'get_calendar': '/calendars/{id}', 'default_calendar': '/calendar', 'events': '/calendar/events' } calendar_constructor = Calendar event_constructor = Event def __init__(self, *, parent=None, con=None, **kwargs): assert parent or con, 'Need a parent or a connection' self.con = parent.con if parent else con # Choose the main_resource passed in kwargs over the parent main_resource main_resource = kwargs.pop('main_resource', None) or getattr(parent, 'main_resource', None) if parent else None super().__init__(protocol=parent.protocol if parent else kwargs.get('protocol'), main_resource=main_resource) def __str__(self): return 'Schedule resource: {}'.format(self.main_resource) def __repr__(self): return self.__str__() def list_calendars(self, limit=None, *, query=None, order_by=None): """ Gets a list of calendars To use query an order_by check the OData specification here: http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html :param limit: Number of elements to return. :param query: a OData valid filter clause :param order_by: OData valid order by clause """ url = self.build_url(self._endpoints.get('root_calendars')) params = {} if limit: params['$top'] = limit if query: params['$filter'] = str(query) if order_by: params['$orderby'] = order_by try: response = self.con.get(url, params=params or None) except Exception as e: log.error('Error getting calendars. Error {}'.format(str(e))) return [] if response.status_code != 200: log.debug('Getting calendars Request failed: {}'.format(response.reason)) return [] data = response.json() # Everything received from the cloud must be passed with self._cloud_data_key contacts = [self.calendar_constructor(parent=self, **{self._cloud_data_key: calendar}) for calendar in data.get('value', [])] return contacts def new_calendar(self, calendar_name): """ Creates a new calendar :return a new Calendar instance """ if not calendar_name: return None url = self.build_url(self._endpoints.get('root_calendars')) try: response = self.con.post(url, data={self._cc('name'): calendar_name}) except Exception as e: log.error('Error creating new calendar. Error: {}'.format(str(e))) return None if response.status_code != 201: log.debug('Creating new calendar Request failed: {}'.format(response.reason)) return None calendar = response.json() # Everything received from the cloud must be passed with self._cloud_data_key return self.calendar_constructor(parent=self, **{self._cloud_data_key: calendar}) def get_calendar(self, calendar_id=None, calendar_name=None): """ Returns a calendar by it's id or name :param calendar_id: the calendar id to be retrieved. :param calendar_name: the calendar name to be retrieved. """ if calendar_id and calendar_name: raise RuntimeError('Provide only one of the options') if not calendar_id and not calendar_name: raise RuntimeError('Provide one of the options') if calendar_id: # get calendar by it's id url = self.build_url(self._endpoints.get('get_calendar').format(id=calendar_id)) params = None else: # get calendar by name url = self.build_url(self._endpoints.get('root_calendars')) params = {'$filter': "{} eq '{}'".format(self._cc('name'), calendar_name), '$top': 1} try: response = self.con.get(url, params=params) except Exception as e: log.error('Error getting calendar {}. Error: {}'.format(calendar_id or calendar_name, str(e))) return None if response.status_code != 200: log.debug('Getting calendar Request failed: {}'.format(response.reason)) return None if calendar_id: calendar = response.json() else: calendar = response.json().get('value') calendar = calendar[0] if calendar else None if calendar is None: return None # Everything received from the cloud must be passed with self._cloud_data_key return self.calendar_constructor(parent=self, **{self._cloud_data_key: calendar}) def get_default_calendar(self): """ Returns the default calendar for the current user """ url = self.build_url(self._endpoints.get('default_calendar')) try: response = self.con.get(url) except Exception as e: log.error('Error getting default calendar. Error: {}'.format(e)) return None if response.status_code != 200: log.debug('Getting default calendar Request failed: {}'.format(response.reason)) return None calendar = response.json() # Everything received from the cloud must be passed with self._cloud_data_key return self.calendar_constructor(parent=self, **{self._cloud_data_key: calendar}) def get_events(self, limit=25, *, query=None, order_by=None, batch=None, download_attachments=False): """ Get events from the default Calendar :param limit: limits the result set. Over 999 uses batch. :param query: applies a filter to the request such as 'displayName:HelloFolder' :param order_by: orders the result set based on this condition :param batch: Returns a custom iterator that retrieves items in batches allowing to retrieve more items than the limit. Download_attachments is ignored. :param download_attachments: downloads event attachments """ url = self.build_url(self._endpoints.get('events')) if limit is None or limit > self.protocol.max_top_value: batch = self.protocol.max_top_value if batch: download_attachments = False params = {'$top': batch if batch else limit} if order_by: params['$orderby'] = order_by if query: if isinstance(query, str): params['$filter'] = query else: params.update(query.as_params()) try: response = self.con.get(url, params=params, headers={'Prefer': 'outlook.timezone="UTC"'}) except Exception as e: log.error('Error donwloading events. Error {}'.format(e)) return [] if response.status_code != 200: log.debug('Getting events Request failed: {}'.format(response.reason)) return [] data = response.json() # Everything received from the cloud must be passed with self._cloud_data_key events = [self.event_constructor(parent=self, download_attachments=download_attachments, **{self._cloud_data_key: event}) for event in data.get('value', [])] if batch: return Pagination(parent=self, data=events, constructor=self.event_constructor, next_link=data.get(NEXT_LINK_KEYWORD, None), limit=limit) else: return events def new_event(self, subject=None): """ Returns a new (unsaved) Event object in the default calendar """ return self.event_constructor(parent=self, subject=subject)
[ 1, 1053, 12183, 13, 3166, 14115, 1053, 1174, 398, 13, 3166, 2635, 4422, 29889, 16680, 1053, 6088, 13, 5215, 12865, 408, 11636, 13, 5215, 282, 3637, 29920, 13, 5215, 17684, 13, 3166, 24512, 29946, 1053, 25685, 29903, 1132, 408, 24512, 13, 13, 3166, 438, 29941, 29953, 29945, 29889, 13239, 1053, 349, 351, 3381, 29892, 405, 12194, 29918, 23714, 29968, 29918, 10818, 17013, 29892, 29749, 5308, 29892, 6212, 496, 1860, 29892, 6212, 25117, 29892, 320, 13, 1678, 6212, 496, 519, 29924, 861, 262, 29892, 16032, 749, 10108, 29892, 3201, 4937, 2697, 13, 3166, 438, 29941, 29953, 29945, 29889, 4906, 1053, 29273, 1123, 7334, 10070, 29924, 861, 262, 13, 13, 1188, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 22877, 4690, 29918, 5813, 29903, 353, 518, 23392, 29889, 10874, 29918, 978, 29961, 29916, 29962, 363, 921, 297, 3464, 29898, 29896, 29892, 29871, 29896, 29941, 4638, 13, 13, 13, 1990, 6864, 5103, 29898, 16854, 1125, 13, 1678, 9205, 3950, 353, 525, 6388, 3950, 29915, 13, 1678, 323, 296, 6703, 23965, 287, 353, 525, 29873, 296, 6703, 23965, 287, 29915, 13, 1678, 29848, 287, 353, 525, 16044, 287, 29915, 13, 1678, 3826, 21354, 353, 525, 27787, 1312, 29915, 13, 1678, 2216, 1666, 2818, 287, 353, 525, 1333, 1666, 2818, 287, 29915, 13, 13, 13, 1990, 6212, 3324, 29872, 1542, 29898, 16854, 1125, 13, 1678, 830, 5958, 353, 525, 12403, 29915, 13, 1678, 28379, 353, 525, 25253, 29915, 13, 1678, 18981, 353, 525, 10314, 29915, 13, 13, 13, 1990, 6864, 29903, 575, 24858, 29898, 16854, 1125, 13, 1678, 21981, 353, 525, 8945, 29915, 13, 1678, 16224, 353, 525, 10532, 284, 29915, 13, 1678, 12230, 353, 525, 9053, 29915, 13, 1678, 10811, 1693, 616, 353, 525, 5527, 1693, 616, 29915, 13, 13, 13, 1990, 6864, 8964, 2887, 29898, 16854, 1125, 13, 1678, 12362, 353, 525, 9021, 29915, 13, 1678, 323, 296, 1230, 353, 525, 29873, 296, 1230, 29915, 13, 1678, 8406, 29891, 353, 525, 8262, 29891, 29915, 13, 1678, 438, 974, 353, 525, 29877, 974, 29915, 13, 1678, 24176, 27406, 3062, 353, 525, 22899, 27406, 3062, 29915, 13, 1678, 853, 5203, 353, 525, 26690, 29915, 13, 13, 13, 1990, 26431, 1625, 943, 29898, 16854, 1125, 13, 1678, 12790, 21319, 353, 29871, 29900, 13, 1678, 12790, 24599, 353, 29871, 29896, 13, 1678, 12790, 29949, 3881, 353, 29871, 29906, 13, 1678, 12790, 29954, 764, 353, 29871, 29941, 13, 1678, 12790, 29979, 4743, 353, 29871, 29946, 13, 1678, 12790, 7141, 284, 353, 29871, 29945, 13, 1678, 12790, 29925, 682, 353, 29871, 29953, 13, 1678, 12790, 29933, 4708, 353, 29871, 29955, 13, 1678, 12790, 9039, 353, 29871, 29947, 13, 1678, 5918, 3306, 353, 29871, 29929, 13, 1678, 11133, 353, 448, 29896, 13, 13, 13, 1990, 6864, 4165, 25117, 29898, 4165, 25117, 1125, 13, 1678, 903, 355, 9748, 353, 11117, 14930, 2396, 8207, 13604, 19248, 333, 6822, 14930, 1860, 10827, 13, 13, 13, 1990, 6864, 4165, 496, 1860, 29898, 4165, 496, 1860, 1125, 13, 1678, 903, 355, 9748, 353, 11117, 14930, 1860, 2396, 8207, 13604, 19248, 333, 6822, 14930, 1860, 10827, 13, 13, 13, 1990, 23331, 2624, 23923, 23860, 29901, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1162, 26841, 29918, 1853, 29892, 7292, 1125, 13, 4706, 1583, 29889, 3757, 26841, 29918, 1853, 353, 1162, 26841, 29918, 1853, 13, 4706, 1583, 29889, 19207, 353, 7292, 13, 13, 13, 1990, 6864, 4789, 26841, 29898, 11713, 5308, 1125, 13, 1678, 9995, 319, 8954, 310, 385, 1741, 1162, 26841, 4426, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1741, 29892, 1162, 26841, 29922, 8516, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 20464, 29922, 3696, 29889, 20464, 29892, 1667, 29918, 10314, 29922, 3696, 29889, 3396, 29918, 10314, 29897, 13, 13, 4706, 1583, 3032, 3696, 353, 1741, 13, 4706, 1162, 26841, 353, 1162, 26841, 470, 6571, 13, 4706, 396, 1162, 26841, 4766, 13, 4706, 1162, 26841, 29918, 11037, 353, 1162, 26841, 29889, 657, 29898, 1311, 3032, 617, 877, 11037, 5477, 426, 1800, 13, 13, 4706, 1583, 17255, 19207, 353, 1162, 26841, 29918, 11037, 29889, 657, 29898, 1311, 3032, 617, 877, 19207, 5477, 6213, 29897, 13, 4706, 1583, 17255, 16700, 29918, 974, 29918, 18448, 353, 1162, 26841, 29918, 11037, 29889, 657, 29898, 1311, 3032, 617, 877, 16700, 2776, 22606, 5477, 731, 3101, 13, 4706, 1583, 17255, 4102, 29918, 3250, 29918, 974, 29918, 18448, 353, 1162, 26841, 29918, 11037, 29889, 657, 29898, 1311, 3032, 617, 877, 4102, 12742, 2776, 22606, 5477, 6213, 29897, 13, 4706, 1583, 17255, 3250, 29918, 974, 29918, 10874, 353, 1162, 26841, 29918, 11037, 29889, 657, 29898, 1311, 3032, 617, 877, 3250, 2776, 13953, 5477, 6213, 29897, 13, 4706, 1583, 17255, 10874, 353, 1162, 26841, 29918, 11037, 29889, 657, 29898, 1311, 3032, 617, 877, 10874, 5477, 6213, 29897, 13, 4706, 1583, 17255, 2248, 353, 1162, 26841, 29918, 11037, 29889, 657, 29898, 1311, 3032, 617, 877, 2248, 5477, 525, 4102, 1495, 13, 13, 4706, 396, 1162, 26841, 3464, 13, 4706, 1162, 26841, 29918, 3881, 353, 1162, 26841, 29889, 657, 29898, 1311, 3032, 617, 877, 3881, 5477, 426, 1800, 13, 13, 4706, 1583, 17255, 542, 1038, 2063, 353, 1162, 26841, 29918, 3881, 29889, 657, 29898, 1311, 3032, 617, 877, 4537, 2776, 22034, 1038, 2063, 5477, 6213, 29897, 13, 4706, 1583, 17255, 2962, 29918, 1256, 353, 1162, 26841, 29918, 3881, 29889, 657, 29898, 1311, 3032, 617, 877, 2962, 2539, 5477, 6213, 29897, 13, 4706, 1583, 17255, 355, 29918, 1256, 353, 1162, 26841, 29918, 3881, 29889, 657, 29898, 1311, 3032, 617, 877, 355, 2539, 5477, 6213, 29897, 13, 4706, 1583, 17255, 3757, 26841, 29918, 2230, 29918, 8028, 353, 1162, 26841, 29918, 3881, 29889, 657, 29898, 1311, 3032, 617, 877, 3757, 26841, 2481, 18482, 5477, 1583, 29889, 20464, 29889, 657, 29918, 10499, 29918, 17559, 3101, 13, 4706, 396, 931, 322, 931, 20542, 526, 451, 5545, 297, 1162, 26841, 20238, 856, 13, 4706, 396, 306, 1016, 29915, 29873, 1073, 2020, 525, 3757, 26841, 2481, 18482, 29915, 338, 2198, 1244, 13, 4706, 396, 317, 2548, 263, 1369, 2539, 12865, 304, 278, 1923, 2582, 297, 385, 4829, 29901, 13, 4706, 396, 376, 29089, 3588, 278, 16333, 525, 12673, 29915, 304, 278, 3806, 1134, 525, 3853, 29885, 29889, 2539, 11838, 13, 4706, 565, 1162, 26841, 29918, 3881, 29901, 13, 9651, 1583, 17255, 2962, 29918, 1256, 353, 6088, 29898, 1311, 17255, 2962, 29918, 1256, 467, 1256, 580, 565, 1583, 17255, 2962, 29918, 1256, 1683, 6213, 13, 9651, 1583, 17255, 355, 29918, 1256, 353, 6088, 29898, 1311, 17255, 355, 29918, 1256, 467, 1256, 580, 565, 1583, 17255, 355, 29918, 1256, 1683, 6213, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 565, 1583, 17255, 19207, 29901, 13, 9651, 4766, 353, 525, 29928, 8683, 29901, 1432, 6571, 2462, 29914, 29879, 4286, 4830, 29898, 1311, 17255, 19207, 29897, 13, 9651, 565, 1583, 17255, 16700, 29918, 974, 29918, 18448, 29901, 13, 18884, 3841, 353, 525, 470, 15300, 7122, 29898, 1761, 29898, 1311, 17255, 16700, 29918, 974, 29918, 18448, 876, 13, 18884, 4766, 353, 525, 18278, 23471, 368, 29901, 6571, 6571, 1432, 6571, 4098, 29914, 29879, 4286, 4830, 29898, 1311, 17255, 2248, 29892, 3841, 29892, 1583, 17255, 19207, 29897, 13, 18884, 565, 1583, 17255, 4102, 29918, 3250, 29918, 974, 29918, 18448, 29901, 13, 462, 1678, 4766, 353, 525, 22606, 368, 29901, 1432, 6571, 4723, 29914, 29879, 373, 6571, 4286, 4830, 29898, 1311, 17255, 19207, 29892, 3841, 29897, 13, 18884, 25342, 1583, 17255, 10874, 29901, 13, 462, 1678, 4766, 353, 525, 18278, 8905, 368, 29901, 6571, 6571, 1432, 6571, 1629, 29914, 29879, 373, 6571, 4286, 4830, 29898, 1311, 17255, 2248, 29892, 3841, 29892, 13, 462, 462, 462, 462, 462, 1678, 1583, 17255, 19207, 29892, 13, 462, 462, 462, 462, 462, 1678, 341, 1164, 4690, 29918, 5813, 29903, 29961, 1311, 17255, 10874, 448, 29871, 29896, 2314, 13, 9651, 25342, 1583, 17255, 3250, 29918, 974, 29918, 10874, 29901, 13, 18884, 4766, 353, 525, 4920, 14977, 23471, 368, 29901, 373, 2462, 6571, 1432, 6571, 4098, 29914, 29879, 4286, 4830, 29898, 1311, 17255, 3250, 29918, 974, 29918, 10874, 29892, 1583, 17255, 19207, 29897, 13, 18884, 565, 1583, 17255, 10874, 29901, 13, 462, 1678, 4766, 353, 525, 4920, 14977, 8905, 368, 29901, 373, 6571, 6571, 1432, 6571, 1629, 29914, 29879, 4286, 4830, 29898, 22877, 4690, 29918, 5813, 29903, 29961, 1311, 17255, 10874, 448, 29871, 29896, 1402, 13, 462, 462, 462, 462, 462, 1583, 17255, 3250, 29918, 974, 29918, 10874, 29892, 13, 462, 462, 462, 462, 462, 1583, 17255, 19207, 29897, 13, 13, 9651, 364, 29918, 3881, 353, 6629, 13, 9651, 565, 1583, 17255, 2962, 29918, 1256, 29901, 13, 18884, 364, 29918, 3881, 353, 525, 4763, 292, 373, 6571, 4286, 4830, 29898, 1311, 17255, 2962, 29918, 1256, 29897, 13, 18884, 10614, 29918, 265, 353, 525, 2541, 694, 1095, 29915, 13, 18884, 565, 1583, 17255, 355, 29918, 1256, 29901, 13, 462, 1678, 10614, 29918, 265, 353, 525, 2548, 373, 6571, 4286, 4830, 29898, 1311, 17255, 355, 29918, 1256, 29897, 13, 18884, 25342, 1583, 17255, 542, 1038, 2063, 29901, 13, 462, 1678, 10614, 29918, 265, 353, 525, 786, 304, 6571, 12954, 1038, 2063, 4286, 4830, 29898, 1311, 17255, 542, 1038, 2063, 29897, 13, 18884, 364, 29918, 3881, 353, 525, 8875, 6571, 4286, 4830, 29898, 29878, 29918, 3881, 29892, 10614, 29918, 265, 29897, 13, 9651, 736, 22372, 1836, 6571, 4286, 4830, 29898, 11037, 29892, 364, 29918, 3881, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 525, 3782, 1162, 26841, 9615, 29915, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 710, 1649, 580, 13, 13, 1678, 822, 4770, 11227, 12035, 1311, 1125, 13, 4706, 736, 6120, 29898, 1311, 17255, 19207, 29897, 13, 13, 1678, 822, 903, 11294, 29918, 25990, 29898, 1311, 1125, 13, 4706, 9995, 10318, 278, 5702, 29918, 25990, 373, 278, 1741, 304, 9432, 263, 4312, 2767, 373, 445, 1746, 9995, 13, 4706, 1583, 3032, 3696, 3032, 11294, 29918, 25990, 29889, 1202, 877, 3757, 26841, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 7292, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 19207, 13, 13, 1678, 732, 19207, 29889, 842, 357, 13, 1678, 822, 7292, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 19207, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 3841, 29918, 974, 29918, 18448, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 16700, 29918, 974, 29918, 18448, 13, 13, 1678, 732, 16700, 29918, 974, 29918, 18448, 29889, 842, 357, 13, 1678, 822, 3841, 29918, 974, 29918, 18448, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 16700, 29918, 974, 29918, 18448, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 937, 29918, 3250, 29918, 974, 29918, 18448, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 4102, 29918, 3250, 29918, 974, 29918, 18448, 13, 13, 1678, 732, 4102, 29918, 3250, 29918, 974, 29918, 18448, 29889, 842, 357, 13, 1678, 822, 937, 29918, 3250, 29918, 974, 29918, 18448, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 4102, 29918, 3250, 29918, 974, 29918, 18448, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2462, 29918, 974, 29918, 10874, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 3250, 29918, 974, 29918, 10874, 13, 13, 1678, 732, 3250, 29918, 974, 29918, 10874, 29889, 842, 357, 13, 1678, 822, 2462, 29918, 974, 29918, 10874, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 3250, 29918, 974, 29918, 10874, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 4098, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 10874, 13, 13, 1678, 732, 10874, 29889, 842, 357, 13, 1678, 822, 4098, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 10874, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2380, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 2248, 13, 13, 1678, 732, 2248, 29889, 842, 357, 13, 1678, 822, 2380, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 2248, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 12954, 1038, 2063, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 542, 1038, 2063, 13, 13, 1678, 732, 542, 1038, 2063, 29889, 842, 357, 13, 1678, 822, 12954, 1038, 2063, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 542, 1038, 2063, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1162, 26841, 29918, 2230, 29918, 8028, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 3757, 26841, 29918, 2230, 29918, 8028, 13, 13, 1678, 732, 3757, 26841, 29918, 2230, 29918, 8028, 29889, 842, 357, 13, 1678, 822, 1162, 26841, 29918, 2230, 29918, 8028, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 3757, 26841, 29918, 2230, 29918, 8028, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1369, 29918, 1256, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 2962, 29918, 1256, 13, 13, 1678, 732, 2962, 29918, 1256, 29889, 842, 357, 13, 1678, 822, 1369, 29918, 1256, 29898, 1311, 29892, 995, 1125, 13, 4706, 565, 451, 338, 8758, 29898, 1767, 29892, 11636, 29889, 1256, 1125, 13, 9651, 12020, 7865, 2392, 877, 2962, 29918, 1256, 995, 1818, 367, 263, 2854, 2635, 1203, 1495, 13, 4706, 565, 338, 8758, 29898, 1767, 29892, 11636, 29889, 12673, 1125, 13, 9651, 995, 353, 995, 29889, 1256, 580, 13, 4706, 1583, 17255, 2962, 29918, 1256, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1095, 29918, 1256, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 2962, 29918, 1256, 13, 13, 1678, 732, 355, 29918, 1256, 29889, 842, 357, 13, 1678, 822, 1095, 29918, 1256, 29898, 1311, 29892, 995, 1125, 13, 4706, 565, 451, 338, 8758, 29898, 1767, 29892, 11636, 29889, 1256, 1125, 13, 9651, 12020, 7865, 2392, 877, 355, 29918, 1256, 995, 1818, 367, 263, 2854, 2635, 1203, 1495, 13, 4706, 565, 338, 8758, 29898, 1767, 29892, 11636, 29889, 12673, 1125, 13, 9651, 995, 353, 995, 29889, 1256, 580, 13, 4706, 1583, 17255, 355, 29918, 1256, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 822, 304, 29918, 2754, 29918, 1272, 29898, 1311, 1125, 13, 4706, 848, 353, 6571, 13, 4706, 396, 1162, 26841, 4766, 13, 4706, 565, 1583, 17255, 19207, 322, 338, 8758, 29898, 1311, 17255, 19207, 29892, 938, 1125, 13, 9651, 1162, 26841, 29918, 11037, 353, 848, 29961, 1311, 3032, 617, 877, 11037, 1495, 29962, 353, 6571, 13, 9651, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 1853, 1495, 29962, 353, 525, 29881, 8683, 29915, 13, 9651, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 19207, 1495, 29962, 353, 1583, 17255, 19207, 13, 9651, 565, 1583, 17255, 16700, 29918, 974, 29918, 18448, 322, 338, 8758, 29898, 1311, 17255, 16700, 29918, 974, 29918, 18448, 29892, 313, 1761, 29892, 18761, 29892, 731, 22164, 13, 18884, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 1853, 1495, 29962, 353, 525, 22925, 13953, 368, 29915, 13, 18884, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 16700, 2776, 22606, 1495, 29962, 353, 1051, 29898, 1311, 17255, 16700, 29918, 974, 29918, 18448, 29897, 13, 18884, 565, 1583, 17255, 4102, 29918, 3250, 29918, 974, 29918, 18448, 29901, 13, 462, 1678, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 1853, 1495, 29962, 353, 525, 18448, 368, 29915, 13, 462, 1678, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 4102, 12742, 2776, 22606, 1495, 29962, 353, 1583, 17255, 4102, 29918, 3250, 29918, 974, 29918, 18448, 13, 18884, 25342, 1583, 17255, 10874, 322, 338, 8758, 29898, 1311, 17255, 10874, 29892, 938, 1125, 13, 462, 1678, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 1853, 1495, 29962, 353, 525, 22925, 12883, 368, 29915, 13, 462, 1678, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 10874, 1495, 29962, 353, 1583, 17255, 10874, 13, 462, 1678, 565, 1583, 17255, 2248, 29901, 13, 462, 4706, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 2248, 1495, 29962, 353, 1583, 17255, 2248, 13, 18884, 1683, 29901, 13, 462, 1678, 565, 1583, 17255, 2248, 29901, 13, 462, 4706, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 2248, 1495, 29962, 353, 1583, 17255, 2248, 13, 13, 9651, 25342, 1583, 17255, 3250, 29918, 974, 29918, 10874, 322, 338, 8758, 29898, 1311, 17255, 3250, 29918, 974, 29918, 10874, 29892, 938, 1125, 13, 18884, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 1853, 1495, 29962, 353, 525, 23552, 13953, 368, 29915, 13, 18884, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 3250, 2776, 13953, 1495, 29962, 353, 1583, 17255, 3250, 29918, 974, 29918, 10874, 13, 18884, 565, 1583, 17255, 10874, 322, 338, 8758, 29898, 1311, 17255, 10874, 29892, 938, 1125, 13, 462, 1678, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 1853, 1495, 29962, 353, 525, 23552, 12883, 368, 29915, 13, 462, 1678, 1162, 26841, 29918, 11037, 29961, 1311, 3032, 617, 877, 10874, 1495, 29962, 353, 1583, 17255, 10874, 13, 13, 4706, 396, 1162, 26841, 3464, 13, 4706, 565, 1583, 17255, 2962, 29918, 1256, 29901, 13, 9651, 1162, 26841, 29918, 3881, 353, 848, 29961, 1311, 3032, 617, 877, 3881, 1495, 29962, 353, 6571, 13, 9651, 1162, 26841, 29918, 3881, 29961, 1311, 3032, 617, 877, 1853, 1495, 29962, 353, 525, 1217, 5044, 29915, 13, 9651, 1162, 26841, 29918, 3881, 29961, 1311, 3032, 617, 877, 2962, 2539, 1495, 29962, 353, 1583, 17255, 2962, 29918, 1256, 29889, 10718, 4830, 580, 13, 9651, 1162, 26841, 29918, 3881, 29961, 1311, 3032, 617, 877, 3757, 26841, 2481, 18482, 1495, 29962, 353, 1583, 17255, 3757, 26841, 29918, 2230, 29918, 8028, 13, 13, 9651, 565, 1583, 17255, 355, 29918, 1256, 29901, 13, 18884, 1162, 26841, 29918, 3881, 29961, 1311, 3032, 617, 877, 1853, 1495, 29962, 353, 525, 355, 2539, 29915, 13, 18884, 1162, 26841, 29918, 3881, 29961, 1311, 3032, 617, 877, 355, 2539, 1495, 29962, 353, 1583, 17255, 355, 29918, 1256, 29889, 10718, 4830, 580, 13, 9651, 25342, 1583, 17255, 542, 1038, 2063, 338, 451, 6213, 322, 338, 8758, 29898, 1311, 17255, 542, 1038, 2063, 29892, 938, 1125, 13, 18884, 1162, 26841, 29918, 3881, 29961, 1311, 3032, 617, 877, 1853, 1495, 29962, 353, 525, 4537, 287, 29915, 13, 18884, 1162, 26841, 29918, 3881, 29961, 1311, 3032, 617, 877, 4537, 2776, 22034, 1038, 2063, 1495, 29962, 353, 1583, 17255, 542, 1038, 2063, 13, 13, 4706, 736, 848, 13, 13, 1678, 822, 903, 8551, 29918, 11037, 29898, 1311, 1125, 13, 4706, 9995, 21386, 1503, 445, 1741, 1162, 26841, 9995, 13, 4706, 396, 4766, 2318, 13, 4706, 1583, 17255, 19207, 353, 6213, 13, 4706, 1583, 17255, 16700, 29918, 974, 29918, 18448, 353, 731, 580, 13, 4706, 1583, 17255, 4102, 29918, 3250, 29918, 974, 29918, 18448, 353, 6213, 13, 4706, 1583, 17255, 3250, 29918, 974, 29918, 10874, 353, 6213, 13, 4706, 1583, 17255, 10874, 353, 6213, 13, 4706, 1583, 17255, 2248, 353, 525, 4102, 29915, 13, 4706, 396, 3464, 2318, 13, 4706, 1583, 17255, 2962, 29918, 1256, 353, 6213, 13, 4706, 1583, 17255, 355, 29918, 1256, 353, 6213, 13, 4706, 1583, 17255, 542, 1038, 2063, 353, 6213, 13, 13, 1678, 822, 731, 29918, 3881, 29898, 1311, 29892, 1369, 29922, 8516, 29892, 1095, 29922, 8516, 29892, 12954, 1038, 2063, 29922, 8516, 1125, 13, 4706, 565, 1369, 338, 6213, 29901, 13, 9651, 565, 1583, 17255, 2962, 29918, 1256, 338, 6213, 29901, 13, 18884, 1583, 17255, 2962, 29918, 1256, 353, 11636, 29889, 1256, 29889, 27765, 580, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 2962, 29918, 1256, 353, 1369, 13, 13, 4706, 565, 1095, 29901, 13, 9651, 1583, 29889, 355, 29918, 1256, 353, 1095, 13, 4706, 25342, 12954, 1038, 2063, 29901, 13, 9651, 1583, 17255, 542, 1038, 2063, 353, 12954, 1038, 2063, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 822, 731, 29918, 29881, 8683, 29898, 1311, 29892, 7292, 29892, 3579, 19290, 1125, 13, 4706, 1583, 3032, 8551, 29918, 11037, 580, 13, 4706, 1583, 17255, 19207, 353, 7292, 13, 4706, 1583, 29889, 842, 29918, 3881, 29898, 1068, 19290, 29897, 13, 13, 1678, 822, 731, 29918, 18448, 368, 29898, 1311, 29892, 7292, 29892, 334, 29892, 3841, 29918, 974, 29918, 18448, 29892, 937, 29918, 3250, 29918, 974, 29918, 18448, 29892, 3579, 19290, 1125, 13, 4706, 1583, 29889, 842, 29918, 29881, 8683, 29898, 19207, 29892, 3579, 19290, 29897, 13, 4706, 1583, 17255, 16700, 29918, 974, 29918, 18448, 353, 731, 29898, 16700, 29918, 974, 29918, 18448, 29897, 13, 4706, 1583, 17255, 4102, 29918, 3250, 29918, 974, 29918, 18448, 353, 937, 29918, 3250, 29918, 974, 29918, 18448, 13, 13, 1678, 822, 731, 29918, 10874, 368, 29898, 1311, 29892, 7292, 29892, 334, 29892, 2462, 29918, 974, 29918, 10874, 29922, 8516, 29892, 3841, 29918, 974, 29918, 18448, 29922, 8516, 29892, 2380, 29922, 8516, 29892, 3579, 19290, 1125, 13, 4706, 565, 451, 2462, 29918, 974, 29918, 10874, 322, 451, 3841, 29918, 974, 29918, 18448, 29901, 13, 9651, 12020, 7865, 2392, 877, 29924, 504, 3867, 2462, 29918, 974, 29918, 10874, 470, 3841, 29918, 974, 29918, 18448, 1819, 1495, 13, 4706, 565, 2462, 29918, 974, 29918, 10874, 322, 3841, 29918, 974, 29918, 18448, 29901, 13, 9651, 12020, 7865, 2392, 877, 29924, 504, 3867, 871, 697, 310, 278, 1023, 3987, 1495, 13, 4706, 1583, 29889, 842, 29918, 29881, 8683, 29898, 19207, 29892, 3579, 19290, 29897, 13, 4706, 565, 2462, 29918, 974, 29918, 10874, 29901, 13, 9651, 1583, 17255, 3250, 29918, 974, 29918, 10874, 353, 2462, 29918, 974, 29918, 10874, 13, 4706, 25342, 3841, 29918, 974, 29918, 18448, 29901, 13, 9651, 1583, 17255, 16700, 29918, 974, 29918, 18448, 353, 731, 29898, 16700, 29918, 974, 29918, 18448, 29897, 13, 9651, 565, 2380, 29901, 13, 18884, 1583, 17255, 2248, 353, 2380, 13, 13, 1678, 822, 731, 29918, 6360, 368, 29898, 1311, 29892, 7292, 29892, 4098, 29892, 334, 29892, 2462, 29918, 974, 29918, 10874, 29922, 8516, 29892, 3841, 29918, 974, 29918, 18448, 29922, 8516, 29892, 2380, 29922, 8516, 29892, 3579, 19290, 1125, 13, 4706, 1583, 29889, 842, 29918, 10874, 368, 29898, 19207, 29892, 2462, 29918, 974, 29918, 10874, 29922, 3250, 29918, 974, 29918, 10874, 29892, 3841, 29918, 974, 29918, 18448, 29922, 16700, 29918, 974, 29918, 18448, 29892, 2380, 29922, 2248, 29892, 3579, 19290, 29897, 13, 4706, 1583, 17255, 10874, 353, 4098, 13, 13, 13, 1990, 13291, 5709, 29898, 11713, 5308, 1125, 13, 1678, 9995, 530, 1741, 2933, 4660, 313, 4882, 29892, 931, 29897, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3847, 29892, 2933, 29918, 4882, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 20464, 29922, 3560, 29889, 20464, 29892, 1667, 29918, 10314, 29922, 3560, 29889, 3396, 29918, 10314, 29897, 13, 4706, 1583, 29889, 4882, 353, 2933, 29918, 4882, 29889, 657, 29898, 1311, 3032, 617, 877, 5327, 5477, 6213, 29897, 13, 4706, 1583, 29889, 4882, 353, 6213, 565, 1583, 29889, 4882, 1275, 525, 9290, 29915, 1683, 1583, 29889, 4882, 13, 4706, 565, 1583, 29889, 4882, 29901, 13, 9651, 1583, 29889, 5327, 29918, 2230, 353, 2933, 29918, 4882, 29889, 657, 29898, 1311, 3032, 617, 877, 2230, 5477, 6213, 29897, 13, 9651, 565, 1583, 29889, 5327, 29918, 2230, 29901, 13, 18884, 1583, 29889, 5327, 29918, 2230, 353, 6088, 29898, 1311, 29889, 5327, 29918, 2230, 467, 579, 603, 8028, 29898, 1311, 29889, 20464, 29889, 2230, 8028, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 5327, 29918, 2230, 353, 6213, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 29889, 4882, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 710, 1649, 580, 13, 13, 13, 1990, 6212, 3324, 29872, 29901, 13, 1678, 9995, 319, 6864, 472, 841, 311, 29872, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3211, 29892, 334, 29892, 1024, 29922, 8516, 29892, 472, 841, 311, 29872, 29918, 1853, 29922, 8516, 29892, 2933, 29918, 4882, 29922, 8516, 29892, 1741, 29922, 8516, 1125, 13, 4706, 1583, 3032, 7328, 353, 3211, 13, 4706, 1583, 3032, 978, 353, 1024, 13, 4706, 1583, 3032, 3696, 353, 1741, 13, 4706, 565, 338, 8758, 29898, 5327, 29918, 4882, 29892, 13291, 5709, 1125, 13, 9651, 1583, 17255, 5327, 29918, 4882, 353, 2933, 29918, 4882, 13, 4706, 1683, 29901, 13, 9651, 1583, 17255, 5327, 29918, 4882, 353, 6213, 13, 4706, 1583, 17255, 8606, 311, 29872, 29918, 1853, 353, 6212, 3324, 29872, 1542, 29889, 19347, 13, 4706, 565, 472, 841, 311, 29872, 29918, 1853, 29901, 13, 9651, 1583, 29889, 8606, 311, 29872, 29918, 1853, 353, 472, 841, 311, 29872, 29918, 1853, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 565, 1583, 29889, 978, 29901, 13, 9651, 736, 22372, 6177, 6571, 21313, 1800, 4286, 4830, 29898, 1311, 29889, 8606, 311, 29872, 29918, 1853, 29889, 978, 29892, 1583, 29889, 978, 29892, 1583, 29889, 7328, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 22372, 6177, 6571, 4286, 4830, 29898, 1311, 29889, 8606, 311, 29872, 29918, 1853, 29889, 978, 29892, 1583, 29889, 7328, 29897, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 710, 1649, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 3211, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 7328, 13, 13, 1678, 732, 7328, 29889, 842, 357, 13, 1678, 822, 3211, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 7328, 353, 995, 13, 4706, 1583, 3032, 978, 353, 6629, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1024, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 978, 13, 13, 1678, 732, 978, 29889, 842, 357, 13, 1678, 822, 1024, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 978, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 822, 903, 11294, 29918, 25990, 29898, 1311, 1125, 13, 4706, 9995, 10318, 278, 5702, 29918, 25990, 373, 278, 1741, 304, 9432, 263, 4312, 2767, 373, 445, 1746, 9995, 13, 4706, 1583, 3032, 3696, 3032, 11294, 29918, 25990, 29889, 1202, 877, 8606, 311, 267, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2933, 29918, 4882, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 5327, 29918, 4882, 13, 13, 1678, 732, 6799, 13, 1678, 822, 472, 841, 311, 29872, 29918, 1853, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 8606, 311, 29872, 29918, 1853, 13, 13, 1678, 732, 8606, 311, 29872, 29918, 1853, 29889, 842, 357, 13, 1678, 822, 472, 841, 311, 29872, 29918, 1853, 29898, 1311, 29892, 995, 1125, 13, 4706, 565, 338, 8758, 29898, 1767, 29892, 6212, 3324, 29872, 1542, 1125, 13, 9651, 1583, 17255, 8606, 311, 29872, 29918, 1853, 353, 995, 13, 4706, 1683, 29901, 13, 9651, 1583, 17255, 8606, 311, 29872, 29918, 1853, 353, 6212, 3324, 29872, 1542, 29898, 1767, 29897, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 13, 1990, 6212, 3324, 267, 29898, 11713, 5308, 1125, 13, 1678, 9995, 319, 14348, 310, 6212, 3324, 267, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1741, 29892, 472, 841, 311, 267, 29922, 8516, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 20464, 29922, 3696, 29889, 20464, 29892, 1667, 29918, 10314, 29922, 3696, 29889, 3396, 29918, 10314, 29897, 13, 4706, 1583, 3032, 3696, 353, 1741, 13, 4706, 1583, 17255, 8606, 311, 267, 353, 5159, 13, 4706, 565, 472, 841, 311, 267, 29901, 13, 9651, 1583, 29889, 1202, 29898, 8606, 311, 267, 29897, 13, 13, 1678, 822, 4770, 1524, 12035, 1311, 1125, 13, 4706, 736, 4256, 29898, 1311, 17255, 8606, 311, 267, 29897, 13, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 1820, 1125, 13, 4706, 736, 1583, 17255, 8606, 311, 267, 29961, 1989, 29962, 13, 13, 1678, 822, 4770, 11516, 12035, 1311, 29892, 2944, 1125, 13, 4706, 736, 2944, 297, 426, 8606, 311, 29872, 29889, 5269, 363, 472, 841, 311, 29872, 297, 1583, 17255, 8606, 311, 267, 29913, 13, 13, 1678, 822, 4770, 2435, 12035, 1311, 1125, 13, 4706, 736, 7431, 29898, 1311, 17255, 8606, 311, 267, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 525, 4165, 3324, 267, 3917, 29901, 6571, 4286, 4830, 29898, 2435, 29898, 1311, 17255, 8606, 311, 267, 876, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 710, 1649, 580, 13, 13, 1678, 822, 2821, 29898, 1311, 1125, 13, 4706, 1583, 17255, 8606, 311, 267, 353, 5159, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 822, 903, 11294, 29918, 25990, 29898, 1311, 1125, 13, 4706, 9995, 10318, 278, 5702, 29918, 25990, 373, 278, 1741, 304, 9432, 263, 4312, 2767, 373, 445, 1746, 9995, 13, 4706, 1583, 3032, 3696, 3032, 11294, 29918, 25990, 29889, 1202, 877, 8606, 311, 267, 1495, 13, 13, 1678, 822, 788, 29898, 1311, 29892, 472, 841, 311, 267, 1125, 13, 4706, 9995, 3462, 472, 841, 311, 267, 304, 278, 3847, 1741, 9995, 13, 13, 4706, 565, 472, 841, 311, 267, 29901, 13, 9651, 565, 338, 8758, 29898, 8606, 311, 267, 29892, 851, 1125, 13, 18884, 1583, 17255, 8606, 311, 267, 29889, 4397, 29898, 4165, 3324, 29872, 29898, 7328, 29922, 8606, 311, 267, 29892, 1741, 29922, 1311, 3032, 3696, 876, 13, 18884, 1583, 3032, 11294, 29918, 25990, 580, 13, 9651, 25342, 338, 8758, 29898, 8606, 311, 267, 29892, 6212, 3324, 29872, 1125, 13, 18884, 1583, 17255, 8606, 311, 267, 29889, 4397, 29898, 8606, 311, 267, 29897, 13, 18884, 1583, 3032, 11294, 29918, 25990, 580, 13, 9651, 25342, 338, 8758, 29898, 8606, 311, 267, 29892, 18761, 1125, 13, 18884, 1024, 29892, 3211, 353, 472, 841, 311, 267, 13, 18884, 565, 3211, 29901, 13, 462, 1678, 1583, 17255, 8606, 311, 267, 29889, 4397, 29898, 4165, 3324, 29872, 29898, 7328, 29922, 7328, 29892, 1024, 29922, 978, 29892, 1741, 29922, 1311, 3032, 3696, 876, 13, 462, 1678, 1583, 3032, 11294, 29918, 25990, 580, 13, 9651, 25342, 338, 8758, 29898, 8606, 311, 267, 29892, 1051, 1125, 13, 18884, 363, 472, 841, 311, 29872, 297, 472, 841, 311, 267, 29901, 13, 462, 1678, 1583, 29889, 1202, 29898, 8606, 311, 29872, 29897, 13, 9651, 25342, 338, 8758, 29898, 8606, 311, 267, 29892, 9657, 29897, 322, 1583, 3032, 9274, 29918, 1272, 29918, 1989, 297, 472, 841, 311, 267, 29901, 13, 18884, 472, 841, 311, 267, 353, 472, 841, 311, 267, 29889, 657, 29898, 1311, 3032, 9274, 29918, 1272, 29918, 1989, 29897, 13, 18884, 363, 472, 841, 311, 29872, 297, 472, 841, 311, 267, 29901, 13, 462, 1678, 4876, 353, 472, 841, 311, 29872, 29889, 657, 29898, 1311, 3032, 617, 877, 5269, 7061, 5477, 426, 1800, 13, 462, 1678, 3211, 353, 4876, 29889, 657, 29898, 1311, 3032, 617, 877, 7328, 5477, 6213, 29897, 13, 462, 1678, 565, 3211, 29901, 13, 462, 4706, 1024, 353, 4876, 29889, 657, 29898, 1311, 3032, 617, 877, 978, 5477, 6213, 29897, 13, 462, 4706, 472, 841, 311, 29872, 29918, 1853, 353, 472, 841, 311, 29872, 29889, 657, 29898, 1311, 3032, 617, 877, 1853, 5477, 525, 12403, 1495, 29871, 396, 2322, 995, 13, 462, 4706, 1583, 17255, 8606, 311, 267, 29889, 4397, 29898, 13, 462, 9651, 6212, 3324, 29872, 29898, 7328, 29922, 7328, 29892, 1024, 29922, 978, 29892, 472, 841, 311, 29872, 29918, 1853, 29922, 8606, 311, 29872, 29918, 1853, 29892, 1741, 29922, 1311, 3032, 3696, 29892, 13, 462, 462, 268, 2933, 29918, 4882, 29922, 5103, 5709, 29898, 3560, 29922, 1311, 29892, 13, 462, 462, 462, 462, 1678, 2933, 29918, 4882, 29922, 8606, 311, 29872, 29889, 657, 29898, 1311, 3032, 617, 877, 4882, 5477, 6571, 13697, 13, 9651, 1683, 29901, 13, 18884, 12020, 7865, 2392, 877, 4165, 3324, 267, 1818, 367, 385, 3211, 1347, 29892, 385, 29915, 13, 462, 462, 525, 6212, 3324, 29872, 2777, 29892, 263, 313, 978, 29892, 3211, 29897, 18761, 470, 263, 1051, 1495, 13, 13, 1678, 822, 3349, 29898, 1311, 29892, 472, 841, 311, 267, 1125, 13, 4706, 9995, 15154, 278, 4944, 472, 841, 311, 267, 515, 278, 1741, 9995, 13, 4706, 565, 338, 8758, 29898, 8606, 311, 267, 29892, 313, 1761, 29892, 18761, 22164, 13, 9651, 472, 841, 311, 267, 353, 426, 8606, 311, 29872, 29889, 7328, 565, 338, 8758, 29898, 8606, 311, 29872, 29892, 6212, 3324, 29872, 29897, 1683, 472, 841, 311, 29872, 363, 472, 841, 311, 29872, 297, 472, 841, 311, 267, 29913, 13, 4706, 25342, 338, 8758, 29898, 8606, 311, 267, 29892, 851, 1125, 13, 9651, 472, 841, 311, 267, 353, 426, 8606, 311, 267, 29913, 13, 4706, 25342, 338, 8758, 29898, 8606, 311, 267, 29892, 6212, 3324, 29872, 1125, 13, 9651, 472, 841, 311, 267, 353, 426, 8606, 311, 267, 29889, 7328, 29913, 13, 4706, 1683, 29901, 13, 9651, 12020, 7865, 2392, 877, 797, 15728, 3443, 1134, 363, 472, 841, 311, 267, 1495, 13, 13, 4706, 716, 29918, 8606, 311, 267, 353, 5159, 13, 4706, 363, 472, 841, 311, 29872, 297, 1583, 17255, 8606, 311, 267, 29901, 13, 9651, 565, 472, 841, 311, 29872, 29889, 7328, 451, 297, 472, 841, 311, 267, 29901, 13, 18884, 716, 29918, 8606, 311, 267, 29889, 4397, 29898, 8606, 311, 29872, 29897, 13, 4706, 1583, 17255, 8606, 311, 267, 353, 716, 29918, 8606, 311, 267, 13, 4706, 1583, 3032, 11294, 29918, 25990, 580, 13, 13, 1678, 822, 304, 29918, 2754, 29918, 1272, 29898, 1311, 1125, 13, 4706, 848, 353, 5159, 13, 4706, 363, 472, 841, 311, 29872, 297, 1583, 17255, 8606, 311, 267, 29901, 13, 9651, 565, 472, 841, 311, 29872, 29889, 7328, 29901, 13, 18884, 1098, 29918, 1272, 353, 426, 13, 462, 1678, 1583, 3032, 617, 877, 5269, 7061, 29374, 426, 13, 462, 4706, 1583, 3032, 617, 877, 7328, 29374, 472, 841, 311, 29872, 29889, 7328, 29892, 13, 462, 4706, 1583, 3032, 617, 877, 978, 29374, 472, 841, 311, 29872, 29889, 978, 13, 462, 1678, 2981, 13, 462, 1678, 1583, 3032, 617, 877, 1853, 29374, 472, 841, 311, 29872, 29889, 8606, 311, 29872, 29918, 1853, 29889, 1767, 13, 18884, 500, 13, 18884, 848, 29889, 4397, 29898, 1131, 29918, 1272, 29897, 13, 4706, 736, 848, 13, 13, 13, 1990, 6864, 29898, 11713, 5308, 29892, 6212, 496, 519, 29924, 861, 262, 29892, 29273, 1123, 7334, 10070, 29924, 861, 262, 1125, 13, 1678, 9995, 319, 26431, 1741, 9995, 13, 13, 1678, 903, 355, 9748, 353, 426, 13, 4706, 525, 23392, 2396, 8207, 1052, 355, 1503, 19248, 333, 29913, 742, 13, 4706, 525, 3696, 2396, 8207, 13604, 19248, 333, 29913, 742, 13, 4706, 525, 3696, 29918, 4381, 2396, 8207, 23392, 29914, 13604, 742, 13, 4706, 525, 3696, 29918, 23392, 2396, 8207, 1052, 355, 1503, 19248, 333, 6822, 13604, 29915, 13, 1678, 500, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 29892, 3847, 29922, 8516, 29892, 378, 29922, 8516, 29892, 3579, 19290, 1125, 13, 4706, 4974, 3847, 470, 378, 29892, 525, 8139, 287, 263, 3847, 470, 263, 3957, 29915, 13, 4706, 1583, 29889, 535, 353, 3847, 29889, 535, 565, 3847, 1683, 378, 13, 13, 4706, 396, 14542, 852, 278, 1667, 29918, 10314, 4502, 297, 9049, 5085, 975, 278, 3847, 1667, 29918, 10314, 13, 4706, 1667, 29918, 10314, 353, 9049, 5085, 29889, 7323, 877, 3396, 29918, 10314, 742, 6213, 29897, 470, 679, 5552, 29898, 3560, 29892, 525, 3396, 29918, 10314, 742, 6213, 29897, 565, 3847, 1683, 6213, 13, 4706, 2428, 2141, 1649, 2344, 12035, 20464, 29922, 3560, 29889, 20464, 565, 3847, 1683, 9049, 5085, 29889, 657, 877, 20464, 5477, 1667, 29918, 10314, 29922, 3396, 29918, 10314, 29897, 13, 13, 4706, 21759, 353, 1583, 3032, 617, 29871, 396, 13995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 353, 3201, 4937, 2697, 29898, 29883, 5832, 29922, 617, 29897, 29871, 396, 7463, 304, 1073, 607, 4426, 817, 304, 367, 4784, 373, 278, 1923, 13, 4706, 1583, 29889, 23392, 29918, 333, 353, 9049, 5085, 29889, 657, 877, 23392, 29918, 333, 742, 6213, 29897, 13, 4706, 5142, 29918, 14930, 1860, 353, 9049, 5085, 29889, 657, 877, 10382, 29918, 14930, 1860, 1495, 13, 4706, 9570, 29918, 1272, 353, 9049, 5085, 29889, 657, 29898, 1311, 3032, 9274, 29918, 1272, 29918, 1989, 29892, 426, 1800, 13, 13, 4706, 1583, 29889, 3318, 29918, 333, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 333, 5477, 6213, 29897, 13, 4706, 1583, 17255, 16009, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 16009, 5477, 9049, 5085, 29889, 657, 877, 16009, 742, 27255, 470, 27255, 13, 4706, 3573, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 2587, 5477, 426, 1800, 13, 4706, 1583, 17255, 2587, 353, 3573, 29889, 657, 29898, 617, 877, 3051, 5477, 27255, 13, 4706, 1583, 29889, 2587, 29918, 1853, 353, 3573, 29889, 657, 29898, 617, 877, 3051, 1542, 5477, 525, 7020, 1495, 29871, 396, 2322, 304, 4544, 363, 716, 7191, 13, 13, 4706, 1583, 17255, 8606, 311, 267, 353, 6212, 3324, 267, 29898, 3696, 29922, 1311, 29892, 472, 841, 311, 267, 3790, 1311, 3032, 9274, 29918, 1272, 29918, 1989, 29901, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 8606, 311, 267, 5477, 518, 2314, 1800, 13, 4706, 1583, 17255, 20683, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 20683, 5477, 518, 2314, 13, 13, 4706, 1583, 17255, 11600, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 11600, 11384, 5477, 6213, 29897, 13, 4706, 1583, 17255, 1545, 2164, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 4230, 2111, 2164, 11384, 5477, 6213, 29897, 13, 13, 4706, 1887, 29918, 17559, 353, 1583, 29889, 20464, 29889, 2230, 8028, 13, 4706, 1583, 17255, 11600, 353, 6088, 29898, 1311, 17255, 11600, 467, 579, 603, 8028, 29898, 2997, 29918, 17559, 29897, 565, 1583, 17255, 11600, 1683, 6213, 13, 4706, 1583, 17255, 1545, 2164, 353, 6088, 29898, 1311, 17255, 1545, 2164, 467, 579, 603, 8028, 29898, 2997, 29918, 17559, 29897, 565, 1583, 17255, 1545, 2164, 1683, 6213, 13, 13, 4706, 1369, 29918, 5415, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 2962, 5477, 426, 1800, 13, 4706, 565, 338, 8758, 29898, 2962, 29918, 5415, 29892, 9657, 1125, 13, 9651, 1018, 29901, 13, 18884, 29431, 353, 282, 3637, 29920, 29889, 2230, 8028, 29898, 1311, 29889, 20464, 29889, 657, 29918, 3857, 29918, 17559, 29898, 2962, 29918, 5415, 29889, 657, 29898, 1311, 3032, 617, 877, 2230, 18482, 5477, 525, 26913, 29915, 4961, 13, 9651, 5174, 282, 3637, 29920, 29889, 14148, 2481, 18482, 2392, 29901, 13, 18884, 29431, 353, 1887, 29918, 17559, 13, 9651, 1369, 353, 1369, 29918, 5415, 29889, 657, 29898, 617, 877, 1256, 2481, 5477, 6213, 29897, 13, 9651, 1369, 353, 29431, 29889, 2997, 675, 29898, 5510, 29898, 2962, 876, 565, 1369, 1683, 6213, 13, 9651, 565, 1369, 322, 29431, 2804, 1887, 29918, 17559, 29901, 13, 18884, 1369, 353, 1369, 29889, 579, 603, 8028, 29898, 2997, 29918, 17559, 29897, 13, 4706, 1683, 29901, 13, 9651, 396, 4451, 6914, 325, 29896, 29889, 29900, 7882, 24521, 13, 9651, 1369, 353, 1887, 29918, 17559, 29889, 2997, 675, 29898, 5510, 29898, 2962, 29918, 5415, 876, 565, 1369, 29918, 5415, 1683, 6213, 13, 4706, 1583, 17255, 2962, 353, 1369, 13, 13, 4706, 1095, 29918, 5415, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 355, 5477, 426, 1800, 13, 4706, 565, 338, 8758, 29898, 355, 29918, 5415, 29892, 9657, 1125, 13, 9651, 1018, 29901, 13, 18884, 29431, 353, 282, 3637, 29920, 29889, 2230, 8028, 29898, 1311, 29889, 20464, 29889, 657, 29918, 3857, 29918, 17559, 29898, 355, 29918, 5415, 29889, 657, 29898, 1311, 3032, 617, 877, 2230, 18482, 5477, 525, 26913, 29915, 4961, 13, 9651, 5174, 282, 3637, 29920, 29889, 14148, 2481, 18482, 2392, 29901, 13, 18884, 29431, 353, 1887, 29918, 17559, 13, 9651, 1095, 353, 1095, 29918, 5415, 29889, 657, 29898, 617, 877, 1256, 2481, 5477, 6213, 29897, 13, 9651, 1095, 353, 29431, 29889, 2997, 675, 29898, 5510, 29898, 355, 876, 565, 1095, 1683, 6213, 13, 9651, 565, 1095, 322, 29431, 2804, 1887, 29918, 17559, 29901, 13, 18884, 1095, 353, 1095, 29889, 579, 603, 8028, 29898, 2997, 29918, 17559, 29897, 13, 4706, 1683, 29901, 13, 9651, 396, 4451, 6914, 325, 29896, 29889, 29900, 7882, 24521, 13, 9651, 1095, 353, 1887, 29918, 17559, 29889, 2997, 675, 29898, 5510, 29898, 355, 29918, 5415, 876, 565, 1095, 29918, 5415, 1683, 6213, 13, 4706, 1583, 17255, 355, 353, 1095, 13, 13, 4706, 1583, 29889, 5349, 29918, 14930, 1860, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 5349, 4165, 496, 1860, 5477, 7700, 29897, 13, 4706, 1583, 17255, 14930, 1860, 353, 6864, 4165, 496, 1860, 29898, 3560, 29922, 1311, 29892, 10641, 1860, 11759, 2314, 13, 4706, 565, 1583, 29889, 5349, 29918, 14930, 1860, 322, 5142, 29918, 14930, 1860, 29901, 13, 9651, 1583, 29889, 14930, 1860, 29889, 10382, 29918, 14930, 1860, 580, 13, 4706, 1583, 17255, 20683, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 20683, 5477, 518, 2314, 13, 4706, 1583, 29889, 936, 29918, 5416, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 29875, 7856, 29965, 1204, 5477, 6213, 29897, 13, 4706, 1583, 17255, 5215, 749, 353, 16032, 749, 10108, 29898, 9274, 29918, 1272, 29889, 657, 29898, 617, 877, 5215, 749, 5477, 525, 8945, 1495, 470, 525, 8945, 1495, 13, 4706, 1583, 17255, 275, 29918, 497, 29918, 3250, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 275, 3596, 12742, 5477, 7700, 29897, 13, 4706, 1583, 29889, 275, 29918, 20713, 839, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 275, 19420, 839, 5477, 7700, 29897, 13, 4706, 1583, 29889, 275, 29918, 6388, 3950, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 275, 27356, 3950, 5477, 5852, 29897, 13, 4706, 1583, 17255, 5479, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 5479, 5477, 6571, 467, 657, 29898, 617, 877, 4990, 1170, 5477, 27255, 13, 4706, 1583, 29889, 2029, 800, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 2029, 800, 5477, 518, 2314, 29871, 396, 14402, 13, 4706, 1583, 29889, 14627, 29918, 1004, 15133, 29918, 2271, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 14627, 6816, 15133, 5983, 5477, 6213, 29897, 13, 4706, 1583, 17255, 6388, 3950, 353, 1583, 3032, 4361, 29886, 993, 29918, 3166, 29918, 9274, 29898, 9274, 29918, 1272, 29889, 657, 29898, 617, 877, 6388, 3950, 5477, 6213, 511, 1746, 2433, 6388, 3950, 1495, 13, 4706, 1583, 17255, 3757, 26841, 353, 6864, 4789, 26841, 29898, 3696, 29922, 1311, 29892, 1162, 26841, 29922, 9274, 29918, 1272, 29889, 657, 29898, 617, 877, 3757, 26841, 5477, 6213, 876, 13, 4706, 1583, 17255, 275, 29918, 1745, 4995, 29918, 265, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 275, 7301, 4995, 2951, 5477, 5852, 29897, 13, 4706, 1583, 17255, 1745, 513, 29918, 11083, 29918, 1195, 2667, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 1745, 4995, 8140, 2667, 18743, 4763, 5477, 29871, 29896, 29945, 29897, 13, 4706, 1583, 17255, 5327, 29918, 3827, 287, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 5327, 3089, 287, 5477, 5852, 29897, 13, 4706, 1583, 17255, 5327, 29918, 4882, 353, 13291, 5709, 29898, 3560, 29922, 1311, 29892, 2933, 29918, 4882, 29922, 9274, 29918, 1272, 29889, 657, 29898, 617, 877, 5327, 5709, 5477, 6571, 876, 13, 4706, 1583, 17255, 23149, 24858, 353, 6864, 29903, 575, 24858, 29898, 9274, 29918, 1272, 29889, 657, 29898, 617, 877, 23149, 24858, 5477, 525, 8945, 8785, 13, 4706, 1583, 29889, 13757, 29918, 6207, 29918, 333, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 13757, 19203, 1204, 5477, 6213, 29897, 13, 4706, 1583, 17255, 4294, 29918, 294, 353, 6864, 8964, 2887, 29898, 9274, 29918, 1272, 29889, 657, 29898, 617, 877, 4294, 2887, 5477, 525, 8262, 29891, 8785, 13, 4706, 1583, 29889, 3696, 29918, 1853, 353, 9570, 29918, 1272, 29889, 657, 29898, 617, 877, 1853, 5477, 6213, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 525, 20622, 29901, 6571, 4286, 4830, 29898, 1311, 29889, 16009, 29897, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 710, 1649, 580, 13, 13, 1678, 822, 304, 29918, 2754, 29918, 1272, 29898, 1311, 29892, 9250, 29918, 8149, 29922, 8516, 1125, 13, 4706, 9995, 16969, 263, 9657, 304, 419, 2523, 403, 411, 278, 1923, 13, 13, 4706, 584, 3207, 9250, 29918, 8149, 29901, 263, 731, 310, 6611, 304, 9250, 278, 4133, 848, 304, 29889, 13, 4706, 9995, 13, 4706, 21759, 353, 1583, 3032, 617, 29871, 396, 13995, 13, 4706, 848, 353, 426, 13, 9651, 21759, 877, 16009, 29374, 1583, 17255, 16009, 29892, 13, 9651, 21759, 877, 2587, 29374, 426, 13, 18884, 21759, 877, 3051, 1542, 29374, 1583, 29889, 2587, 29918, 1853, 29892, 13, 18884, 21759, 877, 3051, 29374, 1583, 17255, 2587, 1118, 13, 9651, 21759, 877, 2962, 29374, 426, 13, 18884, 21759, 877, 1256, 2481, 29374, 1583, 17255, 2962, 29889, 710, 615, 603, 877, 29995, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 16664, 29903, 5477, 13, 18884, 21759, 877, 2230, 18482, 29374, 1583, 29889, 20464, 29889, 657, 29918, 10499, 29918, 17559, 29898, 1311, 17255, 2962, 29889, 17559, 3888, 29889, 8028, 29897, 13, 9651, 2981, 13, 9651, 21759, 877, 355, 29374, 426, 13, 18884, 21759, 877, 1256, 2481, 29374, 1583, 17255, 355, 29889, 710, 615, 603, 877, 29995, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 16664, 29903, 5477, 13, 18884, 21759, 877, 2230, 18482, 29374, 1583, 29889, 20464, 29889, 657, 29918, 10499, 29918, 17559, 29898, 1311, 17255, 355, 29889, 17559, 3888, 29889, 8028, 29897, 13, 9651, 2981, 13, 9651, 21759, 877, 8606, 311, 267, 29374, 1583, 17255, 8606, 311, 267, 29889, 517, 29918, 2754, 29918, 1272, 3285, 13, 9651, 21759, 877, 5479, 29374, 426, 617, 877, 4990, 1170, 29374, 1583, 17255, 5479, 1118, 13, 9651, 21759, 877, 20683, 29374, 1583, 17255, 20683, 29892, 13, 9651, 21759, 877, 275, 3596, 12742, 29374, 1583, 17255, 275, 29918, 497, 29918, 3250, 29892, 13, 9651, 21759, 877, 5215, 749, 29374, 1583, 17255, 5215, 749, 29889, 1767, 29892, 13, 9651, 21759, 877, 275, 7301, 4995, 2951, 29374, 1583, 17255, 275, 29918, 1745, 4995, 29918, 265, 29892, 13, 9651, 21759, 877, 1745, 4995, 8140, 2667, 18743, 4763, 29374, 1583, 17255, 1745, 513, 29918, 11083, 29918, 1195, 2667, 29892, 13, 9651, 21759, 877, 5327, 3089, 287, 29374, 1583, 17255, 5327, 29918, 3827, 287, 29892, 13, 9651, 21759, 877, 23149, 24858, 29374, 1583, 17255, 23149, 24858, 29889, 1767, 29892, 13, 9651, 21759, 877, 4294, 2887, 29374, 1583, 17255, 4294, 29918, 294, 29889, 1767, 29892, 13, 4706, 500, 13, 13, 4706, 565, 1583, 17255, 3757, 26841, 29901, 13, 9651, 848, 29961, 617, 877, 3757, 26841, 1495, 29962, 353, 1583, 17255, 3757, 26841, 29889, 517, 29918, 2754, 29918, 1272, 580, 13, 13, 4706, 565, 1583, 29889, 5349, 29918, 14930, 1860, 29901, 13, 9651, 848, 29961, 617, 877, 14930, 1860, 1495, 29962, 353, 1583, 17255, 14930, 1860, 29889, 517, 29918, 2754, 29918, 1272, 580, 13, 13, 4706, 565, 9250, 29918, 8149, 29901, 13, 9651, 363, 1820, 297, 1051, 29898, 1272, 29889, 8149, 580, 1125, 13, 18884, 565, 1820, 451, 297, 9250, 29918, 8149, 29901, 13, 462, 1678, 628, 848, 29961, 1989, 29962, 13, 4706, 736, 848, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2825, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 11600, 13, 13, 1678, 732, 6799, 13, 1678, 822, 9120, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 1545, 2164, 13, 13, 1678, 732, 6799, 13, 1678, 822, 3573, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 2587, 13, 13, 1678, 732, 2587, 29889, 842, 357, 13, 1678, 822, 3573, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 2587, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 2587, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 4967, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 16009, 13, 13, 1678, 732, 16009, 29889, 842, 357, 13, 1678, 822, 4967, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 16009, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 16009, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1369, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 2962, 13, 13, 1678, 732, 2962, 29889, 842, 357, 13, 1678, 822, 1369, 29898, 1311, 29892, 995, 1125, 13, 4706, 565, 451, 338, 8758, 29898, 1767, 29892, 11636, 29889, 1256, 1125, 13, 9651, 12020, 7865, 2392, 703, 29915, 2962, 29915, 1818, 367, 263, 2854, 12865, 1203, 1159, 13, 4706, 565, 451, 338, 8758, 29898, 1767, 29892, 11636, 29889, 12673, 1125, 13, 9651, 396, 4889, 12865, 13, 9651, 995, 353, 11636, 29889, 12673, 29898, 1767, 29889, 6360, 29892, 995, 29889, 10874, 29892, 995, 29889, 3250, 29897, 13, 4706, 565, 995, 29889, 17559, 3888, 338, 6213, 29901, 13, 9651, 396, 1887, 675, 12865, 13, 9651, 995, 353, 1583, 29889, 20464, 29889, 2230, 8028, 29889, 2997, 675, 29898, 1767, 29897, 13, 4706, 25342, 995, 29889, 17559, 3888, 2804, 1583, 29889, 20464, 29889, 2230, 8028, 29901, 13, 9651, 995, 353, 995, 29889, 579, 603, 8028, 29898, 1311, 29889, 20464, 29889, 2230, 8028, 29897, 13, 4706, 1583, 17255, 2962, 353, 995, 13, 4706, 565, 451, 1583, 29889, 355, 29901, 13, 9651, 1583, 29889, 355, 353, 1583, 17255, 2962, 718, 11636, 29889, 9346, 287, 2554, 29898, 1195, 2667, 29922, 29941, 29900, 29897, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 2962, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1095, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 355, 13, 13, 1678, 732, 355, 29889, 842, 357, 13, 1678, 822, 1095, 29898, 1311, 29892, 995, 1125, 13, 4706, 565, 451, 338, 8758, 29898, 1767, 29892, 11636, 29889, 1256, 1125, 13, 9651, 12020, 7865, 2392, 703, 29915, 355, 29915, 1818, 367, 263, 2854, 12865, 1203, 1159, 13, 4706, 565, 451, 338, 8758, 29898, 1767, 29892, 11636, 29889, 12673, 1125, 13, 9651, 396, 4889, 12865, 13, 9651, 995, 353, 11636, 29889, 12673, 29898, 1767, 29889, 6360, 29892, 995, 29889, 10874, 29892, 995, 29889, 3250, 29897, 13, 4706, 565, 995, 29889, 17559, 3888, 338, 6213, 29901, 13, 9651, 396, 1887, 675, 12865, 13, 9651, 995, 353, 1583, 29889, 20464, 29889, 2230, 8028, 29889, 2997, 675, 29898, 1767, 29897, 13, 4706, 25342, 995, 29889, 17559, 3888, 2804, 1583, 29889, 20464, 29889, 2230, 8028, 29901, 13, 9651, 995, 353, 995, 29889, 579, 603, 8028, 29898, 1311, 29889, 20464, 29889, 2230, 8028, 29897, 13, 4706, 1583, 17255, 355, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 355, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 13500, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 5215, 749, 13, 13, 1678, 732, 5215, 749, 29889, 842, 357, 13, 1678, 822, 13500, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 5215, 749, 353, 995, 565, 338, 8758, 29898, 1767, 29892, 16032, 749, 10108, 29897, 1683, 16032, 749, 10108, 29898, 1767, 29897, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 5215, 749, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 338, 29918, 497, 29918, 3250, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 275, 29918, 497, 29918, 3250, 13, 13, 1678, 732, 275, 29918, 497, 29918, 3250, 29889, 842, 357, 13, 1678, 822, 338, 29918, 497, 29918, 3250, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 275, 29918, 497, 29918, 3250, 353, 995, 13, 4706, 565, 995, 29901, 13, 9651, 396, 29749, 11809, 29901, 1369, 322, 1095, 1818, 367, 731, 304, 7145, 11147, 13, 9651, 396, 338, 29918, 497, 29918, 3250, 4225, 1741, 29889, 2962, 5134, 297, 278, 2009, 373, 11217, 13, 9651, 396, 338, 29918, 497, 29918, 3250, 4225, 1741, 29889, 355, 5134, 297, 278, 2009, 373, 11217, 13, 9651, 1369, 353, 1583, 17255, 2962, 470, 11636, 29889, 1256, 29889, 27765, 580, 13, 9651, 1095, 353, 1583, 17255, 355, 470, 11636, 29889, 1256, 29889, 27765, 580, 13, 13, 9651, 565, 313, 2962, 718, 11636, 29889, 9346, 287, 2554, 29898, 29882, 2470, 29922, 29906, 29946, 876, 1405, 1095, 29901, 13, 18884, 396, 29749, 6858, 393, 1090, 338, 29918, 497, 29918, 3250, 29922, 5574, 1369, 322, 1095, 1818, 367, 472, 3203, 29871, 29906, 29946, 6199, 3448, 13, 18884, 1095, 353, 1369, 718, 11636, 29889, 9346, 287, 2554, 29898, 29882, 2470, 29922, 29906, 29946, 29897, 13, 13, 9651, 396, 731, 304, 7145, 11147, 13, 9651, 1369, 353, 11636, 29889, 12673, 29898, 2962, 29889, 6360, 29892, 1369, 29889, 10874, 29892, 1369, 29889, 3250, 29897, 13, 9651, 1095, 353, 11636, 29889, 12673, 29898, 355, 29889, 6360, 29892, 1095, 29889, 10874, 29892, 1095, 29889, 3250, 29897, 13, 13, 9651, 1583, 29889, 2962, 353, 1369, 13, 9651, 1583, 29889, 355, 353, 1095, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 275, 3596, 12742, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 4423, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 5479, 13, 13, 1678, 732, 5479, 29889, 842, 357, 13, 1678, 822, 4423, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 5479, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 5479, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 338, 29918, 1745, 4995, 29918, 265, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 275, 29918, 1745, 4995, 29918, 265, 13, 13, 1678, 732, 275, 29918, 1745, 4995, 29918, 265, 29889, 842, 357, 13, 1678, 822, 338, 29918, 1745, 4995, 29918, 265, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 275, 29918, 1745, 4995, 29918, 265, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 275, 7301, 4995, 2951, 1495, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 1745, 4995, 8140, 2667, 18743, 4763, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1083, 513, 29918, 11083, 29918, 1195, 2667, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 1745, 513, 29918, 11083, 29918, 1195, 2667, 13, 13, 1678, 732, 1745, 513, 29918, 11083, 29918, 1195, 2667, 29889, 842, 357, 13, 1678, 822, 1083, 513, 29918, 11083, 29918, 1195, 2667, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 275, 29918, 1745, 4995, 29918, 265, 353, 5852, 13, 4706, 1583, 17255, 1745, 513, 29918, 11083, 29918, 1195, 2667, 353, 938, 29898, 1767, 29897, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 275, 7301, 4995, 2951, 1495, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 1745, 4995, 8140, 2667, 18743, 4763, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2933, 29918, 3827, 287, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 5327, 29918, 3827, 287, 13, 13, 1678, 732, 5327, 29918, 3827, 287, 29889, 842, 357, 13, 1678, 822, 2933, 29918, 3827, 287, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 5327, 29918, 3827, 287, 353, 995, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 5327, 3089, 287, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1162, 26841, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 3757, 26841, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2894, 3950, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 6388, 3950, 13, 13, 1678, 732, 6799, 13, 1678, 822, 1510, 29918, 294, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 4294, 29918, 294, 13, 13, 1678, 732, 4294, 29918, 294, 29889, 842, 357, 13, 1678, 822, 1510, 29918, 294, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 4294, 29918, 294, 353, 995, 565, 338, 8758, 29898, 1767, 29892, 6864, 8964, 2887, 29897, 1683, 6864, 8964, 2887, 29898, 1767, 29897, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 4294, 2887, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 4771, 24858, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 23149, 24858, 13, 13, 1678, 732, 23149, 24858, 29889, 842, 357, 13, 1678, 822, 4771, 24858, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 17255, 23149, 24858, 353, 995, 565, 338, 8758, 29898, 1767, 29892, 6864, 29903, 575, 24858, 29897, 1683, 6864, 29903, 575, 24858, 29898, 1767, 29897, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 23149, 24858, 1495, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2933, 29918, 4882, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 5327, 29918, 4882, 13, 13, 1678, 732, 6799, 13, 1678, 822, 10641, 1860, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 14930, 1860, 13, 13, 1678, 732, 6799, 13, 1678, 822, 472, 841, 311, 267, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 8606, 311, 267, 13, 13, 1678, 732, 6799, 13, 1678, 822, 13997, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 20683, 13, 13, 1678, 732, 20683, 29889, 842, 357, 13, 1678, 822, 13997, 29898, 1311, 29892, 995, 1125, 13, 4706, 565, 338, 8758, 29898, 1767, 29892, 1051, 1125, 13, 9651, 1583, 17255, 20683, 353, 995, 13, 4706, 25342, 338, 8758, 29898, 1767, 29892, 851, 1125, 13, 9651, 1583, 17255, 20683, 353, 518, 1767, 29962, 13, 4706, 25342, 338, 8758, 29898, 1767, 29892, 18761, 1125, 13, 9651, 1583, 17255, 20683, 353, 1051, 29898, 1767, 29897, 13, 4706, 1683, 29901, 13, 9651, 12020, 7865, 2392, 877, 20683, 1818, 367, 263, 1051, 1495, 13, 4706, 1583, 3032, 11294, 29918, 25990, 29889, 1202, 877, 20683, 1495, 13, 13, 1678, 822, 5217, 29898, 1311, 1125, 13, 4706, 9995, 897, 1026, 267, 263, 6087, 1741, 9995, 13, 4706, 565, 1583, 29889, 3318, 29918, 333, 338, 6213, 29901, 13, 9651, 12020, 24875, 2392, 877, 4165, 3456, 292, 304, 5217, 385, 9644, 10511, 1741, 1495, 13, 13, 4706, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 3696, 2824, 4830, 29898, 333, 29922, 1311, 29889, 3318, 29918, 333, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 1583, 29889, 535, 29889, 8143, 29898, 2271, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 877, 2624, 313, 333, 29901, 426, 1800, 1033, 451, 367, 11132, 29889, 4829, 29901, 6571, 4286, 4830, 29898, 1311, 29889, 3318, 29918, 333, 29892, 851, 29898, 29872, 4961, 13, 9651, 736, 7700, 13, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29946, 29901, 13, 9651, 1480, 29889, 8382, 877, 2624, 313, 333, 29901, 426, 1800, 1033, 451, 367, 11132, 29889, 830, 1658, 29901, 6571, 4286, 4830, 29898, 1311, 29889, 3318, 29918, 333, 29892, 2933, 29889, 23147, 876, 13, 9651, 736, 7700, 13, 13, 4706, 736, 5852, 13, 13, 1678, 822, 4078, 29898, 1311, 1125, 13, 4706, 9995, 6204, 263, 716, 1741, 470, 2767, 385, 5923, 697, 491, 8454, 825, 13, 4706, 1819, 505, 3939, 322, 2767, 963, 373, 278, 1923, 13, 4706, 9995, 13, 13, 4706, 565, 1583, 29889, 3318, 29918, 333, 29901, 13, 9651, 396, 2767, 1741, 13, 9651, 565, 451, 1583, 3032, 11294, 29918, 25990, 29901, 13, 18884, 736, 5852, 29871, 396, 727, 29915, 29879, 3078, 304, 2767, 13, 9651, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 3696, 2824, 4830, 29898, 333, 29922, 1311, 29889, 3318, 29918, 333, 876, 13, 9651, 1158, 353, 1583, 29889, 535, 29889, 5041, 13, 9651, 848, 353, 1583, 29889, 517, 29918, 2754, 29918, 1272, 29898, 5060, 4146, 29918, 8149, 29922, 1311, 3032, 11294, 29918, 25990, 29897, 13, 4706, 1683, 29901, 13, 9651, 396, 716, 1741, 13, 9651, 565, 1583, 29889, 23392, 29918, 333, 29901, 13, 18884, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 3696, 29918, 23392, 2824, 4830, 29898, 333, 29922, 1311, 29889, 23392, 29918, 333, 876, 13, 9651, 1683, 29901, 13, 18884, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 3696, 29918, 4381, 8785, 13, 9651, 1158, 353, 1583, 29889, 535, 29889, 2490, 13, 9651, 848, 353, 1583, 29889, 517, 29918, 2754, 29918, 1272, 580, 13, 13, 4706, 1018, 29901, 13, 9651, 1480, 29889, 8382, 877, 29903, 5555, 1741, 4426, 29901, 6571, 4286, 4830, 29898, 1272, 29889, 8149, 22130, 13, 9651, 2933, 353, 1158, 29898, 2271, 29892, 848, 29922, 1272, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 877, 2392, 1550, 14238, 1741, 29889, 4829, 29901, 426, 2704, 29913, 4286, 4830, 29898, 2704, 29922, 710, 29898, 29872, 4961, 13, 9651, 736, 7700, 13, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 451, 297, 313, 29906, 29900, 29900, 29892, 29871, 29906, 29900, 29896, 1125, 29871, 396, 29871, 29906, 29900, 29900, 4784, 29892, 29871, 29906, 29900, 29896, 2825, 13, 9651, 1480, 29889, 8382, 877, 29903, 5555, 1741, 10729, 5229, 29901, 6571, 4286, 4830, 29898, 5327, 29889, 23147, 876, 13, 9651, 736, 7700, 13, 13, 4706, 565, 451, 1583, 29889, 3318, 29918, 333, 29901, 13, 9651, 396, 716, 1741, 13, 9651, 1741, 353, 2933, 29889, 3126, 580, 13, 13, 9651, 1583, 29889, 3318, 29918, 333, 353, 1741, 29889, 657, 29898, 1311, 3032, 617, 877, 333, 5477, 6213, 29897, 13, 13, 9651, 1583, 17255, 11600, 353, 1741, 29889, 657, 29898, 1311, 3032, 617, 877, 11600, 11384, 5477, 6213, 29897, 13, 9651, 1583, 17255, 1545, 2164, 353, 1741, 29889, 657, 29898, 1311, 3032, 617, 877, 4230, 2111, 2164, 11384, 5477, 6213, 29897, 13, 13, 9651, 1583, 17255, 11600, 353, 6088, 29898, 1311, 17255, 11600, 467, 579, 603, 8028, 29898, 1311, 29889, 20464, 29889, 2230, 8028, 29897, 565, 1583, 17255, 11600, 1683, 6213, 13, 9651, 1583, 17255, 1545, 2164, 353, 6088, 29898, 1311, 17255, 1545, 2164, 467, 579, 603, 8028, 29898, 1311, 29889, 20464, 29889, 2230, 8028, 29897, 565, 1583, 17255, 1545, 2164, 1683, 6213, 13, 4706, 1683, 29901, 13, 9651, 1583, 17255, 1545, 2164, 353, 1583, 29889, 20464, 29889, 2230, 8028, 29889, 2997, 675, 29898, 6008, 29889, 12673, 29889, 3707, 3101, 13, 13, 4706, 736, 5852, 13, 13, 1678, 822, 3544, 29918, 3696, 29898, 1311, 29892, 3440, 29922, 8516, 29892, 334, 29892, 3638, 29918, 5327, 29922, 5574, 29892, 12033, 6703, 29922, 8824, 1125, 13, 13, 4706, 565, 451, 1583, 29889, 3318, 29918, 333, 29901, 13, 9651, 12020, 24875, 2392, 703, 6028, 29915, 29873, 3544, 1741, 393, 1838, 29915, 29873, 1863, 1159, 13, 13, 4706, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 3696, 2824, 4830, 29898, 333, 29922, 1311, 29889, 3318, 29918, 333, 876, 13, 4706, 3142, 353, 3142, 718, 8207, 29873, 296, 6703, 23965, 29915, 565, 12033, 6703, 1683, 8207, 16044, 29915, 13, 13, 4706, 848, 353, 6571, 13, 4706, 565, 3440, 322, 338, 8758, 29898, 9342, 29892, 851, 1125, 13, 9651, 848, 29961, 1311, 3032, 617, 877, 9342, 1495, 29962, 353, 3440, 13, 4706, 565, 3638, 29918, 5327, 338, 7700, 29901, 13, 9651, 848, 29961, 1311, 3032, 617, 877, 6717, 5103, 1495, 29962, 353, 3638, 29918, 5327, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 1583, 29889, 535, 29889, 2490, 29898, 2271, 29892, 848, 29922, 1272, 470, 6213, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 877, 2392, 1550, 25967, 1741, 29889, 4829, 29901, 426, 2704, 29913, 4286, 4830, 29898, 2704, 29922, 710, 29898, 29872, 4961, 13, 9651, 736, 7700, 13, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29906, 29901, 13, 9651, 1480, 29889, 8382, 877, 23965, 292, 1741, 10729, 5229, 29901, 6571, 4286, 4830, 29898, 5327, 29889, 23147, 876, 13, 9651, 736, 7700, 13, 13, 4706, 736, 5852, 13, 13, 1678, 822, 4845, 457, 29918, 3696, 29898, 1311, 29892, 3440, 29922, 8516, 29892, 334, 29892, 3638, 29918, 5327, 29922, 5574, 1125, 13, 13, 4706, 565, 451, 1583, 29889, 3318, 29918, 333, 29901, 13, 9651, 12020, 24875, 2392, 703, 6028, 29915, 29873, 3544, 1741, 393, 1838, 29915, 29873, 1863, 1159, 13, 13, 4706, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 3696, 2824, 4830, 29898, 333, 29922, 1311, 29889, 3318, 29918, 333, 876, 13, 4706, 3142, 353, 3142, 718, 8207, 27787, 457, 29915, 13, 13, 4706, 848, 353, 6571, 13, 4706, 565, 3440, 322, 338, 8758, 29898, 9342, 29892, 851, 1125, 13, 9651, 848, 29961, 1311, 3032, 617, 877, 9342, 1495, 29962, 353, 3440, 13, 4706, 565, 3638, 29918, 5327, 338, 7700, 29901, 13, 9651, 848, 29961, 1311, 3032, 617, 877, 6717, 5103, 1495, 29962, 353, 3638, 29918, 5327, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 1583, 29889, 535, 29889, 2490, 29898, 2271, 29892, 848, 29922, 1272, 470, 6213, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 877, 2392, 1550, 4845, 2827, 1741, 29889, 4829, 29901, 426, 2704, 29913, 4286, 4830, 29898, 2704, 29922, 710, 29898, 29872, 4961, 13, 9651, 736, 7700, 13, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29906, 29901, 13, 9651, 1480, 29889, 8382, 877, 6185, 1915, 292, 1741, 10729, 5229, 29901, 6571, 4286, 4830, 29898, 5327, 29889, 23147, 876, 13, 9651, 736, 7700, 13, 13, 4706, 736, 5852, 13, 13, 1678, 822, 679, 29918, 2587, 29918, 726, 29898, 1311, 1125, 13, 4706, 9995, 20969, 278, 3573, 3472, 322, 3639, 278, 3573, 1426, 773, 24512, 29946, 9995, 13, 4706, 565, 1583, 29889, 2587, 29918, 1853, 2804, 525, 7020, 2396, 13, 9651, 736, 1583, 29889, 2587, 13, 13, 4706, 1018, 29901, 13, 9651, 22300, 353, 24512, 29898, 1311, 29889, 2587, 29892, 525, 1420, 29889, 16680, 1495, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 736, 1583, 29889, 2587, 13, 4706, 1683, 29901, 13, 9651, 736, 22300, 29889, 2587, 29889, 726, 13, 13, 1678, 822, 679, 29918, 2587, 29918, 29879, 1132, 29898, 1311, 1125, 13, 4706, 9995, 16969, 278, 9560, 29879, 1132, 29946, 310, 278, 3472, 3573, 15945, 29908, 13, 4706, 565, 1583, 29889, 2587, 29918, 1853, 2804, 525, 7020, 2396, 13, 9651, 736, 6213, 13, 4706, 1683, 29901, 13, 9651, 736, 24512, 29898, 1311, 29889, 2587, 29892, 525, 1420, 29889, 16680, 1495, 13, 13, 13, 1990, 26431, 29898, 11713, 5308, 29892, 29273, 1123, 7334, 10070, 29924, 861, 262, 1125, 13, 1678, 9995, 319, 26431, 16314, 362, 9995, 13, 13, 1678, 903, 355, 9748, 353, 426, 13, 4706, 525, 23392, 2396, 8207, 1052, 355, 1503, 19248, 333, 29913, 742, 13, 4706, 525, 657, 29918, 13604, 2396, 8207, 1052, 355, 1503, 19248, 333, 6822, 13604, 742, 13, 4706, 525, 657, 29918, 3696, 2396, 8207, 1052, 355, 1503, 19248, 333, 6822, 13604, 19248, 680, 10162, 13, 1678, 500, 13, 1678, 1741, 29918, 27821, 353, 6864, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 29892, 3847, 29922, 8516, 29892, 378, 29922, 8516, 29892, 3579, 19290, 1125, 13, 4706, 4974, 3847, 470, 378, 29892, 525, 8139, 287, 263, 3847, 470, 263, 3957, 29915, 13, 4706, 1583, 29889, 535, 353, 3847, 29889, 535, 565, 3847, 1683, 378, 13, 13, 4706, 396, 14542, 852, 278, 1667, 29918, 10314, 4502, 297, 9049, 5085, 975, 278, 3847, 1667, 29918, 10314, 13, 4706, 1667, 29918, 10314, 353, 9049, 5085, 29889, 7323, 877, 3396, 29918, 10314, 742, 6213, 29897, 470, 679, 5552, 29898, 3560, 29892, 525, 3396, 29918, 10314, 742, 6213, 29897, 565, 3847, 1683, 6213, 13, 4706, 2428, 2141, 1649, 2344, 12035, 20464, 29922, 3560, 29889, 20464, 565, 3847, 1683, 9049, 5085, 29889, 657, 877, 20464, 5477, 1667, 29918, 10314, 29922, 3396, 29918, 10314, 29897, 13, 13, 4706, 9570, 29918, 1272, 353, 9049, 5085, 29889, 657, 29898, 1311, 3032, 9274, 29918, 1272, 29918, 1989, 29892, 426, 1800, 13, 13, 4706, 1583, 29889, 978, 353, 9570, 29918, 1272, 29889, 657, 29898, 1311, 3032, 617, 877, 978, 5477, 27255, 13, 4706, 1583, 29889, 23392, 29918, 333, 353, 9570, 29918, 1272, 29889, 657, 29898, 1311, 3032, 617, 877, 333, 5477, 6213, 29897, 13, 4706, 1583, 17255, 20348, 353, 1583, 3032, 4361, 29886, 993, 29918, 3166, 29918, 9274, 29898, 9274, 29918, 1272, 29889, 657, 29898, 1311, 3032, 617, 877, 20348, 5477, 6571, 511, 1746, 2433, 20348, 1495, 13, 4706, 2927, 353, 9570, 29918, 1272, 29889, 657, 29898, 1311, 3032, 617, 877, 2780, 5477, 448, 29896, 29897, 13, 4706, 565, 338, 8758, 29898, 2780, 29892, 851, 1125, 13, 9651, 2927, 353, 448, 29896, 565, 2927, 1275, 525, 6921, 29915, 1683, 2927, 13, 9651, 396, 14402, 29901, 916, 1347, 11955, 29973, 13, 4706, 1583, 29889, 2780, 353, 26431, 1625, 943, 29898, 2780, 29897, 13, 4706, 1583, 29889, 3068, 29918, 5628, 353, 9570, 29918, 1272, 29889, 657, 29898, 1311, 3032, 617, 877, 3068, 6103, 5477, 7700, 29897, 13, 4706, 1583, 29889, 3068, 29918, 13653, 353, 9570, 29918, 1272, 29889, 657, 29898, 1311, 3032, 617, 877, 3068, 2713, 598, 5477, 7700, 29897, 13, 4706, 1583, 29889, 3068, 29918, 1493, 29918, 9053, 29918, 7076, 353, 9570, 29918, 1272, 29889, 657, 29898, 1311, 3032, 617, 877, 3068, 1043, 25207, 6913, 5477, 7700, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 525, 17447, 29901, 6571, 515, 6571, 4286, 4830, 29898, 1311, 29889, 978, 29892, 1583, 29889, 20348, 29897, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 710, 1649, 580, 13, 13, 1678, 732, 6799, 13, 1678, 822, 12271, 29898, 1311, 1125, 13, 4706, 736, 1583, 17255, 20348, 13, 13, 1678, 822, 2767, 29898, 1311, 1125, 13, 4706, 9995, 5020, 15190, 445, 17684, 29889, 9333, 1024, 322, 2927, 508, 367, 3939, 29889, 9995, 13, 13, 4706, 565, 451, 1583, 29889, 23392, 29918, 333, 29901, 13, 9651, 736, 7700, 13, 13, 4706, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 23392, 8785, 13, 13, 4706, 848, 353, 426, 13, 9651, 1583, 3032, 617, 877, 978, 29374, 1583, 29889, 978, 29892, 13, 9651, 1583, 3032, 617, 877, 2780, 29374, 1583, 29889, 2780, 29889, 1767, 565, 338, 8758, 29898, 1311, 29889, 2780, 29892, 26431, 1625, 943, 29897, 1683, 1583, 29889, 2780, 13, 4706, 500, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 1583, 29889, 535, 29889, 5041, 29898, 2271, 29892, 848, 29922, 1272, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 877, 2392, 13271, 17684, 426, 1836, 4829, 29901, 6571, 4286, 4830, 29898, 1311, 29889, 23392, 29918, 333, 29892, 851, 29898, 29872, 4961, 13, 9651, 736, 7700, 13, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29896, 29901, 13, 9651, 1480, 29889, 8382, 877, 3373, 26747, 17684, 313, 333, 29901, 426, 1800, 10729, 5229, 29901, 6571, 4286, 4830, 29898, 1311, 29889, 23392, 29918, 333, 29892, 2933, 29889, 23147, 876, 13, 9651, 736, 7700, 13, 13, 4706, 736, 5852, 13, 13, 1678, 822, 5217, 29898, 1311, 1125, 13, 4706, 9995, 897, 1026, 267, 445, 17684, 9995, 13, 13, 4706, 565, 451, 1583, 29889, 23392, 29918, 333, 29901, 13, 9651, 736, 7700, 13, 13, 4706, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 23392, 2824, 4830, 29898, 333, 29922, 1311, 29889, 23392, 29918, 333, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 1583, 29889, 535, 29889, 8143, 29898, 2271, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 877, 2392, 21228, 17684, 426, 1836, 4829, 29901, 6571, 4286, 4830, 29898, 1311, 29889, 978, 29892, 851, 29898, 29872, 4961, 13, 9651, 736, 7700, 13, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29946, 29901, 13, 9651, 1480, 29889, 8382, 877, 2772, 1026, 292, 17684, 10729, 5229, 29901, 6571, 4286, 4830, 29898, 5327, 29889, 23147, 876, 13, 9651, 736, 7700, 13, 13, 4706, 1583, 29889, 23392, 29918, 333, 353, 6213, 13, 13, 4706, 736, 5852, 13, 13, 1678, 822, 679, 29918, 13604, 29898, 1311, 29892, 4046, 29922, 29906, 29945, 29892, 334, 29892, 2346, 29922, 8516, 29892, 1797, 29918, 1609, 29922, 8516, 29892, 9853, 29922, 8516, 29892, 5142, 29918, 14930, 1860, 29922, 8824, 1125, 13, 4706, 9995, 13, 4706, 3617, 4959, 515, 278, 2322, 26431, 13, 13, 4706, 584, 3207, 4046, 29901, 13071, 278, 1121, 731, 29889, 6811, 29871, 29929, 29929, 29929, 3913, 9853, 29889, 13, 4706, 584, 3207, 2346, 29901, 16058, 263, 4175, 304, 278, 2009, 1316, 408, 525, 4990, 1170, 29901, 10994, 12924, 29915, 13, 4706, 584, 3207, 1797, 29918, 1609, 29901, 11299, 278, 1121, 731, 2729, 373, 445, 4195, 13, 4706, 584, 3207, 9853, 29901, 16969, 263, 2888, 20380, 393, 5663, 17180, 4452, 297, 9853, 267, 14372, 13, 9651, 304, 10563, 901, 4452, 1135, 278, 4046, 29889, 25553, 29918, 14930, 1860, 338, 17262, 29889, 13, 4706, 584, 3207, 5142, 29918, 14930, 1860, 29901, 5142, 29879, 1741, 10641, 1860, 13, 4706, 9995, 13, 13, 4706, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 657, 29918, 13604, 2824, 4830, 29898, 333, 29922, 1311, 29889, 23392, 29918, 333, 876, 13, 13, 4706, 565, 4046, 338, 6213, 470, 4046, 1405, 1583, 29889, 20464, 29889, 3317, 29918, 3332, 29918, 1767, 29901, 13, 9651, 9853, 353, 1583, 29889, 20464, 29889, 3317, 29918, 3332, 29918, 1767, 13, 13, 4706, 565, 9853, 29901, 13, 9651, 5142, 29918, 14930, 1860, 353, 7700, 13, 13, 4706, 8636, 353, 11117, 29938, 3332, 2396, 9853, 565, 9853, 1683, 4046, 29913, 13, 13, 4706, 565, 1797, 29918, 1609, 29901, 13, 9651, 8636, 1839, 29938, 2098, 1609, 2033, 353, 1797, 29918, 1609, 13, 13, 4706, 565, 2346, 29901, 13, 9651, 565, 338, 8758, 29898, 1972, 29892, 851, 1125, 13, 18884, 8636, 1839, 29938, 4572, 2033, 353, 2346, 13, 9651, 1683, 29901, 13, 18884, 8636, 29889, 5504, 29898, 1972, 29889, 294, 29918, 7529, 3101, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 1583, 29889, 535, 29889, 657, 29898, 2271, 29892, 8636, 29922, 7529, 29892, 9066, 3790, 29915, 6572, 571, 2396, 525, 449, 6914, 29889, 2230, 8028, 543, 26913, 29908, 29915, 1800, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 877, 2392, 1016, 29893, 13234, 4959, 29889, 4829, 6571, 4286, 4830, 29898, 29872, 876, 13, 9651, 736, 5159, 13, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29900, 29901, 13, 9651, 1480, 29889, 8382, 877, 2577, 1259, 4959, 10729, 5229, 29901, 6571, 4286, 4830, 29898, 5327, 29889, 23147, 876, 13, 9651, 736, 5159, 13, 13, 4706, 848, 353, 2933, 29889, 3126, 580, 13, 13, 4706, 396, 17296, 4520, 515, 278, 9570, 1818, 367, 4502, 411, 1583, 3032, 9274, 29918, 1272, 29918, 1989, 13, 4706, 4959, 353, 518, 1311, 29889, 3696, 29918, 27821, 29898, 3560, 29922, 1311, 29892, 5142, 29918, 14930, 1860, 29922, 10382, 29918, 14930, 1860, 29892, 13, 462, 462, 308, 3579, 29912, 1311, 3032, 9274, 29918, 1272, 29918, 1989, 29901, 1741, 1800, 13, 462, 29871, 363, 1741, 297, 848, 29889, 657, 877, 1767, 742, 518, 2314, 29962, 13, 4706, 565, 9853, 29901, 13, 9651, 736, 349, 351, 3381, 29898, 3560, 29922, 1311, 29892, 848, 29922, 13604, 29892, 5823, 29922, 1311, 29889, 3696, 29918, 27821, 29892, 13, 462, 795, 2446, 29918, 2324, 29922, 1272, 29889, 657, 29898, 29940, 12194, 29918, 23714, 29968, 29918, 10818, 17013, 29892, 6213, 511, 4046, 29922, 13400, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 4959, 13, 13, 1678, 822, 716, 29918, 3696, 29898, 1311, 29892, 4967, 29922, 8516, 1125, 13, 4706, 9995, 16969, 263, 716, 313, 6948, 10511, 29897, 6864, 1203, 9995, 13, 4706, 736, 1583, 29889, 3696, 29918, 27821, 29898, 3560, 29922, 1311, 29892, 4967, 29922, 16009, 29892, 17684, 29918, 333, 29922, 1311, 29889, 23392, 29918, 333, 29897, 13, 13, 1678, 822, 679, 29918, 3696, 29898, 1311, 29892, 1828, 1125, 13, 4706, 9995, 11609, 29879, 385, 6864, 2777, 491, 372, 29915, 29879, 1178, 13, 4706, 584, 3207, 1828, 29901, 385, 1741, 29918, 333, 470, 263, 13641, 2777, 13, 4706, 9995, 13, 13, 4706, 565, 1828, 338, 6213, 29901, 13, 9651, 736, 6213, 13, 4706, 565, 338, 8758, 29898, 3207, 29892, 851, 1125, 13, 9651, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 657, 29918, 3696, 2824, 4830, 29898, 333, 29922, 1311, 29889, 23392, 29918, 333, 29892, 1957, 29922, 3207, 876, 13, 9651, 8636, 353, 6213, 13, 4706, 1683, 29901, 13, 9651, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 657, 29918, 13604, 2824, 4830, 29898, 333, 29922, 1311, 29889, 23392, 29918, 333, 876, 13, 9651, 8636, 353, 11117, 29938, 3332, 2396, 29871, 29896, 29913, 13, 9651, 8636, 29889, 5504, 29898, 3207, 29889, 294, 29918, 7529, 3101, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 1583, 29889, 535, 29889, 657, 29898, 2271, 29892, 8636, 29922, 7529, 29892, 9066, 3790, 29915, 6572, 571, 2396, 525, 449, 6914, 29889, 2230, 8028, 543, 26913, 29908, 29915, 1800, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 877, 2392, 2805, 1741, 29901, 426, 1836, 4829, 6571, 4286, 4830, 29898, 3207, 29892, 321, 876, 13, 9651, 736, 6213, 13, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29900, 29901, 13, 9651, 1480, 29889, 8382, 877, 2577, 1259, 1741, 10729, 5229, 29901, 6571, 4286, 4830, 29898, 5327, 29889, 23147, 876, 13, 9651, 736, 6213, 13, 13, 4706, 565, 338, 8758, 29898, 3207, 29892, 851, 1125, 13, 9651, 1741, 353, 2933, 29889, 3126, 580, 13, 4706, 1683, 29901, 13, 9651, 1741, 353, 2933, 29889, 3126, 2141, 657, 877, 1767, 742, 518, 2314, 13, 9651, 565, 1741, 29901, 13, 18884, 1741, 353, 1741, 29961, 29900, 29962, 13, 9651, 1683, 29901, 13, 18884, 736, 6213, 13, 4706, 736, 1583, 29889, 3696, 29918, 27821, 29898, 3560, 29922, 1311, 29892, 3579, 29912, 1311, 3032, 9274, 29918, 1272, 29918, 1989, 29901, 1741, 1800, 13, 13, 13, 1990, 1102, 11272, 29898, 11713, 5308, 1125, 13, 1678, 9995, 319, 399, 6794, 2820, 1208, 355, 1503, 322, 4959, 15945, 29908, 13, 13, 1678, 903, 355, 9748, 353, 426, 13, 4706, 525, 4632, 29918, 1052, 355, 1503, 2396, 8207, 1052, 355, 1503, 742, 13, 4706, 525, 657, 29918, 23392, 2396, 8207, 1052, 355, 1503, 19248, 333, 29913, 742, 13, 4706, 525, 4381, 29918, 23392, 2396, 8207, 23392, 742, 13, 4706, 525, 13604, 2396, 8207, 23392, 29914, 13604, 29915, 13, 1678, 500, 13, 13, 1678, 17684, 29918, 27821, 353, 26431, 13, 1678, 1741, 29918, 27821, 353, 6864, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 29892, 3847, 29922, 8516, 29892, 378, 29922, 8516, 29892, 3579, 19290, 1125, 13, 4706, 4974, 3847, 470, 378, 29892, 525, 8139, 287, 263, 3847, 470, 263, 3957, 29915, 13, 4706, 1583, 29889, 535, 353, 3847, 29889, 535, 565, 3847, 1683, 378, 13, 13, 4706, 396, 14542, 852, 278, 1667, 29918, 10314, 4502, 297, 9049, 5085, 975, 278, 3847, 1667, 29918, 10314, 13, 4706, 1667, 29918, 10314, 353, 9049, 5085, 29889, 7323, 877, 3396, 29918, 10314, 742, 6213, 29897, 470, 679, 5552, 29898, 3560, 29892, 525, 3396, 29918, 10314, 742, 6213, 29897, 565, 3847, 1683, 6213, 13, 4706, 2428, 2141, 1649, 2344, 12035, 20464, 29922, 3560, 29889, 20464, 565, 3847, 1683, 9049, 5085, 29889, 657, 877, 20464, 5477, 1667, 29918, 10314, 29922, 3396, 29918, 10314, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 525, 4504, 11272, 6503, 29901, 6571, 4286, 4830, 29898, 1311, 29889, 3396, 29918, 10314, 29897, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 736, 1583, 17255, 710, 1649, 580, 13, 13, 1678, 822, 1051, 29918, 1052, 355, 1503, 29898, 1311, 29892, 4046, 29922, 8516, 29892, 334, 29892, 2346, 29922, 8516, 29892, 1797, 29918, 1609, 29922, 8516, 1125, 13, 4706, 9995, 13, 4706, 402, 1691, 263, 1051, 310, 1208, 355, 1503, 13, 13, 4706, 1763, 671, 2346, 385, 1797, 29918, 1609, 1423, 278, 438, 1469, 21992, 1244, 29901, 13, 4706, 1732, 597, 2640, 29889, 29877, 25101, 29899, 3150, 29889, 990, 29914, 397, 532, 29914, 397, 532, 29914, 29894, 29946, 29889, 29900, 29914, 3127, 532, 29900, 29941, 29914, 359, 29914, 8835, 29914, 1595, 29906, 29899, 2271, 29899, 535, 794, 1080, 29914, 397, 532, 29899, 29894, 29946, 29889, 29900, 29899, 3127, 532, 29900, 29941, 29899, 359, 29899, 1595, 29906, 29899, 2271, 29899, 535, 794, 1080, 29899, 8835, 29889, 1420, 13, 13, 4706, 584, 3207, 4046, 29901, 9681, 310, 3161, 304, 736, 29889, 13, 4706, 584, 3207, 2346, 29901, 263, 438, 1469, 2854, 4175, 11845, 13, 4706, 584, 3207, 1797, 29918, 1609, 29901, 438, 1469, 2854, 1797, 491, 11845, 13, 4706, 9995, 13, 13, 4706, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 4632, 29918, 1052, 355, 1503, 8785, 13, 13, 4706, 8636, 353, 6571, 13, 4706, 565, 4046, 29901, 13, 9651, 8636, 1839, 29938, 3332, 2033, 353, 4046, 13, 4706, 565, 2346, 29901, 13, 9651, 8636, 1839, 29938, 4572, 2033, 353, 851, 29898, 1972, 29897, 13, 4706, 565, 1797, 29918, 1609, 29901, 13, 9651, 8636, 1839, 29938, 2098, 1609, 2033, 353, 1797, 29918, 1609, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 1583, 29889, 535, 29889, 657, 29898, 2271, 29892, 8636, 29922, 7529, 470, 6213, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 877, 2392, 2805, 1208, 355, 1503, 29889, 4829, 6571, 4286, 4830, 29898, 710, 29898, 29872, 4961, 13, 9651, 736, 5159, 13, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29900, 29901, 13, 9651, 1480, 29889, 8382, 877, 2577, 1259, 1208, 355, 1503, 10729, 5229, 29901, 6571, 4286, 4830, 29898, 5327, 29889, 23147, 876, 13, 9651, 736, 5159, 13, 13, 4706, 848, 353, 2933, 29889, 3126, 580, 13, 13, 4706, 396, 17296, 4520, 515, 278, 9570, 1818, 367, 4502, 411, 1583, 3032, 9274, 29918, 1272, 29918, 1989, 13, 4706, 25957, 353, 518, 1311, 29889, 23392, 29918, 27821, 29898, 3560, 29922, 1311, 29892, 3579, 29912, 1311, 3032, 9274, 29918, 1272, 29918, 1989, 29901, 17684, 1800, 13, 462, 1678, 363, 17684, 297, 848, 29889, 657, 877, 1767, 742, 518, 2314, 29962, 13, 13, 4706, 736, 25957, 13, 13, 1678, 822, 716, 29918, 23392, 29898, 1311, 29892, 17684, 29918, 978, 1125, 13, 4706, 9995, 13, 4706, 6760, 1078, 263, 716, 17684, 13, 4706, 584, 2457, 263, 716, 26431, 2777, 13, 4706, 9995, 13, 13, 4706, 565, 451, 17684, 29918, 978, 29901, 13, 9651, 736, 6213, 13, 13, 4706, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 4632, 29918, 1052, 355, 1503, 8785, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 1583, 29889, 535, 29889, 2490, 29898, 2271, 29892, 848, 3790, 1311, 3032, 617, 877, 978, 29374, 17684, 29918, 978, 1800, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 877, 2392, 4969, 716, 17684, 29889, 4829, 29901, 6571, 4286, 4830, 29898, 710, 29898, 29872, 4961, 13, 9651, 736, 6213, 13, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29896, 29901, 13, 9651, 1480, 29889, 8382, 877, 9832, 1218, 716, 17684, 10729, 5229, 29901, 6571, 4286, 4830, 29898, 5327, 29889, 23147, 876, 13, 9651, 736, 6213, 13, 13, 4706, 17684, 353, 2933, 29889, 3126, 580, 13, 13, 4706, 396, 17296, 4520, 515, 278, 9570, 1818, 367, 4502, 411, 1583, 3032, 9274, 29918, 1272, 29918, 1989, 13, 4706, 736, 1583, 29889, 23392, 29918, 27821, 29898, 3560, 29922, 1311, 29892, 3579, 29912, 1311, 3032, 9274, 29918, 1272, 29918, 1989, 29901, 17684, 1800, 13, 13, 1678, 822, 679, 29918, 23392, 29898, 1311, 29892, 17684, 29918, 333, 29922, 8516, 29892, 17684, 29918, 978, 29922, 8516, 1125, 13, 4706, 9995, 13, 4706, 16969, 263, 17684, 491, 372, 29915, 29879, 1178, 470, 1024, 13, 4706, 584, 3207, 17684, 29918, 333, 29901, 278, 17684, 1178, 304, 367, 27387, 29889, 13, 4706, 584, 3207, 17684, 29918, 978, 29901, 278, 17684, 1024, 304, 367, 27387, 29889, 13, 4706, 9995, 13, 4706, 565, 17684, 29918, 333, 322, 17684, 29918, 978, 29901, 13, 9651, 12020, 24875, 2392, 877, 1184, 29894, 680, 871, 697, 310, 278, 3987, 1495, 13, 13, 4706, 565, 451, 17684, 29918, 333, 322, 451, 17684, 29918, 978, 29901, 13, 9651, 12020, 24875, 2392, 877, 1184, 29894, 680, 697, 310, 278, 3987, 1495, 13, 13, 4706, 565, 17684, 29918, 333, 29901, 13, 9651, 396, 679, 17684, 491, 372, 29915, 29879, 1178, 13, 9651, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 657, 29918, 23392, 2824, 4830, 29898, 333, 29922, 23392, 29918, 333, 876, 13, 9651, 8636, 353, 6213, 13, 4706, 1683, 29901, 13, 9651, 396, 679, 17684, 491, 1024, 13, 9651, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 4632, 29918, 1052, 355, 1503, 8785, 13, 9651, 8636, 353, 11117, 29938, 4572, 2396, 376, 8875, 11594, 525, 8875, 29915, 1642, 4830, 29898, 1311, 3032, 617, 877, 978, 5477, 17684, 29918, 978, 511, 14180, 3332, 2396, 29871, 29896, 29913, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 1583, 29889, 535, 29889, 657, 29898, 2271, 29892, 8636, 29922, 7529, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 877, 2392, 2805, 17684, 426, 1836, 4829, 29901, 6571, 4286, 4830, 29898, 23392, 29918, 333, 470, 17684, 29918, 978, 29892, 851, 29898, 29872, 4961, 13, 9651, 736, 6213, 13, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29900, 29901, 13, 9651, 1480, 29889, 8382, 877, 2577, 1259, 17684, 10729, 5229, 29901, 6571, 4286, 4830, 29898, 5327, 29889, 23147, 876, 13, 9651, 736, 6213, 13, 13, 4706, 565, 17684, 29918, 333, 29901, 13, 9651, 17684, 353, 2933, 29889, 3126, 580, 13, 4706, 1683, 29901, 13, 9651, 17684, 353, 2933, 29889, 3126, 2141, 657, 877, 1767, 1495, 13, 9651, 17684, 353, 17684, 29961, 29900, 29962, 565, 17684, 1683, 6213, 13, 9651, 565, 17684, 338, 6213, 29901, 13, 18884, 736, 6213, 13, 13, 4706, 396, 17296, 4520, 515, 278, 9570, 1818, 367, 4502, 411, 1583, 3032, 9274, 29918, 1272, 29918, 1989, 13, 4706, 736, 1583, 29889, 23392, 29918, 27821, 29898, 3560, 29922, 1311, 29892, 3579, 29912, 1311, 3032, 9274, 29918, 1272, 29918, 1989, 29901, 17684, 1800, 13, 13, 1678, 822, 679, 29918, 4381, 29918, 23392, 29898, 1311, 1125, 13, 4706, 9995, 16969, 278, 2322, 17684, 363, 278, 1857, 1404, 9995, 13, 13, 4706, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 4381, 29918, 23392, 8785, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 1583, 29889, 535, 29889, 657, 29898, 2271, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 877, 2392, 2805, 2322, 17684, 29889, 4829, 29901, 6571, 4286, 4830, 29898, 29872, 876, 13, 9651, 736, 6213, 13, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29900, 29901, 13, 9651, 1480, 29889, 8382, 877, 2577, 1259, 2322, 17684, 10729, 5229, 29901, 6571, 4286, 4830, 29898, 5327, 29889, 23147, 876, 13, 9651, 736, 6213, 13, 13, 4706, 17684, 353, 2933, 29889, 3126, 580, 13, 13, 4706, 396, 17296, 4520, 515, 278, 9570, 1818, 367, 4502, 411, 1583, 3032, 9274, 29918, 1272, 29918, 1989, 13, 4706, 736, 1583, 29889, 23392, 29918, 27821, 29898, 3560, 29922, 1311, 29892, 3579, 29912, 1311, 3032, 9274, 29918, 1272, 29918, 1989, 29901, 17684, 1800, 13, 13, 1678, 822, 679, 29918, 13604, 29898, 1311, 29892, 4046, 29922, 29906, 29945, 29892, 334, 29892, 2346, 29922, 8516, 29892, 1797, 29918, 1609, 29922, 8516, 29892, 9853, 29922, 8516, 29892, 5142, 29918, 14930, 1860, 29922, 8824, 1125, 13, 4706, 9995, 13, 4706, 3617, 4959, 515, 278, 2322, 26431, 13, 13, 4706, 584, 3207, 4046, 29901, 13071, 278, 1121, 731, 29889, 6811, 29871, 29929, 29929, 29929, 3913, 9853, 29889, 13, 4706, 584, 3207, 2346, 29901, 16058, 263, 4175, 304, 278, 2009, 1316, 408, 525, 4990, 1170, 29901, 10994, 12924, 29915, 13, 4706, 584, 3207, 1797, 29918, 1609, 29901, 11299, 278, 1121, 731, 2729, 373, 445, 4195, 13, 4706, 584, 3207, 9853, 29901, 16969, 263, 2888, 20380, 393, 5663, 17180, 4452, 297, 9853, 267, 14372, 13, 9651, 304, 10563, 901, 4452, 1135, 278, 4046, 29889, 25553, 29918, 14930, 1860, 338, 17262, 29889, 13, 4706, 584, 3207, 5142, 29918, 14930, 1860, 29901, 5142, 29879, 1741, 10641, 1860, 13, 4706, 9995, 13, 13, 4706, 3142, 353, 1583, 29889, 4282, 29918, 2271, 29898, 1311, 3032, 355, 9748, 29889, 657, 877, 13604, 8785, 13, 13, 4706, 565, 4046, 338, 6213, 470, 4046, 1405, 1583, 29889, 20464, 29889, 3317, 29918, 3332, 29918, 1767, 29901, 13, 9651, 9853, 353, 1583, 29889, 20464, 29889, 3317, 29918, 3332, 29918, 1767, 13, 13, 4706, 565, 9853, 29901, 13, 9651, 5142, 29918, 14930, 1860, 353, 7700, 13, 13, 4706, 8636, 353, 11117, 29938, 3332, 2396, 9853, 565, 9853, 1683, 4046, 29913, 13, 13, 4706, 565, 1797, 29918, 1609, 29901, 13, 9651, 8636, 1839, 29938, 2098, 1609, 2033, 353, 1797, 29918, 1609, 13, 13, 4706, 565, 2346, 29901, 13, 9651, 565, 338, 8758, 29898, 1972, 29892, 851, 1125, 13, 18884, 8636, 1839, 29938, 4572, 2033, 353, 2346, 13, 9651, 1683, 29901, 13, 18884, 8636, 29889, 5504, 29898, 1972, 29889, 294, 29918, 7529, 3101, 13, 13, 4706, 1018, 29901, 13, 9651, 2933, 353, 1583, 29889, 535, 29889, 657, 29898, 2271, 29892, 8636, 29922, 7529, 29892, 9066, 3790, 29915, 6572, 571, 2396, 525, 449, 6914, 29889, 2230, 8028, 543, 26913, 29908, 29915, 1800, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 877, 2392, 1016, 29893, 13234, 4959, 29889, 4829, 6571, 4286, 4830, 29898, 29872, 876, 13, 9651, 736, 5159, 13, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29900, 29901, 13, 9651, 1480, 29889, 8382, 877, 2577, 1259, 4959, 10729, 5229, 29901, 6571, 4286, 4830, 29898, 5327, 29889, 23147, 876, 13, 9651, 736, 5159, 13, 13, 4706, 848, 353, 2933, 29889, 3126, 580, 13, 13, 4706, 396, 17296, 4520, 515, 278, 9570, 1818, 367, 4502, 411, 1583, 3032, 9274, 29918, 1272, 29918, 1989, 13, 4706, 4959, 353, 518, 1311, 29889, 3696, 29918, 27821, 29898, 3560, 29922, 1311, 29892, 5142, 29918, 14930, 1860, 29922, 10382, 29918, 14930, 1860, 29892, 13, 462, 462, 308, 3579, 29912, 1311, 3032, 9274, 29918, 1272, 29918, 1989, 29901, 1741, 1800, 13, 462, 29871, 363, 1741, 297, 848, 29889, 657, 877, 1767, 742, 518, 2314, 29962, 13, 4706, 565, 9853, 29901, 13, 9651, 736, 349, 351, 3381, 29898, 3560, 29922, 1311, 29892, 848, 29922, 13604, 29892, 5823, 29922, 1311, 29889, 3696, 29918, 27821, 29892, 13, 462, 795, 2446, 29918, 2324, 29922, 1272, 29889, 657, 29898, 29940, 12194, 29918, 23714, 29968, 29918, 10818, 17013, 29892, 6213, 511, 4046, 29922, 13400, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 4959, 13, 13, 1678, 822, 716, 29918, 3696, 29898, 1311, 29892, 4967, 29922, 8516, 1125, 13, 4706, 9995, 16969, 263, 716, 313, 6948, 10511, 29897, 6864, 1203, 297, 278, 2322, 17684, 9995, 13, 4706, 736, 1583, 29889, 3696, 29918, 27821, 29898, 3560, 29922, 1311, 29892, 4967, 29922, 16009, 29897, 13, 2 ]
axelrod/tests/strategies/test_gambler.py
nandhinianandj/Axelrod
596
130818
<filename>axelrod/tests/strategies/test_gambler.py """Test for the Gambler strategy. Most tests come from the LookerUp test suite. """ import copy import unittest import axelrod as axl from axelrod.load_data_ import load_pso_tables from axelrod.strategies.lookerup import create_lookup_table_keys from .test_evolvable_player import PartialClass, TestEvolvablePlayer from .test_lookerup import convert_original_to_current from .test_player import TestPlayer tables = load_pso_tables("pso_gambler.csv", directory="data") C, D = axl.Action.C, axl.Action.D random = axl.RandomGenerator() class TestGambler(TestPlayer): name = "Gambler" player = axl.Gambler expected_classifier = { "memory_depth": 1, "stochastic": True, "makes_use_of": set(), "long_run_time": False, "inspects_source": False, "manipulates_source": False, "manipulates_state": False, } expected_class_classifier = copy.copy(expected_classifier) def test_strategy(self): tft_table = {((), (D,), ()): 0, ((), (C,), ()): 1} self.versus_test( axl.Alternator(), expected_actions=[(C, C)] + [(C, D), (D, C)] * 5, init_kwargs={"lookup_dict": tft_table}, ) def test_stochastic_values(self): stochastic_lookup = {((), (), ()): 0.3} expected_actions = [(C, C), (D, C), (D, C), (C, C), (D, C)] self.versus_test( axl.Cooperator(), expected_actions=expected_actions, init_kwargs={"lookup_dict": stochastic_lookup}, seed=80, ) class TestPSOGamblerMem1(TestPlayer): name = "PSO Gambler Mem1" player = axl.PSOGamblerMem1 expected_classifier = { "memory_depth": 1, "stochastic": True, "makes_use_of": set(), "long_run_time": False, "inspects_source": False, "manipulates_source": False, "manipulates_state": False, } expected_class_classifier = copy.copy(expected_classifier) def test_new_data(self): original_data = { ("", "C", "C"): 1.0, ("", "C", "D"): 0.52173487, ("", "D", "C"): 0.0, ("", "D", "D"): 0.12050939, } converted_original = convert_original_to_current(original_data) self.assertEqual(self.player().lookup_dict, converted_original) def test_strategy(self): vs_cooperator = [(C, C)] * 5 self.versus_test(axl.Cooperator(), expected_actions=vs_cooperator) def test_defects_forever_with_correct_conditions(self): opponent_actions = [D, D] + [C] * 10 expected = [(C, D), (C, D), (D, C)] + [(D, C)] * 9 self.versus_test( axl.MockPlayer(actions=opponent_actions), expected_actions=expected, seed=1, ) class TestPSOGambler1_1_1(TestPlayer): name = "PSO Gambler 1_1_1" player = axl.PSOGambler1_1_1 expected_classifier = { "memory_depth": float("inf"), "stochastic": True, "makes_use_of": set(), "long_run_time": False, "inspects_source": False, "manipulates_source": False, "manipulates_state": False, } def test_new_data(self): original_data = { ("C", "C", "C"): 1.0, ("C", "C", "D"): 0.12304797, ("C", "D", "C"): 0.0, ("C", "D", "D"): 0.13581423, ("D", "C", "C"): 1.0, ("D", "C", "D"): 0.57740178, ("D", "D", "C"): 0.0, ("D", "D", "D"): 0.11886807, } converted_original = convert_original_to_current(original_data) self.assertEqual(self.player().lookup_dict, converted_original) def test_cooperate_forever(self): opponent = [D] * 3 + [C] * 10 expected = [(C, D), (D, D), (D, D)] + [(C, C)] * 10 self.versus_test( axl.MockPlayer(opponent), expected_actions=expected, seed=4 ) def test_defect_forever(self): opponent_actions = [C] + [D] + [C] * 10 expected = [(C, C), (C, D)] + [(D, C)] * 10 self.versus_test( axl.MockPlayer(opponent_actions), expected_actions=expected, seed=2 ) def test_defect_forever2(self): opponent_actions = [D] + [C] * 10 expected = [(C, D)] + [(D, C)] * 10 self.versus_test( axl.MockPlayer(opponent_actions), expected_actions=expected, seed=4 ) class TestPSOGambler2_2_2(TestPlayer): name = "PSO Gambler 2_2_2" player = axl.PSOGambler2_2_2 expected_classifier = { "memory_depth": float("inf"), "stochastic": True, "makes_use_of": set(), "long_run_time": False, "inspects_source": False, "manipulates_source": False, "manipulates_state": False, } def test_new_data(self): original_data = { ("CC", "CC", "CC"): 1.0, ("CC", "CC", "CD"): 1.0, ("CC", "CC", "DC"): 0.0, ("CC", "CC", "DD"): 0.02126434, ("CC", "CD", "CC"): 0.0, ("CC", "CD", "CD"): 1.0, ("CC", "CD", "DC"): 1.0, ("CC", "CD", "DD"): 0.0, ("CC", "DC", "CC"): 0.0, ("CC", "DC", "CD"): 0.0, ("CC", "DC", "DC"): 0.0, ("CC", "DC", "DD"): 0.0, ("CC", "DD", "CC"): 0.0, ("CC", "DD", "CD"): 0.0, ("CC", "DD", "DC"): 0.0, ("CC", "DD", "DD"): 1.0, ("CD", "CC", "CC"): 1.0, ("CD", "CC", "CD"): 0.95280465, ("CD", "CC", "DC"): 0.80897541, ("CD", "CC", "DD"): 0.0, ("CD", "CD", "CC"): 0.0, ("CD", "CD", "CD"): 0.0, ("CD", "CD", "DC"): 0.0, ("CD", "CD", "DD"): 0.65147565, ("CD", "DC", "CC"): 0.15412392, ("CD", "DC", "CD"): 0.24922166, ("CD", "DC", "DC"): 0.0, ("CD", "DC", "DD"): 0.0, ("CD", "DD", "CC"): 0.0, ("CD", "DD", "CD"): 0.0, ("CD", "DD", "DC"): 0.0, ("CD", "DD", "DD"): 0.24523149, ("DC", "CC", "CC"): 1.0, ("DC", "CC", "CD"): 0.0, ("DC", "CC", "DC"): 0.0, ("DC", "CC", "DD"): 0.43278586, ("DC", "CD", "CC"): 1.0, ("DC", "CD", "CD"): 0.0, ("DC", "CD", "DC"): 0.23563137, ("DC", "CD", "DD"): 1.0, ("DC", "DC", "CC"): 1.0, ("DC", "DC", "CD"): 1.0, ("DC", "DC", "DC"): 0.00227615, ("DC", "DC", "DD"): 0.0, ("DC", "DD", "CC"): 0.0, ("DC", "DD", "CD"): 0.0, ("DC", "DD", "DC"): 0.0, ("DC", "DD", "DD"): 1.0, ("DD", "CC", "CC"): 0.0, ("DD", "CC", "CD"): 0.0, ("DD", "CC", "DC"): 0.0, ("DD", "CC", "DD"): 0.0, ("DD", "CD", "CC"): 0.15140743, ("DD", "CD", "CD"): 0.0, ("DD", "CD", "DC"): 0.0, ("DD", "CD", "DD"): 0.0, ("DD", "DC", "CC"): 0.0, ("DD", "DC", "CD"): 0.0, ("DD", "DC", "DC"): 0.0, ("DD", "DC", "DD"): 1.0, ("DD", "DD", "CC"): 0.0, ("DD", "DD", "CD"): 1.0, ("DD", "DD", "DC"): 0.77344942, ("DD", "DD", "DD"): 0.0, } converted_original = convert_original_to_current(original_data) self.assertEqual(self.player().lookup_dict, converted_original) def test_vs_defector(self): expected = [(C, D), (C, D)] + [(D, D)] * 10 self.versus_test(axl.Defector(), expected_actions=expected) def test_vs_cooperator(self): expected = [(C, C)] * 10 self.versus_test(axl.Cooperator(), expected_actions=expected) def test_vs_alternator(self): expected = [(C, C), (C, D), (C, C), (D, D), (D, C), (D, D), (D, C)] self.versus_test(axl.Alternator(), expected_actions=expected, seed=20) def test_vs_DCDDC(self): opponent_actions = [D, C, D, D, C] expected = [ (C, D), (C, C), (D, D), (D, D), (C, C), (D, D), (D, C), (D, D), (D, D), (C, C), ] self.versus_test( axl.MockPlayer(actions=opponent_actions), expected_actions=expected, seed=2, ) def test_vs_DCDDC2(self): opponent_actions = [D, C, D, D, C] expected = [ (C, D), (C, C), (D, D), (D, D), (C, C), (D, D), (D, C), (D, D), (D, D), (C, C), ] expected[5] = (C, D) self.versus_test( axl.MockPlayer(actions=opponent_actions), expected_actions=expected, seed=531, ) class TestPSOGambler2_2_2_Noise05(TestPlayer): name = "PSO Gambler 2_2_2 Noise 05" player = axl.PSOGambler2_2_2_Noise05 expected_classifier = { "memory_depth": float("inf"), "stochastic": True, "makes_use_of": set(), "long_run_time": False, "inspects_source": False, "manipulates_source": False, "manipulates_state": False, } def test_new_data(self): original_data = { ("CC", "CC", "CC"): 1.0, ("CC", "CC", "CD"): 0.0, ("CC", "CC", "DC"): 1.0, ("CC", "CC", "DD"): 0.63548102, ("CC", "CD", "CC"): 1.0, ("CC", "CD", "CD"): 1.0, ("CC", "CD", "DC"): 1.0, ("CC", "CD", "DD"): 0.0, ("CC", "DC", "CC"): 0.0, ("CC", "DC", "CD"): 1.0, ("CC", "DC", "DC"): 0.0, ("CC", "DC", "DD"): 0.0, ("CC", "DD", "CC"): 1.0, ("CC", "DD", "CD"): 0.0, ("CC", "DD", "DC"): 0.0, ("CC", "DD", "DD"): 0.0, ("CD", "CC", "CC"): 1.0, ("CD", "CC", "CD"): 1.0, ("CD", "CC", "DC"): 0.0, ("CD", "CC", "DD"): 0.0, ("CD", "CD", "CC"): 0.0, ("CD", "CD", "CD"): 0.13863175, ("CD", "CD", "DC"): 1.0, ("CD", "CD", "DD"): 0.7724137, ("CD", "DC", "CC"): 0.0, ("CD", "DC", "CD"): 1.0, ("CD", "DC", "DC"): 0.0, ("CD", "DC", "DD"): 0.07127653, ("CD", "DD", "CC"): 0.0, ("CD", "DD", "CD"): 1.0, ("CD", "DD", "DC"): 0.28124022, ("CD", "DD", "DD"): 0.0, ("DC", "CC", "CC"): 0.0, ("DC", "CC", "CD"): 0.98603825, ("DC", "CC", "DC"): 0.0, ("DC", "CC", "DD"): 0.0, ("DC", "CD", "CC"): 1.0, ("DC", "CD", "CD"): 0.06434619, ("DC", "CD", "DC"): 1.0, ("DC", "CD", "DD"): 1.0, ("DC", "DC", "CC"): 1.0, ("DC", "DC", "CD"): 0.50999729, ("DC", "DC", "DC"): 0.00524508, ("DC", "DC", "DD"): 1.0, ("DC", "DD", "CC"): 1.0, ("DC", "DD", "CD"): 1.0, ("DC", "DD", "DC"): 1.0, ("DC", "DD", "DD"): 1.0, ("DD", "CC", "CC"): 0.0, ("DD", "CC", "CD"): 1.0, ("DD", "CC", "DC"): 0.16240799, ("DD", "CC", "DD"): 0.0, ("DD", "CD", "CC"): 0.0, ("DD", "CD", "CD"): 1.0, ("DD", "CD", "DC"): 1.0, ("DD", "CD", "DD"): 0.0, ("DD", "DC", "CC"): 0.0, ("DD", "DC", "CD"): 1.0, ("DD", "DC", "DC"): 0.87463905, ("DD", "DC", "DD"): 0.0, ("DD", "DD", "CC"): 0.0, ("DD", "DD", "CD"): 1.0, ("DD", "DD", "DC"): 0.0, ("DD", "DD", "DD"): 0.0, } converted_original = convert_original_to_current(original_data) self.assertEqual(self.player().lookup_dict, converted_original) def test_vs_defector(self): expected = [(C, D), (C, D)] + [(D, D)] * 10 self.versus_test(axl.Defector(), expected_actions=expected) def test_vs_cooperator(self): expected = [(C, C)] * 10 self.versus_test(axl.Cooperator(), expected_actions=expected) def test_vs_alternator(self): expected = [(C, C), (C, D), (C, C), (D, D), (D, C), (D, D), (C, C)] self.versus_test(axl.Alternator(), expected_actions=expected, seed=2) def test_vs_alternator2(self): expected = [(C, C), (C, D), (C, C), (D, D), (D, C), (D, D), (C, C)] expected[4] = (C, C) expected[6] = (D, C) self.versus_test(axl.Alternator(), expected_actions=expected, seed=3) def test_vs_DCDDC(self): opponent_actions = [D, C, D, D, C] expected = [ (C, D), (C, C), (D, D), (D, D), (C, C), (D, D), (D, C), (C, D), (C, D), ] self.versus_test( axl.MockPlayer(opponent_actions), expected_actions=expected, seed=1 ) def test_vs_DCDDC2(self): opponent_actions = [D, C, D, D, C] expected = [ (C, D), (C, C), (D, D), (D, D), (C, C), (D, D), (D, C), (C, D), (D, D), # different than above test ] self.versus_test( axl.MockPlayer(opponent_actions), expected_actions=expected, seed=5, ) def test_vs_DCDDC3(self): opponent_actions = [D, C, D, D, C] expected = [ (C, D), (C, C), (D, D), (D, D), (C, C), (D, D), (D, C), (C, C), # different than above test (D, D), # different than above test (D, D), # different than above test ] new_expected = expected[:6] + [(C, C), (D, D), (D, D)] self.versus_test( axl.MockPlayer(opponent_actions), expected_actions=new_expected, seed=10, ) class TestZDMem2(TestPlayer): name = "ZD-Mem2" player = axl.ZDMem2 expected_classifier = { "memory_depth": 2, "stochastic": True, "makes_use_of": set(), "long_run_time": False, "inspects_source": False, "manipulates_source": False, "manipulates_state": False, } def test_new_data(self): original_data = { ("", "CC", "CC"): 11 / 12, ("", "CC", "CD"): 4 / 11, ("", "CC", "DC"): 7 / 9, ("", "CC", "DD"): 1 / 10, ("", "CD", "CC"): 5 / 6, ("", "CD", "CD"): 3 / 11, ("", "CD", "DC"): 7 / 9, ("", "CD", "DD"): 1 / 10, ("", "DC", "CC"): 2 / 3, ("", "DC", "CD"): 1 / 11, ("", "DC", "DC"): 7 / 9, ("", "DC", "DD"): 1 / 10, ("", "DD", "CC"): 3 / 4, ("", "DD", "CD"): 2 / 11, ("", "DD", "DC"): 7 / 9, ("", "DD", "DD"): 1 / 10, } converted_original = convert_original_to_current(original_data) self.assertEqual(self.player().lookup_dict, converted_original) def test_vs_defector(self): expected = [ (C, D), (C, D), (D, D), (D, D), (D, D), (D, D), (D, D), (D, D), (C, D), (D, D), ] self.versus_test(axl.Defector(), expected_actions=expected, seed=30) def test_vs_cooperator(self): expected = [ (C, C), (C, C), (C, C), (C, C), (C, C), (D, C), (C, C), (D, C), (C, C), (C, C), ] self.versus_test(axl.Cooperator(), expected_actions=expected, seed=33) def test_vs_alternator(self): expected = [(C, C), (C, D), (D, C), (D, D), (C, C), (C, D), (D, C)] self.versus_test(axl.Alternator(), expected_actions=expected, seed=42) def test_vs_alternator2(self): expected = [(C, C), (C, D), (C, C), (D, D), (D, C), (C, D), (D, C)] self.versus_test(axl.Alternator(), expected_actions=expected, seed=67) class TestEvolvableGambler(unittest.TestCase): def test_receive_vector(self): plays, op_plays, op_start_plays = 1, 1, 1 player = axl.EvolvableGambler( parameters=(plays, op_plays, op_start_plays), seed=1 ) self.assertRaises( AttributeError, axl.EvolvableGambler.__getattribute__, *[player, "vector"] ) vector = [random.random() for _ in range(8)] player.receive_vector(vector) self.assertEqual(player.pattern, vector) def test_vector_to_instance(self): plays, op_plays, op_start_plays = 1, 1, 1 player = axl.EvolvableGambler( parameters=(plays, op_plays, op_start_plays), seed=1 ) vector = [random.random() for _ in range(8)] player.receive_vector(vector) keys = create_lookup_table_keys( player_depth=plays, op_depth=op_plays, op_openings_depth=op_start_plays, ) action_dict = dict(zip(keys, vector)) self.assertEqual(player._lookup.dictionary, action_dict) def test_create_vector_bounds(self): plays, op_plays, op_start_plays = 1, 1, 1 player = axl.EvolvableGambler( parameters=(plays, op_plays, op_start_plays), seed=1 ) lb, ub = player.create_vector_bounds() self.assertIsInstance(lb, list) self.assertIsInstance(ub, list) self.assertEqual(len(lb), 8) self.assertEqual(len(ub), 8) def test_mutate_value_bounds(self): player = axl.EvolvableGambler(parameters=(1, 1, 1), seed=0) self.assertEqual(player.mutate_value(2), 1) self.assertEqual(player.mutate_value(-2), 0) class TestEvolvableGambler2(TestEvolvablePlayer): name = "EvolvableGambler" player_class = axl.EvolvableGambler parent_class = axl.Gambler parent_kwargs = ["lookup_dict"] init_parameters = {"parameters": (1, 1, 1), "initial_actions": (C,)} class TestEvolvableGambler3(TestEvolvablePlayer): name = "EvolvableGambler" player_class = axl.EvolvableGambler parent_class = axl.Gambler parent_kwargs = ["lookup_dict"] init_parameters = { "parameters": (3, 2, 1), "initial_actions": ( C, C, C, ), } class TestEvolvableGambler4(TestEvolvablePlayer): name = "EvolvableGambler" player_class = axl.EvolvableGambler parent_class = axl.Gambler parent_kwargs = ["lookup_dict"] init_parameters = { "parameters": (2, 2, 2), "pattern": [random.random() for _ in range(64)], "initial_actions": ( C, C, ), } # Substitute EvolvableHMMPlayer as a regular HMMPlayer. EvolvableGamblerWithDefault = PartialClass( axl.EvolvableGambler, pattern=tables[("PSO Gambler 2_2_2", 2, 2, 2)], parameters=(2, 2, 2), initial_actions=( C, C, ), ) class EvolvableGamblerAsGambler(TestPSOGambler2_2_2): player = EvolvableGamblerWithDefault def test_equality_of_clone(self): pass def test_equality_of_pickle_clone(self): pass def test_repr(self): pass
[ 1, 529, 9507, 29958, 1165, 295, 5964, 29914, 21150, 29914, 710, 1845, 583, 29914, 1688, 29918, 29887, 1117, 1358, 29889, 2272, 13, 15945, 29908, 3057, 363, 278, 402, 1117, 1358, 13705, 29889, 7849, 6987, 2041, 515, 278, 7419, 261, 3373, 1243, 9460, 29889, 13, 15945, 29908, 13, 5215, 3509, 13, 5215, 443, 27958, 13, 13, 5215, 4853, 295, 5964, 408, 4853, 29880, 13, 3166, 4853, 295, 5964, 29889, 1359, 29918, 1272, 29918, 1053, 2254, 29918, 567, 29877, 29918, 24051, 13, 3166, 4853, 295, 5964, 29889, 710, 1845, 583, 29889, 6914, 261, 786, 1053, 1653, 29918, 20401, 29918, 2371, 29918, 8149, 13, 13, 3166, 869, 1688, 29918, 29872, 1555, 29894, 519, 29918, 9106, 1053, 3455, 616, 2385, 29892, 4321, 29923, 1555, 29894, 519, 9075, 13, 3166, 869, 1688, 29918, 6914, 261, 786, 1053, 3588, 29918, 13492, 29918, 517, 29918, 3784, 13, 3166, 869, 1688, 29918, 9106, 1053, 4321, 9075, 13, 13, 24051, 353, 2254, 29918, 567, 29877, 29918, 24051, 703, 567, 29877, 29918, 29887, 1117, 1358, 29889, 7638, 613, 3884, 543, 1272, 1159, 13, 29907, 29892, 360, 353, 4853, 29880, 29889, 4276, 29889, 29907, 29892, 4853, 29880, 29889, 4276, 29889, 29928, 13, 8172, 353, 4853, 29880, 29889, 17875, 21575, 580, 13, 13, 13, 1990, 4321, 29954, 1117, 1358, 29898, 3057, 9075, 1125, 13, 13, 1678, 1024, 353, 376, 29954, 1117, 1358, 29908, 13, 1678, 4847, 353, 4853, 29880, 29889, 29954, 1117, 1358, 13, 13, 1678, 3806, 29918, 1990, 3709, 353, 426, 13, 4706, 376, 14834, 29918, 19488, 1115, 29871, 29896, 29892, 13, 4706, 376, 303, 28225, 1115, 5852, 29892, 13, 4706, 376, 29885, 6926, 29918, 1509, 29918, 974, 1115, 731, 3285, 13, 4706, 376, 5426, 29918, 3389, 29918, 2230, 1115, 7700, 29892, 13, 4706, 376, 1144, 1103, 29879, 29918, 4993, 1115, 7700, 29892, 13, 4706, 376, 1171, 666, 352, 1078, 29918, 4993, 1115, 7700, 29892, 13, 4706, 376, 1171, 666, 352, 1078, 29918, 3859, 1115, 7700, 29892, 13, 1678, 500, 13, 13, 1678, 3806, 29918, 1990, 29918, 1990, 3709, 353, 3509, 29889, 8552, 29898, 9684, 29918, 1990, 3709, 29897, 13, 13, 1678, 822, 1243, 29918, 710, 8963, 29898, 1311, 1125, 13, 4706, 260, 615, 29918, 2371, 353, 426, 29898, 3285, 313, 29928, 29892, 511, 313, 22164, 29871, 29900, 29892, 313, 3285, 313, 29907, 29892, 511, 313, 22164, 29871, 29896, 29913, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 13, 9651, 4853, 29880, 29889, 2499, 725, 1061, 3285, 13, 9651, 3806, 29918, 7387, 11759, 29898, 29907, 29892, 315, 4638, 718, 17288, 29907, 29892, 360, 511, 313, 29928, 29892, 315, 4638, 334, 29871, 29945, 29892, 13, 9651, 2069, 29918, 19290, 3790, 29908, 20401, 29918, 8977, 1115, 260, 615, 29918, 2371, 1118, 13, 4706, 1723, 13, 13, 1678, 822, 1243, 29918, 303, 28225, 29918, 5975, 29898, 1311, 1125, 13, 4706, 380, 28225, 29918, 20401, 353, 426, 29898, 3285, 313, 511, 313, 22164, 29871, 29900, 29889, 29941, 29913, 13, 4706, 3806, 29918, 7387, 353, 17288, 29907, 29892, 315, 511, 313, 29928, 29892, 315, 511, 313, 29928, 29892, 315, 511, 313, 29907, 29892, 315, 511, 313, 29928, 29892, 315, 4638, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 13, 9651, 4853, 29880, 29889, 7967, 6891, 3285, 13, 9651, 3806, 29918, 7387, 29922, 9684, 29918, 7387, 29892, 13, 9651, 2069, 29918, 19290, 3790, 29908, 20401, 29918, 8977, 1115, 380, 28225, 29918, 20401, 1118, 13, 9651, 16717, 29922, 29947, 29900, 29892, 13, 4706, 1723, 13, 13, 13, 1990, 4321, 29925, 6156, 29954, 1117, 1358, 11442, 29896, 29898, 3057, 9075, 1125, 13, 13, 1678, 1024, 353, 376, 29925, 6156, 402, 1117, 1358, 8133, 29896, 29908, 13, 1678, 4847, 353, 4853, 29880, 29889, 29925, 6156, 29954, 1117, 1358, 11442, 29896, 13, 13, 1678, 3806, 29918, 1990, 3709, 353, 426, 13, 4706, 376, 14834, 29918, 19488, 1115, 29871, 29896, 29892, 13, 4706, 376, 303, 28225, 1115, 5852, 29892, 13, 4706, 376, 29885, 6926, 29918, 1509, 29918, 974, 1115, 731, 3285, 13, 4706, 376, 5426, 29918, 3389, 29918, 2230, 1115, 7700, 29892, 13, 4706, 376, 1144, 1103, 29879, 29918, 4993, 1115, 7700, 29892, 13, 4706, 376, 1171, 666, 352, 1078, 29918, 4993, 1115, 7700, 29892, 13, 4706, 376, 1171, 666, 352, 1078, 29918, 3859, 1115, 7700, 29892, 13, 1678, 500, 13, 1678, 3806, 29918, 1990, 29918, 1990, 3709, 353, 3509, 29889, 8552, 29898, 9684, 29918, 1990, 3709, 29897, 13, 13, 1678, 822, 1243, 29918, 1482, 29918, 1272, 29898, 1311, 1125, 13, 4706, 2441, 29918, 1272, 353, 426, 13, 9651, 4852, 613, 376, 29907, 613, 376, 29907, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 613, 376, 29907, 613, 376, 29928, 29908, 1125, 29871, 29900, 29889, 29945, 29906, 29896, 29955, 29941, 29946, 29947, 29955, 29892, 13, 9651, 4852, 613, 376, 29928, 613, 376, 29907, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 613, 376, 29928, 613, 376, 29928, 29908, 1125, 29871, 29900, 29889, 29896, 29906, 29900, 29945, 29900, 29929, 29941, 29929, 29892, 13, 4706, 500, 13, 4706, 11543, 29918, 13492, 353, 3588, 29918, 13492, 29918, 517, 29918, 3784, 29898, 13492, 29918, 1272, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1311, 29889, 9106, 2141, 20401, 29918, 8977, 29892, 11543, 29918, 13492, 29897, 13, 13, 1678, 822, 1243, 29918, 710, 8963, 29898, 1311, 1125, 13, 4706, 7186, 29918, 1111, 6891, 353, 17288, 29907, 29892, 315, 4638, 334, 29871, 29945, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 1165, 29880, 29889, 7967, 6891, 3285, 3806, 29918, 7387, 29922, 4270, 29918, 1111, 6891, 29897, 13, 13, 1678, 822, 1243, 29918, 1753, 522, 29879, 29918, 1079, 369, 29918, 2541, 29918, 15728, 29918, 1116, 2187, 29898, 1311, 1125, 13, 4706, 23995, 296, 29918, 7387, 353, 518, 29928, 29892, 360, 29962, 718, 518, 29907, 29962, 334, 29871, 29896, 29900, 13, 4706, 3806, 353, 17288, 29907, 29892, 360, 511, 313, 29907, 29892, 360, 511, 313, 29928, 29892, 315, 4638, 718, 17288, 29928, 29892, 315, 4638, 334, 29871, 29929, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 13, 9651, 4853, 29880, 29889, 18680, 9075, 29898, 7387, 29922, 9354, 265, 296, 29918, 7387, 511, 13, 9651, 3806, 29918, 7387, 29922, 9684, 29892, 13, 9651, 16717, 29922, 29896, 29892, 13, 4706, 1723, 13, 13, 13, 1990, 4321, 29925, 6156, 29954, 1117, 1358, 29896, 29918, 29896, 29918, 29896, 29898, 3057, 9075, 1125, 13, 13, 1678, 1024, 353, 376, 29925, 6156, 402, 1117, 1358, 29871, 29896, 29918, 29896, 29918, 29896, 29908, 13, 1678, 4847, 353, 4853, 29880, 29889, 29925, 6156, 29954, 1117, 1358, 29896, 29918, 29896, 29918, 29896, 13, 13, 1678, 3806, 29918, 1990, 3709, 353, 426, 13, 4706, 376, 14834, 29918, 19488, 1115, 5785, 703, 7192, 4968, 13, 4706, 376, 303, 28225, 1115, 5852, 29892, 13, 4706, 376, 29885, 6926, 29918, 1509, 29918, 974, 1115, 731, 3285, 13, 4706, 376, 5426, 29918, 3389, 29918, 2230, 1115, 7700, 29892, 13, 4706, 376, 1144, 1103, 29879, 29918, 4993, 1115, 7700, 29892, 13, 4706, 376, 1171, 666, 352, 1078, 29918, 4993, 1115, 7700, 29892, 13, 4706, 376, 1171, 666, 352, 1078, 29918, 3859, 1115, 7700, 29892, 13, 1678, 500, 13, 13, 1678, 822, 1243, 29918, 1482, 29918, 1272, 29898, 1311, 1125, 13, 4706, 2441, 29918, 1272, 353, 426, 13, 9651, 4852, 29907, 613, 376, 29907, 613, 376, 29907, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 29907, 613, 376, 29907, 613, 376, 29928, 29908, 1125, 29871, 29900, 29889, 29896, 29906, 29941, 29900, 29946, 29955, 29929, 29955, 29892, 13, 9651, 4852, 29907, 613, 376, 29928, 613, 376, 29907, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 29907, 613, 376, 29928, 613, 376, 29928, 29908, 1125, 29871, 29900, 29889, 29896, 29941, 29945, 29947, 29896, 29946, 29906, 29941, 29892, 13, 9651, 4852, 29928, 613, 376, 29907, 613, 376, 29907, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 29928, 613, 376, 29907, 613, 376, 29928, 29908, 1125, 29871, 29900, 29889, 29945, 29955, 29955, 29946, 29900, 29896, 29955, 29947, 29892, 13, 9651, 4852, 29928, 613, 376, 29928, 613, 376, 29907, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 29928, 613, 376, 29928, 613, 376, 29928, 29908, 1125, 29871, 29900, 29889, 29896, 29896, 29947, 29947, 29953, 29947, 29900, 29955, 29892, 13, 4706, 500, 13, 4706, 11543, 29918, 13492, 353, 3588, 29918, 13492, 29918, 517, 29918, 3784, 29898, 13492, 29918, 1272, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1311, 29889, 9106, 2141, 20401, 29918, 8977, 29892, 11543, 29918, 13492, 29897, 13, 13, 1678, 822, 1243, 29918, 1111, 3372, 403, 29918, 1079, 369, 29898, 1311, 1125, 13, 4706, 23995, 296, 353, 518, 29928, 29962, 334, 29871, 29941, 718, 518, 29907, 29962, 334, 29871, 29896, 29900, 13, 4706, 3806, 353, 17288, 29907, 29892, 360, 511, 313, 29928, 29892, 360, 511, 313, 29928, 29892, 360, 4638, 718, 17288, 29907, 29892, 315, 4638, 334, 29871, 29896, 29900, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 13, 9651, 4853, 29880, 29889, 18680, 9075, 29898, 9354, 265, 296, 511, 3806, 29918, 7387, 29922, 9684, 29892, 16717, 29922, 29946, 13, 4706, 1723, 13, 13, 1678, 822, 1243, 29918, 1753, 522, 29918, 1079, 369, 29898, 1311, 1125, 13, 4706, 23995, 296, 29918, 7387, 353, 518, 29907, 29962, 718, 518, 29928, 29962, 718, 518, 29907, 29962, 334, 29871, 29896, 29900, 13, 4706, 3806, 353, 17288, 29907, 29892, 315, 511, 313, 29907, 29892, 360, 4638, 718, 17288, 29928, 29892, 315, 4638, 334, 29871, 29896, 29900, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 13, 9651, 4853, 29880, 29889, 18680, 9075, 29898, 9354, 265, 296, 29918, 7387, 511, 3806, 29918, 7387, 29922, 9684, 29892, 16717, 29922, 29906, 13, 4706, 1723, 13, 13, 1678, 822, 1243, 29918, 1753, 522, 29918, 1079, 369, 29906, 29898, 1311, 1125, 13, 4706, 23995, 296, 29918, 7387, 353, 518, 29928, 29962, 718, 518, 29907, 29962, 334, 29871, 29896, 29900, 13, 4706, 3806, 353, 17288, 29907, 29892, 360, 4638, 718, 17288, 29928, 29892, 315, 4638, 334, 29871, 29896, 29900, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 13, 9651, 4853, 29880, 29889, 18680, 9075, 29898, 9354, 265, 296, 29918, 7387, 511, 3806, 29918, 7387, 29922, 9684, 29892, 16717, 29922, 29946, 13, 4706, 1723, 13, 13, 13, 1990, 4321, 29925, 6156, 29954, 1117, 1358, 29906, 29918, 29906, 29918, 29906, 29898, 3057, 9075, 1125, 13, 13, 1678, 1024, 353, 376, 29925, 6156, 402, 1117, 1358, 29871, 29906, 29918, 29906, 29918, 29906, 29908, 13, 1678, 4847, 353, 4853, 29880, 29889, 29925, 6156, 29954, 1117, 1358, 29906, 29918, 29906, 29918, 29906, 13, 13, 1678, 3806, 29918, 1990, 3709, 353, 426, 13, 4706, 376, 14834, 29918, 19488, 1115, 5785, 703, 7192, 4968, 13, 4706, 376, 303, 28225, 1115, 5852, 29892, 13, 4706, 376, 29885, 6926, 29918, 1509, 29918, 974, 1115, 731, 3285, 13, 4706, 376, 5426, 29918, 3389, 29918, 2230, 1115, 7700, 29892, 13, 4706, 376, 1144, 1103, 29879, 29918, 4993, 1115, 7700, 29892, 13, 4706, 376, 1171, 666, 352, 1078, 29918, 4993, 1115, 7700, 29892, 13, 4706, 376, 1171, 666, 352, 1078, 29918, 3859, 1115, 7700, 29892, 13, 1678, 500, 13, 13, 1678, 822, 1243, 29918, 1482, 29918, 1272, 29898, 1311, 1125, 13, 4706, 2441, 29918, 1272, 353, 426, 13, 9651, 4852, 4174, 613, 376, 4174, 613, 376, 4174, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 4174, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 4174, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 4174, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29906, 29896, 29906, 29953, 29946, 29941, 29946, 29892, 13, 9651, 4852, 4174, 613, 376, 6530, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 6530, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 6530, 613, 376, 12696, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 6530, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 12696, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 12696, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 12696, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 12696, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 7858, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 7858, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 7858, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 7858, 613, 376, 7858, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 4174, 613, 376, 4174, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 4174, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29929, 29945, 29906, 29947, 29900, 29946, 29953, 29945, 29892, 13, 9651, 4852, 6530, 613, 376, 4174, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29947, 29900, 29947, 29929, 29955, 29945, 29946, 29896, 29892, 13, 9651, 4852, 6530, 613, 376, 4174, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 6530, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 6530, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 6530, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 6530, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29953, 29945, 29896, 29946, 29955, 29945, 29953, 29945, 29892, 13, 9651, 4852, 6530, 613, 376, 12696, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29896, 29945, 29946, 29896, 29906, 29941, 29929, 29906, 29892, 13, 9651, 4852, 6530, 613, 376, 12696, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29906, 29946, 29929, 29906, 29906, 29896, 29953, 29953, 29892, 13, 9651, 4852, 6530, 613, 376, 12696, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 12696, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 7858, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 7858, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 7858, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 7858, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29906, 29946, 29945, 29906, 29941, 29896, 29946, 29929, 29892, 13, 9651, 4852, 12696, 613, 376, 4174, 613, 376, 4174, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 4174, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 4174, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 4174, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29946, 29941, 29906, 29955, 29947, 29945, 29947, 29953, 29892, 13, 9651, 4852, 12696, 613, 376, 6530, 613, 376, 4174, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 6530, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 6530, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29906, 29941, 29945, 29953, 29941, 29896, 29941, 29955, 29892, 13, 9651, 4852, 12696, 613, 376, 6530, 613, 376, 7858, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 12696, 613, 376, 4174, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 12696, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 12696, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29900, 29906, 29906, 29955, 29953, 29896, 29945, 29892, 13, 9651, 4852, 12696, 613, 376, 12696, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 7858, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 7858, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 7858, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 7858, 613, 376, 7858, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 4174, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 4174, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 4174, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 4174, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 6530, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29896, 29945, 29896, 29946, 29900, 29955, 29946, 29941, 29892, 13, 9651, 4852, 7858, 613, 376, 6530, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 6530, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 6530, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 12696, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 12696, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 12696, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 12696, 613, 376, 7858, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 7858, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 7858, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 7858, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29955, 29955, 29941, 29946, 29946, 29929, 29946, 29906, 29892, 13, 9651, 4852, 7858, 613, 376, 7858, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 4706, 500, 13, 4706, 11543, 29918, 13492, 353, 3588, 29918, 13492, 29918, 517, 29918, 3784, 29898, 13492, 29918, 1272, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1311, 29889, 9106, 2141, 20401, 29918, 8977, 29892, 11543, 29918, 13492, 29897, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 1753, 3019, 29898, 1311, 1125, 13, 4706, 3806, 353, 17288, 29907, 29892, 360, 511, 313, 29907, 29892, 360, 4638, 718, 17288, 29928, 29892, 360, 4638, 334, 29871, 29896, 29900, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 1165, 29880, 29889, 3206, 3019, 3285, 3806, 29918, 7387, 29922, 9684, 29897, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 1111, 6891, 29898, 1311, 1125, 13, 4706, 3806, 353, 17288, 29907, 29892, 315, 4638, 334, 29871, 29896, 29900, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 1165, 29880, 29889, 7967, 6891, 3285, 3806, 29918, 7387, 29922, 9684, 29897, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 26123, 1061, 29898, 1311, 1125, 13, 4706, 3806, 353, 17288, 29907, 29892, 315, 511, 313, 29907, 29892, 360, 511, 313, 29907, 29892, 315, 511, 313, 29928, 29892, 360, 511, 313, 29928, 29892, 315, 511, 313, 29928, 29892, 360, 511, 313, 29928, 29892, 315, 4638, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 1165, 29880, 29889, 2499, 725, 1061, 3285, 3806, 29918, 7387, 29922, 9684, 29892, 16717, 29922, 29906, 29900, 29897, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 29928, 6530, 12696, 29898, 1311, 1125, 13, 4706, 23995, 296, 29918, 7387, 353, 518, 29928, 29892, 315, 29892, 360, 29892, 360, 29892, 315, 29962, 13, 4706, 3806, 353, 518, 13, 9651, 313, 29907, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 4706, 4514, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 13, 9651, 4853, 29880, 29889, 18680, 9075, 29898, 7387, 29922, 9354, 265, 296, 29918, 7387, 511, 13, 9651, 3806, 29918, 7387, 29922, 9684, 29892, 13, 9651, 16717, 29922, 29906, 29892, 13, 4706, 1723, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 29928, 6530, 12696, 29906, 29898, 1311, 1125, 13, 4706, 23995, 296, 29918, 7387, 353, 518, 29928, 29892, 315, 29892, 360, 29892, 360, 29892, 315, 29962, 13, 4706, 3806, 353, 518, 13, 9651, 313, 29907, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 4706, 4514, 13, 4706, 3806, 29961, 29945, 29962, 353, 313, 29907, 29892, 360, 29897, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 13, 9651, 4853, 29880, 29889, 18680, 9075, 29898, 7387, 29922, 9354, 265, 296, 29918, 7387, 511, 13, 9651, 3806, 29918, 7387, 29922, 9684, 29892, 13, 9651, 16717, 29922, 29945, 29941, 29896, 29892, 13, 4706, 1723, 13, 13, 13, 1990, 4321, 29925, 6156, 29954, 1117, 1358, 29906, 29918, 29906, 29918, 29906, 29918, 3782, 895, 29900, 29945, 29898, 3057, 9075, 1125, 13, 1678, 1024, 353, 376, 29925, 6156, 402, 1117, 1358, 29871, 29906, 29918, 29906, 29918, 29906, 1939, 895, 29871, 29900, 29945, 29908, 13, 1678, 4847, 353, 4853, 29880, 29889, 29925, 6156, 29954, 1117, 1358, 29906, 29918, 29906, 29918, 29906, 29918, 3782, 895, 29900, 29945, 13, 13, 1678, 3806, 29918, 1990, 3709, 353, 426, 13, 4706, 376, 14834, 29918, 19488, 1115, 5785, 703, 7192, 4968, 13, 4706, 376, 303, 28225, 1115, 5852, 29892, 13, 4706, 376, 29885, 6926, 29918, 1509, 29918, 974, 1115, 731, 3285, 13, 4706, 376, 5426, 29918, 3389, 29918, 2230, 1115, 7700, 29892, 13, 4706, 376, 1144, 1103, 29879, 29918, 4993, 1115, 7700, 29892, 13, 4706, 376, 1171, 666, 352, 1078, 29918, 4993, 1115, 7700, 29892, 13, 4706, 376, 1171, 666, 352, 1078, 29918, 3859, 1115, 7700, 29892, 13, 1678, 500, 13, 13, 1678, 822, 1243, 29918, 1482, 29918, 1272, 29898, 1311, 1125, 13, 4706, 2441, 29918, 1272, 353, 426, 13, 9651, 4852, 4174, 613, 376, 4174, 613, 376, 4174, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 4174, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 4174, 613, 376, 12696, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 4174, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29953, 29941, 29945, 29946, 29947, 29896, 29900, 29906, 29892, 13, 9651, 4852, 4174, 613, 376, 6530, 613, 376, 4174, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 6530, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 6530, 613, 376, 12696, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 6530, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 12696, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 12696, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 12696, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 12696, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 7858, 613, 376, 4174, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 7858, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 7858, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 4174, 613, 376, 7858, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 4174, 613, 376, 4174, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 4174, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 4174, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 4174, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 6530, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 6530, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29896, 29941, 29947, 29953, 29941, 29896, 29955, 29945, 29892, 13, 9651, 4852, 6530, 613, 376, 6530, 613, 376, 12696, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 6530, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29955, 29955, 29906, 29946, 29896, 29941, 29955, 29892, 13, 9651, 4852, 6530, 613, 376, 12696, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 12696, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 12696, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 12696, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29955, 29896, 29906, 29955, 29953, 29945, 29941, 29892, 13, 9651, 4852, 6530, 613, 376, 7858, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 7858, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 6530, 613, 376, 7858, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29906, 29947, 29896, 29906, 29946, 29900, 29906, 29906, 29892, 13, 9651, 4852, 6530, 613, 376, 7858, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 4174, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 4174, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29929, 29947, 29953, 29900, 29941, 29947, 29906, 29945, 29892, 13, 9651, 4852, 12696, 613, 376, 4174, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 4174, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 6530, 613, 376, 4174, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 6530, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29900, 29953, 29946, 29941, 29946, 29953, 29896, 29929, 29892, 13, 9651, 4852, 12696, 613, 376, 6530, 613, 376, 12696, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 6530, 613, 376, 7858, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 12696, 613, 376, 4174, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 12696, 613, 376, 6530, 29908, 1125, 29871, 29900, 29889, 29945, 29900, 29929, 29929, 29929, 29955, 29906, 29929, 29892, 13, 9651, 4852, 12696, 613, 376, 12696, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29900, 29945, 29906, 29946, 29945, 29900, 29947, 29892, 13, 9651, 4852, 12696, 613, 376, 12696, 613, 376, 7858, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 7858, 613, 376, 4174, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 7858, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 7858, 613, 376, 12696, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 12696, 613, 376, 7858, 613, 376, 7858, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 4174, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 4174, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 4174, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29896, 29953, 29906, 29946, 29900, 29955, 29929, 29929, 29892, 13, 9651, 4852, 7858, 613, 376, 4174, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 6530, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 6530, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 6530, 613, 376, 12696, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 6530, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 12696, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 12696, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 12696, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29947, 29955, 29946, 29953, 29941, 29929, 29900, 29945, 29892, 13, 9651, 4852, 7858, 613, 376, 12696, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 7858, 613, 376, 4174, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 7858, 613, 376, 6530, 29908, 1125, 29871, 29896, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 7858, 613, 376, 12696, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 9651, 4852, 7858, 613, 376, 7858, 613, 376, 7858, 29908, 1125, 29871, 29900, 29889, 29900, 29892, 13, 4706, 500, 13, 4706, 11543, 29918, 13492, 353, 3588, 29918, 13492, 29918, 517, 29918, 3784, 29898, 13492, 29918, 1272, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1311, 29889, 9106, 2141, 20401, 29918, 8977, 29892, 11543, 29918, 13492, 29897, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 1753, 3019, 29898, 1311, 1125, 13, 4706, 3806, 353, 17288, 29907, 29892, 360, 511, 313, 29907, 29892, 360, 4638, 718, 17288, 29928, 29892, 360, 4638, 334, 29871, 29896, 29900, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 1165, 29880, 29889, 3206, 3019, 3285, 3806, 29918, 7387, 29922, 9684, 29897, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 1111, 6891, 29898, 1311, 1125, 13, 4706, 3806, 353, 17288, 29907, 29892, 315, 4638, 334, 29871, 29896, 29900, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 1165, 29880, 29889, 7967, 6891, 3285, 3806, 29918, 7387, 29922, 9684, 29897, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 26123, 1061, 29898, 1311, 1125, 13, 4706, 3806, 353, 17288, 29907, 29892, 315, 511, 313, 29907, 29892, 360, 511, 313, 29907, 29892, 315, 511, 313, 29928, 29892, 360, 511, 313, 29928, 29892, 315, 511, 313, 29928, 29892, 360, 511, 313, 29907, 29892, 315, 4638, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 1165, 29880, 29889, 2499, 725, 1061, 3285, 3806, 29918, 7387, 29922, 9684, 29892, 16717, 29922, 29906, 29897, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 26123, 1061, 29906, 29898, 1311, 1125, 13, 4706, 3806, 353, 17288, 29907, 29892, 315, 511, 313, 29907, 29892, 360, 511, 313, 29907, 29892, 315, 511, 313, 29928, 29892, 360, 511, 313, 29928, 29892, 315, 511, 313, 29928, 29892, 360, 511, 313, 29907, 29892, 315, 4638, 13, 4706, 3806, 29961, 29946, 29962, 353, 313, 29907, 29892, 315, 29897, 13, 4706, 3806, 29961, 29953, 29962, 353, 313, 29928, 29892, 315, 29897, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 1165, 29880, 29889, 2499, 725, 1061, 3285, 3806, 29918, 7387, 29922, 9684, 29892, 16717, 29922, 29941, 29897, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 29928, 6530, 12696, 29898, 1311, 1125, 13, 4706, 23995, 296, 29918, 7387, 353, 518, 29928, 29892, 315, 29892, 360, 29892, 360, 29892, 315, 29962, 13, 4706, 3806, 353, 518, 13, 9651, 313, 29907, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 315, 511, 13, 9651, 313, 29907, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 360, 511, 13, 4706, 4514, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 13, 9651, 4853, 29880, 29889, 18680, 9075, 29898, 9354, 265, 296, 29918, 7387, 511, 3806, 29918, 7387, 29922, 9684, 29892, 16717, 29922, 29896, 13, 4706, 1723, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 29928, 6530, 12696, 29906, 29898, 1311, 1125, 13, 4706, 23995, 296, 29918, 7387, 353, 518, 29928, 29892, 315, 29892, 360, 29892, 360, 29892, 315, 29962, 13, 4706, 3806, 353, 518, 13, 9651, 313, 29907, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 315, 511, 13, 9651, 313, 29907, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 29871, 396, 1422, 1135, 2038, 1243, 13, 4706, 4514, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 13, 9651, 4853, 29880, 29889, 18680, 9075, 29898, 9354, 265, 296, 29918, 7387, 511, 13, 9651, 3806, 29918, 7387, 29922, 9684, 29892, 13, 9651, 16717, 29922, 29945, 29892, 13, 4706, 1723, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 29928, 6530, 12696, 29941, 29898, 1311, 1125, 13, 4706, 23995, 296, 29918, 7387, 353, 518, 29928, 29892, 315, 29892, 360, 29892, 360, 29892, 315, 29962, 13, 4706, 3806, 353, 518, 13, 9651, 313, 29907, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 315, 511, 13, 9651, 313, 29907, 29892, 315, 511, 29871, 396, 1422, 1135, 2038, 1243, 13, 9651, 313, 29928, 29892, 360, 511, 29871, 396, 1422, 1135, 2038, 1243, 13, 9651, 313, 29928, 29892, 360, 511, 29871, 396, 1422, 1135, 2038, 1243, 13, 4706, 4514, 13, 4706, 716, 29918, 9684, 353, 3806, 7503, 29953, 29962, 718, 17288, 29907, 29892, 315, 511, 313, 29928, 29892, 360, 511, 313, 29928, 29892, 360, 4638, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 13, 9651, 4853, 29880, 29889, 18680, 9075, 29898, 9354, 265, 296, 29918, 7387, 511, 13, 9651, 3806, 29918, 7387, 29922, 1482, 29918, 9684, 29892, 13, 9651, 16717, 29922, 29896, 29900, 29892, 13, 4706, 1723, 13, 13, 13, 1990, 4321, 29999, 29928, 11442, 29906, 29898, 3057, 9075, 1125, 13, 1678, 1024, 353, 376, 29999, 29928, 29899, 11442, 29906, 29908, 13, 1678, 4847, 353, 4853, 29880, 29889, 29999, 29928, 11442, 29906, 13, 13, 1678, 3806, 29918, 1990, 3709, 353, 426, 13, 4706, 376, 14834, 29918, 19488, 1115, 29871, 29906, 29892, 13, 4706, 376, 303, 28225, 1115, 5852, 29892, 13, 4706, 376, 29885, 6926, 29918, 1509, 29918, 974, 1115, 731, 3285, 13, 4706, 376, 5426, 29918, 3389, 29918, 2230, 1115, 7700, 29892, 13, 4706, 376, 1144, 1103, 29879, 29918, 4993, 1115, 7700, 29892, 13, 4706, 376, 1171, 666, 352, 1078, 29918, 4993, 1115, 7700, 29892, 13, 4706, 376, 1171, 666, 352, 1078, 29918, 3859, 1115, 7700, 29892, 13, 1678, 500, 13, 13, 1678, 822, 1243, 29918, 1482, 29918, 1272, 29898, 1311, 1125, 13, 4706, 2441, 29918, 1272, 353, 426, 13, 9651, 4852, 613, 376, 4174, 613, 376, 4174, 29908, 1125, 29871, 29896, 29896, 847, 29871, 29896, 29906, 29892, 13, 9651, 4852, 613, 376, 4174, 613, 376, 6530, 29908, 1125, 29871, 29946, 847, 29871, 29896, 29896, 29892, 13, 9651, 4852, 613, 376, 4174, 613, 376, 12696, 29908, 1125, 29871, 29955, 847, 29871, 29929, 29892, 13, 9651, 4852, 613, 376, 4174, 613, 376, 7858, 29908, 1125, 29871, 29896, 847, 29871, 29896, 29900, 29892, 13, 9651, 4852, 613, 376, 6530, 613, 376, 4174, 29908, 1125, 29871, 29945, 847, 29871, 29953, 29892, 13, 9651, 4852, 613, 376, 6530, 613, 376, 6530, 29908, 1125, 29871, 29941, 847, 29871, 29896, 29896, 29892, 13, 9651, 4852, 613, 376, 6530, 613, 376, 12696, 29908, 1125, 29871, 29955, 847, 29871, 29929, 29892, 13, 9651, 4852, 613, 376, 6530, 613, 376, 7858, 29908, 1125, 29871, 29896, 847, 29871, 29896, 29900, 29892, 13, 9651, 4852, 613, 376, 12696, 613, 376, 4174, 29908, 1125, 29871, 29906, 847, 29871, 29941, 29892, 13, 9651, 4852, 613, 376, 12696, 613, 376, 6530, 29908, 1125, 29871, 29896, 847, 29871, 29896, 29896, 29892, 13, 9651, 4852, 613, 376, 12696, 613, 376, 12696, 29908, 1125, 29871, 29955, 847, 29871, 29929, 29892, 13, 9651, 4852, 613, 376, 12696, 613, 376, 7858, 29908, 1125, 29871, 29896, 847, 29871, 29896, 29900, 29892, 13, 9651, 4852, 613, 376, 7858, 613, 376, 4174, 29908, 1125, 29871, 29941, 847, 29871, 29946, 29892, 13, 9651, 4852, 613, 376, 7858, 613, 376, 6530, 29908, 1125, 29871, 29906, 847, 29871, 29896, 29896, 29892, 13, 9651, 4852, 613, 376, 7858, 613, 376, 12696, 29908, 1125, 29871, 29955, 847, 29871, 29929, 29892, 13, 9651, 4852, 613, 376, 7858, 613, 376, 7858, 29908, 1125, 29871, 29896, 847, 29871, 29896, 29900, 29892, 13, 4706, 500, 13, 4706, 11543, 29918, 13492, 353, 3588, 29918, 13492, 29918, 517, 29918, 3784, 29898, 13492, 29918, 1272, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1311, 29889, 9106, 2141, 20401, 29918, 8977, 29892, 11543, 29918, 13492, 29897, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 1753, 3019, 29898, 1311, 1125, 13, 4706, 3806, 353, 518, 13, 9651, 313, 29907, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 9651, 313, 29907, 29892, 360, 511, 13, 9651, 313, 29928, 29892, 360, 511, 13, 4706, 4514, 13, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 1165, 29880, 29889, 3206, 3019, 3285, 3806, 29918, 7387, 29922, 9684, 29892, 16717, 29922, 29941, 29900, 29897, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 1111, 6891, 29898, 1311, 1125, 13, 4706, 3806, 353, 518, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 315, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29928, 29892, 315, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 9651, 313, 29907, 29892, 315, 511, 13, 4706, 4514, 13, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 1165, 29880, 29889, 7967, 6891, 3285, 3806, 29918, 7387, 29922, 9684, 29892, 16717, 29922, 29941, 29941, 29897, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 26123, 1061, 29898, 1311, 1125, 13, 4706, 3806, 353, 17288, 29907, 29892, 315, 511, 313, 29907, 29892, 360, 511, 313, 29928, 29892, 315, 511, 313, 29928, 29892, 360, 511, 313, 29907, 29892, 315, 511, 313, 29907, 29892, 360, 511, 313, 29928, 29892, 315, 4638, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 1165, 29880, 29889, 2499, 725, 1061, 3285, 3806, 29918, 7387, 29922, 9684, 29892, 16717, 29922, 29946, 29906, 29897, 13, 13, 1678, 822, 1243, 29918, 4270, 29918, 26123, 1061, 29906, 29898, 1311, 1125, 13, 4706, 3806, 353, 17288, 29907, 29892, 315, 511, 313, 29907, 29892, 360, 511, 313, 29907, 29892, 315, 511, 313, 29928, 29892, 360, 511, 313, 29928, 29892, 315, 511, 313, 29907, 29892, 360, 511, 313, 29928, 29892, 315, 4638, 13, 4706, 1583, 29889, 874, 375, 29918, 1688, 29898, 1165, 29880, 29889, 2499, 725, 1061, 3285, 3806, 29918, 7387, 29922, 9684, 29892, 16717, 29922, 29953, 29955, 29897, 13, 13, 13, 1990, 4321, 29923, 1555, 29894, 519, 29954, 1117, 1358, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 13556, 573, 29918, 8111, 29898, 1311, 1125, 13, 4706, 13582, 29892, 1015, 29918, 12922, 29892, 1015, 29918, 2962, 29918, 12922, 353, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 13, 4706, 4847, 353, 4853, 29880, 29889, 29923, 1555, 29894, 519, 29954, 1117, 1358, 29898, 13, 9651, 4128, 7607, 12922, 29892, 1015, 29918, 12922, 29892, 1015, 29918, 2962, 29918, 12922, 511, 16717, 29922, 29896, 13, 4706, 1723, 13, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 13, 9651, 23833, 2392, 29892, 13, 9651, 4853, 29880, 29889, 29923, 1555, 29894, 519, 29954, 1117, 1358, 17255, 657, 12715, 1649, 29892, 13, 9651, 334, 29961, 9106, 29892, 376, 8111, 3108, 13, 4706, 1723, 13, 13, 4706, 4608, 353, 518, 8172, 29889, 8172, 580, 363, 903, 297, 3464, 29898, 29947, 4638, 13, 4706, 4847, 29889, 13556, 573, 29918, 8111, 29898, 8111, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 9106, 29889, 11037, 29892, 4608, 29897, 13, 13, 1678, 822, 1243, 29918, 8111, 29918, 517, 29918, 8758, 29898, 1311, 1125, 13, 4706, 13582, 29892, 1015, 29918, 12922, 29892, 1015, 29918, 2962, 29918, 12922, 353, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 13, 4706, 4847, 353, 4853, 29880, 29889, 29923, 1555, 29894, 519, 29954, 1117, 1358, 29898, 13, 9651, 4128, 7607, 12922, 29892, 1015, 29918, 12922, 29892, 1015, 29918, 2962, 29918, 12922, 511, 16717, 29922, 29896, 13, 4706, 1723, 13, 13, 4706, 4608, 353, 518, 8172, 29889, 8172, 580, 363, 903, 297, 3464, 29898, 29947, 4638, 13, 4706, 4847, 29889, 13556, 573, 29918, 8111, 29898, 8111, 29897, 13, 4706, 6611, 353, 1653, 29918, 20401, 29918, 2371, 29918, 8149, 29898, 13, 9651, 4847, 29918, 19488, 29922, 12922, 29892, 13, 9651, 1015, 29918, 19488, 29922, 459, 29918, 12922, 29892, 13, 9651, 1015, 29918, 3150, 886, 29918, 19488, 29922, 459, 29918, 2962, 29918, 12922, 29892, 13, 4706, 1723, 13, 4706, 3158, 29918, 8977, 353, 9657, 29898, 7554, 29898, 8149, 29892, 4608, 876, 13, 4706, 1583, 29889, 9294, 9843, 29898, 9106, 3032, 20401, 29889, 27126, 29892, 3158, 29918, 8977, 29897, 13, 13, 1678, 822, 1243, 29918, 3258, 29918, 8111, 29918, 23687, 29898, 1311, 1125, 13, 4706, 13582, 29892, 1015, 29918, 12922, 29892, 1015, 29918, 2962, 29918, 12922, 353, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 13, 4706, 4847, 353, 4853, 29880, 29889, 29923, 1555, 29894, 519, 29954, 1117, 1358, 29898, 13, 9651, 4128, 7607, 12922, 29892, 1015, 29918, 12922, 29892, 1015, 29918, 2962, 29918, 12922, 511, 16717, 29922, 29896, 13, 4706, 1723, 13, 4706, 27981, 29892, 13069, 353, 4847, 29889, 3258, 29918, 8111, 29918, 23687, 580, 13, 4706, 1583, 29889, 9294, 3624, 4998, 29898, 27728, 29892, 1051, 29897, 13, 4706, 1583, 29889, 9294, 3624, 4998, 29898, 431, 29892, 1051, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 27728, 511, 29871, 29947, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 2435, 29898, 431, 511, 29871, 29947, 29897, 13, 13, 1678, 822, 1243, 29918, 6149, 403, 29918, 1767, 29918, 23687, 29898, 1311, 1125, 13, 4706, 4847, 353, 4853, 29880, 29889, 29923, 1555, 29894, 519, 29954, 1117, 1358, 29898, 16744, 7607, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 511, 16717, 29922, 29900, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 9106, 29889, 6149, 403, 29918, 1767, 29898, 29906, 511, 29871, 29896, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 9106, 29889, 6149, 403, 29918, 1767, 6278, 29906, 511, 29871, 29900, 29897, 13, 13, 13, 1990, 4321, 29923, 1555, 29894, 519, 29954, 1117, 1358, 29906, 29898, 3057, 29923, 1555, 29894, 519, 9075, 1125, 13, 1678, 1024, 353, 376, 29923, 1555, 29894, 519, 29954, 1117, 1358, 29908, 13, 1678, 4847, 29918, 1990, 353, 4853, 29880, 29889, 29923, 1555, 29894, 519, 29954, 1117, 1358, 13, 1678, 3847, 29918, 1990, 353, 4853, 29880, 29889, 29954, 1117, 1358, 13, 1678, 3847, 29918, 19290, 353, 6796, 20401, 29918, 8977, 3108, 13, 1678, 2069, 29918, 16744, 353, 8853, 16744, 1115, 313, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 511, 376, 11228, 29918, 7387, 1115, 313, 29907, 29892, 2915, 13, 13, 13, 1990, 4321, 29923, 1555, 29894, 519, 29954, 1117, 1358, 29941, 29898, 3057, 29923, 1555, 29894, 519, 9075, 1125, 13, 1678, 1024, 353, 376, 29923, 1555, 29894, 519, 29954, 1117, 1358, 29908, 13, 1678, 4847, 29918, 1990, 353, 4853, 29880, 29889, 29923, 1555, 29894, 519, 29954, 1117, 1358, 13, 1678, 3847, 29918, 1990, 353, 4853, 29880, 29889, 29954, 1117, 1358, 13, 1678, 3847, 29918, 19290, 353, 6796, 20401, 29918, 8977, 3108, 13, 1678, 2069, 29918, 16744, 353, 426, 13, 4706, 376, 16744, 1115, 313, 29941, 29892, 29871, 29906, 29892, 29871, 29896, 511, 13, 4706, 376, 11228, 29918, 7387, 1115, 313, 13, 9651, 315, 29892, 13, 9651, 315, 29892, 13, 9651, 315, 29892, 13, 4706, 10353, 13, 1678, 500, 13, 13, 13, 1990, 4321, 29923, 1555, 29894, 519, 29954, 1117, 1358, 29946, 29898, 3057, 29923, 1555, 29894, 519, 9075, 1125, 13, 1678, 1024, 353, 376, 29923, 1555, 29894, 519, 29954, 1117, 1358, 29908, 13, 1678, 4847, 29918, 1990, 353, 4853, 29880, 29889, 29923, 1555, 29894, 519, 29954, 1117, 1358, 13, 1678, 3847, 29918, 1990, 353, 4853, 29880, 29889, 29954, 1117, 1358, 13, 1678, 3847, 29918, 19290, 353, 6796, 20401, 29918, 8977, 3108, 13, 1678, 2069, 29918, 16744, 353, 426, 13, 4706, 376, 16744, 1115, 313, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 511, 13, 4706, 376, 11037, 1115, 518, 8172, 29889, 8172, 580, 363, 903, 297, 3464, 29898, 29953, 29946, 29897, 1402, 13, 4706, 376, 11228, 29918, 7387, 1115, 313, 13, 9651, 315, 29892, 13, 9651, 315, 29892, 13, 4706, 10353, 13, 1678, 500, 13, 13, 13, 29937, 3323, 303, 12356, 382, 1555, 29894, 519, 29950, 7428, 9075, 408, 263, 4943, 379, 7428, 9075, 29889, 13, 29923, 1555, 29894, 519, 29954, 1117, 1358, 3047, 4592, 353, 3455, 616, 2385, 29898, 13, 1678, 4853, 29880, 29889, 29923, 1555, 29894, 519, 29954, 1117, 1358, 29892, 13, 1678, 4766, 29922, 24051, 29961, 703, 29925, 6156, 402, 1117, 1358, 29871, 29906, 29918, 29906, 29918, 29906, 613, 29871, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 29897, 1402, 13, 1678, 4128, 7607, 29906, 29892, 29871, 29906, 29892, 29871, 29906, 511, 13, 1678, 2847, 29918, 7387, 7607, 13, 4706, 315, 29892, 13, 4706, 315, 29892, 13, 1678, 10353, 13, 29897, 13, 13, 13, 1990, 382, 1555, 29894, 519, 29954, 1117, 1358, 2887, 29954, 1117, 1358, 29898, 3057, 29925, 6156, 29954, 1117, 1358, 29906, 29918, 29906, 29918, 29906, 1125, 13, 1678, 4847, 353, 382, 1555, 29894, 519, 29954, 1117, 1358, 3047, 4592, 13, 13, 1678, 822, 1243, 29918, 13895, 29918, 974, 29918, 16513, 29898, 1311, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 1243, 29918, 13895, 29918, 974, 29918, 23945, 280, 29918, 16513, 29898, 1311, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 1243, 29918, 276, 558, 29898, 1311, 1125, 13, 4706, 1209, 13, 2 ]
replay_buffer.py
zhihanyang2022/pytorch-a2c
0
180804
from collections import namedtuple import random import numpy as np import torch # very exhaustive but as a result code is very easy to read ;) Transition = namedtuple('Transition', 's a r done') Transitions = namedtuple('Transitions', 's a r done') # functionally the same as Transition NStepTransitions = namedtuple('Batch', 's a n_step_sum_of_r n_step_s done_within_n_step') # each item corresponds to a tensor class SequentialBuffer: def __init__(self, gamma: float, n_step: int): self.memory = [] self.gamma = gamma self.n_step = n_step def push(self, transition: Transition) -> None: self.memory.append(transition) def instantiate_NStepTransitions_and_empty_buffer(self) -> NStepTransitions: """We empty the buffer because this is an on-policy algorithm.""" dummy_transition = Transition(np.zeros((self.memory[0].s.shape)), 0, 0, 0) memory_with_dummies = self.memory + [dummy_transition] * (self.n_step - 1) transitions = Transitions(*zip(*memory_with_dummies)) length = len(self.memory) # not computed with memory_with_dummies s = torch.tensor(transitions.s[:-(self.n_step-1) or None], dtype=torch.float).view(length, -1) a = torch.tensor(transitions.a[:-(self.n_step-1) or None], dtype=torch.long ).view(length, 1) n_step_s = torch.tensor(transitions.s[self.n_step-1:], dtype=torch.float).view(length, -1) # last few are dummies and their values will be ignored conveniently through done_within_n_step n_step_sum_of_r = np.zeros((len(self.memory),)) done_within_n_step = np.zeros((len(self.memory),)) # including the zeroth and the (n-1)th step for t in range(len(transitions.r[:-(self.n_step-1) or None])): # t = 0, 1, ..., T-1, (T, ..., T+n_step-1), where bracket terms due to dummies sum = 0 for i in range(self.n_step): # from 0 to n_step - 1 inclusive; exactly what we want sum += (self.gamma ** i) * transitions.r[t+i] if transitions.done[t+i]: done_within_n_step[t] = 1 # indicates that we shouldn't care about the value of n_step_s break n_step_sum_of_r[t] = sum n_step_sum_of_r = torch.tensor(n_step_sum_of_r, dtype=torch.float).view(length, 1) done_within_n_step = torch.tensor(done_within_n_step, dtype=torch.long).view(length, 1) self.memory = [] return NStepTransitions(s, a, n_step_sum_of_r, n_step_s, done_within_n_step) # for SIL # no done is needed here because we only need to calculate the monte-carlo return for one episode at a time TransitionWithoutDone = namedtuple('TransitionWithoutDone', 's a r') TransitionWithoutDoneWithReturn = namedtuple('TransitionWithoutDoneWithReturn', 's a R') MonteCarloTransitions = namedtuple('MonteCarloTransitions', 's a R') class SILBuffer: def __init__(self, gamma: float): self.memory = [] self.current_episode = [] self.gamma = gamma def push(self, transition: TransitionWithoutDone) -> None: self.current_episode.append(transition) def process_and_empty_current_episode(self) -> None: discounted_return = 0 for transition in reversed(self.current_episode): discounted_return = transition.r + self.gamma * discounted_return self.memory.append(TransitionWithoutDoneWithReturn(transition.s, transition.a, discounted_return)) self.current_episode = [] def ready_for(self, batch_size: int) -> bool: return len(self.memory) >= batch_size def sample(self, batch_size: int) -> MonteCarloTransitions: transitions = random.sample(self.memory, batch_size) transitions = MonteCarloTransitions(*zip(*transitions)) s = torch.tensor(transitions.s, dtype=torch.float).view(batch_size, -1) a = torch.tensor(transitions.a, dtype=torch.long ).view(batch_size, 1) R = torch.tensor(transitions.R, dtype=torch.float).view(batch_size, 1) return MonteCarloTransitions(s, a, R)
[ 1, 515, 16250, 1053, 4257, 23583, 13, 5215, 4036, 13, 5215, 12655, 408, 7442, 13, 5215, 4842, 305, 13, 13, 29937, 1407, 27096, 573, 541, 408, 263, 1121, 775, 338, 1407, 4780, 304, 1303, 15718, 13, 13, 4300, 654, 353, 4257, 23583, 877, 4300, 654, 742, 525, 29879, 263, 364, 2309, 1495, 13, 4300, 2187, 353, 4257, 23583, 877, 4300, 2187, 742, 525, 29879, 263, 364, 2309, 1495, 29871, 396, 740, 635, 278, 1021, 408, 4103, 654, 13, 3059, 371, 29886, 4300, 2187, 353, 4257, 23583, 877, 23145, 742, 525, 29879, 263, 302, 29918, 10568, 29918, 2083, 29918, 974, 29918, 29878, 302, 29918, 10568, 29918, 29879, 2309, 29918, 2541, 262, 29918, 29876, 29918, 10568, 1495, 29871, 396, 1269, 2944, 16161, 304, 263, 12489, 13, 13, 1990, 922, 339, 2556, 7701, 29901, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 330, 2735, 29901, 5785, 29892, 302, 29918, 10568, 29901, 938, 1125, 13, 4706, 1583, 29889, 14834, 353, 5159, 13, 4706, 1583, 29889, 4283, 353, 330, 2735, 13, 4706, 1583, 29889, 29876, 29918, 10568, 353, 302, 29918, 10568, 13, 13, 1678, 822, 5503, 29898, 1311, 29892, 9558, 29901, 4103, 654, 29897, 1599, 6213, 29901, 13, 4706, 1583, 29889, 14834, 29889, 4397, 29898, 20543, 29897, 13, 13, 1678, 822, 25112, 29918, 3059, 371, 29886, 4300, 2187, 29918, 392, 29918, 6310, 29918, 9040, 29898, 1311, 29897, 1599, 3865, 371, 29886, 4300, 2187, 29901, 13, 13, 4706, 9995, 4806, 4069, 278, 6835, 1363, 445, 338, 385, 373, 29899, 22197, 5687, 1213, 15945, 13, 13, 4706, 20254, 29918, 20543, 353, 4103, 654, 29898, 9302, 29889, 3298, 359, 3552, 1311, 29889, 14834, 29961, 29900, 1822, 29879, 29889, 12181, 8243, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29897, 13, 13, 4706, 3370, 29918, 2541, 29918, 29881, 23824, 583, 353, 1583, 29889, 14834, 718, 518, 29881, 11770, 29918, 20543, 29962, 334, 313, 1311, 29889, 29876, 29918, 10568, 448, 29871, 29896, 29897, 13, 13, 4706, 1301, 2187, 353, 4103, 2187, 10456, 7554, 10456, 14834, 29918, 2541, 29918, 29881, 23824, 583, 876, 13, 4706, 3309, 353, 7431, 29898, 1311, 29889, 14834, 29897, 29871, 396, 451, 15712, 411, 3370, 29918, 2541, 29918, 29881, 23824, 583, 13, 13, 4706, 269, 4706, 353, 4842, 305, 29889, 20158, 29898, 3286, 2187, 29889, 29879, 7503, 17722, 1311, 29889, 29876, 29918, 10568, 29899, 29896, 29897, 470, 6213, 1402, 29871, 26688, 29922, 7345, 305, 29889, 7411, 467, 1493, 29898, 2848, 29892, 448, 29896, 29897, 13, 4706, 263, 4706, 353, 4842, 305, 29889, 20158, 29898, 3286, 2187, 29889, 29874, 7503, 17722, 1311, 29889, 29876, 29918, 10568, 29899, 29896, 29897, 470, 6213, 1402, 29871, 26688, 29922, 7345, 305, 29889, 5426, 13742, 1493, 29898, 2848, 29892, 259, 29896, 29897, 13, 4706, 302, 29918, 10568, 29918, 29879, 353, 4842, 305, 29889, 20158, 29898, 3286, 2187, 29889, 29879, 29961, 1311, 29889, 29876, 29918, 10568, 29899, 29896, 29901, 1402, 26688, 29922, 7345, 305, 29889, 7411, 467, 1493, 29898, 2848, 29892, 448, 29896, 29897, 13, 4706, 396, 1833, 2846, 526, 270, 23824, 583, 322, 1009, 1819, 674, 367, 17262, 19192, 368, 1549, 2309, 29918, 2541, 262, 29918, 29876, 29918, 10568, 13, 13, 4706, 302, 29918, 10568, 29918, 2083, 29918, 974, 29918, 29878, 353, 7442, 29889, 3298, 359, 3552, 2435, 29898, 1311, 29889, 14834, 511, 876, 13, 4706, 2309, 29918, 2541, 262, 29918, 29876, 29918, 10568, 353, 7442, 29889, 3298, 359, 3552, 2435, 29898, 1311, 29889, 14834, 511, 876, 29871, 396, 3704, 278, 503, 261, 720, 322, 278, 313, 29876, 29899, 29896, 29897, 386, 4331, 13, 13, 4706, 363, 260, 297, 3464, 29898, 2435, 29898, 3286, 2187, 29889, 29878, 7503, 17722, 1311, 29889, 29876, 29918, 10568, 29899, 29896, 29897, 470, 6213, 12622, 29901, 29871, 396, 260, 353, 29871, 29900, 29892, 29871, 29896, 29892, 2023, 29892, 323, 29899, 29896, 29892, 313, 29911, 29892, 2023, 29892, 323, 29974, 29876, 29918, 10568, 29899, 29896, 511, 988, 4105, 3522, 4958, 2861, 304, 270, 23824, 583, 13, 9651, 2533, 353, 29871, 29900, 13, 9651, 363, 474, 297, 3464, 29898, 1311, 29889, 29876, 29918, 10568, 1125, 29871, 396, 515, 29871, 29900, 304, 302, 29918, 10568, 448, 29871, 29896, 20978, 573, 29936, 3721, 825, 591, 864, 13, 18884, 2533, 4619, 313, 1311, 29889, 4283, 3579, 474, 29897, 334, 1301, 2187, 29889, 29878, 29961, 29873, 29974, 29875, 29962, 13, 18884, 565, 1301, 2187, 29889, 15091, 29961, 29873, 29974, 29875, 5387, 13, 462, 1678, 2309, 29918, 2541, 262, 29918, 29876, 29918, 10568, 29961, 29873, 29962, 353, 29871, 29896, 29871, 396, 14088, 393, 591, 9273, 29915, 29873, 2562, 1048, 278, 995, 310, 302, 29918, 10568, 29918, 29879, 13, 462, 1678, 2867, 13, 9651, 302, 29918, 10568, 29918, 2083, 29918, 974, 29918, 29878, 29961, 29873, 29962, 353, 2533, 13, 13, 4706, 302, 29918, 10568, 29918, 2083, 29918, 974, 29918, 29878, 353, 4842, 305, 29889, 20158, 29898, 29876, 29918, 10568, 29918, 2083, 29918, 974, 29918, 29878, 29892, 26688, 29922, 7345, 305, 29889, 7411, 467, 1493, 29898, 2848, 29892, 29871, 29896, 29897, 13, 4706, 2309, 29918, 2541, 262, 29918, 29876, 29918, 10568, 353, 4842, 305, 29889, 20158, 29898, 15091, 29918, 2541, 262, 29918, 29876, 29918, 10568, 29892, 26688, 29922, 7345, 305, 29889, 5426, 467, 1493, 29898, 2848, 29892, 29871, 29896, 29897, 13, 13, 4706, 1583, 29889, 14834, 353, 5159, 13, 13, 4706, 736, 3865, 371, 29886, 4300, 2187, 29898, 29879, 29892, 263, 29892, 302, 29918, 10568, 29918, 2083, 29918, 974, 29918, 29878, 29892, 302, 29918, 10568, 29918, 29879, 29892, 2309, 29918, 2541, 262, 29918, 29876, 29918, 10568, 29897, 13, 13, 29937, 363, 317, 6227, 13, 29937, 694, 2309, 338, 4312, 1244, 1363, 591, 871, 817, 304, 8147, 278, 1601, 371, 29899, 4287, 417, 736, 363, 697, 12720, 472, 263, 931, 13, 4300, 654, 3047, 449, 25632, 353, 4257, 23583, 877, 4300, 654, 3047, 449, 25632, 742, 525, 29879, 263, 364, 1495, 13, 4300, 654, 3047, 449, 25632, 3047, 11609, 353, 4257, 23583, 877, 4300, 654, 3047, 449, 25632, 3047, 11609, 742, 525, 29879, 263, 390, 1495, 13, 7185, 371, 8179, 417, 4300, 2187, 353, 4257, 23583, 877, 7185, 371, 8179, 417, 4300, 2187, 742, 525, 29879, 263, 390, 1495, 13, 13, 1990, 317, 6227, 7701, 29901, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 330, 2735, 29901, 5785, 1125, 13, 4706, 1583, 29889, 14834, 353, 5159, 13, 4706, 1583, 29889, 3784, 29918, 1022, 275, 356, 353, 5159, 13, 4706, 1583, 29889, 4283, 353, 330, 2735, 13, 13, 1678, 822, 5503, 29898, 1311, 29892, 9558, 29901, 4103, 654, 3047, 449, 25632, 29897, 1599, 6213, 29901, 13, 4706, 1583, 29889, 3784, 29918, 1022, 275, 356, 29889, 4397, 29898, 20543, 29897, 13, 13, 1678, 822, 1889, 29918, 392, 29918, 6310, 29918, 3784, 29918, 1022, 275, 356, 29898, 1311, 29897, 1599, 6213, 29901, 13, 4706, 2313, 792, 287, 29918, 2457, 353, 29871, 29900, 13, 4706, 363, 9558, 297, 18764, 287, 29898, 1311, 29889, 3784, 29918, 1022, 275, 356, 1125, 13, 9651, 2313, 792, 287, 29918, 2457, 353, 9558, 29889, 29878, 718, 1583, 29889, 4283, 334, 2313, 792, 287, 29918, 2457, 13, 9651, 1583, 29889, 14834, 29889, 4397, 29898, 4300, 654, 3047, 449, 25632, 3047, 11609, 29898, 20543, 29889, 29879, 29892, 9558, 29889, 29874, 29892, 2313, 792, 287, 29918, 2457, 876, 13, 4706, 1583, 29889, 3784, 29918, 1022, 275, 356, 353, 5159, 13, 13, 1678, 822, 7960, 29918, 1454, 29898, 1311, 29892, 9853, 29918, 2311, 29901, 938, 29897, 1599, 6120, 29901, 13, 4706, 736, 7431, 29898, 1311, 29889, 14834, 29897, 6736, 9853, 29918, 2311, 13, 13, 1678, 822, 4559, 29898, 1311, 29892, 9853, 29918, 2311, 29901, 938, 29897, 1599, 11240, 8179, 417, 4300, 2187, 29901, 13, 4706, 1301, 2187, 353, 4036, 29889, 11249, 29898, 1311, 29889, 14834, 29892, 9853, 29918, 2311, 29897, 13, 4706, 1301, 2187, 353, 11240, 8179, 417, 4300, 2187, 10456, 7554, 10456, 3286, 2187, 876, 13, 4706, 269, 353, 4842, 305, 29889, 20158, 29898, 3286, 2187, 29889, 29879, 29892, 26688, 29922, 7345, 305, 29889, 7411, 467, 1493, 29898, 16175, 29918, 2311, 29892, 448, 29896, 29897, 13, 4706, 263, 353, 4842, 305, 29889, 20158, 29898, 3286, 2187, 29889, 29874, 29892, 26688, 29922, 7345, 305, 29889, 5426, 13742, 1493, 29898, 16175, 29918, 2311, 29892, 259, 29896, 29897, 13, 4706, 390, 353, 4842, 305, 29889, 20158, 29898, 3286, 2187, 29889, 29934, 29892, 26688, 29922, 7345, 305, 29889, 7411, 467, 1493, 29898, 16175, 29918, 2311, 29892, 259, 29896, 29897, 13, 4706, 736, 11240, 8179, 417, 4300, 2187, 29898, 29879, 29892, 263, 29892, 390, 29897, 2 ]
0_numpy_lineare_algebra/assignments/learntools/challenges/challenge2.py
layerwise/training
0
41754
<filename>0_numpy_lineare_algebra/assignments/learntools/challenges/challenge2.py import pandas as pd import os import numpy as np from learntools.core import * class Evaluation(CodingProblem): show_solution_on_correct = False _vars = ["data_path", "results"] _hints = [ """Checking your solution requires that the file 'AmesIowaHousingData_test_with_labels.csv' be available at `data_path`.""" ] def check(self, *args): data_path = args[0] results = args[1] data_file = 'AmesIowaHousingData_test_with_labels.csv' assert_file_exists(os.path.join(data_path, data_file)) test_df = pd.read_csv(os.path.join(data_path, data_file), index_col=0) y_true = test_df.loc[:, "SalePrice"] if not set(y_true.index).issubset(set(results.keys())): missing = set(y_true.index).difference(set(results.keys())) print(f"Es gibt noch keine Vorhersage für die folgenden `id`s") for missing_id in missing: print(missing_id) assert False if not set(results.keys()).issubset(set(y_true.index)): additional = set(results.keys()).difference(set(y_true.index)) print("Es gibt Vorhersagen für nicht vorhandene `id`s. Diese sind") for additional_id in additional: print(additional_id) assert False error = 0 for id_, y_pred in results.items(): error += np.abs(y_true.loc[id_] - y_pred) mean_error = error / len(y_true) print(f"Sie liegen durchschnittlich falsch um {np.round(mean_error)} US-Dollar.") assert True qvars = bind_exercises(globals(), [ Evaluation ], ) __all__ = list(qvars)
[ 1, 529, 9507, 29958, 29900, 29918, 23749, 29918, 1220, 598, 29918, 15742, 29914, 16645, 1860, 29914, 19668, 8504, 29914, 305, 16047, 267, 29914, 305, 11768, 29906, 29889, 2272, 13, 5215, 11701, 408, 10518, 13, 5215, 2897, 13, 5215, 12655, 408, 7442, 13, 13, 3166, 5110, 8504, 29889, 3221, 1053, 334, 13, 13, 1990, 382, 4387, 362, 29898, 29907, 3689, 26604, 1125, 13, 1678, 1510, 29918, 2929, 918, 29918, 265, 29918, 15728, 353, 7700, 13, 13, 1678, 903, 16908, 353, 6796, 1272, 29918, 2084, 613, 376, 9902, 3108, 13, 1678, 903, 29882, 9466, 353, 518, 13, 4706, 9995, 5596, 292, 596, 1650, 6858, 393, 278, 934, 525, 29909, 4467, 29902, 5604, 29950, 681, 292, 1469, 29918, 1688, 29918, 2541, 29918, 21134, 29889, 7638, 29915, 367, 3625, 472, 421, 1272, 29918, 2084, 29952, 1213, 15945, 13, 1678, 4514, 13, 13, 1678, 822, 1423, 29898, 1311, 29892, 334, 5085, 1125, 13, 4706, 848, 29918, 2084, 353, 6389, 29961, 29900, 29962, 13, 4706, 2582, 353, 6389, 29961, 29896, 29962, 13, 4706, 848, 29918, 1445, 353, 525, 29909, 4467, 29902, 5604, 29950, 681, 292, 1469, 29918, 1688, 29918, 2541, 29918, 21134, 29889, 7638, 29915, 13, 4706, 4974, 29918, 1445, 29918, 9933, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 2084, 29892, 848, 29918, 1445, 876, 13, 308, 13, 4706, 1243, 29918, 2176, 353, 29871, 10518, 29889, 949, 29918, 7638, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 2084, 29892, 848, 29918, 1445, 511, 2380, 29918, 1054, 29922, 29900, 29897, 13, 13, 4706, 343, 29918, 3009, 353, 1243, 29918, 2176, 29889, 2029, 7503, 29892, 376, 29903, 744, 13026, 3108, 13, 13, 4706, 565, 451, 731, 29898, 29891, 29918, 3009, 29889, 2248, 467, 790, 431, 842, 29898, 842, 29898, 9902, 29889, 8149, 22130, 29901, 13, 9651, 4567, 353, 731, 29898, 29891, 29918, 3009, 29889, 2248, 467, 29881, 17678, 29898, 842, 29898, 9902, 29889, 8149, 22130, 13, 9651, 1596, 29898, 29888, 29908, 14190, 13456, 5440, 13945, 6266, 29882, 414, 482, 1865, 762, 24245, 421, 333, 29952, 29879, 1159, 13, 9651, 363, 4567, 29918, 333, 297, 4567, 29901, 13, 18884, 1596, 29898, 27259, 29918, 333, 29897, 13, 9651, 4974, 7700, 13, 13, 4706, 565, 451, 731, 29898, 9902, 29889, 8149, 16655, 790, 431, 842, 29898, 842, 29898, 29891, 29918, 3009, 29889, 2248, 22164, 13, 9651, 5684, 353, 731, 29898, 9902, 29889, 8149, 16655, 29881, 17678, 29898, 842, 29898, 29891, 29918, 3009, 29889, 2248, 876, 13, 9651, 1596, 703, 14190, 13456, 6266, 29882, 414, 5370, 1865, 3072, 3764, 3179, 1600, 421, 333, 29952, 29879, 29889, 13528, 3937, 1159, 13, 9651, 363, 5684, 29918, 333, 297, 5684, 29901, 13, 18884, 1596, 29898, 1202, 3245, 29918, 333, 29897, 13, 9651, 4974, 7700, 13, 13, 4706, 1059, 353, 29871, 29900, 13, 4706, 363, 1178, 3383, 343, 29918, 11965, 297, 2582, 29889, 7076, 7295, 13, 9651, 1059, 4619, 7442, 29889, 6897, 29898, 29891, 29918, 3009, 29889, 2029, 29961, 333, 29918, 29962, 448, 343, 29918, 11965, 29897, 13, 13, 4706, 2099, 29918, 2704, 353, 1059, 847, 7431, 29898, 29891, 29918, 3009, 29897, 13, 13, 4706, 1596, 29898, 29888, 29908, 29903, 347, 3804, 1885, 3494, 19564, 1470, 11092, 816, 1922, 426, 9302, 29889, 14486, 29898, 12676, 29918, 2704, 2915, 3148, 29899, 29928, 26810, 23157, 13, 4706, 4974, 5852, 13, 308, 13, 13, 29939, 16908, 353, 7868, 29918, 735, 261, 3476, 267, 29898, 23705, 1338, 3285, 518, 13, 1678, 382, 4387, 362, 13, 1678, 21251, 13, 1678, 1723, 13, 1649, 497, 1649, 353, 1051, 29898, 29939, 16908, 29897, 13, 13, 2 ]
apps/core/views/ServerEditView.py
Couapy/mc-manager
0
85462
<gh_stars>0 from core.exceptions import NotRunningError from core.forms import ServerForm from core.models import Server from django.contrib import messages from django.contrib.auth.decorators import login_required from django.shortcuts import (HttpResponseRedirect, get_object_or_404, render, reverse) from django.utils.decorators import method_decorator from django.views import View from core.decorators import CheckServerAuthorization, owner_expected @method_decorator(login_required, name='dispatch') @method_decorator(CheckServerAuthorization('manage'), name='dispatch') class ServerEditView(View): """This is the server edit view.""" def get(self, request, id: int): server = get_object_or_404(Server, pk=id) form = ServerForm( data=request.POST or None, instance=server, ) context = { 'server': server, 'form': form, } return render(request, 'core/settings/edit.html', context) def post(self, request, id: int): server = get_object_or_404(Server, pk=id) form = ServerForm( data=request.POST or None, files=request.FILES or None, instance=server, ) if form.has_changed() and form.is_valid(): form.save() messages.add_message( request=request, level=messages.INFO, message='Les paramètres du serveur ont bien été enregistrés.', ) return self.get(request, id)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 13, 3166, 7136, 29889, 11739, 29879, 1053, 2216, 27795, 2392, 13, 3166, 7136, 29889, 9514, 1053, 5656, 2500, 13, 3166, 7136, 29889, 9794, 1053, 5656, 13, 3166, 9557, 29889, 21570, 1053, 7191, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 19557, 4097, 1053, 6464, 29918, 12403, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 313, 5506, 5103, 24735, 29892, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29892, 4050, 29892, 13, 462, 795, 11837, 29897, 13, 3166, 9557, 29889, 13239, 29889, 19557, 4097, 1053, 1158, 29918, 19557, 1061, 13, 3166, 9557, 29889, 7406, 1053, 4533, 13, 13, 3166, 7136, 29889, 19557, 4097, 1053, 5399, 6004, 25471, 29892, 12271, 29918, 9684, 13, 13, 13, 29992, 5696, 29918, 19557, 1061, 29898, 7507, 29918, 12403, 29892, 1024, 2433, 13369, 1495, 13, 29992, 5696, 29918, 19557, 1061, 29898, 5596, 6004, 25471, 877, 1171, 482, 5477, 1024, 2433, 13369, 1495, 13, 1990, 5656, 6103, 1043, 29898, 1043, 1125, 13, 1678, 9995, 4013, 338, 278, 1923, 3863, 1776, 1213, 15945, 13, 13, 1678, 822, 679, 29898, 1311, 29892, 2009, 29892, 1178, 29901, 938, 1125, 13, 4706, 1923, 353, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29898, 6004, 29892, 282, 29895, 29922, 333, 29897, 13, 4706, 883, 353, 5656, 2500, 29898, 13, 9651, 848, 29922, 3827, 29889, 5438, 470, 6213, 29892, 13, 9651, 2777, 29922, 2974, 29892, 13, 4706, 1723, 13, 4706, 3030, 353, 426, 13, 9651, 525, 2974, 2396, 1923, 29892, 13, 9651, 525, 689, 2396, 883, 29892, 13, 4706, 500, 13, 4706, 736, 4050, 29898, 3827, 29892, 525, 3221, 29914, 11027, 29914, 5628, 29889, 1420, 742, 3030, 29897, 13, 13, 1678, 822, 1400, 29898, 1311, 29892, 2009, 29892, 1178, 29901, 938, 1125, 13, 4706, 1923, 353, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29898, 6004, 29892, 282, 29895, 29922, 333, 29897, 13, 4706, 883, 353, 5656, 2500, 29898, 13, 9651, 848, 29922, 3827, 29889, 5438, 470, 6213, 29892, 13, 9651, 2066, 29922, 3827, 29889, 24483, 470, 6213, 29892, 13, 9651, 2777, 29922, 2974, 29892, 13, 4706, 1723, 13, 4706, 565, 883, 29889, 5349, 29918, 15033, 580, 322, 883, 29889, 275, 29918, 3084, 7295, 13, 9651, 883, 29889, 7620, 580, 13, 9651, 7191, 29889, 1202, 29918, 4906, 29898, 13, 18884, 2009, 29922, 3827, 29892, 13, 18884, 3233, 29922, 19158, 29889, 11690, 29892, 13, 18884, 2643, 2433, 24560, 1828, 14228, 868, 9080, 332, 4625, 6079, 4370, 427, 29238, 743, 29889, 742, 13, 9651, 1723, 13, 4706, 736, 1583, 29889, 657, 29898, 3827, 29892, 1178, 29897, 13, 2 ]