content
stringlengths
1
1.04M
input_ids
sequencelengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
import numpy as np import logging OptimizerList = {'SGD': SGD, 'ADAGRAD': ADAGRAD, 'ADADELTA': ADADELTA}
[ 11748, 299, 32152, 355, 45941, 198, 11748, 18931, 198, 198, 27871, 320, 7509, 8053, 796, 1391, 6, 38475, 35, 10354, 26147, 35, 11, 705, 2885, 4760, 49, 2885, 10354, 5984, 4760, 49, 2885, 11, 705, 2885, 2885, 3698, 5603, 10354, 5984, 2885, 3698, 5603, 92, 198 ]
2.304348
46
from collections import MutableMapping
[ 6738, 17268, 1330, 13859, 540, 44, 5912, 198 ]
4.875
8
import ConfigParser import datetime import threading import time from slackclient import SlackClient from responses import bot Config = ConfigParser.ConfigParser() Config.read("credentials.ini") token = Config.get('Slack_Creds', 'token') print "token: " + token sc = SlackClient(token) robot = bot(sc, token) print "Starting up!" connected = False start = time.time() # Spin and try to connect every 5 seconds upon initial boot. while connected is False: if sc.rtm_connect(): print "Successfully connected to Slack!" connected = True while connected: # Read from the Slack Channels that the bot is currently a part of. try: Incoming_Message = sc.rtm_read() except Exception as e: print e Incoming_Message = [] connected = False # Process each incoming message from Slack. for msg in Incoming_Message: thread = threading.Thread( target=robot.Process, args=(msg,)) thread.start() time.sleep(0.1) else: print "Connection Failed, invalid token?" connected = False time.sleep(5)
[ 11748, 17056, 46677, 198, 11748, 4818, 8079, 198, 11748, 4704, 278, 198, 11748, 640, 198, 198, 6738, 30740, 16366, 1330, 36256, 11792, 198, 6738, 9109, 1330, 10214, 198, 198, 16934, 796, 17056, 46677, 13, 16934, 46677, 3419, 198, 16934, 13, 961, 7203, 66, 445, 14817, 13, 5362, 4943, 198, 198, 30001, 796, 17056, 13, 1136, 10786, 11122, 441, 62, 34, 445, 82, 3256, 705, 30001, 11537, 198, 4798, 366, 30001, 25, 366, 1343, 11241, 198, 1416, 796, 36256, 11792, 7, 30001, 8, 198, 305, 13645, 796, 10214, 7, 1416, 11, 11241, 8, 198, 198, 4798, 366, 22851, 510, 2474, 198, 15236, 796, 10352, 198, 9688, 796, 640, 13, 2435, 3419, 198, 198, 2, 28002, 290, 1949, 284, 2018, 790, 642, 4201, 2402, 4238, 6297, 13, 198, 4514, 5884, 318, 10352, 25, 198, 220, 220, 220, 611, 629, 13, 17034, 76, 62, 8443, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 366, 33244, 2759, 5884, 284, 36256, 2474, 198, 220, 220, 220, 220, 220, 220, 220, 5884, 796, 6407, 628, 220, 220, 220, 220, 220, 220, 220, 981, 5884, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 4149, 422, 262, 36256, 609, 8961, 326, 262, 10214, 318, 3058, 257, 636, 286, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 554, 4976, 62, 12837, 796, 629, 13, 17034, 76, 62, 961, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2845, 35528, 355, 304, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 304, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 554, 4976, 62, 12837, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5884, 796, 10352, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 10854, 1123, 15619, 3275, 422, 36256, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 31456, 287, 554, 4976, 62, 12837, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4704, 796, 4704, 278, 13, 16818, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2496, 28, 305, 13645, 13, 18709, 11, 26498, 16193, 19662, 11, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4704, 13, 9688, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 640, 13, 42832, 7, 15, 13, 16, 8, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 366, 32048, 22738, 11, 12515, 11241, 1701, 198, 220, 220, 220, 220, 220, 220, 220, 5884, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 640, 13, 42832, 7, 20, 8 ]
2.40668
509
""" (c) 2017 DigitalOcean 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 pynetbox.core.query import Request from pynetbox.core.util import Hashabledict import pynetbox.core.endpoint # List of fields that are lists but should be treated as sets. LIST_AS_SET = ("tags", "tagged_vlans") def get_return(lookup, return_fields=None): """Returns simple representations for items passed to lookup. Used to return a "simple" representation of objects and collections sent to it via lookup. If lookup is an IPNetwork object immediately return the string representation. Otherwise, we look to see if lookup is a "choices" field (dict with only 'id' and 'value') or a nested_return. Finally, we check if it's a Record, if so simply return a string. Order is important due to nested_return being self-referential. :arg list,optional return_fields: A list of fields to reference when calling values on lookup. """ for i in return_fields or ["id", "value", "nested_return"]: if isinstance(lookup, dict) and lookup.get(i): return lookup[i] else: if hasattr(lookup, i): return getattr(lookup, i) if isinstance(lookup, Record): return str(lookup) else: return lookup class JsonField(object): """Explicit field type for values that are not to be converted to a Record object""" _json_field = True class Record(object): """Create python objects from netbox API responses. Creates an object from a NetBox response passed as `values`. Nested dicts that represent other endpoints are also turned into Record objects. All fields are then assigned to the object's attributes. If a missing attr is requested (e.g. requesting a field that's only present on a full response on a Record made from a nested response) the pynetbox will make a request for the full object and return the requsted value. :examples: Default representation of the object is usually its name >>> x = nb.dcim.devices.get(1) >>> x test1-switch1 >>> Querying a string field. >>> x = nb.dcim.devices.get(1) >>> x.serial 'ABC123' >>> Querying a field on a nested object. >>> x = nb.dcim.devices.get(1) >>> x.device_type.model 'QFX5100-24Q' >>> Casting the object as a dictionary. >>> from pprint import pprint >>> pprint(dict(x)) {'asset_tag': None, 'cluster': None, 'comments': '', 'config_context': {}, 'created': '2018-04-01', 'custom_fields': {}, 'device_role': {'id': 1, 'name': 'Test Switch', 'slug': 'test-switch', 'url': 'http://localhost:8000/api/dcim/device-roles/1/'}, 'device_type': {...}, 'display_name': 'test1-switch1', 'face': {'label': 'Rear', 'value': 1}, 'id': 1, 'name': 'test1-switch1', 'parent_device': None, 'platform': {...}, 'position': 1, 'primary_ip': {'address': '192.0.2.1/24', 'family': 4, 'id': 1, 'url': 'http://localhost:8000/api/ipam/ip-addresses/1/'}, 'primary_ip4': {...}, 'primary_ip6': None, 'rack': {'display_name': 'Test Rack', 'id': 1, 'name': 'Test Rack', 'url': 'http://localhost:8000/api/dcim/racks/1/'}, 'serial': 'ABC123', 'site': {'id': 1, 'name': 'TEST', 'slug': 'TEST', 'url': 'http://localhost:8000/api/dcim/sites/1/'}, 'status': {'label': 'Active', 'value': 1}, 'tags': [], 'tenant': None, 'vc_position': None, 'vc_priority': None, 'virtual_chassis': None} >>> Iterating over a Record object. >>> for i in x: ... print(i) ... ('id', 1) ('name', 'test1-switch1') ('display_name', 'test1-switch1') >>> """ url = None def __getattr__(self, k): """Default behavior for missing attrs. We'll call `full_details()` if we're asked for an attribute we don't have. In order to prevent non-explicit behavior,`k='keys'` is excluded because casting to dict() calls this attr. """ if self.url: if self.has_details is False and k != "keys": if self.full_details(): ret = getattr(self, k, None) if ret or hasattr(self, k): return ret raise AttributeError('object has no attribute "{}"'.format(k)) def _parse_values(self, values): """ Parses values init arg. Parses values dict at init and sets object attributes with the values within. """ for k, v in values.items(): if isinstance(v, dict): lookup = getattr(self.__class__, k, None) if k == "custom_fields" or hasattr(lookup, "_json_field"): self._add_cache((k, v.copy())) setattr(self, k, v) continue k_endpoint = None if "url" in v: k_path_list = v["url"].split("/") if "api" in k_path_list: offset = k_path_list.index("api") + 1 if len(k_path_list[offset:]) > 0 \ and k_path_list[offset:][0] == "api": # domain name is "api" offset = offset + 1 if len(k_path_list[offset:]) > 1: k_app = k_path_list[offset:][0] k_name = k_path_list[offset:][1] if hasattr(self.api, k_app): k_endpoint = pynetbox.core.endpoint.\ Endpoint(self.api, getattr(self.api, k_app), k_name, model=None) if lookup: v = lookup(v, self.api, k_endpoint) else: v = self.default_ret(v, self.api, k_endpoint) self._add_cache((k, v)) elif isinstance(v, list): v = [list_parser(i) for i in v] to_cache = list(v) self._add_cache((k, to_cache)) else: self._add_cache((k, v)) setattr(self, k, v) def _compare(self): """Compares current attributes to values at instantiation. In order to be idempotent we run this method in `save()`. Returns: Boolean value, True indicates current instance has the same attributes as the ones passed to `values`. """ if self.serialize(init=True) == self.serialize(): return True return False def full_details(self): """Queries the hyperlinked endpoint if 'url' is defined. This method will populate the attributes from the detail endpoint when it's called. Sets the class-level `has_details` attribute when it's called to prevent being called more than once. :returns: True """ if self.url: req = Request( base=self.url, token=self.api.token, session_key=self.api.session_key, ssl_verify=self.api.ssl_verify, http_session=self.api.http_session, ) self._parse_values(req.get()) self.has_details = True return True return False def serialize(self, nested=False, init=False): """Serializes an object Pulls all the attributes in an object and creates a dict that can be turned into the json that netbox is expecting. If an attribute's value is a ``Record`` type it's replaced with the ``id`` field of that object. .. note:: Using this to get a dictionary representation of the record is discouraged. It's probably better to cast to dict() instead. See Record docstring for example. :returns: dict. """ if nested: return get_return(self) if init: init_vals = dict(self._init_cache) ret = {} for i in dict(self): current_val = getattr(self, i) if not init else init_vals.get(i) if i == "custom_fields": ret[i] = flatten_custom(current_val) else: if isinstance(current_val, Record): current_val = getattr(current_val, "serialize")( nested=True ) if isinstance(current_val, list): current_val = [ v.id if isinstance(v, Record) else v for v in current_val ] if i in LIST_AS_SET: current_val = list(set(current_val)) ret[i] = current_val return ret def save(self): """Saves changes to an existing object. Takes a diff between the objects current state and its state at init and sends them as a dictionary to Request.patch(). :returns: True if PATCH request was successful. :example: >>> x = nb.dcim.devices.get(name='test1-a3-tor1b') >>> x.serial u'' >>> x.serial = '1234' >>> x.save() True >>> """ if self.id: diff = self._diff() if diff: serialized = self.serialize() req = Request( key=self.id, base=self.endpoint.url, token=self.api.token, session_key=self.api.session_key, ssl_verify=self.api.ssl_verify, http_session=self.api.http_session, ) if req.patch({i: serialized[i] for i in diff}): return True return False def update(self, data): """Update an object with a dictionary. Accepts a dict and uses it to update the record and call save(). For nested and choice fields you'd pass an int the same as if you were modifying the attribute and calling save(). :arg dict data: Dictionary containing the k/v to update the record object with. :returns: True if PATCH request was successful. :example: >>> x = nb.dcim.devices.get(1) >>> x.update({ ... "name": "test-switch2", ... "serial": "ABC321", ... }) True """ for k, v in data.items(): setattr(self, k, v) return self.save() def delete(self): """Deletes an existing object. :returns: True if DELETE operation was successful. :example: >>> x = nb.dcim.devices.get(name='test1-a3-tor1b') >>> x.delete() True >>> """ req = Request( key=self.id, base=self.endpoint.url, token=self.api.token, session_key=self.api.session_key, ssl_verify=self.api.ssl_verify, http_session=self.api.http_session, ) return True if req.delete() else False
[ 37811, 198, 7, 66, 8, 2177, 10231, 46607, 198, 198, 26656, 15385, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 5832, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 1639, 743, 7330, 257, 4866, 286, 262, 13789, 379, 628, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 198, 28042, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 198, 17080, 6169, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 198, 54, 10554, 12425, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 198, 6214, 262, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 198, 2475, 20597, 739, 262, 13789, 13, 198, 37811, 198, 6738, 279, 2047, 316, 3524, 13, 7295, 13, 22766, 1330, 19390, 198, 6738, 279, 2047, 316, 3524, 13, 7295, 13, 22602, 1330, 21059, 4510, 713, 198, 11748, 279, 2047, 316, 3524, 13, 7295, 13, 437, 4122, 628, 198, 2, 7343, 286, 7032, 326, 389, 8341, 475, 815, 307, 5716, 355, 5621, 13, 198, 45849, 62, 1921, 62, 28480, 796, 5855, 31499, 1600, 366, 12985, 2004, 62, 19279, 504, 4943, 628, 198, 4299, 651, 62, 7783, 7, 5460, 929, 11, 1441, 62, 25747, 28, 14202, 2599, 198, 220, 220, 220, 37227, 35561, 2829, 24612, 329, 3709, 3804, 284, 35847, 13, 628, 220, 220, 220, 16718, 284, 1441, 257, 366, 36439, 1, 10552, 286, 5563, 290, 17268, 198, 220, 220, 220, 1908, 284, 340, 2884, 35847, 13, 1002, 35847, 318, 281, 6101, 26245, 2134, 3393, 198, 220, 220, 220, 1441, 262, 4731, 10552, 13, 15323, 11, 356, 804, 284, 766, 611, 198, 220, 220, 220, 35847, 318, 257, 366, 6679, 1063, 1, 2214, 357, 11600, 351, 691, 705, 312, 6, 290, 705, 8367, 11537, 198, 220, 220, 220, 393, 257, 28376, 62, 7783, 13, 9461, 11, 356, 2198, 611, 340, 338, 257, 13266, 11, 611, 198, 220, 220, 220, 523, 2391, 1441, 257, 4731, 13, 8284, 318, 1593, 2233, 284, 28376, 62, 7783, 198, 220, 220, 220, 852, 2116, 12, 5420, 33369, 13, 628, 220, 220, 220, 1058, 853, 1351, 11, 25968, 1441, 62, 25747, 25, 317, 1351, 286, 7032, 284, 4941, 618, 198, 220, 220, 220, 220, 220, 220, 220, 4585, 3815, 319, 35847, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 329, 1312, 287, 1441, 62, 25747, 393, 14631, 312, 1600, 366, 8367, 1600, 366, 77, 7287, 62, 7783, 1, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 611, 318, 39098, 7, 5460, 929, 11, 8633, 8, 290, 35847, 13, 1136, 7, 72, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 35847, 58, 72, 60, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 468, 35226, 7, 5460, 929, 11, 1312, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 651, 35226, 7, 5460, 929, 11, 1312, 8, 628, 220, 220, 220, 611, 318, 39098, 7, 5460, 929, 11, 13266, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 965, 7, 5460, 929, 8, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 35847, 628, 198, 198, 4871, 449, 1559, 15878, 7, 15252, 2599, 198, 220, 220, 220, 37227, 18438, 3628, 2214, 2099, 329, 3815, 326, 389, 407, 284, 307, 11513, 198, 220, 220, 220, 284, 257, 13266, 2134, 37811, 198, 220, 220, 220, 4808, 17752, 62, 3245, 796, 6407, 628, 198, 4871, 13266, 7, 15252, 2599, 198, 220, 220, 220, 37227, 16447, 21015, 5563, 422, 2010, 3524, 7824, 9109, 13, 628, 220, 220, 220, 7921, 274, 281, 2134, 422, 257, 3433, 14253, 2882, 3804, 355, 4600, 27160, 44646, 198, 220, 220, 220, 399, 7287, 8633, 82, 326, 2380, 584, 886, 13033, 389, 635, 2900, 198, 220, 220, 220, 656, 13266, 5563, 13, 1439, 7032, 389, 788, 8686, 284, 262, 198, 220, 220, 220, 2134, 338, 12608, 13, 1002, 257, 4814, 708, 81, 318, 9167, 198, 220, 220, 220, 357, 68, 13, 70, 13, 20623, 257, 2214, 326, 338, 691, 1944, 319, 257, 1336, 2882, 319, 198, 220, 220, 220, 257, 13266, 925, 422, 257, 28376, 2882, 8, 262, 279, 2047, 316, 3524, 481, 787, 257, 198, 220, 220, 220, 2581, 329, 262, 1336, 2134, 290, 1441, 262, 1038, 30679, 1988, 13, 628, 220, 220, 220, 1058, 1069, 12629, 25, 628, 220, 220, 220, 15161, 10552, 286, 262, 2134, 318, 3221, 663, 1438, 628, 220, 220, 220, 13163, 2124, 796, 299, 65, 13, 17896, 320, 13, 42034, 13, 1136, 7, 16, 8, 198, 220, 220, 220, 13163, 2124, 198, 220, 220, 220, 1332, 16, 12, 31943, 16, 198, 220, 220, 220, 13163, 628, 220, 220, 220, 2264, 263, 1112, 257, 4731, 2214, 13, 628, 220, 220, 220, 13163, 2124, 796, 299, 65, 13, 17896, 320, 13, 42034, 13, 1136, 7, 16, 8, 198, 220, 220, 220, 13163, 2124, 13, 46911, 198, 220, 220, 220, 705, 24694, 10163, 6, 198, 220, 220, 220, 13163, 628, 220, 220, 220, 2264, 263, 1112, 257, 2214, 319, 257, 28376, 2134, 13, 628, 220, 220, 220, 13163, 2124, 796, 299, 65, 13, 17896, 320, 13, 42034, 13, 1136, 7, 16, 8, 198, 220, 220, 220, 13163, 2124, 13, 25202, 62, 4906, 13, 19849, 198, 220, 220, 220, 705, 48, 17213, 20, 3064, 12, 1731, 48, 6, 198, 220, 220, 220, 13163, 628, 220, 220, 220, 39285, 262, 2134, 355, 257, 22155, 13, 628, 220, 220, 220, 13163, 422, 279, 4798, 1330, 279, 4798, 198, 220, 220, 220, 13163, 279, 4798, 7, 11600, 7, 87, 4008, 198, 220, 220, 220, 1391, 6, 562, 316, 62, 12985, 10354, 6045, 11, 198, 220, 220, 220, 220, 705, 565, 5819, 10354, 6045, 11, 198, 220, 220, 220, 220, 705, 15944, 10354, 705, 3256, 198, 220, 220, 220, 220, 705, 11250, 62, 22866, 10354, 1391, 5512, 198, 220, 220, 220, 220, 705, 25598, 10354, 705, 7908, 12, 3023, 12, 486, 3256, 198, 220, 220, 220, 220, 705, 23144, 62, 25747, 10354, 1391, 5512, 198, 220, 220, 220, 220, 705, 25202, 62, 18090, 10354, 1391, 6, 312, 10354, 352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 3672, 10354, 705, 14402, 14645, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 6649, 1018, 10354, 705, 9288, 12, 31943, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 6371, 10354, 705, 4023, 1378, 36750, 25, 33942, 14, 15042, 14, 17896, 320, 14, 25202, 12, 305, 829, 14, 16, 14, 6, 5512, 198, 220, 220, 220, 220, 705, 25202, 62, 4906, 10354, 1391, 986, 5512, 198, 220, 220, 220, 220, 705, 13812, 62, 3672, 10354, 705, 9288, 16, 12, 31943, 16, 3256, 198, 220, 220, 220, 220, 705, 2550, 10354, 1391, 6, 18242, 10354, 705, 49, 451, 3256, 705, 8367, 10354, 352, 5512, 198, 220, 220, 220, 220, 705, 312, 10354, 352, 11, 198, 220, 220, 220, 220, 705, 3672, 10354, 705, 9288, 16, 12, 31943, 16, 3256, 198, 220, 220, 220, 220, 705, 8000, 62, 25202, 10354, 6045, 11, 198, 220, 220, 220, 220, 705, 24254, 10354, 1391, 986, 5512, 198, 220, 220, 220, 220, 705, 9150, 10354, 352, 11, 198, 220, 220, 220, 220, 705, 39754, 62, 541, 10354, 1391, 6, 21975, 10354, 705, 17477, 13, 15, 13, 17, 13, 16, 14, 1731, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 17989, 10354, 604, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 312, 10354, 352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 6371, 10354, 705, 4023, 1378, 36750, 25, 33942, 14, 15042, 14, 541, 321, 14, 541, 12, 2860, 16746, 14, 16, 14, 6, 5512, 198, 220, 220, 220, 220, 705, 39754, 62, 541, 19, 10354, 1391, 986, 5512, 198, 220, 220, 220, 220, 705, 39754, 62, 541, 21, 10354, 6045, 11, 198, 220, 220, 220, 220, 705, 39638, 10354, 1391, 6, 13812, 62, 3672, 10354, 705, 14402, 37927, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 312, 10354, 352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 3672, 10354, 705, 14402, 37927, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 6371, 10354, 705, 4023, 1378, 36750, 25, 33942, 14, 15042, 14, 17896, 320, 14, 81, 4595, 14, 16, 14, 6, 5512, 198, 220, 220, 220, 220, 705, 46911, 10354, 705, 24694, 10163, 3256, 198, 220, 220, 220, 220, 705, 15654, 10354, 1391, 6, 312, 10354, 352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 3672, 10354, 705, 51, 6465, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 6649, 1018, 10354, 705, 51, 6465, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 6371, 10354, 705, 4023, 1378, 36750, 25, 33942, 14, 15042, 14, 17896, 320, 14, 49315, 14, 16, 14, 6, 5512, 198, 220, 220, 220, 220, 705, 13376, 10354, 1391, 6, 18242, 10354, 705, 13739, 3256, 705, 8367, 10354, 352, 5512, 198, 220, 220, 220, 220, 705, 31499, 10354, 685, 4357, 198, 220, 220, 220, 220, 705, 1452, 415, 10354, 6045, 11, 198, 220, 220, 220, 220, 705, 28435, 62, 9150, 10354, 6045, 11, 198, 220, 220, 220, 220, 705, 28435, 62, 49336, 10354, 6045, 11, 198, 220, 220, 220, 220, 705, 32844, 62, 354, 20297, 10354, 6045, 92, 198, 220, 220, 220, 220, 13163, 628, 220, 220, 220, 220, 40806, 803, 625, 257, 13266, 2134, 13, 628, 220, 220, 220, 13163, 329, 1312, 287, 2124, 25, 198, 220, 220, 220, 2644, 220, 3601, 7, 72, 8, 198, 220, 220, 220, 2644, 198, 220, 220, 220, 19203, 312, 3256, 352, 8, 198, 220, 220, 220, 19203, 3672, 3256, 705, 9288, 16, 12, 31943, 16, 11537, 198, 220, 220, 220, 19203, 13812, 62, 3672, 3256, 705, 9288, 16, 12, 31943, 16, 11537, 198, 220, 220, 220, 13163, 628, 220, 220, 220, 37227, 628, 220, 220, 220, 19016, 796, 6045, 628, 220, 220, 220, 825, 11593, 1136, 35226, 834, 7, 944, 11, 479, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 19463, 4069, 329, 4814, 708, 3808, 13, 628, 220, 220, 220, 220, 220, 220, 220, 775, 1183, 869, 4600, 12853, 62, 36604, 3419, 63, 611, 356, 821, 1965, 329, 281, 11688, 198, 220, 220, 220, 220, 220, 220, 220, 356, 836, 470, 423, 13, 628, 220, 220, 220, 220, 220, 220, 220, 554, 1502, 284, 2948, 1729, 12, 20676, 3628, 4069, 11, 63, 74, 11639, 13083, 6, 63, 318, 198, 220, 220, 220, 220, 220, 220, 220, 15009, 780, 13092, 284, 8633, 3419, 3848, 428, 708, 81, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 6371, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 10134, 62, 36604, 318, 10352, 290, 479, 14512, 366, 13083, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 12853, 62, 36604, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1005, 796, 651, 35226, 7, 944, 11, 479, 11, 6045, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 1005, 393, 468, 35226, 7, 944, 11, 479, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 1005, 628, 220, 220, 220, 220, 220, 220, 220, 5298, 3460, 4163, 12331, 10786, 15252, 468, 645, 11688, 45144, 36786, 4458, 18982, 7, 74, 4008, 628, 220, 220, 220, 825, 4808, 29572, 62, 27160, 7, 944, 11, 3815, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 23042, 274, 3815, 2315, 1822, 13, 628, 220, 220, 220, 220, 220, 220, 220, 23042, 274, 3815, 8633, 379, 2315, 290, 5621, 2134, 12608, 351, 262, 198, 220, 220, 220, 220, 220, 220, 220, 3815, 1626, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 329, 479, 11, 410, 287, 3815, 13, 23814, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 318, 39098, 7, 85, 11, 8633, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 35847, 796, 651, 35226, 7, 944, 13, 834, 4871, 834, 11, 479, 11, 6045, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 479, 6624, 366, 23144, 62, 25747, 1, 393, 468, 35226, 7, 5460, 929, 11, 45434, 17752, 62, 3245, 1, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 2860, 62, 23870, 19510, 74, 11, 410, 13, 30073, 3419, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 900, 35226, 7, 944, 11, 479, 11, 410, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2555, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 479, 62, 437, 4122, 796, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 366, 6371, 1, 287, 410, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 479, 62, 6978, 62, 4868, 796, 410, 14692, 6371, 1, 4083, 35312, 7203, 14, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 366, 15042, 1, 287, 479, 62, 6978, 62, 4868, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11677, 796, 479, 62, 6978, 62, 4868, 13, 9630, 7203, 15042, 4943, 1343, 352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 18896, 7, 74, 62, 6978, 62, 4868, 58, 28968, 25, 12962, 1875, 657, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 290, 479, 62, 6978, 62, 4868, 58, 28968, 25, 7131, 15, 60, 6624, 366, 15042, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 7386, 1438, 318, 366, 15042, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11677, 796, 11677, 1343, 352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 18896, 7, 74, 62, 6978, 62, 4868, 58, 28968, 25, 12962, 1875, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 479, 62, 1324, 796, 479, 62, 6978, 62, 4868, 58, 28968, 25, 7131, 15, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 479, 62, 3672, 796, 479, 62, 6978, 62, 4868, 58, 28968, 25, 7131, 16, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 468, 35226, 7, 944, 13, 15042, 11, 479, 62, 1324, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 479, 62, 437, 4122, 796, 279, 2047, 316, 3524, 13, 7295, 13, 437, 4122, 13, 59, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5268, 4122, 7, 944, 13, 15042, 11, 651, 35226, 7, 944, 13, 15042, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 479, 62, 1324, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 479, 62, 3672, 11, 2746, 28, 14202, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 35847, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 410, 796, 35847, 7, 85, 11, 2116, 13, 15042, 11, 479, 62, 437, 4122, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 410, 796, 2116, 13, 12286, 62, 1186, 7, 85, 11, 2116, 13, 15042, 11, 479, 62, 437, 4122, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 2860, 62, 23870, 19510, 74, 11, 410, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 318, 39098, 7, 85, 11, 1351, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 410, 796, 685, 4868, 62, 48610, 7, 72, 8, 329, 1312, 287, 410, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 284, 62, 23870, 796, 1351, 7, 85, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 2860, 62, 23870, 19510, 74, 11, 284, 62, 23870, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 2860, 62, 23870, 19510, 74, 11, 410, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 900, 35226, 7, 944, 11, 479, 11, 410, 8, 628, 220, 220, 220, 825, 4808, 5589, 533, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 7293, 3565, 1459, 12608, 284, 3815, 379, 9113, 3920, 13, 628, 220, 220, 220, 220, 220, 220, 220, 554, 1502, 284, 307, 4686, 368, 13059, 298, 356, 1057, 428, 2446, 287, 4600, 21928, 3419, 44646, 628, 220, 220, 220, 220, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 41146, 1988, 11, 6407, 9217, 1459, 4554, 468, 262, 976, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 12608, 355, 262, 3392, 3804, 284, 4600, 27160, 44646, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 46911, 1096, 7, 15003, 28, 17821, 8, 6624, 2116, 13, 46911, 1096, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 10352, 628, 220, 220, 220, 825, 1336, 62, 36604, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 4507, 10640, 262, 8718, 25614, 36123, 611, 705, 6371, 6, 318, 5447, 13, 628, 220, 220, 220, 220, 220, 220, 220, 770, 2446, 481, 48040, 262, 12608, 422, 262, 3703, 198, 220, 220, 220, 220, 220, 220, 220, 36123, 618, 340, 338, 1444, 13, 21394, 262, 1398, 12, 5715, 4600, 10134, 62, 36604, 63, 198, 220, 220, 220, 220, 220, 220, 220, 11688, 618, 340, 338, 1444, 284, 2948, 852, 1444, 517, 198, 220, 220, 220, 220, 220, 220, 220, 621, 1752, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 82, 25, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 6371, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 43089, 796, 19390, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2779, 28, 944, 13, 6371, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11241, 28, 944, 13, 15042, 13, 30001, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6246, 62, 2539, 28, 944, 13, 15042, 13, 29891, 62, 2539, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 264, 6649, 62, 332, 1958, 28, 944, 13, 15042, 13, 45163, 62, 332, 1958, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2638, 62, 29891, 28, 944, 13, 15042, 13, 4023, 62, 29891, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 29572, 62, 27160, 7, 42180, 13, 1136, 28955, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 10134, 62, 36604, 796, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 10352, 628, 220, 220, 220, 825, 11389, 1096, 7, 944, 11, 28376, 28, 25101, 11, 2315, 28, 25101, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 32634, 4340, 281, 2134, 628, 220, 220, 220, 220, 220, 220, 220, 21429, 82, 477, 262, 12608, 287, 281, 2134, 290, 8075, 257, 8633, 326, 198, 220, 220, 220, 220, 220, 220, 220, 460, 307, 2900, 656, 262, 33918, 326, 2010, 3524, 318, 12451, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1002, 281, 11688, 338, 1988, 318, 257, 7559, 23739, 15506, 2099, 340, 338, 6928, 351, 198, 220, 220, 220, 220, 220, 220, 220, 262, 7559, 312, 15506, 2214, 286, 326, 2134, 13, 628, 220, 220, 220, 220, 220, 220, 220, 11485, 3465, 3712, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8554, 428, 284, 651, 257, 22155, 10552, 286, 262, 1700, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 30170, 13, 632, 338, 2192, 1365, 284, 3350, 284, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2427, 13, 4091, 13266, 2205, 8841, 329, 1672, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 82, 25, 8633, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 28376, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 651, 62, 7783, 7, 944, 8, 628, 220, 220, 220, 220, 220, 220, 220, 611, 2315, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2315, 62, 12786, 796, 8633, 7, 944, 13557, 15003, 62, 23870, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1005, 796, 23884, 198, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 8633, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1459, 62, 2100, 796, 651, 35226, 7, 944, 11, 1312, 8, 611, 407, 2315, 2073, 2315, 62, 12786, 13, 1136, 7, 72, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 1312, 6624, 366, 23144, 62, 25747, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1005, 58, 72, 60, 796, 27172, 268, 62, 23144, 7, 14421, 62, 2100, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 318, 39098, 7, 14421, 62, 2100, 11, 13266, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1459, 62, 2100, 796, 651, 35226, 7, 14421, 62, 2100, 11, 366, 46911, 1096, 4943, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 28376, 28, 17821, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 318, 39098, 7, 14421, 62, 2100, 11, 1351, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1459, 62, 2100, 796, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 410, 13, 312, 611, 318, 39098, 7, 85, 11, 13266, 8, 2073, 410, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 410, 287, 1459, 62, 2100, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2361, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 1312, 287, 39498, 62, 1921, 62, 28480, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1459, 62, 2100, 796, 1351, 7, 2617, 7, 14421, 62, 2100, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1005, 58, 72, 60, 796, 1459, 62, 2100, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 1005, 628, 220, 220, 220, 825, 3613, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 50, 3080, 2458, 284, 281, 4683, 2134, 13, 628, 220, 220, 220, 220, 220, 220, 220, 33687, 257, 814, 1022, 262, 5563, 1459, 1181, 290, 663, 1181, 379, 2315, 198, 220, 220, 220, 220, 220, 220, 220, 290, 12800, 606, 355, 257, 22155, 284, 19390, 13, 17147, 22446, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 82, 25, 6407, 611, 350, 11417, 2581, 373, 4388, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 20688, 25, 628, 220, 220, 220, 220, 220, 220, 220, 13163, 2124, 796, 299, 65, 13, 17896, 320, 13, 42034, 13, 1136, 7, 3672, 11639, 9288, 16, 12, 64, 18, 12, 13165, 16, 65, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 13163, 2124, 13, 46911, 198, 220, 220, 220, 220, 220, 220, 220, 334, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 13163, 2124, 13, 46911, 796, 705, 1065, 2682, 6, 198, 220, 220, 220, 220, 220, 220, 220, 13163, 2124, 13, 21928, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 13163, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 312, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 814, 796, 2116, 13557, 26069, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 814, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11389, 1143, 796, 2116, 13, 46911, 1096, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 43089, 796, 19390, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1994, 28, 944, 13, 312, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2779, 28, 944, 13, 437, 4122, 13, 6371, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11241, 28, 944, 13, 15042, 13, 30001, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6246, 62, 2539, 28, 944, 13, 15042, 13, 29891, 62, 2539, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 264, 6649, 62, 332, 1958, 28, 944, 13, 15042, 13, 45163, 62, 332, 1958, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2638, 62, 29891, 28, 944, 13, 15042, 13, 4023, 62, 29891, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 43089, 13, 17147, 15090, 72, 25, 11389, 1143, 58, 72, 60, 329, 1312, 287, 814, 92, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 6407, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 10352, 628, 220, 220, 220, 825, 4296, 7, 944, 11, 1366, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 10260, 281, 2134, 351, 257, 22155, 13, 628, 220, 220, 220, 220, 220, 220, 220, 21699, 82, 257, 8633, 290, 3544, 340, 284, 4296, 262, 1700, 290, 869, 3613, 22446, 198, 220, 220, 220, 220, 220, 220, 220, 1114, 28376, 290, 3572, 7032, 345, 1549, 1208, 281, 493, 262, 976, 355, 198, 220, 220, 220, 220, 220, 220, 220, 611, 345, 547, 30620, 262, 11688, 290, 4585, 3613, 22446, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 853, 8633, 1366, 25, 28261, 7268, 262, 479, 14, 85, 284, 4296, 262, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1700, 2134, 351, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 82, 25, 6407, 611, 350, 11417, 2581, 373, 4388, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 20688, 25, 628, 220, 220, 220, 220, 220, 220, 220, 13163, 2124, 796, 299, 65, 13, 17896, 320, 13, 42034, 13, 1136, 7, 16, 8, 198, 220, 220, 220, 220, 220, 220, 220, 13163, 2124, 13, 19119, 15090, 198, 220, 220, 220, 220, 220, 220, 220, 2644, 220, 220, 366, 3672, 1298, 366, 9288, 12, 31943, 17, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 2644, 220, 220, 366, 46911, 1298, 366, 24694, 36453, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 2644, 32092, 198, 220, 220, 220, 220, 220, 220, 220, 6407, 628, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 329, 479, 11, 410, 287, 1366, 13, 23814, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 900, 35226, 7, 944, 11, 479, 11, 410, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 21928, 3419, 628, 220, 220, 220, 825, 12233, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 5005, 40676, 281, 4683, 2134, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 7783, 82, 25, 6407, 611, 5550, 2538, 9328, 4905, 373, 4388, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 20688, 25, 628, 220, 220, 220, 220, 220, 220, 220, 13163, 2124, 796, 299, 65, 13, 17896, 320, 13, 42034, 13, 1136, 7, 3672, 11639, 9288, 16, 12, 64, 18, 12, 13165, 16, 65, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 13163, 2124, 13, 33678, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 6407, 198, 220, 220, 220, 220, 220, 220, 220, 13163, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 43089, 796, 19390, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1994, 28, 944, 13, 312, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2779, 28, 944, 13, 437, 4122, 13, 6371, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11241, 28, 944, 13, 15042, 13, 30001, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6246, 62, 2539, 28, 944, 13, 15042, 13, 29891, 62, 2539, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 264, 6649, 62, 332, 1958, 28, 944, 13, 15042, 13, 45163, 62, 332, 1958, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2638, 62, 29891, 28, 944, 13, 15042, 13, 4023, 62, 29891, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 6407, 611, 43089, 13, 33678, 3419, 2073, 10352, 198 ]
2.081573
5,774
class User: """ Class that generates new instances of Users. """ user_list = [] # Empty user list def save_user(self): ''' This method saves User objects into user_list ''' User.user_list.append(self) @classmethod def user_exist(cls,username,password): ''' Method that checks if a user exists from the users list. Boolean: True or false depending if the user exists ''' for user in cls.user_list: if user.username == username and user.password==password: return True return False @classmethod def login(cls,username,password): ''' Method that logs in a user if it exists from the user list. ''' for user in cls.user_list: if user.username == username and user.password==password: return user
[ 4871, 11787, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 5016, 326, 18616, 649, 10245, 286, 18987, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 2836, 62, 4868, 796, 17635, 1303, 33523, 2836, 1351, 198, 220, 220, 220, 198, 220, 220, 220, 825, 3613, 62, 7220, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 770, 2446, 16031, 11787, 5563, 656, 2836, 62, 4868, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 11787, 13, 7220, 62, 4868, 13, 33295, 7, 944, 8, 628, 220, 220, 220, 2488, 4871, 24396, 198, 220, 220, 220, 825, 2836, 62, 38476, 7, 565, 82, 11, 29460, 11, 28712, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 11789, 326, 8794, 611, 257, 2836, 7160, 422, 262, 2985, 1351, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 41146, 25, 6407, 393, 3991, 6906, 611, 262, 2836, 7160, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 329, 2836, 287, 537, 82, 13, 7220, 62, 4868, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 2836, 13, 29460, 6624, 20579, 290, 2836, 13, 28712, 855, 28712, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 6407, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 10352, 628, 198, 220, 220, 220, 2488, 4871, 24396, 198, 220, 220, 220, 825, 17594, 7, 565, 82, 11, 29460, 11, 28712, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 11789, 326, 17259, 287, 257, 2836, 611, 340, 7160, 422, 262, 2836, 1351, 13, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 329, 2836, 287, 537, 82, 13, 7220, 62, 4868, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 2836, 13, 29460, 6624, 20579, 290, 2836, 13, 28712, 855, 28712, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 2836, 628, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 628, 220, 220, 628, 198 ]
2.234597
422
#!/usr/bin/env python import argparse import document_pb2 import struct import gzip import sys if __name__ == '__main__': reader = DocumentStreamReader(parse_command_line().files) for doc in reader: print "%s\t%d bytes" % (doc.url, len(doc.text))
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 11748, 1822, 29572, 198, 11748, 3188, 62, 40842, 17, 198, 11748, 2878, 198, 11748, 308, 13344, 198, 11748, 25064, 628, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 9173, 796, 16854, 12124, 33634, 7, 29572, 62, 21812, 62, 1370, 22446, 16624, 8, 198, 220, 220, 220, 329, 2205, 287, 9173, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 36521, 82, 59, 83, 4, 67, 9881, 1, 4064, 357, 15390, 13, 6371, 11, 18896, 7, 15390, 13, 5239, 4008, 198 ]
2.72449
98
import pytest from shakedown import * import sdk_cmd as cmd import sdk_install as install import sdk_plan as plan import sdk_tasks as tasks import sdk_marathon as marathon import time import json from tests.config import ( PACKAGE_NAME ) NUM_HELLO = 2 NUM_WORLD = 3 secret_content_default = "hello-world-secret-data" secret_content_alternative = "hello-world-secret-data-alternative" secret_options = { "service": { "spec_file": "examples/secrets.yml" }, "hello": { "count": NUM_HELLO, "secret1": "hello-world/secret1", "secret2": "hello-world/secret2" }, "world": { "count": NUM_WORLD, "secret1": "hello-world/secret1", "secret2": "hello-world/secret2", "secret3": "hello-world/secret3" } } options_dcos_space_test = { "service": { "spec_file": "examples/secrets.yml" }, "hello": { "count": NUM_HELLO, "secret1": "hello-world/somePath/secret1", "secret2": "hello-world/somePath/secret2" }, "world": { "count": NUM_WORLD, "secret1": "hello-world/somePath/secret1", "secret2": "hello-world/somePath/secret2", "secret3": "hello-world/somePath/secret3" } } @pytest.mark.sanity @pytest.mark.smoke @pytest.mark.secrets @dcos_1_10 @pytest.mark.sanity @pytest.mark.secrets @dcos_1_10 @pytest.mark.sanity @pytest.mark.secrets @dcos_1_10 @pytest.mark.sanity @pytest.mark.secrets @dcos_1_10 @pytest.mark.sanity @pytest.mark.secrets @pytest.mark.skip(reason="DCOS_SPACE authorization is not working in testing/master. Enable this test later.") @dcos_1_10
[ 11748, 12972, 9288, 198, 6738, 427, 25817, 1330, 1635, 198, 198, 11748, 264, 34388, 62, 28758, 355, 23991, 198, 11748, 264, 34388, 62, 17350, 355, 2721, 198, 11748, 264, 34388, 62, 11578, 355, 1410, 198, 11748, 264, 34388, 62, 83, 6791, 355, 8861, 198, 11748, 264, 34388, 62, 3876, 12938, 355, 22336, 198, 11748, 640, 198, 11748, 33918, 198, 198, 6738, 5254, 13, 11250, 1330, 357, 198, 220, 220, 220, 47035, 11879, 62, 20608, 198, 8, 198, 198, 41359, 62, 13909, 3069, 46, 796, 362, 198, 41359, 62, 45359, 11163, 796, 513, 198, 198, 21078, 62, 11299, 62, 12286, 796, 366, 31373, 12, 6894, 12, 21078, 12, 7890, 1, 198, 21078, 62, 11299, 62, 33645, 876, 796, 366, 31373, 12, 6894, 12, 21078, 12, 7890, 12, 33645, 876, 1, 198, 198, 21078, 62, 25811, 796, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15271, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 16684, 62, 7753, 1298, 366, 1069, 12629, 14, 2363, 8004, 13, 88, 4029, 1, 198, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 366, 31373, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 9127, 1298, 36871, 62, 13909, 3069, 46, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 21078, 16, 1298, 366, 31373, 12, 6894, 14, 21078, 16, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 21078, 17, 1298, 366, 31373, 12, 6894, 14, 21078, 17, 1, 198, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 366, 6894, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 9127, 1298, 36871, 62, 45359, 11163, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 21078, 16, 1298, 366, 31373, 12, 6894, 14, 21078, 16, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 21078, 17, 1298, 366, 31373, 12, 6894, 14, 21078, 17, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 21078, 18, 1298, 366, 31373, 12, 6894, 14, 21078, 18, 1, 198, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 220, 220, 220, 1782, 198, 198, 25811, 62, 67, 6966, 62, 13200, 62, 9288, 796, 1391, 198, 220, 220, 220, 366, 15271, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 16684, 62, 7753, 1298, 366, 1069, 12629, 14, 2363, 8004, 13, 88, 4029, 1, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 31373, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 9127, 1298, 36871, 62, 13909, 3069, 46, 11, 198, 220, 220, 220, 220, 220, 220, 220, 366, 21078, 16, 1298, 366, 31373, 12, 6894, 14, 11246, 15235, 14, 21078, 16, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 21078, 17, 1298, 366, 31373, 12, 6894, 14, 11246, 15235, 14, 21078, 17, 1, 198, 220, 220, 220, 8964, 198, 220, 220, 220, 366, 6894, 1298, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 366, 9127, 1298, 36871, 62, 45359, 11163, 11, 198, 220, 220, 220, 220, 220, 220, 220, 366, 21078, 16, 1298, 366, 31373, 12, 6894, 14, 11246, 15235, 14, 21078, 16, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 21078, 17, 1298, 366, 31373, 12, 6894, 14, 11246, 15235, 14, 21078, 17, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 21078, 18, 1298, 366, 31373, 12, 6894, 14, 11246, 15235, 14, 21078, 18, 1, 198, 220, 220, 220, 1782, 198, 92, 628, 628, 198, 31, 9078, 9288, 13, 4102, 13, 12807, 414, 198, 31, 9078, 9288, 13, 4102, 13, 5796, 2088, 198, 31, 9078, 9288, 13, 4102, 13, 2363, 8004, 198, 31, 67, 6966, 62, 16, 62, 940, 628, 198, 31, 9078, 9288, 13, 4102, 13, 12807, 414, 198, 31, 9078, 9288, 13, 4102, 13, 2363, 8004, 198, 31, 67, 6966, 62, 16, 62, 940, 628, 198, 31, 9078, 9288, 13, 4102, 13, 12807, 414, 198, 31, 9078, 9288, 13, 4102, 13, 2363, 8004, 198, 31, 67, 6966, 62, 16, 62, 940, 628, 198, 31, 9078, 9288, 13, 4102, 13, 12807, 414, 198, 31, 9078, 9288, 13, 4102, 13, 2363, 8004, 198, 31, 67, 6966, 62, 16, 62, 940, 628, 198, 31, 9078, 9288, 13, 4102, 13, 12807, 414, 198, 31, 9078, 9288, 13, 4102, 13, 2363, 8004, 198, 31, 9078, 9288, 13, 4102, 13, 48267, 7, 41181, 2625, 9697, 2640, 62, 4303, 11598, 19601, 318, 407, 1762, 287, 4856, 14, 9866, 13, 27882, 428, 1332, 1568, 19570, 198, 31, 67, 6966, 62, 16, 62, 940, 628, 628, 198 ]
2.148615
794
"""Helper functions for converting beginning whitesspace characters""" import argparse from collections import deque from typing import Callable, List def add_tab_size_option(parser: argparse.ArgumentParser) -> argparse.ArgumentParser: """Add the `--tab-size` option""" parser.add_argument( "--tab-size", type=int, required=False, help="number of whitespaces to substitute tabs with. defaults to 4 spaces", default=4, dest="tab_size", ) return parser def read_file_convert( full_path: str, num_spaces: int, handle_per_line: Callable[[List[str], int], str] ): """Read file and convert its beginning whitespace per line""" lines = _read_lines_rb(full_path) new_lines = [] while lines: encoded_str = handle_per_line(lines, num_spaces) new_lines.append(encoded_str) with open(full_path, mode="wb") as output_file: output_file.writelines(new_lines) def _read_lines_rb(full_path: str) -> deque: """ We need to open using binary and encode/decode appropriate to enforce that files need to be saved with Linux line endings """ with open(full_path, mode="rb") as input_file: lines = input_file.readlines() lines = deque(lines) return lines def print_check_changes_message(): """Print check changes message""" print( 'You can check the changes made. Then simply "git add --update ." and re-commit' ) return 1
[ 37811, 47429, 5499, 329, 23202, 3726, 20542, 408, 10223, 3435, 37811, 198, 198, 11748, 1822, 29572, 198, 6738, 17268, 1330, 390, 4188, 198, 6738, 19720, 1330, 4889, 540, 11, 7343, 628, 198, 4299, 751, 62, 8658, 62, 7857, 62, 18076, 7, 48610, 25, 1822, 29572, 13, 28100, 1713, 46677, 8, 4613, 1822, 29572, 13, 28100, 1713, 46677, 25, 198, 220, 220, 220, 37227, 4550, 262, 4600, 438, 8658, 12, 7857, 63, 3038, 37811, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 7, 198, 220, 220, 220, 220, 220, 220, 220, 366, 438, 8658, 12, 7857, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 2099, 28, 600, 11, 198, 220, 220, 220, 220, 220, 220, 220, 2672, 28, 25101, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 17618, 286, 13216, 43076, 284, 15373, 22524, 351, 13, 26235, 284, 604, 9029, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 4277, 28, 19, 11, 198, 220, 220, 220, 220, 220, 220, 220, 2244, 2625, 8658, 62, 7857, 1600, 198, 220, 220, 220, 1267, 198, 220, 220, 220, 1441, 30751, 628, 198, 4299, 1100, 62, 7753, 62, 1102, 1851, 7, 198, 220, 220, 220, 1336, 62, 6978, 25, 965, 11, 997, 62, 2777, 2114, 25, 493, 11, 5412, 62, 525, 62, 1370, 25, 4889, 540, 30109, 8053, 58, 2536, 4357, 493, 4357, 965, 60, 198, 2599, 198, 220, 220, 220, 37227, 5569, 2393, 290, 10385, 663, 3726, 13216, 10223, 583, 1627, 37811, 198, 220, 220, 220, 3951, 796, 4808, 961, 62, 6615, 62, 26145, 7, 12853, 62, 6978, 8, 198, 220, 220, 220, 649, 62, 6615, 796, 17635, 198, 220, 220, 220, 981, 3951, 25, 198, 220, 220, 220, 220, 220, 220, 220, 30240, 62, 2536, 796, 5412, 62, 525, 62, 1370, 7, 6615, 11, 997, 62, 2777, 2114, 8, 198, 220, 220, 220, 220, 220, 220, 220, 649, 62, 6615, 13, 33295, 7, 12685, 9043, 62, 2536, 8, 628, 220, 220, 220, 351, 1280, 7, 12853, 62, 6978, 11, 4235, 2625, 39346, 4943, 355, 5072, 62, 7753, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5072, 62, 7753, 13, 8933, 20655, 7, 3605, 62, 6615, 8, 628, 198, 4299, 4808, 961, 62, 6615, 62, 26145, 7, 12853, 62, 6978, 25, 965, 8, 4613, 390, 4188, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 775, 761, 284, 1280, 1262, 13934, 290, 37773, 14, 12501, 1098, 5035, 284, 4605, 326, 3696, 761, 284, 307, 7448, 198, 220, 220, 220, 351, 7020, 1627, 38168, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 351, 1280, 7, 12853, 62, 6978, 11, 4235, 2625, 26145, 4943, 355, 5128, 62, 7753, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3951, 796, 5128, 62, 7753, 13, 961, 6615, 3419, 198, 220, 220, 220, 3951, 796, 390, 4188, 7, 6615, 8, 198, 220, 220, 220, 1441, 3951, 628, 198, 4299, 3601, 62, 9122, 62, 36653, 62, 20500, 33529, 198, 220, 220, 220, 37227, 18557, 2198, 2458, 3275, 37811, 198, 220, 220, 220, 3601, 7, 198, 220, 220, 220, 220, 220, 220, 220, 705, 1639, 460, 2198, 262, 2458, 925, 13, 3244, 2391, 366, 18300, 751, 1377, 19119, 22135, 290, 302, 12, 41509, 6, 198, 220, 220, 220, 1267, 198, 220, 220, 220, 1441, 352, 198 ]
2.722426
544
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from buildstream._protos.build.bazel.remote.asset.v1 import remote_asset_pb2 as build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2 class FetchStub(object): """The Fetch service resolves or fetches assets referenced by URI and Qualifiers, returning a Digest for the content in [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage]. As with other services in the Remote Execution API, any call may return an error with a [RetryInfo][google.rpc.RetryInfo] error detail providing information about when the client should retry the request; clients SHOULD respect the information provided. """ def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.FetchBlob = channel.unary_unary( '/build.bazel.remote.asset.v1.Fetch/FetchBlob', request_serializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchBlobRequest.SerializeToString, response_deserializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchBlobResponse.FromString, ) self.FetchDirectory = channel.unary_unary( '/build.bazel.remote.asset.v1.Fetch/FetchDirectory', request_serializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchDirectoryRequest.SerializeToString, response_deserializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.FetchDirectoryResponse.FromString, ) class FetchServicer(object): """The Fetch service resolves or fetches assets referenced by URI and Qualifiers, returning a Digest for the content in [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage]. As with other services in the Remote Execution API, any call may return an error with a [RetryInfo][google.rpc.RetryInfo] error detail providing information about when the client should retry the request; clients SHOULD respect the information provided. """ def FetchBlob(self, request, context): """Resolve or fetch referenced assets, making them available to the caller and other consumers in the [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage]. Servers *MAY* fetch content that they do not already have cached, for any URLs they support. Servers *SHOULD* ensure that referenced files are present in the CAS at the time of the response, and (if supported) that they will remain available for a reasonable period of time. The TTLs of the referenced blobs *SHOULD* be increased if necessary and applicable. In the event that a client receives a reference to content that is no longer present, it *MAY* re-issue the request with `oldest_content_accepted` set to a more recent timestamp than the original attempt, to induce a re-fetch from origin. Servers *MAY* cache fetched content and reuse it for subsequent requests, subject to `oldest_content_accepted`. Servers *MAY* support the complementary [Push][build.bazel.remote.asset.v1.Push] API and allow content to be directly inserted for use in future fetch responses. Servers *MUST* ensure Fetch'd content matches all the specified qualifiers except in the case of previously Push'd resources, for which the server *MAY* trust the pushing client to have set the qualifiers correctly, without validation. Servers not implementing the complementary [Push][build.bazel.remote.asset.v1.Push] API *MUST* reject requests containing qualifiers it does not support. Servers *MAY* transform assets as part of the fetch. For example a tarball fetched by [FetchDirectory][build.bazel.remote.asset.v1.Fetch.FetchDirectory] might be unpacked, or a Git repository fetched by [FetchBlob][build.bazel.remote.asset.v1.Fetch.FetchBlob] might be passed through `git-archive`. Errors handling the requested assets will be returned as gRPC Status errors here; errors outside the server's control will be returned inline in the `status` field of the response (see comment there for details). The possible RPC errors include: * `INVALID_ARGUMENT`: One or more arguments were invalid, such as a qualifier that is not supported by the server. * `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to perform the requested operation. The client may retry after a delay. * `UNAVAILABLE`: Due to a transient condition the operation could not be completed. The client should retry. * `INTERNAL`: An internal error occurred while performing the operation. The client should retry. * `DEADLINE_EXCEEDED`: The fetch could not be completed within the given RPC deadline. The client should retry for at least as long as the value provided in `timeout` field of the request. In the case of unsupported qualifiers, the server *SHOULD* additionally send a [BadRequest][google.rpc.BadRequest] error detail where, for each unsupported qualifier, there is a `FieldViolation` with a `field` of `qualifiers.name` and a `description` of `"{qualifier}" not supported` indicating the name of the unsupported qualifier. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def FetchDirectory(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') # This class is part of an EXPERIMENTAL API. class Fetch(object): """The Fetch service resolves or fetches assets referenced by URI and Qualifiers, returning a Digest for the content in [ContentAddressableStorage][build.bazel.remote.execution.v2.ContentAddressableStorage]. As with other services in the Remote Execution API, any call may return an error with a [RetryInfo][google.rpc.RetryInfo] error detail providing information about when the client should retry the request; clients SHOULD respect the information provided. """ @staticmethod @staticmethod class PushStub(object): """The Push service is complementary to the Fetch, and allows for associating contents of URLs to be returned in future Fetch API calls. As with other services in the Remote Execution API, any call may return an error with a [RetryInfo][google.rpc.RetryInfo] error detail providing information about when the client should retry the request; clients SHOULD respect the information provided. """ def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.PushBlob = channel.unary_unary( '/build.bazel.remote.asset.v1.Push/PushBlob', request_serializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushBlobRequest.SerializeToString, response_deserializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushBlobResponse.FromString, ) self.PushDirectory = channel.unary_unary( '/build.bazel.remote.asset.v1.Push/PushDirectory', request_serializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushDirectoryRequest.SerializeToString, response_deserializer=build_dot_bazel_dot_remote_dot_asset_dot_v1_dot_remote__asset__pb2.PushDirectoryResponse.FromString, ) class PushServicer(object): """The Push service is complementary to the Fetch, and allows for associating contents of URLs to be returned in future Fetch API calls. As with other services in the Remote Execution API, any call may return an error with a [RetryInfo][google.rpc.RetryInfo] error detail providing information about when the client should retry the request; clients SHOULD respect the information provided. """ def PushBlob(self, request, context): """These APIs associate the identifying information of a resource, as indicated by URI and optionally Qualifiers, with content available in the CAS. For example, associating a repository url and a commit id with a Directory Digest. Servers *SHOULD* only allow trusted clients to associate content, and *MAY* only allow certain URIs to be pushed. Clients *MUST* ensure associated content is available in CAS prior to pushing. Clients *MUST* ensure the Qualifiers listed correctly match the contents, and Servers *MAY* trust these values without validation. Fetch servers *MAY* require exact match of all qualifiers when returning content previously pushed, or allow fetching content with only a subset of the qualifiers specified on Push. Clients can specify expiration information that the server *SHOULD* respect. Subsequent requests can be used to alter the expiration time. A minimal compliant Fetch implementation may support only Push'd content and return `NOT_FOUND` for any resource that was not pushed first. Alternatively, a compliant implementation may choose to not support Push and only return resources that can be Fetch'd from origin. Errors will be returned as gRPC Status errors. The possible RPC errors include: * `INVALID_ARGUMENT`: One or more arguments to the RPC were invalid. * `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to perform the requested operation. The client may retry after a delay. * `UNAVAILABLE`: Due to a transient condition the operation could not be completed. The client should retry. * `INTERNAL`: An internal error occurred while performing the operation. The client should retry. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PushDirectory(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') # This class is part of an EXPERIMENTAL API. class Push(object): """The Push service is complementary to the Fetch, and allows for associating contents of URLs to be returned in future Fetch API calls. As with other services in the Remote Execution API, any call may return an error with a [RetryInfo][google.rpc.RetryInfo] error detail providing information about when the client should retry the request; clients SHOULD respect the information provided. """ @staticmethod @staticmethod
[ 2, 2980, 515, 416, 262, 308, 49, 5662, 11361, 8435, 17050, 13877, 13, 8410, 5626, 48483, 0, 198, 37811, 11792, 290, 4382, 6097, 11188, 284, 1237, 672, 3046, 12, 23211, 2594, 526, 15931, 198, 11748, 1036, 14751, 198, 198, 6738, 1382, 5532, 13557, 11235, 418, 13, 11249, 13, 65, 41319, 13, 47960, 13, 562, 316, 13, 85, 16, 1330, 6569, 62, 562, 316, 62, 40842, 17, 355, 1382, 62, 26518, 62, 65, 41319, 62, 26518, 62, 47960, 62, 26518, 62, 562, 316, 62, 26518, 62, 85, 16, 62, 26518, 62, 47960, 834, 562, 316, 834, 40842, 17, 628, 198, 4871, 376, 7569, 1273, 549, 7, 15252, 2599, 198, 220, 220, 220, 37227, 464, 376, 7569, 2139, 38709, 393, 11351, 2052, 6798, 20717, 416, 43975, 290, 198, 220, 220, 220, 9537, 13350, 11, 8024, 257, 44255, 329, 262, 2695, 287, 220, 198, 220, 220, 220, 685, 19746, 20231, 540, 31425, 7131, 11249, 13, 65, 41319, 13, 47960, 13, 18558, 1009, 13, 85, 17, 13, 19746, 20231, 540, 31425, 4083, 628, 220, 220, 220, 1081, 351, 584, 2594, 287, 262, 21520, 37497, 7824, 11, 597, 869, 743, 1441, 281, 198, 220, 220, 220, 4049, 351, 257, 685, 9781, 563, 12360, 7131, 13297, 13, 81, 14751, 13, 9781, 563, 12360, 60, 4049, 3703, 4955, 198, 220, 220, 220, 1321, 546, 618, 262, 5456, 815, 1005, 563, 262, 2581, 26, 7534, 40312, 198, 220, 220, 220, 2461, 262, 1321, 2810, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 6518, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 42316, 273, 13, 628, 220, 220, 220, 220, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6518, 25, 317, 1036, 14751, 13, 29239, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 37, 7569, 3629, 672, 796, 6518, 13, 403, 560, 62, 403, 560, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 31051, 11249, 13, 65, 41319, 13, 47960, 13, 562, 316, 13, 85, 16, 13, 37, 7569, 14, 37, 7569, 3629, 672, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2581, 62, 46911, 7509, 28, 11249, 62, 26518, 62, 65, 41319, 62, 26518, 62, 47960, 62, 26518, 62, 562, 316, 62, 26518, 62, 85, 16, 62, 26518, 62, 47960, 834, 562, 316, 834, 40842, 17, 13, 37, 7569, 3629, 672, 18453, 13, 32634, 1096, 2514, 10100, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2882, 62, 8906, 48499, 7509, 28, 11249, 62, 26518, 62, 65, 41319, 62, 26518, 62, 47960, 62, 26518, 62, 562, 316, 62, 26518, 62, 85, 16, 62, 26518, 62, 47960, 834, 562, 316, 834, 40842, 17, 13, 37, 7569, 3629, 672, 31077, 13, 4863, 10100, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 37, 7569, 43055, 796, 6518, 13, 403, 560, 62, 403, 560, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 31051, 11249, 13, 65, 41319, 13, 47960, 13, 562, 316, 13, 85, 16, 13, 37, 7569, 14, 37, 7569, 43055, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2581, 62, 46911, 7509, 28, 11249, 62, 26518, 62, 65, 41319, 62, 26518, 62, 47960, 62, 26518, 62, 562, 316, 62, 26518, 62, 85, 16, 62, 26518, 62, 47960, 834, 562, 316, 834, 40842, 17, 13, 37, 7569, 43055, 18453, 13, 32634, 1096, 2514, 10100, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2882, 62, 8906, 48499, 7509, 28, 11249, 62, 26518, 62, 65, 41319, 62, 26518, 62, 47960, 62, 26518, 62, 562, 316, 62, 26518, 62, 85, 16, 62, 26518, 62, 47960, 834, 562, 316, 834, 40842, 17, 13, 37, 7569, 43055, 31077, 13, 4863, 10100, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 198, 4871, 376, 7569, 11838, 16647, 7, 15252, 2599, 198, 220, 220, 220, 37227, 464, 376, 7569, 2139, 38709, 393, 11351, 2052, 6798, 20717, 416, 43975, 290, 198, 220, 220, 220, 9537, 13350, 11, 8024, 257, 44255, 329, 262, 2695, 287, 220, 198, 220, 220, 220, 685, 19746, 20231, 540, 31425, 7131, 11249, 13, 65, 41319, 13, 47960, 13, 18558, 1009, 13, 85, 17, 13, 19746, 20231, 540, 31425, 4083, 628, 220, 220, 220, 1081, 351, 584, 2594, 287, 262, 21520, 37497, 7824, 11, 597, 869, 743, 1441, 281, 198, 220, 220, 220, 4049, 351, 257, 685, 9781, 563, 12360, 7131, 13297, 13, 81, 14751, 13, 9781, 563, 12360, 60, 4049, 3703, 4955, 198, 220, 220, 220, 1321, 546, 618, 262, 5456, 815, 1005, 563, 262, 2581, 26, 7534, 40312, 198, 220, 220, 220, 2461, 262, 1321, 2810, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 825, 376, 7569, 3629, 672, 7, 944, 11, 2581, 11, 4732, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 4965, 6442, 393, 21207, 20717, 6798, 11, 1642, 606, 1695, 284, 262, 24955, 290, 198, 220, 220, 220, 220, 220, 220, 220, 584, 7008, 287, 262, 685, 19746, 20231, 540, 31425, 7131, 11249, 13, 65, 41319, 13, 47960, 13, 18558, 1009, 13, 85, 17, 13, 19746, 20231, 540, 31425, 4083, 628, 220, 220, 220, 220, 220, 220, 220, 2930, 690, 1635, 44, 4792, 9, 21207, 2695, 326, 484, 466, 407, 1541, 423, 39986, 11, 329, 597, 198, 220, 220, 220, 220, 220, 220, 220, 32336, 484, 1104, 13, 628, 220, 220, 220, 220, 220, 220, 220, 2930, 690, 1635, 9693, 24010, 9, 4155, 326, 20717, 3696, 389, 1944, 287, 262, 35106, 379, 262, 198, 220, 220, 220, 220, 220, 220, 220, 640, 286, 262, 2882, 11, 290, 357, 361, 4855, 8, 326, 484, 481, 3520, 1695, 198, 220, 220, 220, 220, 220, 220, 220, 329, 257, 6397, 2278, 286, 640, 13, 383, 42654, 82, 286, 262, 20717, 698, 8158, 1635, 9693, 24010, 9, 198, 220, 220, 220, 220, 220, 220, 220, 307, 3220, 611, 3306, 290, 9723, 13, 198, 220, 220, 220, 220, 220, 220, 220, 554, 262, 1785, 326, 257, 5456, 11583, 257, 4941, 284, 2695, 326, 318, 645, 198, 220, 220, 220, 220, 220, 220, 220, 2392, 1944, 11, 340, 1635, 44, 4792, 9, 302, 12, 21949, 262, 2581, 351, 198, 220, 220, 220, 220, 220, 220, 220, 4600, 727, 395, 62, 11299, 62, 13635, 276, 63, 900, 284, 257, 517, 2274, 41033, 621, 262, 2656, 198, 220, 220, 220, 220, 220, 220, 220, 2230, 11, 284, 21155, 257, 302, 12, 69, 7569, 422, 8159, 13, 628, 220, 220, 220, 220, 220, 220, 220, 2930, 690, 1635, 44, 4792, 9, 12940, 11351, 1740, 2695, 290, 32349, 340, 329, 8840, 7007, 11, 198, 220, 220, 220, 220, 220, 220, 220, 2426, 284, 4600, 727, 395, 62, 11299, 62, 13635, 276, 44646, 628, 220, 220, 220, 220, 220, 220, 220, 2930, 690, 1635, 44, 4792, 9, 1104, 262, 32150, 685, 49222, 7131, 11249, 13, 65, 41319, 13, 47960, 13, 562, 316, 13, 85, 16, 13, 49222, 60, 198, 220, 220, 220, 220, 220, 220, 220, 7824, 290, 1249, 2695, 284, 307, 3264, 18846, 329, 779, 287, 2003, 21207, 198, 220, 220, 220, 220, 220, 220, 220, 9109, 13, 628, 220, 220, 220, 220, 220, 220, 220, 2930, 690, 1635, 44, 7759, 9, 4155, 376, 7569, 1549, 2695, 7466, 477, 262, 7368, 198, 220, 220, 220, 220, 220, 220, 220, 40528, 2845, 287, 262, 1339, 286, 4271, 23691, 1549, 4133, 11, 329, 543, 198, 220, 220, 220, 220, 220, 220, 220, 262, 4382, 1635, 44, 4792, 9, 3774, 262, 7796, 5456, 284, 423, 900, 262, 40528, 198, 220, 220, 220, 220, 220, 220, 220, 9380, 11, 1231, 21201, 13, 628, 220, 220, 220, 220, 220, 220, 220, 2930, 690, 407, 15427, 262, 32150, 685, 49222, 7131, 11249, 13, 65, 41319, 13, 47960, 13, 562, 316, 13, 85, 16, 13, 49222, 60, 198, 220, 220, 220, 220, 220, 220, 220, 7824, 1635, 44, 7759, 9, 4968, 7007, 7268, 40528, 340, 857, 407, 1104, 13, 628, 220, 220, 220, 220, 220, 220, 220, 2930, 690, 1635, 44, 4792, 9, 6121, 6798, 355, 636, 286, 262, 21207, 13, 1114, 1672, 257, 198, 220, 220, 220, 220, 220, 220, 220, 13422, 1894, 11351, 1740, 416, 685, 37, 7569, 43055, 7131, 11249, 13, 65, 41319, 13, 47960, 13, 562, 316, 13, 85, 16, 13, 37, 7569, 13, 37, 7569, 43055, 60, 198, 220, 220, 220, 220, 220, 220, 220, 1244, 307, 8593, 6021, 11, 393, 257, 15151, 16099, 198, 220, 220, 220, 220, 220, 220, 220, 11351, 1740, 416, 685, 37, 7569, 3629, 672, 7131, 11249, 13, 65, 41319, 13, 47960, 13, 562, 316, 13, 85, 16, 13, 37, 7569, 13, 37, 7569, 3629, 672, 60, 198, 220, 220, 220, 220, 220, 220, 220, 1244, 307, 3804, 832, 4600, 18300, 12, 17474, 44646, 628, 220, 220, 220, 220, 220, 220, 220, 44225, 9041, 262, 9167, 6798, 481, 307, 4504, 355, 308, 49, 5662, 12678, 8563, 198, 220, 220, 220, 220, 220, 220, 220, 994, 26, 8563, 2354, 262, 4382, 338, 1630, 481, 307, 4504, 26098, 287, 262, 198, 220, 220, 220, 220, 220, 220, 220, 4600, 13376, 63, 2214, 286, 262, 2882, 357, 3826, 2912, 612, 329, 3307, 737, 198, 220, 220, 220, 220, 220, 220, 220, 383, 1744, 39400, 8563, 2291, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 4600, 1268, 23428, 2389, 62, 1503, 38, 5883, 3525, 63, 25, 1881, 393, 517, 7159, 547, 12515, 11, 884, 355, 257, 198, 220, 220, 220, 220, 220, 220, 220, 39265, 326, 318, 407, 4855, 416, 262, 4382, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 4600, 19535, 31033, 62, 6369, 7801, 7759, 1961, 63, 25, 1318, 318, 19022, 32539, 286, 617, 8271, 284, 198, 220, 220, 220, 220, 220, 220, 220, 1620, 262, 9167, 4905, 13, 383, 5456, 743, 1005, 563, 706, 257, 5711, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 4600, 52, 4535, 11731, 4146, 17534, 63, 25, 14444, 284, 257, 32361, 4006, 262, 4905, 714, 407, 307, 198, 220, 220, 220, 220, 220, 220, 220, 5668, 13, 383, 5456, 815, 1005, 563, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 4600, 1268, 31800, 1847, 63, 25, 1052, 5387, 4049, 5091, 981, 9489, 262, 4905, 13, 198, 220, 220, 220, 220, 220, 220, 220, 383, 5456, 815, 1005, 563, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 4600, 7206, 2885, 24027, 62, 6369, 5222, 1961, 1961, 63, 25, 383, 21207, 714, 407, 307, 5668, 1626, 262, 1813, 198, 220, 220, 220, 220, 220, 220, 220, 39400, 12508, 13, 383, 5456, 815, 1005, 563, 329, 379, 1551, 355, 890, 355, 262, 1988, 198, 220, 220, 220, 220, 220, 220, 220, 2810, 287, 4600, 48678, 63, 2214, 286, 262, 2581, 13, 628, 220, 220, 220, 220, 220, 220, 220, 554, 262, 1339, 286, 24222, 40528, 11, 262, 4382, 1635, 9693, 24010, 9, 36527, 198, 220, 220, 220, 220, 220, 220, 220, 3758, 257, 685, 22069, 18453, 7131, 13297, 13, 81, 14751, 13, 22069, 18453, 60, 4049, 3703, 810, 11, 329, 1123, 198, 220, 220, 220, 220, 220, 220, 220, 24222, 39265, 11, 612, 318, 257, 4600, 15878, 33894, 341, 63, 351, 257, 4600, 3245, 63, 286, 198, 220, 220, 220, 220, 220, 220, 220, 4600, 13255, 13350, 13, 3672, 63, 290, 257, 4600, 11213, 63, 286, 4600, 1, 90, 13255, 7483, 36786, 407, 4855, 63, 198, 220, 220, 220, 220, 220, 220, 220, 12739, 262, 1438, 286, 262, 24222, 39265, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 4732, 13, 2617, 62, 8189, 7, 2164, 14751, 13, 19580, 10669, 13, 4944, 3955, 16437, 10979, 1961, 8, 198, 220, 220, 220, 220, 220, 220, 220, 4732, 13, 2617, 62, 36604, 10786, 17410, 407, 9177, 0, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 1892, 3546, 1154, 12061, 12331, 10786, 17410, 407, 9177, 0, 11537, 628, 220, 220, 220, 825, 376, 7569, 43055, 7, 944, 11, 2581, 11, 4732, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 43730, 3917, 10314, 2912, 287, 764, 1676, 1462, 2393, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 4732, 13, 2617, 62, 8189, 7, 2164, 14751, 13, 19580, 10669, 13, 4944, 3955, 16437, 10979, 1961, 8, 198, 220, 220, 220, 220, 220, 220, 220, 4732, 13, 2617, 62, 36604, 10786, 17410, 407, 9177, 0, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 1892, 3546, 1154, 12061, 12331, 10786, 17410, 407, 9177, 0, 11537, 628, 628, 1303, 770, 1398, 318, 636, 286, 281, 7788, 18973, 3955, 3525, 1847, 7824, 13, 198, 4871, 376, 7569, 7, 15252, 2599, 198, 220, 220, 220, 37227, 464, 376, 7569, 2139, 38709, 393, 11351, 2052, 6798, 20717, 416, 43975, 290, 198, 220, 220, 220, 9537, 13350, 11, 8024, 257, 44255, 329, 262, 2695, 287, 220, 198, 220, 220, 220, 685, 19746, 20231, 540, 31425, 7131, 11249, 13, 65, 41319, 13, 47960, 13, 18558, 1009, 13, 85, 17, 13, 19746, 20231, 540, 31425, 4083, 628, 220, 220, 220, 1081, 351, 584, 2594, 287, 262, 21520, 37497, 7824, 11, 597, 869, 743, 1441, 281, 198, 220, 220, 220, 4049, 351, 257, 685, 9781, 563, 12360, 7131, 13297, 13, 81, 14751, 13, 9781, 563, 12360, 60, 4049, 3703, 4955, 198, 220, 220, 220, 1321, 546, 618, 262, 5456, 815, 1005, 563, 262, 2581, 26, 7534, 40312, 198, 220, 220, 220, 2461, 262, 1321, 2810, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 2488, 12708, 24396, 628, 220, 220, 220, 2488, 12708, 24396, 628, 198, 4871, 23691, 1273, 549, 7, 15252, 2599, 198, 220, 220, 220, 37227, 464, 23691, 2139, 318, 32150, 284, 262, 376, 7569, 11, 290, 3578, 329, 198, 220, 220, 220, 2570, 803, 10154, 286, 32336, 284, 307, 4504, 287, 2003, 376, 7569, 7824, 3848, 13, 628, 220, 220, 220, 1081, 351, 584, 2594, 287, 262, 21520, 37497, 7824, 11, 597, 869, 743, 1441, 281, 198, 220, 220, 220, 4049, 351, 257, 685, 9781, 563, 12360, 7131, 13297, 13, 81, 14751, 13, 9781, 563, 12360, 60, 4049, 3703, 4955, 198, 220, 220, 220, 1321, 546, 618, 262, 5456, 815, 1005, 563, 262, 2581, 26, 7534, 40312, 198, 220, 220, 220, 2461, 262, 1321, 2810, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 6518, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 42316, 273, 13, 628, 220, 220, 220, 220, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6518, 25, 317, 1036, 14751, 13, 29239, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 49222, 3629, 672, 796, 6518, 13, 403, 560, 62, 403, 560, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 31051, 11249, 13, 65, 41319, 13, 47960, 13, 562, 316, 13, 85, 16, 13, 49222, 14, 49222, 3629, 672, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2581, 62, 46911, 7509, 28, 11249, 62, 26518, 62, 65, 41319, 62, 26518, 62, 47960, 62, 26518, 62, 562, 316, 62, 26518, 62, 85, 16, 62, 26518, 62, 47960, 834, 562, 316, 834, 40842, 17, 13, 49222, 3629, 672, 18453, 13, 32634, 1096, 2514, 10100, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2882, 62, 8906, 48499, 7509, 28, 11249, 62, 26518, 62, 65, 41319, 62, 26518, 62, 47960, 62, 26518, 62, 562, 316, 62, 26518, 62, 85, 16, 62, 26518, 62, 47960, 834, 562, 316, 834, 40842, 17, 13, 49222, 3629, 672, 31077, 13, 4863, 10100, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 49222, 43055, 796, 6518, 13, 403, 560, 62, 403, 560, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 31051, 11249, 13, 65, 41319, 13, 47960, 13, 562, 316, 13, 85, 16, 13, 49222, 14, 49222, 43055, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2581, 62, 46911, 7509, 28, 11249, 62, 26518, 62, 65, 41319, 62, 26518, 62, 47960, 62, 26518, 62, 562, 316, 62, 26518, 62, 85, 16, 62, 26518, 62, 47960, 834, 562, 316, 834, 40842, 17, 13, 49222, 43055, 18453, 13, 32634, 1096, 2514, 10100, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2882, 62, 8906, 48499, 7509, 28, 11249, 62, 26518, 62, 65, 41319, 62, 26518, 62, 47960, 62, 26518, 62, 562, 316, 62, 26518, 62, 85, 16, 62, 26518, 62, 47960, 834, 562, 316, 834, 40842, 17, 13, 49222, 43055, 31077, 13, 4863, 10100, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 198, 4871, 23691, 11838, 16647, 7, 15252, 2599, 198, 220, 220, 220, 37227, 464, 23691, 2139, 318, 32150, 284, 262, 376, 7569, 11, 290, 3578, 329, 198, 220, 220, 220, 2570, 803, 10154, 286, 32336, 284, 307, 4504, 287, 2003, 376, 7569, 7824, 3848, 13, 628, 220, 220, 220, 1081, 351, 584, 2594, 287, 262, 21520, 37497, 7824, 11, 597, 869, 743, 1441, 281, 198, 220, 220, 220, 4049, 351, 257, 685, 9781, 563, 12360, 7131, 13297, 13, 81, 14751, 13, 9781, 563, 12360, 60, 4049, 3703, 4955, 198, 220, 220, 220, 1321, 546, 618, 262, 5456, 815, 1005, 563, 262, 2581, 26, 7534, 40312, 198, 220, 220, 220, 2461, 262, 1321, 2810, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 825, 23691, 3629, 672, 7, 944, 11, 2581, 11, 4732, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 4711, 23113, 11602, 262, 13720, 1321, 286, 257, 8271, 11, 355, 198, 220, 220, 220, 220, 220, 220, 220, 8203, 416, 43975, 290, 42976, 9537, 13350, 11, 351, 2695, 1695, 287, 262, 198, 220, 220, 220, 220, 220, 220, 220, 35106, 13, 1114, 1672, 11, 2570, 803, 257, 16099, 19016, 290, 257, 4589, 4686, 351, 257, 198, 220, 220, 220, 220, 220, 220, 220, 27387, 44255, 13, 628, 220, 220, 220, 220, 220, 220, 220, 2930, 690, 1635, 9693, 24010, 9, 691, 1249, 13467, 7534, 284, 11602, 2695, 11, 290, 1635, 44, 4792, 9, 198, 220, 220, 220, 220, 220, 220, 220, 691, 1249, 1728, 37902, 3792, 284, 307, 7121, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1012, 2334, 1635, 44, 7759, 9, 4155, 3917, 2695, 318, 1695, 287, 35106, 3161, 284, 198, 220, 220, 220, 220, 220, 220, 220, 7796, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1012, 2334, 1635, 44, 7759, 9, 4155, 262, 9537, 13350, 5610, 9380, 2872, 262, 10154, 11, 198, 220, 220, 220, 220, 220, 220, 220, 290, 2930, 690, 1635, 44, 4792, 9, 3774, 777, 3815, 1231, 21201, 13, 198, 220, 220, 220, 220, 220, 220, 220, 376, 7569, 9597, 1635, 44, 4792, 9, 2421, 2748, 2872, 286, 477, 40528, 618, 8024, 198, 220, 220, 220, 220, 220, 220, 220, 2695, 4271, 7121, 11, 393, 1249, 21207, 278, 2695, 351, 691, 257, 24637, 286, 198, 220, 220, 220, 220, 220, 220, 220, 262, 40528, 7368, 319, 23691, 13, 628, 220, 220, 220, 220, 220, 220, 220, 1012, 2334, 460, 11986, 28385, 1321, 326, 262, 4382, 1635, 9693, 24010, 9, 198, 220, 220, 220, 220, 220, 220, 220, 2461, 13, 3834, 44399, 7007, 460, 307, 973, 284, 8343, 262, 28385, 640, 13, 628, 220, 220, 220, 220, 220, 220, 220, 317, 10926, 31332, 376, 7569, 7822, 743, 1104, 691, 23691, 1549, 2695, 198, 220, 220, 220, 220, 220, 220, 220, 290, 1441, 4600, 11929, 62, 37, 15919, 63, 329, 597, 8271, 326, 373, 407, 7121, 717, 13, 198, 220, 220, 220, 220, 220, 220, 220, 25929, 11, 257, 31332, 7822, 743, 3853, 284, 407, 1104, 23691, 198, 220, 220, 220, 220, 220, 220, 220, 290, 691, 1441, 4133, 326, 460, 307, 376, 7569, 1549, 422, 8159, 13, 628, 220, 220, 220, 220, 220, 220, 220, 44225, 481, 307, 4504, 355, 308, 49, 5662, 12678, 8563, 13, 198, 220, 220, 220, 220, 220, 220, 220, 383, 1744, 39400, 8563, 2291, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 4600, 1268, 23428, 2389, 62, 1503, 38, 5883, 3525, 63, 25, 1881, 393, 517, 7159, 284, 262, 39400, 547, 12515, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 4600, 19535, 31033, 62, 6369, 7801, 7759, 1961, 63, 25, 1318, 318, 19022, 32539, 286, 617, 8271, 284, 198, 220, 220, 220, 220, 220, 220, 220, 1620, 262, 9167, 4905, 13, 383, 5456, 743, 1005, 563, 706, 257, 5711, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 4600, 52, 4535, 11731, 4146, 17534, 63, 25, 14444, 284, 257, 32361, 4006, 262, 4905, 714, 407, 307, 198, 220, 220, 220, 220, 220, 220, 220, 5668, 13, 383, 5456, 815, 1005, 563, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1635, 4600, 1268, 31800, 1847, 63, 25, 1052, 5387, 4049, 5091, 981, 9489, 262, 4905, 13, 198, 220, 220, 220, 220, 220, 220, 220, 383, 5456, 815, 1005, 563, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 4732, 13, 2617, 62, 8189, 7, 2164, 14751, 13, 19580, 10669, 13, 4944, 3955, 16437, 10979, 1961, 8, 198, 220, 220, 220, 220, 220, 220, 220, 4732, 13, 2617, 62, 36604, 10786, 17410, 407, 9177, 0, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 1892, 3546, 1154, 12061, 12331, 10786, 17410, 407, 9177, 0, 11537, 628, 220, 220, 220, 825, 23691, 43055, 7, 944, 11, 2581, 11, 4732, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 43730, 3917, 10314, 2912, 287, 764, 1676, 1462, 2393, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 4732, 13, 2617, 62, 8189, 7, 2164, 14751, 13, 19580, 10669, 13, 4944, 3955, 16437, 10979, 1961, 8, 198, 220, 220, 220, 220, 220, 220, 220, 4732, 13, 2617, 62, 36604, 10786, 17410, 407, 9177, 0, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 1892, 3546, 1154, 12061, 12331, 10786, 17410, 407, 9177, 0, 11537, 628, 628, 1303, 770, 1398, 318, 636, 286, 281, 7788, 18973, 3955, 3525, 1847, 7824, 13, 198, 4871, 23691, 7, 15252, 2599, 198, 220, 220, 220, 37227, 464, 23691, 2139, 318, 32150, 284, 262, 376, 7569, 11, 290, 3578, 329, 198, 220, 220, 220, 2570, 803, 10154, 286, 32336, 284, 307, 4504, 287, 2003, 376, 7569, 7824, 3848, 13, 628, 220, 220, 220, 1081, 351, 584, 2594, 287, 262, 21520, 37497, 7824, 11, 597, 869, 743, 1441, 281, 198, 220, 220, 220, 4049, 351, 257, 685, 9781, 563, 12360, 7131, 13297, 13, 81, 14751, 13, 9781, 563, 12360, 60, 4049, 3703, 4955, 198, 220, 220, 220, 1321, 546, 618, 262, 5456, 815, 1005, 563, 262, 2581, 26, 7534, 40312, 198, 220, 220, 220, 2461, 262, 1321, 2810, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 2488, 12708, 24396, 628, 220, 220, 220, 2488, 12708, 24396, 198 ]
2.944543
3,931
import logging import time import typing class ShutdownMessage(Message): """This message tells the observers that they should save their data."""
[ 11748, 18931, 198, 11748, 640, 198, 11748, 19720, 628, 628, 628, 198, 198, 4871, 40411, 12837, 7, 12837, 2599, 198, 220, 220, 220, 37227, 1212, 3275, 4952, 262, 17984, 326, 484, 815, 3613, 511, 1366, 526, 15931, 198 ]
4.131579
38
# ======================================== # [] File Name : model.py # # [] Creation Date : January 2018 # # [] Created By : Ali Gholami ([email protected]) # ======================================== """ Training and Validation on notMNIST Dataset Fully connected network implementation with tensorflow """ import pickle as pickle import numpy as np import tensorflow as tf # Data destination path PICKLE_FILE = "../../../data/notMNIST.pickle" # Load the data to the RAM with open(PICKLE_FILE, "rb") as f: SAVE_FILE = pickle.load(f) TRAIN_DATASET = SAVE_FILE['train_dataset'] TRAIN_LABELS = SAVE_FILE['train_labels'] VALID_DATASET = SAVE_FILE['valid_dataset'] VALID_LABELS = SAVE_FILE['valid_labels'] TEST_DATASET = SAVE_FILE['test_dataset'] TEST_LABELS = SAVE_FILE['test_labels'] # Free some memory del SAVE_FILE # Reformat to the one-hot encoding mode # def reformatData(dataset, labels): IMAGE_SIZE = 28 NUM_LABELS = 10 def accuracy(predictions, labels): """ Divides the number of true predictions to the number of total predictions """ return (100.0 * np.sum(np.argmax(predictions, 1) == np.argmax(labels, 1)) / predictions.shape[0]) def reformat(dataset, labels): """ Reformat data to the one-hot and flattened mode """ n_dataset = dataset.reshape((-1, IMAGE_SIZE * IMAGE_SIZE)).astype(np.float32) # Convert to the one hot format n_labels = (np.arange(NUM_LABELS) == labels[:, None]).astype(np.float32) return n_dataset, n_labels TRAIN_DATASET, TRAIN_LABELS = reformat(TRAIN_DATASET, TRAIN_LABELS) VALID_DATASET, VALID_LABELS = reformat(VALID_DATASET, VALID_LABELS) TEST_DATASET, TEST_LABELS = reformat(TEST_DATASET, TEST_LABELS) # Display the openend files print("Training Set ", TRAIN_DATASET.shape, TRAIN_LABELS.shape) print("Validation Set", VALID_DATASET.shape, VALID_LABELS.shape) print("Test Set", TEST_DATASET.shape, TEST_LABELS.shape) # Implements a gradient descent using tensorflow computational graph TRAIN_SUBSET = 10000 GRAPH = tf.Graph() with GRAPH.as_default(): """ Load the training, validation and test data into the constants attached to the graph """ TF_TRAIN_DATASET = tf.constant(TRAIN_DATASET[:TRAIN_SUBSET, :]) TF_TRAIN_LABELS = tf.constant(TRAIN_LABELS[:TRAIN_SUBSET]) TF_VALID_DATASET = tf.constant(VALID_DATASET[:TRAIN_SUBSET]) TF_TEST_DATASET = tf.constant(TEST_DATASET[:TRAIN_SUBSET]) """ Initialize the weights matrix with normal distribution and the biases with zero values """ WEIGHTS = tf.Variable(tf.truncated_normal([IMAGE_SIZE * IMAGE_SIZE, NUM_LABELS])) BIASES = tf.Variable(tf.zeros([NUM_LABELS])) """ Compute the logits WX + b and then apply D(S(WX + b), L) on them """ LOGITS = tf.matmul(TF_TRAIN_DATASET, WEIGHTS) + BIASES LOSS = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels = TF_TRAIN_LABELS, logits = LOGITS)) """ Find the minimum of the loss using gradient descent optimizer remember that the optimizer is an algorithm now - ready to be tested on the test data """ OPTIMIZER = tf.train.GradientDescentOptimizer(0.1).minimize(LOSS) """ Predictions for the training, validation, and test data. """ TRAIN_PREDICTION = tf.nn.softmax(LOGITS) VALID_PREDICTION = tf.nn.softmax(tf.matmul(TF_VALID_DATASET, WEIGHTS) + BIASES) TEST_PREDICTION = tf.nn.softmax(tf.matmul(TF_TEST_DATASET, WEIGHTS) + BIASES) NUM_ITERATIONS = 3000 with tf.Session(graph=GRAPH) as session: """ Start the above variable initialization """ tf.initialize_all_variables().run() print("Variables initialized") for step in range(NUM_ITERATIONS): _, l, predictions = session.run([OPTIMIZER, LOSS, TRAIN_PREDICTION]) if(step % 100 == 0): print("Loss at step ", step, ": ", l) print("Training accuracy: ", accuracy(predictions, TRAIN_LABELS[:TRAIN_SUBSET, :])) """ Displays the test prediction results """ print("Validation accuracy: ", accuracy(VALID_PREDICTION.eval(), VALID_LABELS)) print("Test accuracy: ", accuracy(TEST_PREDICTION.eval(), TEST_LABELS))
[ 2, 46111, 1421, 18604, 198, 2, 17635, 9220, 6530, 1058, 2746, 13, 9078, 198, 2, 198, 2, 17635, 21582, 7536, 1058, 3269, 2864, 198, 2, 198, 2, 17635, 15622, 2750, 1058, 12104, 402, 3937, 6277, 357, 282, 394, 349, 6277, 2425, 4846, 31, 14816, 13, 785, 8, 198, 2, 46111, 1421, 18604, 198, 198, 37811, 198, 220, 220, 220, 13614, 290, 3254, 24765, 319, 407, 39764, 8808, 16092, 292, 316, 198, 220, 220, 220, 40234, 5884, 3127, 7822, 351, 11192, 273, 11125, 198, 37811, 198, 11748, 2298, 293, 355, 2298, 293, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 198, 2, 6060, 10965, 3108, 198, 47, 11860, 2538, 62, 25664, 796, 366, 40720, 40720, 40720, 7890, 14, 1662, 39764, 8808, 13, 27729, 293, 1, 198, 198, 2, 8778, 262, 1366, 284, 262, 13931, 198, 4480, 1280, 7, 47, 11860, 2538, 62, 25664, 11, 366, 26145, 4943, 355, 277, 25, 198, 220, 220, 220, 14719, 6089, 62, 25664, 796, 2298, 293, 13, 2220, 7, 69, 8, 628, 220, 220, 220, 29125, 1268, 62, 35, 1404, 1921, 2767, 796, 14719, 6089, 62, 25664, 17816, 27432, 62, 19608, 292, 316, 20520, 198, 220, 220, 220, 29125, 1268, 62, 48780, 37142, 796, 14719, 6089, 62, 25664, 17816, 27432, 62, 23912, 1424, 20520, 628, 220, 220, 220, 26173, 2389, 62, 35, 1404, 1921, 2767, 796, 14719, 6089, 62, 25664, 17816, 12102, 62, 19608, 292, 316, 20520, 198, 220, 220, 220, 26173, 2389, 62, 48780, 37142, 796, 14719, 6089, 62, 25664, 17816, 12102, 62, 23912, 1424, 20520, 628, 220, 220, 220, 43001, 62, 35, 1404, 1921, 2767, 796, 14719, 6089, 62, 25664, 17816, 9288, 62, 19608, 292, 316, 20520, 198, 220, 220, 220, 43001, 62, 48780, 37142, 796, 14719, 6089, 62, 25664, 17816, 9288, 62, 23912, 1424, 20520, 628, 220, 220, 220, 1303, 3232, 617, 4088, 198, 220, 220, 220, 1619, 14719, 6089, 62, 25664, 198, 198, 2, 17893, 265, 284, 262, 530, 12, 8940, 21004, 4235, 198, 2, 825, 4975, 265, 6601, 7, 19608, 292, 316, 11, 14722, 2599, 198, 3955, 11879, 62, 33489, 796, 2579, 198, 41359, 62, 48780, 37142, 796, 838, 198, 198, 4299, 9922, 7, 28764, 9278, 11, 14722, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 4777, 1460, 262, 1271, 286, 2081, 16277, 284, 262, 1271, 286, 2472, 16277, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1441, 357, 3064, 13, 15, 1635, 45941, 13, 16345, 7, 37659, 13, 853, 9806, 7, 28764, 9278, 11, 352, 8, 6624, 45941, 13, 853, 9806, 7, 23912, 1424, 11, 352, 4008, 1220, 16277, 13, 43358, 58, 15, 12962, 198, 198, 4299, 4975, 265, 7, 19608, 292, 316, 11, 14722, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 17893, 265, 1366, 284, 262, 530, 12, 8940, 290, 45096, 4235, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 299, 62, 19608, 292, 316, 796, 27039, 13, 3447, 1758, 19510, 12, 16, 11, 8959, 11879, 62, 33489, 1635, 8959, 11879, 62, 33489, 29720, 459, 2981, 7, 37659, 13, 22468, 2624, 8, 628, 220, 220, 220, 1303, 38240, 284, 262, 530, 3024, 5794, 198, 220, 220, 220, 299, 62, 23912, 1424, 796, 357, 37659, 13, 283, 858, 7, 41359, 62, 48780, 37142, 8, 6624, 14722, 58, 45299, 6045, 35944, 459, 2981, 7, 37659, 13, 22468, 2624, 8, 628, 220, 220, 220, 1441, 299, 62, 19608, 292, 316, 11, 299, 62, 23912, 1424, 198, 198, 51, 3861, 1268, 62, 35, 1404, 1921, 2767, 11, 29125, 1268, 62, 48780, 37142, 796, 4975, 265, 7, 51, 3861, 1268, 62, 35, 1404, 1921, 2767, 11, 29125, 1268, 62, 48780, 37142, 8, 198, 23428, 2389, 62, 35, 1404, 1921, 2767, 11, 26173, 2389, 62, 48780, 37142, 796, 4975, 265, 7, 23428, 2389, 62, 35, 1404, 1921, 2767, 11, 26173, 2389, 62, 48780, 37142, 8, 198, 51, 6465, 62, 35, 1404, 1921, 2767, 11, 43001, 62, 48780, 37142, 796, 4975, 265, 7, 51, 6465, 62, 35, 1404, 1921, 2767, 11, 43001, 62, 48780, 37142, 8, 198, 198, 2, 16531, 262, 1280, 437, 3696, 198, 4798, 7203, 44357, 5345, 33172, 29125, 1268, 62, 35, 1404, 1921, 2767, 13, 43358, 11, 29125, 1268, 62, 48780, 37142, 13, 43358, 8, 198, 4798, 7203, 7762, 24765, 5345, 1600, 26173, 2389, 62, 35, 1404, 1921, 2767, 13, 43358, 11, 26173, 2389, 62, 48780, 37142, 13, 43358, 8, 198, 4798, 7203, 14402, 5345, 1600, 43001, 62, 35, 1404, 1921, 2767, 13, 43358, 11, 43001, 62, 48780, 37142, 13, 43358, 8, 198, 198, 2, 1846, 1154, 902, 257, 31312, 18598, 1262, 11192, 273, 11125, 31350, 4823, 198, 51, 3861, 1268, 62, 12564, 4462, 2767, 796, 33028, 198, 198, 10761, 31300, 796, 48700, 13, 37065, 3419, 198, 198, 4480, 10863, 31300, 13, 292, 62, 12286, 33529, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 8778, 262, 3047, 11, 21201, 290, 1332, 1366, 656, 262, 38491, 7223, 284, 262, 4823, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 24958, 62, 51, 3861, 1268, 62, 35, 1404, 1921, 2767, 796, 48700, 13, 9979, 415, 7, 51, 3861, 1268, 62, 35, 1404, 1921, 2767, 58, 25, 51, 3861, 1268, 62, 12564, 4462, 2767, 11, 1058, 12962, 198, 220, 220, 220, 24958, 62, 51, 3861, 1268, 62, 48780, 37142, 796, 48700, 13, 9979, 415, 7, 51, 3861, 1268, 62, 48780, 37142, 58, 25, 51, 3861, 1268, 62, 12564, 4462, 2767, 12962, 198, 220, 220, 220, 24958, 62, 23428, 2389, 62, 35, 1404, 1921, 2767, 796, 48700, 13, 9979, 415, 7, 23428, 2389, 62, 35, 1404, 1921, 2767, 58, 25, 51, 3861, 1268, 62, 12564, 4462, 2767, 12962, 198, 220, 220, 220, 24958, 62, 51, 6465, 62, 35, 1404, 1921, 2767, 796, 48700, 13, 9979, 415, 7, 51, 6465, 62, 35, 1404, 1921, 2767, 58, 25, 51, 3861, 1268, 62, 12564, 4462, 2767, 12962, 628, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 20768, 1096, 262, 19590, 17593, 351, 3487, 6082, 290, 262, 29275, 351, 6632, 3815, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 12887, 34874, 796, 48700, 13, 43015, 7, 27110, 13, 2213, 19524, 515, 62, 11265, 26933, 3955, 11879, 62, 33489, 1635, 8959, 11879, 62, 33489, 11, 36871, 62, 48780, 37142, 60, 4008, 198, 220, 220, 220, 20068, 1921, 1546, 796, 48700, 13, 43015, 7, 27110, 13, 9107, 418, 26933, 41359, 62, 48780, 37142, 60, 4008, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 3082, 1133, 262, 2604, 896, 370, 55, 1343, 275, 290, 788, 4174, 360, 7, 50, 7, 54, 55, 1343, 275, 828, 406, 8, 319, 606, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 41605, 29722, 796, 48700, 13, 6759, 76, 377, 7, 10234, 62, 51, 3861, 1268, 62, 35, 1404, 1921, 2767, 11, 12887, 34874, 8, 1343, 20068, 1921, 1546, 198, 220, 220, 220, 406, 18420, 796, 48700, 13, 445, 7234, 62, 32604, 7, 27110, 13, 20471, 13, 4215, 9806, 62, 19692, 62, 298, 28338, 62, 4480, 62, 6404, 896, 7, 23912, 1424, 796, 24958, 62, 51, 3861, 1268, 62, 48780, 37142, 11, 2604, 896, 796, 41605, 29722, 4008, 628, 220, 220, 220, 37227, 220, 198, 220, 220, 220, 220, 220, 220, 220, 9938, 262, 5288, 286, 262, 2994, 1262, 31312, 18598, 6436, 7509, 198, 220, 220, 220, 220, 220, 220, 220, 3505, 326, 262, 6436, 7509, 318, 281, 11862, 783, 532, 3492, 284, 307, 6789, 319, 262, 1332, 1366, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 39852, 3955, 14887, 1137, 796, 48700, 13, 27432, 13, 42731, 1153, 5960, 1087, 27871, 320, 7509, 7, 15, 13, 16, 737, 1084, 48439, 7, 43, 18420, 8, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 14322, 9278, 329, 262, 3047, 11, 21201, 11, 290, 1332, 1366, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 29125, 1268, 62, 4805, 1961, 18379, 2849, 796, 48700, 13, 20471, 13, 4215, 9806, 7, 25294, 29722, 8, 198, 220, 220, 220, 26173, 2389, 62, 4805, 1961, 18379, 2849, 796, 48700, 13, 20471, 13, 4215, 9806, 7, 27110, 13, 6759, 76, 377, 7, 10234, 62, 23428, 2389, 62, 35, 1404, 1921, 2767, 11, 12887, 34874, 8, 1343, 20068, 1921, 1546, 8, 198, 220, 220, 220, 43001, 62, 4805, 1961, 18379, 2849, 796, 48700, 13, 20471, 13, 4215, 9806, 7, 27110, 13, 6759, 76, 377, 7, 10234, 62, 51, 6465, 62, 35, 1404, 1921, 2767, 11, 12887, 34874, 8, 1343, 20068, 1921, 1546, 8, 198, 198, 41359, 62, 2043, 1137, 18421, 796, 20343, 198, 198, 4480, 48700, 13, 36044, 7, 34960, 28, 10761, 31300, 8, 355, 6246, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 7253, 262, 2029, 7885, 37588, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 48700, 13, 36733, 1096, 62, 439, 62, 25641, 2977, 22446, 5143, 3419, 198, 220, 220, 220, 3601, 7203, 23907, 2977, 23224, 4943, 628, 220, 220, 220, 329, 2239, 287, 2837, 7, 41359, 62, 2043, 1137, 18421, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 11, 300, 11, 16277, 796, 6246, 13, 5143, 26933, 3185, 51, 3955, 14887, 1137, 11, 406, 18420, 11, 29125, 1268, 62, 4805, 1961, 18379, 2849, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 7, 9662, 4064, 1802, 6624, 657, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 43, 793, 379, 2239, 33172, 2239, 11, 366, 25, 33172, 300, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 44357, 9922, 25, 33172, 9922, 7, 28764, 9278, 11, 29125, 1268, 62, 48780, 37142, 58, 25, 51, 3861, 1268, 62, 12564, 4462, 2767, 11, 1058, 60, 4008, 198, 220, 220, 220, 220, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 3167, 26024, 262, 1332, 17724, 2482, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3601, 7203, 7762, 24765, 9922, 25, 33172, 9922, 7, 23428, 2389, 62, 4805, 1961, 18379, 2849, 13, 18206, 22784, 26173, 2389, 62, 48780, 37142, 4008, 198, 220, 220, 220, 3601, 7203, 14402, 9922, 25, 33172, 9922, 7, 51, 6465, 62, 4805, 1961, 18379, 2849, 13, 18206, 22784, 43001, 62, 48780, 37142, 4008, 628, 628, 220, 220, 220, 220, 628, 220, 220, 220, 220, 628, 198 ]
2.471404
1,731
import re
[ 11748, 302, 628, 628 ]
3.25
4
""" Tests on the swap test in the circuit_primitives module """ import numpy as np import pytest from unittest.mock import patch from pyquil import Program from pyquil.gates import CSWAP, H from grove.circuit_primitives.swap import (swap_circuit_generator, run_swap_test, RegisterSizeMismatch) def test_swap_circuit_gen_type(): """ Test the type checking """ with pytest.raises(TypeError): swap_circuit_generator(5, [1, 2], 0) with pytest.raises(TypeError): swap_circuit_generator([1, 2], 5, 0) with pytest.raises(RegisterSizeMismatch): swap_circuit_generator([1, 2], [3], 0) def test_default_ancilla_assignment(): """ Make sure ancilla is assigned to max(regA + regB) + 1 by default :return: """ test_prog_for_ancilla = swap_circuit_generator([1, 2], [5, 6], None) instruction = test_prog_for_ancilla.pop() assert instruction.qubits[0].index == 7 def test_cswap_program(): """ Test if the correct program is returned. Half way to system test """ test_prog = swap_circuit_generator([1, 2], [5, 6], None) true_prog = Program() true_prog += H(7) true_prog += CSWAP(7, 1, 5) true_prog += CSWAP(7, 2, 6) true_prog += H(7) assert test_prog.out() == true_prog.out() def test_run_swap(): """ Test the qvm return piece """ expected_bitstring = [1, 1, 1, 0, 0, 0, 0, 0, 0] prog_a = Program().inst(H(0)) prog_b = Program().inst(H(1)) with patch("pyquil.api.QuantumComputer") as qc: qc.run.return_value = expected_bitstring test_overlap = run_swap_test(prog_a, prog_b, number_of_measurements=5, quantum_resource=qc) assert np.isclose(np.sqrt(1 - 2 * np.mean(expected_bitstring)), test_overlap) expected_bitstring = [1, 1, 1, 0, 1] prog_a = Program().inst(H(0)) prog_b = Program().inst(H(1)) with patch("pyquil.api.QuantumComputer") as qc: qc.run.return_value = expected_bitstring with pytest.raises(ValueError): test_overlap = run_swap_test(prog_a, prog_b, number_of_measurements=5, quantum_resource=qc)
[ 37811, 198, 51, 3558, 319, 262, 16075, 1332, 287, 262, 10349, 62, 19795, 20288, 8265, 198, 37811, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 12972, 9288, 198, 6738, 555, 715, 395, 13, 76, 735, 1330, 8529, 198, 6738, 12972, 421, 346, 1330, 6118, 198, 6738, 12972, 421, 346, 13, 70, 689, 1330, 9429, 54, 2969, 11, 367, 198, 198, 6738, 7128, 303, 13, 21170, 5013, 62, 19795, 20288, 13, 2032, 499, 1330, 357, 2032, 499, 62, 21170, 5013, 62, 8612, 1352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1057, 62, 2032, 499, 62, 9288, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 17296, 10699, 44, 1042, 963, 8, 198, 198, 4299, 1332, 62, 2032, 499, 62, 21170, 5013, 62, 5235, 62, 4906, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6208, 262, 2099, 10627, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 351, 12972, 9288, 13, 430, 2696, 7, 6030, 12331, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 16075, 62, 21170, 5013, 62, 8612, 1352, 7, 20, 11, 685, 16, 11, 362, 4357, 657, 8, 628, 220, 220, 220, 351, 12972, 9288, 13, 430, 2696, 7, 6030, 12331, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 16075, 62, 21170, 5013, 62, 8612, 1352, 26933, 16, 11, 362, 4357, 642, 11, 657, 8, 628, 220, 220, 220, 351, 12972, 9288, 13, 430, 2696, 7, 38804, 10699, 44, 1042, 963, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 16075, 62, 21170, 5013, 62, 8612, 1352, 26933, 16, 11, 362, 4357, 685, 18, 4357, 657, 8, 628, 198, 4299, 1332, 62, 12286, 62, 1192, 5049, 62, 562, 16747, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6889, 1654, 281, 66, 5049, 318, 8686, 284, 3509, 7, 2301, 32, 1343, 842, 33, 8, 1343, 352, 416, 4277, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1332, 62, 1676, 70, 62, 1640, 62, 1192, 5049, 796, 16075, 62, 21170, 5013, 62, 8612, 1352, 26933, 16, 11, 362, 4357, 685, 20, 11, 718, 4357, 6045, 8, 198, 220, 220, 220, 12064, 796, 1332, 62, 1676, 70, 62, 1640, 62, 1192, 5049, 13, 12924, 3419, 198, 220, 220, 220, 6818, 12064, 13, 421, 9895, 58, 15, 4083, 9630, 6624, 767, 628, 198, 4299, 1332, 62, 66, 2032, 499, 62, 23065, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6208, 611, 262, 3376, 1430, 318, 4504, 13, 220, 13139, 835, 284, 1080, 1332, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1332, 62, 1676, 70, 796, 16075, 62, 21170, 5013, 62, 8612, 1352, 26933, 16, 11, 362, 4357, 685, 20, 11, 718, 4357, 6045, 8, 198, 220, 220, 220, 2081, 62, 1676, 70, 796, 6118, 3419, 198, 220, 220, 220, 2081, 62, 1676, 70, 15853, 367, 7, 22, 8, 198, 220, 220, 220, 2081, 62, 1676, 70, 15853, 9429, 54, 2969, 7, 22, 11, 352, 11, 642, 8, 198, 220, 220, 220, 2081, 62, 1676, 70, 15853, 9429, 54, 2969, 7, 22, 11, 362, 11, 718, 8, 198, 220, 220, 220, 2081, 62, 1676, 70, 15853, 367, 7, 22, 8, 628, 220, 220, 220, 6818, 1332, 62, 1676, 70, 13, 448, 3419, 6624, 2081, 62, 1676, 70, 13, 448, 3419, 628, 198, 4299, 1332, 62, 5143, 62, 2032, 499, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6208, 262, 10662, 14761, 1441, 3704, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2938, 62, 2545, 8841, 796, 685, 16, 11, 352, 11, 352, 11, 657, 11, 657, 11, 657, 11, 657, 11, 657, 11, 657, 60, 198, 220, 220, 220, 1172, 62, 64, 796, 6118, 22446, 8625, 7, 39, 7, 15, 4008, 198, 220, 220, 220, 1172, 62, 65, 796, 6118, 22446, 8625, 7, 39, 7, 16, 4008, 198, 220, 220, 220, 351, 8529, 7203, 9078, 421, 346, 13, 15042, 13, 24915, 388, 34556, 4943, 355, 10662, 66, 25, 198, 220, 220, 220, 220, 220, 220, 220, 10662, 66, 13, 5143, 13, 7783, 62, 8367, 796, 2938, 62, 2545, 8841, 198, 220, 220, 220, 220, 220, 220, 220, 1332, 62, 2502, 37796, 796, 1057, 62, 2032, 499, 62, 9288, 7, 1676, 70, 62, 64, 11, 1172, 62, 65, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1271, 62, 1659, 62, 1326, 5015, 902, 28, 20, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 14821, 62, 31092, 28, 80, 66, 8, 628, 220, 220, 220, 220, 220, 220, 220, 6818, 45941, 13, 271, 19836, 7, 37659, 13, 31166, 17034, 7, 16, 532, 362, 1635, 45941, 13, 32604, 7, 40319, 62, 2545, 8841, 36911, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1332, 62, 2502, 37796, 8, 628, 220, 220, 220, 2938, 62, 2545, 8841, 796, 685, 16, 11, 352, 11, 352, 11, 657, 11, 352, 60, 198, 220, 220, 220, 1172, 62, 64, 796, 6118, 22446, 8625, 7, 39, 7, 15, 4008, 198, 220, 220, 220, 1172, 62, 65, 796, 6118, 22446, 8625, 7, 39, 7, 16, 4008, 198, 220, 220, 220, 351, 8529, 7203, 9078, 421, 346, 13, 15042, 13, 24915, 388, 34556, 4943, 355, 10662, 66, 25, 198, 220, 220, 220, 220, 220, 220, 220, 10662, 66, 13, 5143, 13, 7783, 62, 8367, 796, 2938, 62, 2545, 8841, 198, 220, 220, 220, 220, 220, 220, 220, 351, 12972, 9288, 13, 430, 2696, 7, 11395, 12331, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1332, 62, 2502, 37796, 796, 1057, 62, 2032, 499, 62, 9288, 7, 1676, 70, 62, 64, 11, 1172, 62, 65, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1271, 62, 1659, 62, 1326, 5015, 902, 28, 20, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 14821, 62, 31092, 28, 80, 66, 8, 628 ]
2.030612
1,176
import os import cv2 import numpy as np import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.applications import VGG19 from tensorflow.keras.layers import MaxPooling2D #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# # Settings #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# CONTENT_IMG_PATH = "./input/cat.jpg" STYLE_IMG_PATH = "./input/starry_night.jpg" GENERATED_IMG_PATH = "./output/generated_img.jpg" IMG_SIZE = (400, 300) NUM_COLOR_CHANNELS = 3 ALPHA = 10 BETA = 40 NOISE_RATIO = 0.6 CONTENT_LAYER_INDEX = 13 STYLE_LAYER_INDICES = [1, 4, 7, 12, 17] STYLE_LAYER_COEFFICIENTS = [0.2, 0.2, 0.2, 0.2, 0.2] NUM_ITERATIONS = 500 LEARNING_RATE = 2 VGG_IMAGENET_MEANS = np.array([103.939, 116.779, 123.68]).reshape((1, 1, 3)) # In blue-green-red order LOG_GRAPH = False #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# # Functions #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# def create_output_dir(): """Create output dir if it does not exist.""" cwd = os.getcwd() output_dir_path = os.path.join(cwd, "output") if not os.path.exists(output_dir_path): os.makedirs(output_dir_path) def load_img(path, size, color_means): """Load image from path, preprocess it, and return the image.""" img = cv2.imread(path) img = cv2.resize(img, dsize=size, interpolation=cv2.INTER_CUBIC) img = img.astype("float32") img -= color_means img = np.expand_dims(img, axis=0) return img def save_img(img, path, color_means): """Save image to path after postprocessing.""" img += color_means img = np.clip(img, 0, 255) img = img.astype("uint8") cv2.imwrite(path, img) def create_noisy_img(img, noise_ratio): """Add noise to img and return it.""" noise = np.random.uniform(-20, 20, (img.shape[0], img.shape[1], img.shape[2], img.shape[3])).astype("float32") noisy_img = noise_ratio * noise + (1 - noise_ratio) * img return noisy_img def create_output_tensors(input_variable, content_layer_index, style_layer_indices): """ Create output tensors, using a pretrained Keras VGG19-model. Return tensors for content and style layers. """ vgg_model = VGG19(weights="imagenet", include_top=False) layers = [l for l in vgg_model.layers] x = layers[1](input_variable) x_content_tensor = x x_style_tensors = [] if 1 in style_layer_indices: x_style_tensors.append(x) for i in range(2, len(layers)): # Use layers from vgg model, but swap max pooling layers for average pooling if type(layers[i]) == MaxPooling2D: x = tf.nn.avg_pool(x, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME') else: x = layers[i](x) # Store appropriate layer outputs if i == content_layer_index: x_content_tensor = x if i in style_layer_indices: x_style_tensors.append(x) return x_content_tensor, x_style_tensors def content_cost(a_c, a_g): """Return a tensor representing the content cost.""" _, n_h, n_w, n_c = a_c.shape return (1/(4 * n_h * n_w * n_c)) * tf.reduce_sum(tf.square(tf.subtract(a_c, a_g))) def style_cost(a_s_layers, a_g_layers, style_layer_coefficients): """Return a tensor representing the style cost.""" style_cost = 0 for i in range(len(a_s_layers)): # Compute gram matrix for the activations of the style image a_s = a_s_layers[i] _, n_h, n_w, n_c = a_s.shape a_s_unrolled = tf.reshape(tf.transpose(a_s), [n_c, n_h*n_w]) a_s_gram = tf.matmul(a_s_unrolled, tf.transpose(a_s_unrolled)) # Compute gram matrix for the activations of the generated image a_g = a_g_layers[i] a_g_unrolled = tf.reshape(tf.transpose(a_g), [n_c, n_h*n_w]) a_g_gram = tf.matmul(a_g_unrolled, tf.transpose(a_g_unrolled)) # Compute style cost for the current layer style_cost_layer = (1/(4 * n_c**2 * (n_w* n_h)**2)) * tf.reduce_sum(tf.square(tf.subtract(a_s_gram, a_g_gram))) style_cost += style_cost_layer * style_layer_coefficients[i] return style_cost def total_cost(content_cost, style_cost, alpha, beta): """Return a tensor representing the total cost.""" return alpha * content_cost + beta * style_cost #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# # Model #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# create_output_dir() # Load, resize, and preprocess content and style images content_img = load_img(CONTENT_IMG_PATH, IMG_SIZE, VGG_IMAGENET_MEANS) style_img = load_img(STYLE_IMG_PATH, IMG_SIZE, VGG_IMAGENET_MEANS) # Create initial generated image, this is the starting point for the optimization process generated_img_init = create_noisy_img(content_img, NOISE_RATIO) # Create tensorflow variable that will be used as an input to the network. # This variable will later be assigned generated_img_init and trained. input_var = tf.Variable(content_img, dtype=tf.float32, expected_shape=(None, None, None, NUM_COLOR_CHANNELS), name="input_var") # Create output tensors for the activations of the content and style layers, # using a Keras VGG19-model pretrained on the ImageNet dataset. x_content, x_styles = create_output_tensors(input_var, CONTENT_LAYER_INDEX, STYLE_LAYER_INDICES) optimizer = tf.train.AdamOptimizer(LEARNING_RATE) # Use the Keras session instead of creating a new one with K.get_session() as sess: sess.run(tf.variables_initializer([input_var])) # Extract the layer activations for content and style images a_content = sess.run(x_content, feed_dict={K.learning_phase(): 0}) sess.run(input_var.assign(style_img)) a_styles = sess.run(x_styles, feed_dict={K.learning_phase(): 0}) # Define the cost function J_content = content_cost(a_content, x_content) J_style = style_cost(a_styles, x_styles, STYLE_LAYER_COEFFICIENTS) J_total = total_cost(J_content, J_style, ALPHA, BETA) # Log the graph. To display use "tensorboard --logdir=log". if LOG_GRAPH: writer = tf.summary.FileWriter("log", sess.graph) writer.close() # Assign the generated random initial image as input sess.run(input_var.assign(generated_img_init)) # Create the training operation train_op = optimizer.minimize(J_total, var_list=[input_var]) sess.run(tf.variables_initializer(optimizer.variables())) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# # Train the generated image #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# for i in range(NUM_ITERATIONS): sess.run(train_op) if (i%20) == 0: print( "Iteration: " + str(i) + ", Content cost: " + "{:.2e}".format(sess.run(J_content)) + ", Style cost: " + "{:.2e}".format(sess.run(J_style)) + ", Total cost: " + "{:.2e}".format(sess.run(J_total)) ) # Save the generated image generated_img = sess.run(input_var)[0] save_img(generated_img, GENERATED_IMG_PATH, VGG_IMAGENET_MEANS) # Save the generated image generated_img = sess.run(input_var)[0] save_img(generated_img, GENERATED_IMG_PATH, VGG_IMAGENET_MEANS)
[ 11748, 28686, 198, 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 6738, 11192, 273, 11125, 13, 6122, 292, 1330, 30203, 355, 509, 198, 6738, 11192, 273, 11125, 13, 6122, 292, 13, 1324, 677, 602, 1330, 569, 11190, 1129, 198, 6738, 11192, 273, 11125, 13, 6122, 292, 13, 75, 6962, 1330, 5436, 27201, 278, 17, 35, 198, 198, 2, 27156, 27156, 27156, 15116, 4907, 93, 2, 198, 2, 16163, 198, 2, 27156, 27156, 27156, 15116, 4907, 93, 2, 198, 37815, 3525, 62, 3955, 38, 62, 34219, 796, 366, 19571, 15414, 14, 9246, 13, 9479, 1, 198, 2257, 56, 2538, 62, 3955, 38, 62, 34219, 796, 366, 19571, 15414, 14, 301, 6532, 62, 3847, 13, 9479, 1, 198, 35353, 1137, 11617, 62, 3955, 38, 62, 34219, 796, 366, 19571, 22915, 14, 27568, 62, 9600, 13, 9479, 1, 198, 3955, 38, 62, 33489, 796, 357, 7029, 11, 5867, 8, 198, 41359, 62, 46786, 62, 3398, 22846, 37142, 796, 513, 198, 1847, 47, 7801, 796, 838, 198, 33, 20892, 796, 2319, 198, 15285, 24352, 62, 49, 1404, 9399, 796, 657, 13, 21, 198, 37815, 3525, 62, 43, 4792, 1137, 62, 12115, 6369, 796, 1511, 198, 2257, 56, 2538, 62, 43, 4792, 1137, 62, 12115, 34444, 796, 685, 16, 11, 604, 11, 767, 11, 1105, 11, 1596, 60, 198, 2257, 56, 2538, 62, 43, 4792, 1137, 62, 8220, 37267, 2149, 40, 15365, 796, 685, 15, 13, 17, 11, 657, 13, 17, 11, 657, 13, 17, 11, 657, 13, 17, 11, 657, 13, 17, 60, 198, 41359, 62, 2043, 1137, 18421, 796, 5323, 198, 2538, 1503, 15871, 62, 49, 6158, 796, 362, 198, 53, 11190, 62, 3955, 4760, 1677, 2767, 62, 11682, 15037, 796, 45941, 13, 18747, 26933, 15197, 13, 24, 2670, 11, 18693, 13, 40393, 11, 17031, 13, 3104, 35944, 3447, 1758, 19510, 16, 11, 352, 11, 513, 4008, 1303, 554, 4171, 12, 14809, 12, 445, 1502, 198, 25294, 62, 10761, 31300, 796, 10352, 198, 198, 2, 27156, 27156, 27156, 15116, 4907, 93, 2, 198, 2, 40480, 198, 2, 27156, 27156, 27156, 15116, 4907, 93, 2, 198, 4299, 2251, 62, 22915, 62, 15908, 33529, 198, 220, 220, 220, 37227, 16447, 5072, 26672, 611, 340, 857, 407, 2152, 526, 15931, 198, 220, 220, 220, 269, 16993, 796, 28686, 13, 1136, 66, 16993, 3419, 198, 220, 220, 220, 5072, 62, 15908, 62, 6978, 796, 28686, 13, 6978, 13, 22179, 7, 66, 16993, 11, 366, 22915, 4943, 198, 220, 220, 220, 611, 407, 28686, 13, 6978, 13, 1069, 1023, 7, 22915, 62, 15908, 62, 6978, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 28686, 13, 76, 4335, 17062, 7, 22915, 62, 15908, 62, 6978, 8, 198, 198, 4299, 3440, 62, 9600, 7, 6978, 11, 2546, 11, 3124, 62, 1326, 504, 2599, 198, 220, 220, 220, 37227, 8912, 2939, 422, 3108, 11, 662, 14681, 340, 11, 290, 1441, 262, 2939, 526, 15931, 198, 220, 220, 220, 33705, 796, 269, 85, 17, 13, 320, 961, 7, 6978, 8, 198, 220, 220, 220, 33705, 796, 269, 85, 17, 13, 411, 1096, 7, 9600, 11, 288, 7857, 28, 7857, 11, 39555, 341, 28, 33967, 17, 13, 41358, 62, 34, 10526, 2149, 8, 198, 220, 220, 220, 33705, 796, 33705, 13, 459, 2981, 7203, 22468, 2624, 4943, 198, 220, 220, 220, 33705, 48185, 3124, 62, 1326, 504, 198, 220, 220, 220, 33705, 796, 45941, 13, 11201, 392, 62, 67, 12078, 7, 9600, 11, 16488, 28, 15, 8, 628, 220, 220, 220, 1441, 33705, 198, 198, 4299, 3613, 62, 9600, 7, 9600, 11, 3108, 11, 3124, 62, 1326, 504, 2599, 198, 220, 220, 220, 37227, 16928, 2939, 284, 3108, 706, 1281, 36948, 526, 15931, 198, 220, 220, 220, 33705, 15853, 3124, 62, 1326, 504, 198, 220, 220, 220, 33705, 796, 45941, 13, 15036, 7, 9600, 11, 657, 11, 14280, 8, 198, 220, 220, 220, 33705, 796, 33705, 13, 459, 2981, 7203, 28611, 23, 4943, 198, 220, 220, 220, 269, 85, 17, 13, 320, 13564, 7, 6978, 11, 33705, 8, 198, 198, 4299, 2251, 62, 3919, 13560, 62, 9600, 7, 9600, 11, 7838, 62, 10366, 952, 2599, 198, 220, 220, 220, 37227, 4550, 7838, 284, 33705, 290, 1441, 340, 526, 15931, 198, 220, 220, 220, 7838, 796, 45941, 13, 25120, 13, 403, 6933, 32590, 1238, 11, 1160, 11, 357, 9600, 13, 43358, 58, 15, 4357, 33705, 13, 43358, 58, 16, 4357, 33705, 13, 43358, 58, 17, 4357, 33705, 13, 43358, 58, 18, 12962, 737, 459, 2981, 7203, 22468, 2624, 4943, 198, 220, 220, 220, 31210, 62, 9600, 796, 7838, 62, 10366, 952, 1635, 7838, 1343, 357, 16, 532, 7838, 62, 10366, 952, 8, 1635, 33705, 628, 220, 220, 220, 1441, 31210, 62, 9600, 198, 198, 4299, 2251, 62, 22915, 62, 83, 641, 669, 7, 15414, 62, 45286, 11, 2695, 62, 29289, 62, 9630, 11, 3918, 62, 29289, 62, 521, 1063, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 13610, 5072, 11192, 669, 11, 1262, 257, 2181, 13363, 17337, 292, 569, 11190, 1129, 12, 19849, 13, 198, 220, 220, 220, 8229, 11192, 669, 329, 2695, 290, 3918, 11685, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 410, 1130, 62, 19849, 796, 569, 11190, 1129, 7, 43775, 2625, 320, 11286, 316, 1600, 2291, 62, 4852, 28, 25101, 8, 198, 220, 220, 220, 11685, 796, 685, 75, 329, 300, 287, 410, 1130, 62, 19849, 13, 75, 6962, 60, 628, 220, 220, 220, 2124, 796, 11685, 58, 16, 16151, 15414, 62, 45286, 8, 198, 220, 220, 220, 2124, 62, 11299, 62, 83, 22854, 796, 2124, 198, 220, 220, 220, 2124, 62, 7635, 62, 83, 641, 669, 796, 17635, 198, 220, 220, 220, 611, 352, 287, 3918, 62, 29289, 62, 521, 1063, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2124, 62, 7635, 62, 83, 641, 669, 13, 33295, 7, 87, 8, 628, 220, 220, 220, 329, 1312, 287, 2837, 7, 17, 11, 18896, 7, 75, 6962, 8, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 5765, 11685, 422, 410, 1130, 2746, 11, 475, 16075, 3509, 5933, 278, 11685, 329, 2811, 5933, 278, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2099, 7, 75, 6962, 58, 72, 12962, 6624, 5436, 27201, 278, 17, 35, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2124, 796, 48700, 13, 20471, 13, 615, 70, 62, 7742, 7, 87, 11, 479, 7857, 41888, 16, 11, 362, 11, 362, 11, 352, 4357, 35002, 41888, 16, 11, 362, 11, 362, 11, 352, 4357, 24511, 11639, 50, 10067, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2124, 796, 11685, 58, 72, 16151, 87, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 9363, 5035, 7679, 23862, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1312, 6624, 2695, 62, 29289, 62, 9630, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2124, 62, 11299, 62, 83, 22854, 796, 2124, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1312, 287, 3918, 62, 29289, 62, 521, 1063, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2124, 62, 7635, 62, 83, 641, 669, 13, 33295, 7, 87, 8, 628, 220, 220, 220, 1441, 2124, 62, 11299, 62, 83, 22854, 11, 2124, 62, 7635, 62, 83, 641, 669, 198, 198, 4299, 2695, 62, 15805, 7, 64, 62, 66, 11, 257, 62, 70, 2599, 198, 220, 220, 220, 37227, 13615, 257, 11192, 273, 10200, 262, 2695, 1575, 526, 15931, 198, 220, 220, 220, 4808, 11, 299, 62, 71, 11, 299, 62, 86, 11, 299, 62, 66, 796, 257, 62, 66, 13, 43358, 628, 220, 220, 220, 1441, 357, 16, 29006, 19, 1635, 299, 62, 71, 1635, 299, 62, 86, 1635, 299, 62, 66, 4008, 1635, 48700, 13, 445, 7234, 62, 16345, 7, 27110, 13, 23415, 7, 27110, 13, 7266, 83, 974, 7, 64, 62, 66, 11, 257, 62, 70, 22305, 198, 198, 4299, 3918, 62, 15805, 7, 64, 62, 82, 62, 75, 6962, 11, 257, 62, 70, 62, 75, 6962, 11, 3918, 62, 29289, 62, 1073, 41945, 2599, 198, 220, 220, 220, 37227, 13615, 257, 11192, 273, 10200, 262, 3918, 1575, 526, 15931, 198, 220, 220, 220, 3918, 62, 15805, 796, 657, 198, 220, 220, 220, 329, 1312, 287, 2837, 7, 11925, 7, 64, 62, 82, 62, 75, 6962, 8, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 3082, 1133, 14599, 17593, 329, 262, 1753, 602, 286, 262, 3918, 2939, 198, 220, 220, 220, 220, 220, 220, 220, 257, 62, 82, 796, 257, 62, 82, 62, 75, 6962, 58, 72, 60, 198, 220, 220, 220, 220, 220, 220, 220, 4808, 11, 299, 62, 71, 11, 299, 62, 86, 11, 299, 62, 66, 796, 257, 62, 82, 13, 43358, 198, 220, 220, 220, 220, 220, 220, 220, 257, 62, 82, 62, 403, 8375, 796, 48700, 13, 3447, 1758, 7, 27110, 13, 7645, 3455, 7, 64, 62, 82, 828, 685, 77, 62, 66, 11, 299, 62, 71, 9, 77, 62, 86, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 257, 62, 82, 62, 4546, 796, 48700, 13, 6759, 76, 377, 7, 64, 62, 82, 62, 403, 8375, 11, 48700, 13, 7645, 3455, 7, 64, 62, 82, 62, 403, 8375, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 3082, 1133, 14599, 17593, 329, 262, 1753, 602, 286, 262, 7560, 2939, 198, 220, 220, 220, 220, 220, 220, 220, 257, 62, 70, 796, 257, 62, 70, 62, 75, 6962, 58, 72, 60, 198, 220, 220, 220, 220, 220, 220, 220, 257, 62, 70, 62, 403, 8375, 796, 48700, 13, 3447, 1758, 7, 27110, 13, 7645, 3455, 7, 64, 62, 70, 828, 685, 77, 62, 66, 11, 299, 62, 71, 9, 77, 62, 86, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 257, 62, 70, 62, 4546, 796, 48700, 13, 6759, 76, 377, 7, 64, 62, 70, 62, 403, 8375, 11, 48700, 13, 7645, 3455, 7, 64, 62, 70, 62, 403, 8375, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 3082, 1133, 3918, 1575, 329, 262, 1459, 7679, 198, 220, 220, 220, 220, 220, 220, 220, 3918, 62, 15805, 62, 29289, 796, 357, 16, 29006, 19, 1635, 299, 62, 66, 1174, 17, 1635, 357, 77, 62, 86, 9, 299, 62, 71, 8, 1174, 17, 4008, 1635, 48700, 13, 445, 7234, 62, 16345, 7, 27110, 13, 23415, 7, 27110, 13, 7266, 83, 974, 7, 64, 62, 82, 62, 4546, 11, 257, 62, 70, 62, 4546, 22305, 628, 220, 220, 220, 220, 220, 220, 220, 3918, 62, 15805, 15853, 3918, 62, 15805, 62, 29289, 1635, 3918, 62, 29289, 62, 1073, 41945, 58, 72, 60, 198, 220, 220, 220, 220, 198, 220, 220, 220, 1441, 3918, 62, 15805, 198, 198, 4299, 2472, 62, 15805, 7, 11299, 62, 15805, 11, 3918, 62, 15805, 11, 17130, 11, 12159, 2599, 198, 220, 220, 220, 37227, 13615, 257, 11192, 273, 10200, 262, 2472, 1575, 526, 15931, 198, 220, 220, 220, 1441, 17130, 1635, 2695, 62, 15805, 1343, 12159, 1635, 3918, 62, 15805, 198, 198, 2, 27156, 27156, 27156, 15116, 4907, 93, 2, 198, 2, 9104, 198, 2, 27156, 27156, 27156, 15116, 4907, 93, 2, 198, 17953, 62, 22915, 62, 15908, 3419, 198, 198, 2, 8778, 11, 47558, 11, 290, 662, 14681, 2695, 290, 3918, 4263, 198, 11299, 62, 9600, 796, 3440, 62, 9600, 7, 37815, 3525, 62, 3955, 38, 62, 34219, 11, 8959, 38, 62, 33489, 11, 569, 11190, 62, 3955, 4760, 1677, 2767, 62, 11682, 15037, 8, 198, 7635, 62, 9600, 796, 3440, 62, 9600, 7, 2257, 56, 2538, 62, 3955, 38, 62, 34219, 11, 8959, 38, 62, 33489, 11, 569, 11190, 62, 3955, 4760, 1677, 2767, 62, 11682, 15037, 8, 198, 198, 2, 13610, 4238, 7560, 2939, 11, 428, 318, 262, 3599, 966, 329, 262, 23989, 1429, 198, 27568, 62, 9600, 62, 15003, 796, 2251, 62, 3919, 13560, 62, 9600, 7, 11299, 62, 9600, 11, 8005, 24352, 62, 49, 1404, 9399, 8, 198, 198, 2, 13610, 11192, 273, 11125, 7885, 326, 481, 307, 973, 355, 281, 5128, 284, 262, 3127, 13, 198, 2, 770, 7885, 481, 1568, 307, 8686, 7560, 62, 9600, 62, 15003, 290, 8776, 13, 198, 15414, 62, 7785, 796, 48700, 13, 43015, 7, 11299, 62, 9600, 11, 288, 4906, 28, 27110, 13, 22468, 2624, 11, 2938, 62, 43358, 16193, 14202, 11, 6045, 11, 6045, 11, 36871, 62, 46786, 62, 3398, 22846, 37142, 828, 1438, 2625, 15414, 62, 7785, 4943, 198, 198, 2, 13610, 5072, 11192, 669, 329, 262, 1753, 602, 286, 262, 2695, 290, 3918, 11685, 11, 198, 2, 1262, 257, 17337, 292, 569, 11190, 1129, 12, 19849, 2181, 13363, 319, 262, 7412, 7934, 27039, 13, 198, 87, 62, 11299, 11, 2124, 62, 47720, 796, 2251, 62, 22915, 62, 83, 641, 669, 7, 15414, 62, 7785, 11, 22904, 3525, 62, 43, 4792, 1137, 62, 12115, 6369, 11, 3563, 56, 2538, 62, 43, 4792, 1137, 62, 12115, 34444, 8, 198, 198, 40085, 7509, 796, 48700, 13, 27432, 13, 23159, 27871, 320, 7509, 7, 2538, 1503, 15871, 62, 49, 6158, 8, 198, 198, 2, 5765, 262, 17337, 292, 6246, 2427, 286, 4441, 257, 649, 530, 198, 4480, 509, 13, 1136, 62, 29891, 3419, 355, 264, 408, 25, 198, 220, 220, 220, 264, 408, 13, 5143, 7, 27110, 13, 25641, 2977, 62, 36733, 7509, 26933, 15414, 62, 7785, 60, 4008, 628, 220, 220, 220, 1303, 29677, 262, 7679, 1753, 602, 329, 2695, 290, 3918, 4263, 198, 220, 220, 220, 257, 62, 11299, 796, 264, 408, 13, 5143, 7, 87, 62, 11299, 11, 3745, 62, 11600, 34758, 42, 13, 40684, 62, 40715, 33529, 657, 30072, 198, 220, 220, 220, 264, 408, 13, 5143, 7, 15414, 62, 7785, 13, 562, 570, 7, 7635, 62, 9600, 4008, 198, 220, 220, 220, 257, 62, 47720, 796, 264, 408, 13, 5143, 7, 87, 62, 47720, 11, 3745, 62, 11600, 34758, 42, 13, 40684, 62, 40715, 33529, 657, 30072, 628, 220, 220, 220, 1303, 2896, 500, 262, 1575, 2163, 198, 220, 220, 220, 449, 62, 11299, 796, 2695, 62, 15805, 7, 64, 62, 11299, 11, 2124, 62, 11299, 8, 198, 220, 220, 220, 449, 62, 7635, 796, 3918, 62, 15805, 7, 64, 62, 47720, 11, 2124, 62, 47720, 11, 3563, 56, 2538, 62, 43, 4792, 1137, 62, 8220, 37267, 2149, 40, 15365, 8, 198, 220, 220, 220, 449, 62, 23350, 796, 2472, 62, 15805, 7, 41, 62, 11299, 11, 449, 62, 7635, 11, 42674, 7801, 11, 347, 20892, 8, 628, 220, 220, 220, 1303, 5972, 262, 4823, 13, 1675, 3359, 779, 366, 83, 22854, 3526, 1377, 6404, 15908, 28, 6404, 1911, 198, 220, 220, 220, 611, 41605, 62, 10761, 31300, 25, 198, 220, 220, 220, 220, 220, 220, 220, 6260, 796, 48700, 13, 49736, 13, 8979, 34379, 7203, 6404, 1600, 264, 408, 13, 34960, 8, 198, 220, 220, 220, 220, 220, 220, 220, 6260, 13, 19836, 3419, 628, 220, 220, 220, 1303, 2195, 570, 262, 7560, 4738, 4238, 2939, 355, 5128, 198, 220, 220, 220, 264, 408, 13, 5143, 7, 15414, 62, 7785, 13, 562, 570, 7, 27568, 62, 9600, 62, 15003, 4008, 628, 220, 220, 220, 1303, 13610, 262, 3047, 4905, 198, 220, 220, 220, 4512, 62, 404, 796, 6436, 7509, 13, 1084, 48439, 7, 41, 62, 23350, 11, 1401, 62, 4868, 41888, 15414, 62, 7785, 12962, 198, 220, 220, 220, 264, 408, 13, 5143, 7, 27110, 13, 25641, 2977, 62, 36733, 7509, 7, 40085, 7509, 13, 25641, 2977, 3419, 4008, 628, 220, 220, 220, 1303, 27156, 27156, 27156, 15116, 4907, 93, 2, 198, 220, 220, 220, 1303, 16835, 262, 7560, 2939, 198, 220, 220, 220, 1303, 27156, 27156, 27156, 15116, 4907, 93, 2, 198, 220, 220, 220, 329, 1312, 287, 2837, 7, 41359, 62, 2043, 1137, 18421, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 264, 408, 13, 5143, 7, 27432, 62, 404, 8, 628, 220, 220, 220, 220, 220, 220, 220, 611, 357, 72, 4, 1238, 8, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 29993, 341, 25, 366, 1343, 965, 7, 72, 8, 1343, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 33172, 14041, 1575, 25, 366, 1343, 45144, 25, 13, 17, 68, 92, 1911, 18982, 7, 82, 408, 13, 5143, 7, 41, 62, 11299, 4008, 1343, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 33172, 17738, 1575, 25, 366, 1343, 45144, 25, 13, 17, 68, 92, 1911, 18982, 7, 82, 408, 13, 5143, 7, 41, 62, 7635, 4008, 1343, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 33172, 7472, 1575, 25, 366, 1343, 45144, 25, 13, 17, 68, 92, 1911, 18982, 7, 82, 408, 13, 5143, 7, 41, 62, 23350, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 12793, 262, 7560, 2939, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7560, 62, 9600, 796, 264, 408, 13, 5143, 7, 15414, 62, 7785, 38381, 15, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3613, 62, 9600, 7, 27568, 62, 9600, 11, 24700, 1137, 11617, 62, 3955, 38, 62, 34219, 11, 569, 11190, 62, 3955, 4760, 1677, 2767, 62, 11682, 15037, 8, 628, 220, 220, 220, 1303, 12793, 262, 7560, 2939, 198, 220, 220, 220, 7560, 62, 9600, 796, 264, 408, 13, 5143, 7, 15414, 62, 7785, 38381, 15, 60, 198, 220, 220, 220, 3613, 62, 9600, 7, 27568, 62, 9600, 11, 24700, 1137, 11617, 62, 3955, 38, 62, 34219, 11, 569, 11190, 62, 3955, 4760, 1677, 2767, 62, 11682, 15037, 8, 198 ]
2.45158
2,974
#!/usr/bin/env python3 import argparse import functools from pathlib import Path from datetime import datetime from collections import namedtuple import numpy as np import yaml from box import Box import jax from jax import jit, vmap, pmap, grad, value_and_grad import jax.numpy as jnp from jax.tree_util import register_pytree_node from jax.experimental.optimizers import adam import haiku as hk from tensorboardX import SummaryWriter from tqdm import tqdm, trange from nerf import loader, sampler from nerf import run_one_iter_of_nerf, run_network from nerf import FlexibleNeRFModel, compute_embedding_size from reference import torch_to_jax from util import get_ray_bundle Losses = namedtuple("Losses", ["coarse_loss", "fine_loss"]) register_pytree_node(Losses, lambda xs: (tuple(xs), None), lambda _, xs: Losses(*xs)) if __name__ == "__main__": import cv2 import torch from reference import * import time main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 1822, 29572, 198, 11748, 1257, 310, 10141, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 17268, 1330, 3706, 83, 29291, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 331, 43695, 198, 6738, 3091, 1330, 8315, 198, 11748, 474, 897, 198, 6738, 474, 897, 1330, 474, 270, 11, 410, 8899, 11, 279, 8899, 11, 3915, 11, 1988, 62, 392, 62, 9744, 198, 11748, 474, 897, 13, 77, 32152, 355, 474, 37659, 198, 6738, 474, 897, 13, 21048, 62, 22602, 1330, 7881, 62, 9078, 21048, 62, 17440, 198, 6738, 474, 897, 13, 23100, 9134, 13, 40085, 11341, 1330, 23197, 198, 11748, 387, 28643, 355, 289, 74, 198, 198, 6738, 11192, 273, 3526, 55, 1330, 21293, 34379, 198, 6738, 256, 80, 36020, 1330, 256, 80, 36020, 11, 491, 858, 198, 198, 6738, 17156, 69, 1330, 40213, 11, 6072, 20053, 198, 6738, 17156, 69, 1330, 1057, 62, 505, 62, 2676, 62, 1659, 62, 1008, 69, 11, 1057, 62, 27349, 198, 6738, 17156, 69, 1330, 26719, 856, 8199, 32754, 17633, 11, 24061, 62, 20521, 12083, 62, 7857, 198, 6738, 4941, 1330, 28034, 62, 1462, 62, 73, 897, 198, 6738, 7736, 1330, 651, 62, 2433, 62, 65, 31249, 628, 198, 43, 793, 274, 796, 3706, 83, 29291, 7203, 43, 793, 274, 1600, 14631, 1073, 17208, 62, 22462, 1600, 366, 38125, 62, 22462, 8973, 8, 198, 30238, 62, 9078, 21048, 62, 17440, 7, 43, 793, 274, 11, 37456, 2124, 82, 25, 357, 83, 29291, 7, 34223, 828, 6045, 828, 37456, 4808, 11, 2124, 82, 25, 22014, 274, 46491, 34223, 4008, 628, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1330, 269, 85, 17, 198, 220, 220, 220, 1330, 28034, 198, 220, 220, 220, 422, 4941, 1330, 1635, 198, 220, 220, 220, 1330, 640, 628, 220, 220, 220, 1388, 3419, 198 ]
2.941176
323
from pyexpat import model from django import forms from .models import Profile, Images, Comments
[ 6738, 12972, 1069, 8071, 1330, 2746, 198, 6738, 42625, 14208, 1330, 5107, 198, 6738, 764, 27530, 1330, 13118, 11, 5382, 11, 19502 ]
4.363636
22
# Convertendo polegadas em centimetros polegadas = float(input('Entre com o tamanho em polegadas: ')) centimetros = polegadas * 2.54 print(centimetros)
[ 2, 38240, 31110, 745, 1455, 38768, 795, 1247, 38813, 4951, 198, 198, 7501, 1455, 38768, 796, 12178, 7, 15414, 10786, 14539, 260, 401, 267, 256, 10546, 8873, 795, 745, 1455, 38768, 25, 705, 4008, 198, 1087, 38813, 4951, 796, 745, 1455, 38768, 1635, 362, 13, 4051, 198, 4798, 7, 1087, 38813, 4951, 8 ]
2.867925
53
# coding: utf-8 import sys
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 11748, 25064, 198 ]
2.333333
12
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # This file has been modified from the original repository's version in the following ways: # 1. The model loading logic uses a SwAVModel class that acts as a wrapper around WILDS-Unlabeled # models. # 2. The data loading logic uses a CustomSplitMultiCropDataset class that is compatible with all # WILDS-Unlabeled datasets. # More information about both of these classes can be found in the src/ directory. # import argparse import math import os import pdb import shutil import sys import time from logging import getLogger import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.optim try: import apex from apex.parallel.LARC import LARC except ImportError as e: print("Apex not found. Proceeding without it...") try: import wandb except Exception as e: print("wandb not found. Proceeding without it...") import wilds from src.utils import ( bool_flag, initialize_exp, restart_from_checkpoint, fix_random_seeds, AverageMeter, init_distributed_mode, ParseKwargs, plot_experiment, populate_defaults_for_swav ) from src.multicropdataset import CustomSplitMultiCropDataset from src.model import SwAVModel from examples.models.initializer import initialize_model from examples.utils import initialize_wandb logger = getLogger() parser = argparse.ArgumentParser(description="Implementation of SwAV") ######################### ##### dataset params #### ######################### parser.add_argument('-d', '--dataset', required=True, choices=wilds.unlabeled_datasets) parser.add_argument('--root_dir', required=True, help='The directory where [dataset]/data can be found (or should be downloaded to, if it does not exist).') parser.add_argument('--dataset_kwargs', nargs='*', action=ParseKwargs, default={}) parser.add_argument('--loader_kwargs', nargs='*', action=ParseKwargs, default={}) parser.add_argument('--splits', nargs='+') ######################### #### data aug params #### ######################### parser.add_argument("--nmb_crops", type=int, nargs="+", help="list of number of crops") parser.add_argument("--size_crops", type=int, nargs="+", help="crops resolutions") parser.add_argument("--min_scale_crops", type=float, nargs="+", help="argument in RandomResizedCrop") parser.add_argument("--max_scale_crops", type=float, nargs="+", help="argument in RandomResizedCrop") ######################### ## swav specific params # ######################### parser.add_argument("--crops_for_assign", type=int, nargs="+", default=[0, 1], help="list of crops id used for computing assignments (default: [0, 1])") parser.add_argument("--temperature", default=0.1, type=float, help="temperature parameter in training loss (default: 0.1)") parser.add_argument("--epsilon", default=0.03, type=float, help="regularization parameter for Sinkhorn-Knopp algorithm (default: 0.03)") parser.add_argument("--sinkhorn_iterations", default=3, type=int, help="number of iterations in Sinkhorn-Knopp algorithm") parser.add_argument("--feat_dim", default=128, type=int, help="feature dimension") parser.add_argument("--nmb_prototypes", type=int, help="number of prototypes") parser.add_argument("--queue_length", type=int, default=0, help="length of the queue (0 for no queue)") parser.add_argument("--epoch_queue_starts", type=int, default=500, help="from this epoch, we start using a queue") ######################### #### optim parameters ### ######################### parser.add_argument('--optimizer_kwargs', nargs='*', action=ParseKwargs, default={}) parser.add_argument("--n_epochs", default=400, type=int, help="number of total epochs to run") parser.add_argument("--warmup_epochs", default=0, type=int, help="number of warmup epochs (default: 0)") parser.add_argument("--batch_size", type=int, help="batch size per gpu, i.e. how many unique instances per gpu") parser.add_argument("--lr", type=float, help="base learning rate") parser.add_argument("--final_lr", type=float, help="final learning rate") parser.add_argument("--freeze_prototypes_niters", default=5005, type=int, help="freeze the prototypes during this many iterations from the start (default: 5005).") parser.add_argument("--weight_decay", default=1e-6, type=float, help="weight decay") parser.add_argument("--start_warmup", default=0, type=float, help="initial warmup learning rate") ######################### #### dist parameters ### ######################### parser.add_argument("--dist_url", default="env://", type=str, help="""url used to set up distributed training; see https://pytorch.org/docs/stable/distributed.html""") parser.add_argument("--world_size", default=-1, type=int, help=""" number of processes: it is set automatically and should not be passed as argument""") parser.add_argument("--rank", default=0, type=int, help="""rank of this process: it is set automatically and should not be passed as argument""") parser.add_argument("--local_rank", default=0, type=int, help="this argument is not used and should be ignored") ######################### #### other parameters ### ######################### parser.add_argument("--model", type=str, help="convnet architecture. If not set, uses default model specified in WILDS.") parser.add_argument('--model_kwargs', nargs='*', action=ParseKwargs, default={}, help='keyword arguments for model initialization passed as key1=value1 key2=value2') parser.add_argument("--hidden_mlp", default=2048, type=int, help="hidden layer dimension in projection head") parser.add_argument("--checkpoint_freq", type=int, default=50, help="Save the model periodically") parser.add_argument("--use_fp16", type=bool_flag, default=True, help="whether to train with mixed precision or not") parser.add_argument("--sync_bn", type=str, default="pytorch", help="synchronize bn") parser.add_argument("--syncbn_process_group_size", type=int, default=8, help=""" see https://github.com/NVIDIA/apex/blob/master/apex/parallel/__init__.py#L58-L67""") parser.add_argument("--log_dir", type=str, default=".", help="experiment dump path for checkpoints and log") parser.add_argument("--seed", type=int, default=0, help="seed") parser.add_argument("--is_not_slurm_job", type=bool_flag, default=True, help="Set to true if not running in Slurm.") parser.add_argument("--cpu_only", type=bool_flag, default=False, help="Set to true to run experiment on CPUs instead of GPUs (for debugging).") parser.add_argument('--pretrained_model_path', default=None, type=str) # Weights & Biases parser.add_argument('--use_wandb', type=bool_flag, nargs='?', default=False) parser.add_argument('--wandb_api_key_path', type=str, help="Path to Weights & Biases API Key. If use_wandb is set to True and this argument is not specified, user will be prompted to authenticate.") parser.add_argument('--wandb_kwargs', nargs='*', action=ParseKwargs, default={}, help="Will be passed directly into wandb.init().") @torch.no_grad() if __name__ == "__main__": main()
[ 2, 15069, 357, 66, 8, 3203, 11, 3457, 13, 290, 663, 29116, 13, 198, 2, 1439, 2489, 10395, 13, 198, 2, 198, 2, 770, 2723, 2438, 318, 11971, 739, 262, 5964, 1043, 287, 262, 198, 2, 38559, 24290, 2393, 287, 262, 6808, 8619, 286, 428, 2723, 5509, 13, 198, 2, 198, 2, 770, 2393, 468, 587, 9518, 422, 262, 2656, 16099, 338, 2196, 287, 262, 1708, 2842, 25, 198, 2, 352, 13, 383, 2746, 11046, 9156, 3544, 257, 2451, 10116, 17633, 1398, 326, 6529, 355, 257, 29908, 1088, 370, 4146, 5258, 12, 3118, 18242, 276, 198, 2, 220, 220, 220, 4981, 13, 198, 2, 362, 13, 383, 1366, 11046, 9156, 3544, 257, 8562, 41205, 29800, 34, 1773, 27354, 292, 316, 1398, 326, 318, 11670, 351, 477, 198, 2, 220, 220, 220, 370, 4146, 5258, 12, 3118, 18242, 276, 40522, 13, 198, 2, 3125, 1321, 546, 1111, 286, 777, 6097, 460, 307, 1043, 287, 262, 12351, 14, 8619, 13, 198, 2, 198, 198, 11748, 1822, 29572, 198, 11748, 10688, 198, 11748, 28686, 198, 11748, 279, 9945, 198, 11748, 4423, 346, 198, 11748, 25064, 198, 11748, 640, 198, 6738, 18931, 1330, 651, 11187, 1362, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 13, 20471, 13, 45124, 355, 376, 198, 11748, 28034, 13, 20471, 13, 1845, 29363, 198, 11748, 28034, 13, 1891, 2412, 13, 66, 463, 20471, 355, 269, 463, 20471, 198, 11748, 28034, 13, 17080, 6169, 355, 1233, 198, 11748, 28034, 13, 40085, 198, 28311, 25, 198, 220, 220, 220, 1330, 40167, 198, 220, 220, 220, 422, 40167, 13, 1845, 29363, 13, 43, 25793, 1330, 406, 25793, 198, 16341, 17267, 12331, 355, 304, 25, 198, 220, 220, 220, 3601, 7203, 32, 24900, 407, 1043, 13, 24889, 278, 1231, 340, 9313, 8, 198, 198, 28311, 25, 198, 220, 220, 220, 1330, 11569, 65, 198, 16341, 35528, 355, 304, 25, 198, 220, 220, 220, 3601, 7203, 86, 392, 65, 407, 1043, 13, 24889, 278, 1231, 340, 9313, 8, 628, 198, 11748, 4295, 82, 198, 6738, 12351, 13, 26791, 1330, 357, 198, 220, 220, 220, 20512, 62, 32109, 11, 198, 220, 220, 220, 41216, 62, 11201, 11, 198, 220, 220, 220, 15765, 62, 6738, 62, 9122, 4122, 11, 198, 220, 220, 220, 4259, 62, 25120, 62, 325, 5379, 11, 198, 220, 220, 220, 13475, 44, 2357, 11, 198, 220, 220, 220, 2315, 62, 17080, 6169, 62, 14171, 11, 198, 220, 220, 220, 2547, 325, 42, 86, 22046, 11, 198, 220, 220, 220, 7110, 62, 23100, 3681, 11, 198, 220, 220, 220, 48040, 62, 12286, 82, 62, 1640, 62, 2032, 615, 198, 8, 198, 6738, 12351, 13, 16680, 291, 1773, 19608, 292, 316, 1330, 8562, 41205, 29800, 34, 1773, 27354, 292, 316, 198, 6738, 12351, 13, 19849, 1330, 2451, 10116, 17633, 198, 198, 6738, 6096, 13, 27530, 13, 36733, 7509, 1330, 41216, 62, 19849, 198, 6738, 6096, 13, 26791, 1330, 41216, 62, 86, 392, 65, 198, 198, 6404, 1362, 796, 651, 11187, 1362, 3419, 198, 48610, 796, 1822, 29572, 13, 28100, 1713, 46677, 7, 11213, 2625, 3546, 32851, 286, 2451, 10116, 4943, 198, 198, 14468, 7804, 2, 198, 4242, 2, 27039, 42287, 1303, 21017, 198, 14468, 7804, 2, 198, 48610, 13, 2860, 62, 49140, 10786, 12, 67, 3256, 705, 438, 19608, 292, 316, 3256, 2672, 28, 17821, 11, 7747, 28, 21992, 82, 13, 403, 18242, 276, 62, 19608, 292, 1039, 8, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 15763, 62, 15908, 3256, 2672, 28, 17821, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 11639, 464, 8619, 810, 685, 19608, 292, 316, 60, 14, 7890, 460, 307, 1043, 357, 273, 815, 307, 15680, 284, 11, 611, 340, 857, 407, 2152, 737, 11537, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 19608, 292, 316, 62, 46265, 22046, 3256, 299, 22046, 11639, 9, 3256, 2223, 28, 10044, 325, 42, 86, 22046, 11, 4277, 34758, 30072, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 29356, 62, 46265, 22046, 3256, 299, 22046, 11639, 9, 3256, 2223, 28, 10044, 325, 42, 86, 22046, 11, 4277, 34758, 30072, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 22018, 896, 3256, 299, 22046, 11639, 10, 11537, 198, 198, 14468, 7804, 2, 198, 4242, 1366, 16339, 42287, 1303, 21017, 198, 14468, 7804, 2, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 77, 2022, 62, 19915, 862, 1600, 2099, 28, 600, 11, 299, 22046, 2625, 10, 1600, 1037, 2625, 4868, 286, 1271, 286, 14450, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 7857, 62, 19915, 862, 1600, 2099, 28, 600, 11, 299, 22046, 2625, 10, 1600, 1037, 2625, 19915, 862, 21811, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 1084, 62, 9888, 62, 19915, 862, 1600, 2099, 28, 22468, 11, 299, 22046, 2625, 10, 1600, 1037, 2625, 49140, 287, 14534, 4965, 1143, 34, 1773, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 9806, 62, 9888, 62, 19915, 862, 1600, 2099, 28, 22468, 11, 299, 22046, 2625, 10, 1600, 1037, 2625, 49140, 287, 14534, 4965, 1143, 34, 1773, 4943, 198, 198, 14468, 7804, 2, 198, 2235, 1509, 615, 2176, 42287, 1303, 198, 14468, 7804, 2, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 19915, 862, 62, 1640, 62, 562, 570, 1600, 2099, 28, 600, 11, 299, 22046, 2625, 10, 1600, 4277, 41888, 15, 11, 352, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 4868, 286, 14450, 4686, 973, 329, 14492, 25815, 357, 12286, 25, 685, 15, 11, 352, 12962, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 11498, 21069, 1600, 4277, 28, 15, 13, 16, 11, 2099, 28, 22468, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 11498, 21069, 11507, 287, 3047, 2994, 357, 12286, 25, 657, 13, 16, 8, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 538, 18217, 261, 1600, 4277, 28, 15, 13, 3070, 11, 2099, 28, 22468, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 16338, 1634, 11507, 329, 311, 676, 25311, 12, 42, 3919, 381, 11862, 357, 12286, 25, 657, 13, 3070, 8, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 82, 676, 25311, 62, 2676, 602, 1600, 4277, 28, 18, 11, 2099, 28, 600, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 17618, 286, 34820, 287, 311, 676, 25311, 12, 42, 3919, 381, 11862, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 27594, 62, 27740, 1600, 4277, 28, 12762, 11, 2099, 28, 600, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 30053, 15793, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 77, 2022, 62, 11235, 13567, 1600, 2099, 28, 600, 11, 1037, 2625, 17618, 286, 32338, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 36560, 62, 13664, 1600, 2099, 28, 600, 11, 4277, 28, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 13664, 286, 262, 16834, 357, 15, 329, 645, 16834, 8, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 538, 5374, 62, 36560, 62, 301, 5889, 1600, 2099, 28, 600, 11, 4277, 28, 4059, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 6738, 428, 36835, 11, 356, 923, 1262, 257, 16834, 4943, 198, 198, 14468, 7804, 2, 198, 4242, 6436, 10007, 44386, 198, 14468, 7804, 2, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 40085, 7509, 62, 46265, 22046, 3256, 299, 22046, 11639, 9, 3256, 2223, 28, 10044, 325, 42, 86, 22046, 11, 4277, 34758, 30072, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 77, 62, 538, 5374, 82, 1600, 4277, 28, 7029, 11, 2099, 28, 600, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 17618, 286, 2472, 36835, 82, 284, 1057, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 31975, 929, 62, 538, 5374, 82, 1600, 4277, 28, 15, 11, 2099, 28, 600, 11, 1037, 2625, 17618, 286, 5814, 929, 36835, 82, 357, 12286, 25, 657, 8, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 43501, 62, 7857, 1600, 2099, 28, 600, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 43501, 2546, 583, 308, 19944, 11, 1312, 13, 68, 13, 703, 867, 3748, 10245, 583, 308, 19944, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 14050, 1600, 2099, 28, 22468, 11, 1037, 2625, 8692, 4673, 2494, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 20311, 62, 14050, 1600, 2099, 28, 22468, 11, 1037, 2625, 20311, 4673, 2494, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 5787, 2736, 62, 11235, 13567, 62, 48825, 364, 1600, 4277, 28, 4059, 20, 11, 2099, 28, 600, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 5787, 2736, 262, 32338, 1141, 428, 867, 34820, 422, 262, 923, 357, 12286, 25, 5323, 20, 8, 19570, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 6551, 62, 12501, 323, 1600, 4277, 28, 16, 68, 12, 21, 11, 2099, 28, 22468, 11, 1037, 2625, 6551, 22119, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 9688, 62, 31975, 929, 1600, 4277, 28, 15, 11, 2099, 28, 22468, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 36733, 5814, 929, 4673, 2494, 4943, 198, 198, 14468, 7804, 2, 198, 4242, 1233, 10007, 44386, 198, 14468, 7804, 2, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 17080, 62, 6371, 1600, 4277, 2625, 24330, 1378, 1600, 2099, 28, 2536, 11, 1037, 2625, 15931, 6371, 973, 284, 900, 510, 9387, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3047, 26, 766, 3740, 1378, 9078, 13165, 354, 13, 2398, 14, 31628, 14, 31284, 14, 17080, 6169, 13, 6494, 15931, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 6894, 62, 7857, 1600, 4277, 10779, 16, 11, 2099, 28, 600, 11, 1037, 2625, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1271, 286, 7767, 25, 340, 318, 900, 6338, 290, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 815, 407, 307, 3804, 355, 4578, 15931, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 43027, 1600, 4277, 28, 15, 11, 2099, 28, 600, 11, 1037, 2625, 15931, 43027, 286, 428, 1429, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 340, 318, 900, 6338, 290, 815, 407, 307, 3804, 355, 4578, 15931, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 12001, 62, 43027, 1600, 4277, 28, 15, 11, 2099, 28, 600, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 5661, 4578, 318, 407, 973, 290, 815, 307, 9514, 4943, 198, 198, 14468, 7804, 2, 198, 4242, 584, 10007, 44386, 198, 14468, 7804, 2, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 19849, 1600, 2099, 28, 2536, 11, 1037, 2625, 42946, 3262, 10959, 13, 1002, 407, 900, 11, 3544, 4277, 2746, 7368, 287, 370, 4146, 5258, 19570, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 19849, 62, 46265, 22046, 3256, 299, 22046, 11639, 9, 3256, 2223, 28, 10044, 325, 42, 86, 22046, 11, 4277, 34758, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 11639, 2539, 4775, 7159, 329, 2746, 37588, 3804, 355, 1994, 16, 28, 8367, 16, 1994, 17, 28, 8367, 17, 11537, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 30342, 62, 4029, 79, 1600, 4277, 28, 1238, 2780, 11, 2099, 28, 600, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 30342, 7679, 15793, 287, 20128, 1182, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 9122, 4122, 62, 19503, 80, 1600, 2099, 28, 600, 11, 4277, 28, 1120, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 16928, 262, 2746, 26034, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 1904, 62, 46428, 1433, 1600, 2099, 28, 30388, 62, 32109, 11, 4277, 28, 17821, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 25356, 284, 4512, 351, 7668, 15440, 393, 407, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 27261, 62, 9374, 1600, 2099, 28, 2536, 11, 4277, 2625, 9078, 13165, 354, 1600, 1037, 2625, 28869, 11413, 1096, 275, 77, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 27261, 9374, 62, 14681, 62, 8094, 62, 7857, 1600, 2099, 28, 600, 11, 4277, 28, 23, 11, 1037, 2625, 15931, 766, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3740, 1378, 12567, 13, 785, 14, 38021, 14, 1758, 87, 14, 2436, 672, 14, 9866, 14, 1758, 87, 14, 1845, 29363, 14, 834, 15003, 834, 13, 9078, 2, 43, 3365, 12, 43, 3134, 15931, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 6404, 62, 15908, 1600, 2099, 28, 2536, 11, 4277, 2625, 33283, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 23100, 3681, 10285, 3108, 329, 36628, 290, 2604, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 28826, 1600, 2099, 28, 600, 11, 4277, 28, 15, 11, 1037, 2625, 28826, 4943, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 271, 62, 1662, 62, 6649, 333, 76, 62, 21858, 1600, 2099, 28, 30388, 62, 32109, 11, 4277, 28, 17821, 11, 1037, 2625, 7248, 284, 2081, 611, 407, 2491, 287, 3454, 333, 76, 19570, 198, 48610, 13, 2860, 62, 49140, 7203, 438, 36166, 62, 8807, 1600, 2099, 28, 30388, 62, 32109, 11, 4277, 28, 25101, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 7248, 284, 2081, 284, 1057, 6306, 319, 32340, 2427, 286, 32516, 357, 1640, 28769, 8, 19570, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 5310, 13363, 62, 19849, 62, 6978, 3256, 4277, 28, 14202, 11, 2099, 28, 2536, 8, 198, 198, 2, 775, 2337, 1222, 8436, 1386, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 1904, 62, 86, 392, 65, 3256, 2099, 28, 30388, 62, 32109, 11, 299, 22046, 11639, 30, 3256, 4277, 28, 25101, 8, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 86, 392, 65, 62, 15042, 62, 2539, 62, 6978, 3256, 2099, 28, 2536, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 15235, 284, 775, 2337, 1222, 8436, 1386, 7824, 7383, 13, 1002, 779, 62, 86, 392, 65, 318, 900, 284, 6407, 290, 428, 4578, 318, 407, 7368, 11, 2836, 481, 307, 12053, 284, 8323, 5344, 19570, 198, 48610, 13, 2860, 62, 49140, 10786, 438, 86, 392, 65, 62, 46265, 22046, 3256, 299, 22046, 11639, 9, 3256, 2223, 28, 10044, 325, 42, 86, 22046, 11, 4277, 34758, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 8743, 307, 3804, 3264, 656, 11569, 65, 13, 15003, 3419, 19570, 628, 198, 198, 31, 13165, 354, 13, 3919, 62, 9744, 3419, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1388, 3419, 198 ]
2.837048
2,737
#!/usr/bin/env python # coding: utf-8 # In[7]: import pandas as pd import numpy as np from os.path import dirname, join from bokeh.io import show, output_notebook,output_file, show, save, curdoc, output_notebook, export_png from bokeh.plotting import figure, output_file, show,save from bokeh.models.widgets import Panel, Tabs from bokeh.layouts import column, row, widgetbox from bokeh.models import HoverTool, LinearColorMapper,TextInput,Label,LabelSet,Title,CustomJS,DataTable, Slider, Div,RangeSlider, Button,RadioGroup,LinearAxis, Range1d, ColumnDataSource, Paragraph,Select, TableColumn from bokeh.tile_providers import CARTODBPOSITRON, get_provider,OSM, STAMEN_TERRAIN #colors for each borough colors=['#7bccc4','#4eb3d3','#2b8cbe','#0868ac','#084081'] #Load data mid_dyn = pd.read_csv(join(dirname(__file__), "data/MiddleSchools_2006-2018_clean.csv")) mid_stat = pd.read_csv(join(dirname(__file__), "data/MiddleSchools_2018_clean.csv")) nums =['female_rate', 'male_rate', 'asian_rate', 'black_rate', 'hispanic_rate', 'other_rate', 'white_rate', 'disabilities_rate', 'ell_rate', 'poverty_rate', 'total_schooldays', 'presence_rate', 'absense_rate', 'release_rate', 'mean_score_math', 'mean_score_ela', 'diversity_index','crime_rate','avg_rent_per_sqft'] for num in nums: mid_stat[num] = round(mid_stat[num],1) if num not in ['crime_rate','avg_rent_per_sqft']: mid_dyn[num] = round(mid_dyn[num],1) # In[8]: # In[9]: #Get data from csv to lists # In[10]: # In[14]: # In[31]: text_input = TextInput(value='01M034') text_input.on_change('value',update1,update2) div1 = Div(text="<b> Write School DBN </b>") variables = ['Etnicities','Gender','Mean Score'] div2 = Div(text="<b> Choose variable </b>") radio_group = RadioGroup(labels=variables, active=1) radio_group.on_change('active',update1,update2) div3 = Div(text="<b> Location of School </b>") div4 = Div(text="<b> Overview </b>") plot,para,m,table = create_plot() layout = create_slider(plot, 2006, 2018) div5 = Div(text="<b> </b>") div6 = Div(text="<b> </b>") #Combine all controls to get in column col1= column(div1,text_input,div2,radio_group,div3,m, width=260) col2 = column(div6, layout, width=510) col3 = column(div5,table, width=230) col4 = column(div4, para, width=230) #Layout layout = row(col1,col2,col3,col4) curdoc().add_root(layout) curdoc().title = "NYC_map" #output_file("details.html") #save(layout) show(layout)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 2, 554, 58, 22, 5974, 628, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 28686, 13, 6978, 1330, 26672, 3672, 11, 4654, 198, 6738, 1489, 365, 71, 13, 952, 1330, 905, 11, 5072, 62, 11295, 2070, 11, 22915, 62, 7753, 11, 905, 11, 3613, 11, 1090, 15390, 11, 5072, 62, 11295, 2070, 11, 10784, 62, 11134, 198, 6738, 1489, 365, 71, 13, 29487, 889, 1330, 3785, 11, 5072, 62, 7753, 11, 905, 11, 21928, 198, 6738, 1489, 365, 71, 13, 27530, 13, 28029, 11407, 1330, 18810, 11, 309, 8937, 198, 6738, 1489, 365, 71, 13, 10724, 5269, 1330, 5721, 11, 5752, 11, 26295, 3524, 198, 6738, 1489, 365, 71, 13, 27530, 1330, 220, 38452, 25391, 11, 44800, 10258, 44, 11463, 11, 8206, 20560, 11, 33986, 11, 33986, 7248, 11, 19160, 11, 15022, 20120, 11, 6601, 10962, 11, 220, 220, 220, 220, 220, 220, 220, 3454, 1304, 11, 4777, 11, 17257, 11122, 1304, 11, 20969, 11, 26093, 13247, 11, 14993, 451, 31554, 271, 11, 13667, 16, 67, 11, 29201, 6601, 7416, 11, 2547, 6111, 11, 17563, 11, 8655, 39470, 198, 198, 6738, 1489, 365, 71, 13, 40927, 62, 15234, 4157, 1330, 327, 7227, 3727, 20866, 2640, 2043, 45806, 11, 651, 62, 15234, 1304, 11, 2640, 44, 11, 3563, 2390, 1677, 62, 5781, 3861, 1268, 198, 198, 2, 4033, 669, 329, 1123, 33534, 198, 4033, 669, 28, 17816, 2, 22, 65, 535, 66, 19, 41707, 2, 19, 1765, 18, 67, 18, 41707, 2, 17, 65, 23, 66, 1350, 41707, 2, 2919, 3104, 330, 41707, 2, 2919, 1821, 6659, 20520, 198, 198, 2, 8912, 1366, 198, 13602, 62, 67, 2047, 796, 279, 67, 13, 961, 62, 40664, 7, 22179, 7, 15908, 3672, 7, 834, 7753, 834, 828, 366, 7890, 14, 34621, 26130, 82, 62, 13330, 12, 7908, 62, 27773, 13, 40664, 48774, 198, 13602, 62, 14269, 796, 279, 67, 13, 961, 62, 40664, 7, 22179, 7, 15908, 3672, 7, 834, 7753, 834, 828, 366, 7890, 14, 34621, 26130, 82, 62, 7908, 62, 27773, 13, 40664, 48774, 628, 198, 77, 5700, 796, 17816, 24724, 62, 4873, 3256, 705, 22606, 62, 4873, 3256, 705, 292, 666, 62, 4873, 3256, 705, 13424, 62, 4873, 3256, 705, 14363, 35843, 62, 4873, 3256, 198, 220, 220, 220, 220, 220, 220, 705, 847, 62, 4873, 3256, 705, 11186, 62, 4873, 3256, 705, 6381, 5738, 62, 4873, 3256, 705, 695, 62, 4873, 3256, 198, 220, 220, 220, 220, 220, 220, 705, 79, 24085, 62, 4873, 3256, 705, 23350, 62, 82, 6679, 727, 592, 3256, 705, 18302, 594, 62, 4873, 3256, 705, 8937, 1072, 62, 4873, 3256, 198, 220, 220, 220, 220, 220, 220, 705, 20979, 62, 4873, 3256, 705, 32604, 62, 26675, 62, 11018, 3256, 705, 32604, 62, 26675, 62, 10304, 3256, 705, 67, 1608, 62, 9630, 41707, 28126, 62, 4873, 41707, 615, 70, 62, 1156, 62, 525, 62, 31166, 701, 20520, 198, 198, 1640, 997, 287, 997, 82, 25, 198, 220, 220, 220, 3095, 62, 14269, 58, 22510, 60, 796, 2835, 7, 13602, 62, 14269, 58, 22510, 4357, 16, 8, 198, 220, 220, 220, 611, 997, 407, 287, 37250, 28126, 62, 4873, 41707, 615, 70, 62, 1156, 62, 525, 62, 31166, 701, 6, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 3095, 62, 67, 2047, 58, 22510, 60, 796, 2835, 7, 13602, 62, 67, 2047, 58, 22510, 4357, 16, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 628, 198, 2, 554, 58, 23, 5974, 628, 198, 198, 2, 554, 58, 24, 5974, 628, 198, 2, 3855, 1366, 422, 269, 21370, 284, 8341, 628, 198, 2, 554, 58, 940, 5974, 628, 198, 198, 2, 554, 58, 1415, 5974, 628, 198, 198, 2, 554, 58, 3132, 5974, 628, 220, 220, 220, 220, 198, 220, 220, 220, 220, 198, 5239, 62, 15414, 796, 8255, 20560, 7, 8367, 11639, 486, 44, 49841, 11537, 198, 5239, 62, 15414, 13, 261, 62, 3803, 10786, 8367, 3256, 19119, 16, 11, 19119, 17, 8, 198, 198, 7146, 16, 796, 4777, 7, 5239, 2625, 27, 65, 29, 19430, 3961, 360, 15766, 7359, 65, 29, 4943, 198, 198, 25641, 2977, 796, 37250, 36, 83, 6988, 871, 41707, 41394, 41707, 5308, 272, 15178, 20520, 198, 7146, 17, 796, 4777, 7, 5239, 2625, 27, 65, 29, 17489, 7885, 7359, 65, 29, 4943, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 37004, 62, 8094, 796, 8829, 13247, 7, 23912, 1424, 28, 25641, 2977, 11, 4075, 28, 16, 8, 198, 37004, 62, 8094, 13, 261, 62, 3803, 10786, 5275, 3256, 19119, 16, 11, 19119, 17, 8, 198, 198, 7146, 18, 796, 4777, 7, 5239, 2625, 27, 65, 29, 13397, 286, 3961, 7359, 65, 29, 4943, 198, 198, 7146, 19, 796, 4777, 7, 5239, 2625, 27, 65, 29, 28578, 7359, 65, 29, 4943, 198, 29487, 11, 1845, 64, 11, 76, 11, 11487, 796, 2251, 62, 29487, 3419, 198, 39786, 796, 2251, 62, 6649, 1304, 7, 29487, 11, 4793, 11, 2864, 8, 198, 198, 7146, 20, 796, 4777, 7, 5239, 2625, 27, 65, 29, 7359, 65, 29, 4943, 198, 7146, 21, 796, 4777, 7, 5239, 2625, 27, 65, 29, 7359, 65, 29, 4943, 198, 2, 20575, 500, 477, 6973, 284, 651, 287, 5721, 198, 4033, 16, 28, 5721, 7, 7146, 16, 11, 5239, 62, 15414, 11, 7146, 17, 11, 37004, 62, 8094, 11, 7146, 18, 11, 76, 11, 9647, 28, 21719, 8, 198, 4033, 17, 796, 5721, 7, 7146, 21, 11, 12461, 11, 9647, 28, 33690, 8, 198, 4033, 18, 796, 5721, 7, 7146, 20, 11, 11487, 11, 9647, 28, 19214, 8, 198, 4033, 19, 796, 5721, 7, 7146, 19, 11, 31215, 11, 9647, 28, 19214, 8, 198, 2, 32517, 198, 39786, 796, 5752, 7, 4033, 16, 11, 4033, 17, 11, 4033, 18, 11, 4033, 19, 8, 198, 198, 66, 2799, 420, 22446, 2860, 62, 15763, 7, 39786, 8, 198, 66, 2799, 420, 22446, 7839, 796, 366, 12805, 34, 62, 8899, 1, 198, 198, 2, 22915, 62, 7753, 7203, 36604, 13, 6494, 4943, 198, 2, 21928, 7, 39786, 8, 198, 198, 12860, 7, 39786, 8, 628 ]
2.426357
1,032
import torch import torch.nn from detectron2.export.tensorrt import TensorRTModel from detectron2.utils.logger import setup_logger from ops import export_onnx, get_inputs, SimpleTracer if __name__ == '__main__': logger = setup_logger() logger.info("example: BBoxTransform") m = BBoxTransform() data = get_inputs("rois", "box_regression", "im_info", root="/autox-sz/users/dongqixu/share/trt_plugins/BBoxTransform", map_location="cpu") export_onnx(m, data, "model.onnx") targets = m(data) TensorRTModel.build_engine("model.onnx", "model.trt", 4, device="CUDA") e = TensorRTModel("model.trt") outputs = e.inference(data) # compare torch output and tensorrt output assert len(targets) == len(outputs), "Number of outputs does not match!" targets = [(k, v.cuda()) for k, v in targets.items()] for i, (name, tensor) in enumerate(targets): logger.info(name) diff = outputs[name] - tensor unique = torch.unique(diff) logger.info("unique\n{}".format(unique)) logger.info("max\n{}".format(torch.abs(unique).max())) assert torch.abs(unique).max() < 1e-3
[ 11748, 28034, 198, 11748, 28034, 13, 20471, 198, 6738, 4886, 1313, 17, 13, 39344, 13, 83, 22854, 17034, 1330, 309, 22854, 14181, 17633, 198, 6738, 4886, 1313, 17, 13, 26791, 13, 6404, 1362, 1330, 9058, 62, 6404, 1362, 198, 198, 6738, 39628, 1330, 10784, 62, 261, 77, 87, 11, 651, 62, 15414, 82, 11, 17427, 2898, 11736, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 49706, 796, 9058, 62, 6404, 1362, 3419, 198, 220, 220, 220, 49706, 13, 10951, 7203, 20688, 25, 12597, 1140, 41762, 4943, 628, 220, 220, 220, 285, 796, 12597, 1140, 41762, 3419, 628, 220, 220, 220, 1366, 796, 651, 62, 15414, 82, 7203, 305, 271, 1600, 366, 3524, 62, 2301, 2234, 1600, 366, 320, 62, 10951, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6808, 35922, 2306, 1140, 12, 82, 89, 14, 18417, 14, 67, 506, 80, 844, 84, 14, 20077, 14, 2213, 83, 62, 37390, 14, 33, 14253, 41762, 1600, 3975, 62, 24886, 2625, 36166, 4943, 198, 220, 220, 220, 10784, 62, 261, 77, 87, 7, 76, 11, 1366, 11, 366, 19849, 13, 261, 77, 87, 4943, 198, 220, 220, 220, 6670, 796, 285, 7, 7890, 8, 628, 220, 220, 220, 309, 22854, 14181, 17633, 13, 11249, 62, 18392, 7203, 19849, 13, 261, 77, 87, 1600, 366, 19849, 13, 2213, 83, 1600, 604, 11, 3335, 2625, 43633, 5631, 4943, 198, 220, 220, 220, 304, 796, 309, 22854, 14181, 17633, 7203, 19849, 13, 2213, 83, 4943, 198, 220, 220, 220, 23862, 796, 304, 13, 259, 4288, 7, 7890, 8, 628, 220, 220, 220, 1303, 8996, 28034, 5072, 290, 11192, 273, 17034, 5072, 198, 220, 220, 220, 6818, 18896, 7, 83, 853, 1039, 8, 6624, 18896, 7, 22915, 82, 828, 366, 15057, 286, 23862, 857, 407, 2872, 2474, 198, 220, 220, 220, 6670, 796, 47527, 74, 11, 410, 13, 66, 15339, 28955, 329, 479, 11, 410, 287, 6670, 13, 23814, 3419, 60, 198, 220, 220, 220, 329, 1312, 11, 357, 3672, 11, 11192, 273, 8, 287, 27056, 378, 7, 83, 853, 1039, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 10951, 7, 3672, 8, 198, 220, 220, 220, 220, 220, 220, 220, 814, 796, 23862, 58, 3672, 60, 532, 11192, 273, 198, 220, 220, 220, 220, 220, 220, 220, 3748, 796, 28034, 13, 34642, 7, 26069, 8, 198, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 10951, 7203, 34642, 59, 77, 90, 92, 1911, 18982, 7, 34642, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 10951, 7203, 9806, 59, 77, 90, 92, 1911, 18982, 7, 13165, 354, 13, 8937, 7, 34642, 737, 9806, 3419, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 6818, 28034, 13, 8937, 7, 34642, 737, 9806, 3419, 1279, 352, 68, 12, 18, 198 ]
2.43361
482
from setuptools import setup, find_packages setup( name="subsevenzip", version="0.1", description="7-Zip decompressor", author="Daniel Svensson", author_email="[email protected]", license="ISC", packages=find_packages(), test_suite="nose.collector", setup_requires=[ "coverage", "flake8", "nose" ], classifiers=[ "Programming Language :: Python :: 3 :: Only" ] )
[ 6738, 900, 37623, 10141, 1330, 9058, 11, 1064, 62, 43789, 198, 198, 40406, 7, 198, 220, 220, 220, 1438, 2625, 7266, 26548, 13344, 1600, 198, 220, 220, 220, 2196, 2625, 15, 13, 16, 1600, 198, 220, 220, 220, 6764, 2625, 22, 12, 41729, 38237, 44292, 1600, 198, 220, 220, 220, 1772, 2625, 19962, 44611, 16528, 1600, 198, 220, 220, 220, 1772, 62, 12888, 2625, 9310, 574, 16528, 31, 14816, 13, 785, 1600, 198, 220, 220, 220, 5964, 2625, 37719, 1600, 198, 220, 220, 220, 10392, 28, 19796, 62, 43789, 22784, 198, 220, 220, 220, 1332, 62, 2385, 578, 2625, 77, 577, 13, 33327, 273, 1600, 198, 220, 220, 220, 9058, 62, 47911, 41888, 198, 220, 220, 220, 220, 220, 220, 220, 366, 1073, 1857, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 47597, 23, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 77, 577, 1, 198, 220, 220, 220, 16589, 198, 220, 220, 220, 1398, 13350, 41888, 198, 220, 220, 220, 220, 220, 220, 220, 366, 15167, 2229, 15417, 7904, 11361, 7904, 513, 7904, 5514, 1, 198, 220, 220, 220, 2361, 198, 8, 198 ]
2.37234
188
#!/usr/bin/env python """Base module for end to end tests that run flows on clients.""" import re import time import traceback import unittest from grr.lib import aff4 from grr.lib import client_index from grr.lib import config_lib from grr.lib import data_store from grr.lib import flow_utils from grr.lib import rdfvalue from grr.lib import registry from grr.lib.aff4_objects import aff4_grr from grr.lib.flows.console import debugging from grr.lib.rdfvalues import client as rdf_client class Error(Exception): """Test base error.""" class ErrorEmptyCollection(Error): """Raise when we expect values in a collection, but it is empty.""" class TestStateUncleanError(Error): """Raised when tests encounter bad state that indicates a cleanup failure.""" class ClientTestBase(unittest.TestCase): """This is the base class for all client tests. Tests should only inherit from this class if they are not safe to be run in prod with the EndToEndTests cronjob. """ platforms = [] flow = None args = {} network_bytes_limit = None timeout = flow_utils.DEFAULT_TIMEOUT test_output_path = None # How long after flow is marked complete we should expect results to be # available in the collection. This is essentially how quickly we expect # results to be available to users in the UI. RESULTS_SLA_SECONDS = 10 # Only run on clients after this version client_min_version = None __metaclass__ = registry.MetaclassRegistry def VerifyEmpty(self, urns): """Verify urns have been deleted.""" try: for urn in urns: # TODO(user): aff4.FACTORY.Stat() is the right thing to use here. # We open each urn to generate InstantiationError on failures, multiopen # ignores these errors. This isn't too slow since it's almost always # just one path anyway. aff4.FACTORY.Open(urn, aff4_type=aff4.AFF4Volume, token=self.token) except aff4.InstantiationError: raise TestStateUncleanError("Path wasn't deleted: %s" % traceback.format_exc()) def DeleteUrn(self, urn): """Deletes an object from the db and the index, and flushes the caches.""" data_store.DB.DeleteSubject(urn, token=self.token) aff4.FACTORY._DeleteChildFromIndex(urn, token=self.token) aff4.FACTORY.Flush() def CheckCollectionNotEmptyWithRetry(self, collection_urn, token): """Check collection for results, return list if they exist. Args: collection_urn: URN of the collection token: User token Returns: The collection contents as a list Raises: ErrorEmptyCollection: if the collection has no results after self.RESULTS_SLA_SECONDS """ coll = aff4.FACTORY.Open(collection_urn, mode="r", token=token) coll_list = list(coll) if not coll_list: for _ in range(self.RESULTS_SLA_SECONDS): time.sleep(1) coll_list = list(coll) if coll_list: return coll_list raise ErrorEmptyCollection("No values in %s after SLA: %s seconds" % (collection_urn, self.RESULTS_SLA_SECONDS)) return coll_list def OpenFDWithRetry(self, file_urn, token): """Try to open a aff4 path, retry if it is AFF4Volume.""" fd = aff4.FACTORY.Open(file_urn, mode="r", token=token) # All types are instances of AFF4Volume so we can't use isinstance. if fd.__class__ is aff4.AFF4Volume: for _ in range(self.RESULTS_SLA_SECONDS): time.sleep(1) fd = aff4.FACTORY.Open(file_urn, mode="r", token=token) if fd.__class__ is not aff4.AFF4Volume: return fd self.fail(("No results were written to the data store. Maybe the GRR " "client is not running with root privileges?")) return fd class AutomatedTest(ClientTestBase): """All tests that are safe to run in prod should inherit from this class.""" __metaclass__ = registry.MetaclassRegistry # Prevents this from automatically registering. __abstract = True # pylint: disable=g-bad-name class TestVFSPathExists(AutomatedTest): """Test that checks expected VFS files were created.""" result_type = aff4_grr.VFSFile def CheckFlow(self): """Verify VFS paths were created.""" urn = self.GetURNFromGlobPathWithRetry(self.test_output_path) fd = self.OpenFDWithRetry(urn, token=self.token) self.assertEqual(type(fd), self.result_type) def GetClientTestTargets(client_ids=None, hostnames=None, token=None, checkin_duration_threshold="20m"): """Get client urns for end-to-end tests. Args: client_ids: list of client id URN strings or rdf_client.ClientURNs hostnames: list of hostnames to search for token: access token checkin_duration_threshold: clients that haven't checked in for this long will be excluded Returns: client_id_set: set of rdf_client.ClientURNs available for end-to-end tests. """ if client_ids: client_ids = set(client_ids) else: client_ids = set(config_lib.CONFIG.Get("Test.end_to_end_client_ids")) if hostnames: hosts = set(hostnames) else: hosts = set(config_lib.CONFIG.Get("Test.end_to_end_client_hostnames")) if hosts: client_id_dict = client_index.GetClientURNsForHostnames(hosts, token=token) for client_list in client_id_dict.values(): client_ids.update(client_list) client_id_set = set([rdf_client.ClientURN(x) for x in client_ids]) duration_threshold = rdfvalue.Duration(checkin_duration_threshold) for client in aff4.FACTORY.MultiOpen(client_id_set, token=token): # Only test against client IDs that have checked in recently. Test machines # tend to have lots of old client IDs hanging around that will cause lots of # waiting for timeouts in the tests. if (rdfvalue.RDFDatetime.Now() - client.Get(client.Schema.LAST) > duration_threshold): client_id_set.remove(client.urn) return client_id_set
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 37811, 14881, 8265, 329, 886, 284, 886, 5254, 326, 1057, 15623, 319, 7534, 526, 15931, 628, 198, 198, 11748, 302, 198, 11748, 640, 198, 11748, 12854, 1891, 198, 11748, 555, 715, 395, 628, 198, 6738, 1036, 81, 13, 8019, 1330, 1527, 19, 198, 6738, 1036, 81, 13, 8019, 1330, 5456, 62, 9630, 198, 6738, 1036, 81, 13, 8019, 1330, 4566, 62, 8019, 198, 6738, 1036, 81, 13, 8019, 1330, 1366, 62, 8095, 198, 6738, 1036, 81, 13, 8019, 1330, 5202, 62, 26791, 198, 6738, 1036, 81, 13, 8019, 1330, 374, 7568, 8367, 198, 6738, 1036, 81, 13, 8019, 1330, 20478, 198, 6738, 1036, 81, 13, 8019, 13, 2001, 19, 62, 48205, 1330, 1527, 19, 62, 2164, 81, 198, 6738, 1036, 81, 13, 8019, 13, 44041, 13, 41947, 1330, 28769, 198, 6738, 1036, 81, 13, 8019, 13, 4372, 69, 27160, 1330, 5456, 355, 374, 7568, 62, 16366, 628, 198, 4871, 13047, 7, 16922, 2599, 198, 220, 37227, 14402, 2779, 4049, 526, 15931, 628, 198, 4871, 13047, 40613, 36307, 7, 12331, 2599, 198, 220, 37227, 21762, 786, 618, 356, 1607, 3815, 287, 257, 4947, 11, 475, 340, 318, 6565, 526, 15931, 628, 198, 4871, 6208, 9012, 3118, 27773, 12331, 7, 12331, 2599, 198, 220, 37227, 21762, 1417, 618, 5254, 8791, 2089, 1181, 326, 9217, 257, 27425, 5287, 526, 15931, 628, 198, 198, 4871, 20985, 14402, 14881, 7, 403, 715, 395, 13, 14402, 20448, 2599, 198, 220, 37227, 1212, 318, 262, 2779, 1398, 329, 477, 5456, 5254, 13, 628, 220, 30307, 815, 691, 16955, 422, 428, 1398, 611, 484, 389, 407, 3338, 284, 307, 1057, 287, 198, 220, 40426, 351, 262, 5268, 2514, 12915, 51, 3558, 1067, 261, 21858, 13, 198, 220, 37227, 198, 220, 9554, 796, 17635, 198, 220, 5202, 796, 6045, 198, 220, 26498, 796, 23884, 198, 220, 3127, 62, 33661, 62, 32374, 796, 6045, 198, 220, 26827, 796, 5202, 62, 26791, 13, 7206, 38865, 62, 34694, 12425, 198, 220, 1332, 62, 22915, 62, 6978, 796, 6045, 198, 220, 1303, 1374, 890, 706, 5202, 318, 7498, 1844, 356, 815, 1607, 2482, 284, 307, 198, 220, 1303, 1695, 287, 262, 4947, 13, 770, 318, 6986, 703, 2952, 356, 1607, 198, 220, 1303, 2482, 284, 307, 1695, 284, 2985, 287, 262, 12454, 13, 198, 220, 15731, 35342, 62, 8634, 32, 62, 23683, 1340, 5258, 796, 838, 628, 220, 1303, 5514, 1057, 319, 7534, 706, 428, 2196, 198, 220, 5456, 62, 1084, 62, 9641, 796, 6045, 628, 220, 11593, 4164, 330, 31172, 834, 796, 20478, 13, 9171, 330, 31172, 8081, 4592, 628, 220, 825, 49899, 40613, 7, 944, 11, 220, 700, 82, 2599, 198, 220, 220, 220, 37227, 13414, 1958, 220, 700, 82, 423, 587, 13140, 526, 15931, 198, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 329, 220, 700, 287, 220, 700, 82, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 16926, 46, 7, 7220, 2599, 1527, 19, 13, 37, 10659, 15513, 13, 17126, 3419, 318, 262, 826, 1517, 284, 779, 994, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 775, 1280, 1123, 220, 700, 284, 7716, 24470, 3920, 12331, 319, 15536, 11, 5021, 9654, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 24245, 777, 8563, 13, 220, 770, 2125, 470, 1165, 3105, 1201, 340, 338, 2048, 1464, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 655, 530, 3108, 6949, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1527, 19, 13, 37, 10659, 15513, 13, 11505, 7, 700, 11, 1527, 19, 62, 4906, 28, 2001, 19, 13, 32, 5777, 19, 31715, 11, 11241, 28, 944, 13, 30001, 8, 198, 220, 220, 220, 2845, 1527, 19, 13, 49933, 3920, 12331, 25, 198, 220, 220, 220, 220, 220, 5298, 6208, 9012, 3118, 27773, 12331, 7203, 15235, 2492, 470, 13140, 25, 4064, 82, 1, 4064, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 12854, 1891, 13, 18982, 62, 41194, 28955, 628, 220, 825, 23520, 16692, 77, 7, 944, 11, 220, 700, 2599, 198, 220, 220, 220, 37227, 5005, 40676, 281, 2134, 422, 262, 20613, 290, 262, 6376, 11, 290, 781, 17237, 262, 50177, 526, 15931, 198, 220, 220, 220, 1366, 62, 8095, 13, 11012, 13, 38727, 19776, 7, 700, 11, 11241, 28, 944, 13, 30001, 8, 198, 220, 220, 220, 1527, 19, 13, 37, 10659, 15513, 13557, 38727, 16424, 4863, 15732, 7, 700, 11, 11241, 28, 944, 13, 30001, 8, 198, 220, 220, 220, 1527, 19, 13, 37, 10659, 15513, 13, 7414, 1530, 3419, 628, 220, 825, 6822, 36307, 3673, 40613, 3152, 9781, 563, 7, 944, 11, 4947, 62, 700, 11, 11241, 2599, 198, 220, 220, 220, 37227, 9787, 4947, 329, 2482, 11, 1441, 1351, 611, 484, 2152, 13, 628, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 4947, 62, 700, 25, 37902, 45, 286, 262, 4947, 198, 220, 220, 220, 220, 220, 11241, 25, 11787, 11241, 628, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 383, 4947, 10154, 355, 257, 1351, 198, 220, 220, 220, 7567, 2696, 25, 198, 220, 220, 220, 220, 220, 13047, 40613, 36307, 25, 611, 262, 4947, 468, 645, 2482, 706, 198, 220, 220, 220, 220, 220, 2116, 13, 46274, 62, 8634, 32, 62, 23683, 1340, 5258, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2927, 796, 1527, 19, 13, 37, 10659, 15513, 13, 11505, 7, 43681, 62, 700, 11, 4235, 2625, 81, 1600, 11241, 28, 30001, 8, 198, 220, 220, 220, 2927, 62, 4868, 796, 1351, 7, 26000, 8, 198, 220, 220, 220, 611, 407, 2927, 62, 4868, 25, 628, 220, 220, 220, 220, 220, 329, 4808, 287, 2837, 7, 944, 13, 46274, 62, 8634, 32, 62, 23683, 1340, 5258, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 640, 13, 42832, 7, 16, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2927, 62, 4868, 796, 1351, 7, 26000, 8, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2927, 62, 4868, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 2927, 62, 4868, 198, 220, 220, 220, 220, 220, 5298, 13047, 40613, 36307, 7203, 2949, 3815, 287, 4064, 82, 706, 12419, 32, 25, 4064, 82, 4201, 1, 4064, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 357, 43681, 62, 700, 11, 2116, 13, 46274, 62, 8634, 32, 62, 23683, 1340, 5258, 4008, 198, 220, 220, 220, 1441, 2927, 62, 4868, 628, 220, 825, 4946, 26009, 3152, 9781, 563, 7, 944, 11, 2393, 62, 700, 11, 11241, 2599, 198, 220, 220, 220, 37227, 23433, 284, 1280, 257, 1527, 19, 3108, 11, 1005, 563, 611, 340, 318, 317, 5777, 19, 31715, 526, 15931, 198, 220, 220, 220, 277, 67, 796, 1527, 19, 13, 37, 10659, 15513, 13, 11505, 7, 7753, 62, 700, 11, 4235, 2625, 81, 1600, 11241, 28, 30001, 8, 628, 220, 220, 220, 1303, 1439, 3858, 389, 10245, 286, 317, 5777, 19, 31715, 523, 356, 460, 470, 779, 318, 39098, 13, 198, 220, 220, 220, 611, 277, 67, 13, 834, 4871, 834, 318, 1527, 19, 13, 32, 5777, 19, 31715, 25, 198, 220, 220, 220, 220, 220, 329, 4808, 287, 2837, 7, 944, 13, 46274, 62, 8634, 32, 62, 23683, 1340, 5258, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 640, 13, 42832, 7, 16, 8, 198, 220, 220, 220, 220, 220, 220, 220, 277, 67, 796, 1527, 19, 13, 37, 10659, 15513, 13, 11505, 7, 7753, 62, 700, 11, 4235, 2625, 81, 1600, 11241, 28, 30001, 8, 198, 220, 220, 220, 220, 220, 220, 220, 611, 277, 67, 13, 834, 4871, 834, 318, 407, 1527, 19, 13, 32, 5777, 19, 31715, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 277, 67, 198, 220, 220, 220, 220, 220, 2116, 13, 32165, 7, 7203, 2949, 2482, 547, 3194, 284, 262, 1366, 3650, 13, 6674, 262, 10863, 49, 366, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 16366, 318, 407, 2491, 351, 6808, 18850, 1701, 4008, 198, 220, 220, 220, 1441, 277, 67, 628, 198, 4871, 17406, 515, 14402, 7, 11792, 14402, 14881, 2599, 198, 220, 37227, 3237, 5254, 326, 389, 3338, 284, 1057, 287, 40426, 815, 16955, 422, 428, 1398, 526, 15931, 198, 220, 11593, 4164, 330, 31172, 834, 796, 20478, 13, 9171, 330, 31172, 8081, 4592, 628, 220, 1303, 43280, 658, 428, 422, 6338, 28336, 13, 198, 220, 11593, 397, 8709, 796, 6407, 220, 1303, 279, 2645, 600, 25, 15560, 28, 70, 12, 14774, 12, 3672, 628, 198, 4871, 6208, 53, 37, 4303, 776, 3109, 1023, 7, 38062, 515, 14402, 2599, 198, 220, 37227, 14402, 326, 8794, 2938, 569, 10652, 3696, 547, 2727, 526, 15931, 198, 220, 1255, 62, 4906, 796, 1527, 19, 62, 2164, 81, 13, 53, 10652, 8979, 628, 220, 825, 6822, 37535, 7, 944, 2599, 198, 220, 220, 220, 37227, 13414, 1958, 569, 10652, 13532, 547, 2727, 526, 15931, 198, 220, 220, 220, 220, 700, 796, 2116, 13, 3855, 27064, 4863, 9861, 672, 15235, 3152, 9781, 563, 7, 944, 13, 9288, 62, 22915, 62, 6978, 8, 198, 220, 220, 220, 277, 67, 796, 2116, 13, 11505, 26009, 3152, 9781, 563, 7, 700, 11, 11241, 28, 944, 13, 30001, 8, 198, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 4906, 7, 16344, 828, 2116, 13, 20274, 62, 4906, 8, 628, 628, 628, 628, 198, 4299, 3497, 11792, 14402, 51, 853, 1039, 7, 16366, 62, 2340, 28, 14202, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2583, 14933, 28, 14202, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11241, 28, 14202, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2198, 259, 62, 32257, 62, 400, 10126, 2625, 1238, 76, 1, 2599, 198, 220, 37227, 3855, 5456, 220, 700, 82, 329, 886, 12, 1462, 12, 437, 5254, 13, 628, 220, 943, 14542, 25, 198, 220, 220, 220, 5456, 62, 2340, 25, 1351, 286, 5456, 4686, 37902, 45, 13042, 393, 374, 7568, 62, 16366, 13, 11792, 27064, 82, 198, 220, 220, 220, 2583, 14933, 25, 1351, 286, 2583, 14933, 284, 2989, 329, 198, 220, 220, 220, 11241, 25, 1895, 11241, 198, 220, 220, 220, 2198, 259, 62, 32257, 62, 400, 10126, 25, 7534, 326, 4398, 470, 10667, 287, 329, 428, 890, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 481, 307, 15009, 198, 220, 16409, 25, 198, 220, 220, 220, 5456, 62, 312, 62, 2617, 25, 900, 286, 374, 7568, 62, 16366, 13, 11792, 27064, 82, 1695, 329, 886, 12, 1462, 12, 437, 5254, 13, 198, 220, 37227, 628, 220, 611, 5456, 62, 2340, 25, 198, 220, 220, 220, 5456, 62, 2340, 796, 900, 7, 16366, 62, 2340, 8, 198, 220, 2073, 25, 198, 220, 220, 220, 5456, 62, 2340, 796, 900, 7, 11250, 62, 8019, 13, 10943, 16254, 13, 3855, 7203, 14402, 13, 437, 62, 1462, 62, 437, 62, 16366, 62, 2340, 48774, 628, 220, 611, 2583, 14933, 25, 198, 220, 220, 220, 11453, 796, 900, 7, 4774, 14933, 8, 198, 220, 2073, 25, 198, 220, 220, 220, 11453, 796, 900, 7, 11250, 62, 8019, 13, 10943, 16254, 13, 3855, 7203, 14402, 13, 437, 62, 1462, 62, 437, 62, 16366, 62, 4774, 14933, 48774, 628, 220, 611, 11453, 25, 198, 220, 220, 220, 5456, 62, 312, 62, 11600, 796, 5456, 62, 9630, 13, 3855, 11792, 27064, 82, 1890, 17932, 14933, 7, 4774, 82, 11, 11241, 28, 30001, 8, 198, 220, 220, 220, 329, 5456, 62, 4868, 287, 5456, 62, 312, 62, 11600, 13, 27160, 33529, 198, 220, 220, 220, 220, 220, 5456, 62, 2340, 13, 19119, 7, 16366, 62, 4868, 8, 628, 220, 5456, 62, 312, 62, 2617, 796, 900, 26933, 4372, 69, 62, 16366, 13, 11792, 27064, 7, 87, 8, 329, 2124, 287, 5456, 62, 2340, 12962, 198, 220, 9478, 62, 400, 10126, 796, 374, 7568, 8367, 13, 26054, 7, 9122, 259, 62, 32257, 62, 400, 10126, 8, 198, 220, 329, 5456, 287, 1527, 19, 13, 37, 10659, 15513, 13, 29800, 11505, 7, 16366, 62, 312, 62, 2617, 11, 11241, 28, 30001, 2599, 198, 220, 220, 220, 1303, 5514, 1332, 1028, 5456, 32373, 326, 423, 10667, 287, 2904, 13, 220, 6208, 8217, 198, 220, 220, 220, 1303, 4327, 284, 423, 6041, 286, 1468, 5456, 32373, 10938, 1088, 326, 481, 2728, 6041, 286, 198, 220, 220, 220, 1303, 4953, 329, 640, 5269, 287, 262, 5254, 13, 198, 220, 220, 220, 611, 357, 4372, 69, 8367, 13, 49, 8068, 27354, 8079, 13, 3844, 3419, 532, 5456, 13, 3855, 7, 16366, 13, 27054, 2611, 13, 43, 11262, 8, 1875, 198, 220, 220, 220, 220, 220, 220, 220, 9478, 62, 400, 10126, 2599, 198, 220, 220, 220, 220, 220, 5456, 62, 312, 62, 2617, 13, 28956, 7, 16366, 13, 700, 8, 628, 220, 1441, 5456, 62, 312, 62, 2617, 198 ]
2.687611
2,244
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license" file accompanying this file. This file 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 functools import itertools import json import logging import multiprocessing as mp import sys import traceback from pathlib import Path from pydoc import locate from tempfile import TemporaryDirectory from typing import TYPE_CHECKING, Callable, Iterator, Optional, Type import numpy as np import gluonts from gluonts.core import fqname_for from gluonts.core.component import equals, from_hyperparameters, validated from gluonts.core.serde import dump_json, load_json from gluonts.dataset.common import DataEntry, Dataset from gluonts.exceptions import GluonTSException from gluonts.model.forecast import Forecast if TYPE_CHECKING: # avoid circular import from gluonts.model.estimator import Estimator # noqa OutputTransform = Callable[[DataEntry, np.ndarray], np.ndarray] class Predictor: """ Abstract class representing predictor objects. Parameters ---------- prediction_length Prediction horizon. freq Frequency of the predicted data. """ __version__: str = gluonts.__version__ def predict(self, dataset: Dataset, **kwargs) -> Iterator[Forecast]: """ Compute forecasts for the time series in the provided dataset. This method is not implemented in this abstract class; please use one of the subclasses. Parameters ---------- dataset The dataset containing the time series to predict. Returns ------- Iterator[Forecast] Iterator over the forecasts, in the same order as the dataset iterable was provided. """ raise NotImplementedError @classmethod def deserialize(cls, path: Path, **kwargs) -> "Predictor": """ Load a serialized predictor from the given path Parameters ---------- path Path to the serialized files predictor. **kwargs Optional context/device parameter to be used with the predictor. If nothing is passed will use the GPU if available and CPU otherwise. """ # deserialize Predictor type with (path / "type.txt").open("r") as fp: tpe = locate(fp.readline()) # ensure that predictor_cls is a subtype of Predictor if not issubclass(tpe, Predictor): raise IOError( f"Class {fqname_for(tpe)} is not " f"a subclass of {fqname_for(Predictor)}" ) # call deserialize() for the concrete Predictor type return tpe.deserialize(path, **kwargs) @classmethod @classmethod @classmethod class RepresentablePredictor(Predictor): """ An abstract predictor that can be subclassed by models that are not based on Gluon. Subclasses should have @validated() constructors. (De)serialization and value equality are all implemented on top of the @validated() logic. Parameters ---------- prediction_length Prediction horizon. freq Frequency of the predicted data. """ @validated() def __eq__(self, that): """ Two RepresentablePredictor instances are considered equal if they have the same constructor arguments. """ return equals(self, that) @classmethod def _worker_loop( predictor_path: Path, input_queue: mp.Queue, output_queue: mp.Queue, worker_id, **kwargs, ): """ Worker loop for multiprocessing Predictor. Loads the predictor serialized in predictor_path reads inputs from input_queue and writes forecasts to output_queue """ predictor = Predictor.deserialize(predictor_path) while True: idx, data_chunk = input_queue.get() if idx is None: output_queue.put((None, None, None)) break try: result = list(predictor.predict(data_chunk, **kwargs)) except Exception: we = WorkerError( "".join(traceback.format_exception(*sys.exc_info())) ) output_queue.put((we, None, None)) break output_queue.put((idx, worker_id, result)) class ParallelizedPredictor(Predictor): """ Runs multiple instances (workers) of a predictor in parallel. Exceptions are propagated from the workers. Note: That there is currently an issue with tqdm that will cause things to hang if the ParallelizedPredictor is used with tqdm and an exception occurs during prediction. https://github.com/tqdm/tqdm/issues/548 Parameters ---------- base_predictor A representable predictor that will be used num_workers Number of workers (processes) to use. If set to None, one worker per CPU will be used. chunk_size Number of items to pass per call """ class Localizer(Predictor): """ A Predictor that uses an estimator to train a local model per time series and immediatly calls this to predict. Parameters ---------- estimator The estimator object to train on each dataset entry at prediction time. """
[ 2, 15069, 2864, 6186, 13, 785, 11, 3457, 13, 393, 663, 29116, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 11074, 198, 2, 921, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 317, 4866, 286, 262, 13789, 318, 5140, 379, 198, 2, 198, 2, 220, 220, 220, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 2, 198, 2, 393, 287, 262, 366, 43085, 1, 2393, 19249, 428, 2393, 13, 770, 2393, 318, 9387, 198, 2, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 198, 2, 4911, 393, 17142, 13, 4091, 262, 13789, 329, 262, 2176, 3303, 15030, 198, 2, 21627, 290, 11247, 739, 262, 13789, 13, 198, 198, 11748, 1257, 310, 10141, 198, 11748, 340, 861, 10141, 198, 11748, 33918, 198, 11748, 18931, 198, 11748, 18540, 305, 919, 278, 355, 29034, 198, 11748, 25064, 198, 11748, 12854, 1891, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 279, 5173, 420, 1330, 17276, 198, 6738, 20218, 7753, 1330, 46042, 43055, 198, 6738, 19720, 1330, 41876, 62, 50084, 2751, 11, 4889, 540, 11, 40806, 1352, 11, 32233, 11, 5994, 198, 198, 11748, 299, 32152, 355, 45941, 198, 198, 11748, 1278, 84, 756, 82, 198, 6738, 1278, 84, 756, 82, 13, 7295, 1330, 277, 80, 3672, 62, 1640, 198, 6738, 1278, 84, 756, 82, 13, 7295, 13, 42895, 1330, 21767, 11, 422, 62, 49229, 17143, 7307, 11, 31031, 198, 6738, 1278, 84, 756, 82, 13, 7295, 13, 2655, 2934, 1330, 10285, 62, 17752, 11, 3440, 62, 17752, 198, 6738, 1278, 84, 756, 82, 13, 19608, 292, 316, 13, 11321, 1330, 6060, 30150, 11, 16092, 292, 316, 198, 6738, 1278, 84, 756, 82, 13, 1069, 11755, 1330, 402, 2290, 261, 4694, 16922, 198, 6738, 1278, 84, 756, 82, 13, 19849, 13, 754, 2701, 1330, 4558, 2701, 198, 198, 361, 41876, 62, 50084, 2751, 25, 220, 1303, 3368, 18620, 1330, 198, 220, 220, 220, 422, 1278, 84, 756, 82, 13, 19849, 13, 395, 320, 1352, 1330, 10062, 320, 1352, 220, 1303, 645, 20402, 628, 198, 26410, 41762, 796, 4889, 540, 30109, 6601, 30150, 11, 45941, 13, 358, 18747, 4357, 45941, 13, 358, 18747, 60, 628, 198, 4871, 49461, 273, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 27741, 1398, 10200, 41568, 5563, 13, 198, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 17724, 62, 13664, 198, 220, 220, 220, 220, 220, 220, 220, 46690, 17810, 13, 198, 220, 220, 220, 2030, 80, 198, 220, 220, 220, 220, 220, 220, 220, 31902, 286, 262, 11001, 1366, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 11593, 9641, 834, 25, 965, 796, 1278, 84, 756, 82, 13, 834, 9641, 834, 628, 220, 220, 220, 825, 4331, 7, 944, 11, 27039, 25, 16092, 292, 316, 11, 12429, 46265, 22046, 8, 4613, 40806, 1352, 58, 16351, 2701, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 3082, 1133, 26119, 329, 262, 640, 2168, 287, 262, 2810, 27039, 13, 198, 220, 220, 220, 220, 220, 220, 220, 770, 2446, 318, 407, 9177, 287, 428, 12531, 1398, 26, 3387, 198, 220, 220, 220, 220, 220, 220, 220, 779, 530, 286, 262, 850, 37724, 13, 198, 220, 220, 220, 220, 220, 220, 220, 40117, 198, 220, 220, 220, 220, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 220, 220, 220, 220, 27039, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 383, 27039, 7268, 262, 640, 2168, 284, 4331, 13, 198, 220, 220, 220, 220, 220, 220, 220, 16409, 198, 220, 220, 220, 220, 220, 220, 220, 35656, 198, 220, 220, 220, 220, 220, 220, 220, 40806, 1352, 58, 16351, 2701, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 40806, 1352, 625, 262, 26119, 11, 287, 262, 976, 1502, 355, 262, 27039, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11629, 540, 373, 2810, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 1892, 3546, 1154, 12061, 12331, 628, 220, 220, 220, 2488, 4871, 24396, 198, 220, 220, 220, 825, 748, 48499, 1096, 7, 565, 82, 11, 3108, 25, 10644, 11, 12429, 46265, 22046, 8, 4613, 366, 47, 17407, 273, 1298, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 8778, 257, 11389, 1143, 41568, 422, 262, 1813, 3108, 628, 220, 220, 220, 220, 220, 220, 220, 40117, 198, 220, 220, 220, 220, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 220, 220, 220, 220, 3108, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10644, 284, 262, 11389, 1143, 3696, 41568, 13, 198, 220, 220, 220, 220, 220, 220, 220, 12429, 46265, 22046, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 32233, 4732, 14, 25202, 11507, 284, 307, 973, 351, 262, 41568, 13, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1002, 2147, 318, 3804, 481, 779, 262, 11362, 611, 1695, 290, 9135, 4306, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 748, 48499, 1096, 49461, 273, 2099, 198, 220, 220, 220, 220, 220, 220, 220, 351, 357, 6978, 1220, 366, 4906, 13, 14116, 11074, 9654, 7203, 81, 4943, 355, 277, 79, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 256, 431, 796, 17276, 7, 46428, 13, 961, 1370, 28955, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 4155, 326, 41568, 62, 565, 82, 318, 257, 850, 4906, 286, 49461, 273, 198, 220, 220, 220, 220, 220, 220, 220, 611, 407, 1189, 549, 4871, 7, 83, 431, 11, 49461, 273, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5298, 24418, 12331, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 1, 9487, 1391, 69, 80, 3672, 62, 1640, 7, 83, 431, 38165, 318, 407, 366, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 1, 64, 47611, 286, 1391, 69, 80, 3672, 62, 1640, 7, 47, 17407, 273, 8, 36786, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 869, 748, 48499, 1096, 3419, 329, 262, 10017, 49461, 273, 2099, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 256, 431, 13, 8906, 48499, 1096, 7, 6978, 11, 12429, 46265, 22046, 8, 628, 220, 220, 220, 2488, 4871, 24396, 628, 220, 220, 220, 2488, 4871, 24396, 628, 220, 220, 220, 2488, 4871, 24396, 628, 198, 4871, 10858, 540, 47, 17407, 273, 7, 47, 17407, 273, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1052, 12531, 41568, 326, 460, 307, 47611, 276, 416, 4981, 326, 389, 407, 1912, 198, 220, 220, 220, 319, 402, 2290, 261, 13, 3834, 37724, 815, 423, 2488, 12102, 515, 3419, 5678, 669, 13, 198, 220, 220, 220, 357, 5005, 8, 46911, 1634, 290, 1988, 10537, 389, 477, 9177, 319, 1353, 286, 262, 198, 220, 220, 220, 2488, 12102, 515, 3419, 9156, 13, 198, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 17724, 62, 13664, 198, 220, 220, 220, 220, 220, 220, 220, 46690, 17810, 13, 198, 220, 220, 220, 2030, 80, 198, 220, 220, 220, 220, 220, 220, 220, 31902, 286, 262, 11001, 1366, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 2488, 12102, 515, 3419, 628, 220, 220, 220, 825, 11593, 27363, 834, 7, 944, 11, 326, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 4930, 10858, 540, 47, 17407, 273, 10245, 389, 3177, 4961, 611, 484, 198, 220, 220, 220, 220, 220, 220, 220, 423, 262, 976, 23772, 7159, 13, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 21767, 7, 944, 11, 326, 8, 628, 220, 220, 220, 2488, 4871, 24396, 628, 198, 198, 4299, 4808, 28816, 62, 26268, 7, 198, 220, 220, 220, 41568, 62, 6978, 25, 10644, 11, 198, 220, 220, 220, 5128, 62, 36560, 25, 29034, 13, 34991, 11, 198, 220, 220, 220, 5072, 62, 36560, 25, 29034, 13, 34991, 11, 198, 220, 220, 220, 8383, 62, 312, 11, 198, 220, 220, 220, 12429, 46265, 22046, 11, 198, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 35412, 9052, 329, 18540, 305, 919, 278, 49461, 273, 13, 198, 220, 220, 220, 8778, 82, 262, 41568, 11389, 1143, 287, 41568, 62, 6978, 198, 220, 220, 220, 9743, 17311, 422, 5128, 62, 36560, 290, 6797, 26119, 284, 5072, 62, 36560, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 41568, 796, 49461, 273, 13, 8906, 48499, 1096, 7, 79, 17407, 273, 62, 6978, 8, 198, 220, 220, 220, 981, 6407, 25, 198, 220, 220, 220, 220, 220, 220, 220, 4686, 87, 11, 1366, 62, 354, 2954, 796, 5128, 62, 36560, 13, 1136, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 611, 4686, 87, 318, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5072, 62, 36560, 13, 1996, 19510, 14202, 11, 6045, 11, 6045, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1255, 796, 1351, 7, 79, 17407, 273, 13, 79, 17407, 7, 7890, 62, 354, 2954, 11, 12429, 46265, 22046, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 2845, 35528, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 356, 796, 35412, 12331, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 1911, 22179, 7, 40546, 1891, 13, 18982, 62, 1069, 4516, 46491, 17597, 13, 41194, 62, 10951, 3419, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5072, 62, 36560, 13, 1996, 19510, 732, 11, 6045, 11, 6045, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 220, 220, 220, 220, 220, 220, 220, 5072, 62, 36560, 13, 1996, 19510, 312, 87, 11, 8383, 62, 312, 11, 1255, 4008, 628, 198, 4871, 42945, 1143, 47, 17407, 273, 7, 47, 17407, 273, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 44743, 3294, 10245, 357, 22896, 8, 286, 257, 41568, 287, 10730, 13, 198, 220, 220, 220, 1475, 11755, 389, 8928, 515, 422, 262, 3259, 13, 198, 220, 220, 220, 5740, 25, 1320, 612, 318, 3058, 281, 2071, 351, 256, 80, 36020, 326, 481, 2728, 1243, 198, 220, 220, 220, 284, 8181, 611, 262, 42945, 1143, 47, 17407, 273, 318, 973, 351, 256, 80, 36020, 290, 281, 6631, 198, 220, 220, 220, 8833, 1141, 17724, 13, 198, 220, 220, 220, 3740, 1378, 12567, 13, 785, 14, 83, 80, 36020, 14, 83, 80, 36020, 14, 37165, 14, 49934, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 2779, 62, 79, 17407, 273, 198, 220, 220, 220, 220, 220, 220, 220, 317, 2380, 540, 41568, 326, 481, 307, 973, 198, 220, 220, 220, 997, 62, 22896, 198, 220, 220, 220, 220, 220, 220, 220, 7913, 286, 3259, 357, 14681, 274, 8, 284, 779, 13, 1002, 900, 284, 198, 220, 220, 220, 220, 220, 220, 220, 6045, 11, 530, 8383, 583, 9135, 481, 307, 973, 13, 198, 220, 220, 220, 16058, 62, 7857, 198, 220, 220, 220, 220, 220, 220, 220, 7913, 286, 3709, 284, 1208, 583, 869, 198, 220, 220, 220, 37227, 628, 198, 4871, 10714, 7509, 7, 47, 17407, 273, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 317, 49461, 273, 326, 3544, 281, 3959, 1352, 284, 4512, 257, 1957, 2746, 583, 640, 2168, 290, 198, 220, 220, 220, 2729, 265, 306, 3848, 428, 284, 4331, 13, 198, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 3959, 1352, 198, 220, 220, 220, 220, 220, 220, 220, 383, 3959, 1352, 2134, 284, 4512, 319, 1123, 27039, 5726, 379, 17724, 640, 13, 198, 220, 220, 220, 37227, 628, 198 ]
2.705548
2,109
# Copyright 2018 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from collections import Counter from datetime import datetime from dateutil.tz import tzutc import hashlib import jmespath import json from .core import BaseAction from c7n.utils import type_schema, local_session, chunks, dumps, filter_empty from c7n.manager import resources as aws_resources from c7n.version import version FindingTypes = { "Software and Configuration Checks": [ "Vulnerabilities", "Vulnerabilities/CVE", "AWS Security Best Practices", "AWS Security Best Practices/Network Reachability", "Industry and Regulatory Standards", "Industry and Regulatory Standards/CIS Host Hardening Benchmarks", "Industry and Regulatory Standards/CIS AWS Foundations Benchmark", "Industry and Regulatory Standards/PCI-DSS Controls", "Industry and Regulatory Standards/Cloud Security Alliance Controls", "Industry and Regulatory Standards/ISO 90001 Controls", "Industry and Regulatory Standards/ISO 27001 Controls", "Industry and Regulatory Standards/ISO 27017 Controls", "Industry and Regulatory Standards/ISO 27018 Controls", "Industry and Regulatory Standards/SOC 1", "Industry and Regulatory Standards/SOC 2", "Industry and Regulatory Standards/HIPAA Controls (USA)", "Industry and Regulatory Standards/NIST 800-53 Controls (USA)", "Industry and Regulatory Standards/NIST CSF Controls (USA)", "Industry and Regulatory Standards/IRAP Controls (Australia)", "Industry and Regulatory Standards/K-ISMS Controls (Korea)", "Industry and Regulatory Standards/MTCS Controls (Singapore)", "Industry and Regulatory Standards/FISC Controls (Japan)", "Industry and Regulatory Standards/My Number Act Controls (Japan)", "Industry and Regulatory Standards/ENS Controls (Spain)", "Industry and Regulatory Standards/Cyber Essentials Plus Controls (UK)", "Industry and Regulatory Standards/G-Cloud Controls (UK)", "Industry and Regulatory Standards/C5 Controls (Germany)", "Industry and Regulatory Standards/IT-Grundschutz Controls (Germany)", "Industry and Regulatory Standards/GDPR Controls (Europe)", "Industry and Regulatory Standards/TISAX Controls (Europe)", ], "TTPs": [ "Initial Access", "Execution", "Persistence", "Privilege Escalation", "Defense Evasion", "Credential Access", "Discovery", "Lateral Movement", "Collection", "Command and Control", ], "Effects": [ "Data Exposure", "Data Exfiltration", "Data Destruction", "Denial of Service", "Resource Consumption", ], } # Mostly undocumented value size limit SECHUB_VALUE_SIZE_LIMIT = 1024 class PostFinding(BaseAction): """Report a finding to AWS Security Hub. Custodian acts as a finding provider, allowing users to craft policies that report to the AWS SecurityHub. For resources that are taggable, we will tag the resource with an identifier such that further findings generate updates. Example generate a finding for accounts that don't have shield enabled. :example: .. code-block:: yaml policies: - name: account-shield-enabled resource: account filters: - shield-enabled actions: - type: post-finding severity_normalized: 6 types: - "Software and Configuration Checks/Industry and Regulatory Standards/NIST CSF Controls (USA)" recommendation: "Enable shield" recommendation_url: "https://www.example.com/policies/AntiDDoS.html" confidence: 100 compliance_status: FAILED """ # NOQA FindingVersion = "2018-10-08" ProductName = "default" permissions = ('securityhub:BatchImportFindings',) schema_alias = True schema = type_schema( "post-finding", required=["types"], title={"type": "string"}, severity={"type": "number", 'default': 0}, severity_normalized={"type": "number", "min": 0, "max": 100, 'default': 0}, confidence={"type": "number", "min": 0, "max": 100}, criticality={"type": "number", "min": 0, "max": 100}, # Cross region aggregation region={'type': 'string', 'description': 'cross-region aggregation target'}, recommendation={"type": "string"}, recommendation_url={"type": "string"}, fields={"type": "object"}, batch_size={'type': 'integer', 'minimum': 1, 'maximum': 10}, types={ "type": "array", "items": {"type": "string", "enum": build_vocabulary()}, }, compliance_status={ "type": "string", "enum": ["PASSED", "WARNING", "FAILED", "NOT_AVAILABLE"], }, ) NEW_FINDING = 'New' aws_resources.subscribe( aws_resources.EVENT_FINAL, OtherResourcePostFinding.register_resource)
[ 2, 15069, 2864, 9747, 1881, 6168, 11, 11419, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 921, 743, 7330, 257, 4866, 286, 262, 13789, 379, 198, 2, 198, 2, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 2, 198, 2, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 198, 2, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 198, 2, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 198, 2, 4091, 262, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 198, 2, 11247, 739, 262, 13789, 13, 198, 6738, 17268, 1330, 15034, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 3128, 22602, 13, 22877, 1330, 256, 89, 315, 66, 198, 198, 11748, 12234, 8019, 198, 11748, 474, 6880, 6978, 198, 11748, 33918, 198, 198, 6738, 764, 7295, 1330, 7308, 12502, 198, 6738, 269, 22, 77, 13, 26791, 1330, 2099, 62, 15952, 2611, 11, 1957, 62, 29891, 11, 22716, 11, 45514, 11, 8106, 62, 28920, 198, 198, 6738, 269, 22, 77, 13, 37153, 1330, 4133, 355, 3253, 82, 62, 37540, 198, 6738, 269, 22, 77, 13, 9641, 1330, 2196, 628, 198, 36276, 31431, 796, 1391, 198, 220, 220, 220, 366, 25423, 290, 28373, 47719, 1298, 685, 198, 220, 220, 220, 220, 220, 220, 220, 366, 53, 5697, 5738, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 53, 5697, 5738, 14, 31436, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 12298, 50, 4765, 6705, 42134, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 12298, 50, 4765, 6705, 42134, 14, 26245, 25146, 1799, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 34, 1797, 14504, 6912, 3101, 25187, 14306, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 34, 1797, 30865, 4062, 602, 25187, 4102, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 5662, 40, 12, 5258, 50, 36357, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 18839, 4765, 10302, 36357, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 40734, 15897, 486, 36357, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 40734, 2681, 8298, 36357, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 40734, 2681, 29326, 36357, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 40734, 2681, 29159, 36357, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 50, 4503, 352, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 50, 4503, 362, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 39, 4061, 3838, 36357, 357, 14053, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 45, 8808, 10460, 12, 4310, 36357, 357, 14053, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 45, 8808, 9429, 37, 36357, 357, 14053, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 4663, 2969, 36357, 357, 27429, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 42, 12, 1797, 5653, 36357, 357, 42, 46215, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 44, 4825, 50, 36357, 357, 29974, 11656, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 37, 37719, 36357, 357, 16504, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 3666, 7913, 2191, 36357, 357, 16504, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 16938, 36357, 357, 45355, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 20418, 527, 11985, 14817, 8227, 36357, 357, 15039, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 38, 12, 18839, 36357, 357, 15039, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 34, 20, 36357, 357, 27079, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 2043, 12, 38, 622, 358, 20601, 27839, 36357, 357, 27079, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 45113, 4805, 36357, 357, 16112, 42501, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35848, 563, 290, 38018, 20130, 14, 51, 22312, 55, 36357, 357, 16112, 42501, 198, 220, 220, 220, 16589, 198, 220, 220, 220, 366, 51, 7250, 82, 1298, 685, 198, 220, 220, 220, 220, 220, 220, 220, 366, 24243, 8798, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 23002, 1009, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 30946, 13274, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 20184, 41866, 16319, 282, 341, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 27300, 4319, 4247, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 34, 445, 1843, 8798, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 35, 40821, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 43, 10534, 15477, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 36307, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 21575, 290, 6779, 1600, 198, 220, 220, 220, 16589, 198, 220, 220, 220, 366, 47738, 1298, 685, 198, 220, 220, 220, 220, 220, 220, 220, 366, 6601, 39090, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 6601, 1475, 69, 36055, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 6601, 25034, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 21306, 498, 286, 4809, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 366, 26198, 42158, 1600, 198, 220, 220, 220, 16589, 198, 92, 628, 198, 2, 33495, 21829, 1988, 2546, 4179, 198, 23683, 39, 10526, 62, 39488, 62, 33489, 62, 43, 3955, 2043, 796, 28119, 628, 198, 198, 4871, 2947, 36276, 7, 14881, 12502, 2599, 198, 220, 220, 220, 37227, 19100, 257, 4917, 284, 30865, 4765, 14699, 13, 628, 220, 220, 220, 40619, 375, 666, 6529, 355, 257, 4917, 10131, 11, 5086, 2985, 284, 5977, 198, 220, 220, 220, 4788, 326, 989, 284, 262, 30865, 4765, 16066, 13, 628, 220, 220, 220, 1114, 4133, 326, 389, 7621, 70, 540, 11, 356, 481, 7621, 262, 8271, 351, 281, 27421, 198, 220, 220, 220, 884, 326, 2252, 6373, 7716, 5992, 13, 628, 220, 220, 220, 17934, 7716, 257, 4917, 329, 5504, 326, 836, 470, 423, 7614, 9343, 13, 628, 220, 220, 220, 1058, 20688, 25, 628, 220, 220, 220, 11485, 2438, 12, 9967, 3712, 331, 43695, 628, 220, 220, 220, 220, 220, 4788, 25, 628, 220, 220, 220, 220, 220, 220, 532, 1438, 25, 1848, 12, 26662, 12, 25616, 198, 220, 220, 220, 220, 220, 220, 220, 220, 8271, 25, 1848, 198, 220, 220, 220, 220, 220, 220, 220, 220, 16628, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 532, 7614, 12, 25616, 198, 220, 220, 220, 220, 220, 220, 220, 220, 4028, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 532, 2099, 25, 1281, 12, 41070, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19440, 62, 11265, 1143, 25, 718, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3858, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 532, 366, 25423, 290, 28373, 47719, 14, 35848, 563, 290, 38018, 20130, 14, 45, 8808, 9429, 37, 36357, 357, 14053, 16725, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 15602, 25, 366, 36695, 7614, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 15602, 62, 6371, 25, 366, 5450, 1378, 2503, 13, 20688, 13, 785, 14, 79, 4160, 444, 14, 28795, 35, 46498, 13, 6494, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6628, 25, 1802, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11846, 62, 13376, 25, 9677, 4146, 1961, 628, 220, 220, 220, 37227, 1303, 8005, 48, 32, 628, 220, 220, 220, 27063, 14815, 796, 366, 7908, 12, 940, 12, 2919, 1, 198, 220, 220, 220, 8721, 5376, 796, 366, 12286, 1, 628, 220, 220, 220, 21627, 796, 19203, 12961, 40140, 25, 33, 963, 20939, 16742, 654, 3256, 8, 628, 220, 220, 220, 32815, 62, 26011, 796, 6407, 198, 220, 220, 220, 32815, 796, 2099, 62, 15952, 2611, 7, 198, 220, 220, 220, 220, 220, 220, 220, 366, 7353, 12, 41070, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 2672, 28, 14692, 19199, 33116, 198, 220, 220, 220, 220, 220, 220, 220, 3670, 28, 4895, 4906, 1298, 366, 8841, 25719, 198, 220, 220, 220, 220, 220, 220, 220, 19440, 28, 4895, 4906, 1298, 366, 17618, 1600, 705, 12286, 10354, 657, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 19440, 62, 11265, 1143, 28, 4895, 4906, 1298, 366, 17618, 1600, 366, 1084, 1298, 657, 11, 366, 9806, 1298, 1802, 11, 705, 12286, 10354, 657, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 6628, 28, 4895, 4906, 1298, 366, 17618, 1600, 366, 1084, 1298, 657, 11, 366, 9806, 1298, 1802, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 4688, 414, 28, 4895, 4906, 1298, 366, 17618, 1600, 366, 1084, 1298, 657, 11, 366, 9806, 1298, 1802, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 6372, 3814, 46500, 198, 220, 220, 220, 220, 220, 220, 220, 3814, 34758, 6, 4906, 10354, 705, 8841, 3256, 705, 11213, 10354, 705, 19692, 12, 36996, 46500, 2496, 6, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 15602, 28, 4895, 4906, 1298, 366, 8841, 25719, 198, 220, 220, 220, 220, 220, 220, 220, 15602, 62, 6371, 28, 4895, 4906, 1298, 366, 8841, 25719, 198, 220, 220, 220, 220, 220, 220, 220, 7032, 28, 4895, 4906, 1298, 366, 15252, 25719, 198, 220, 220, 220, 220, 220, 220, 220, 15458, 62, 7857, 34758, 6, 4906, 10354, 705, 41433, 3256, 705, 39504, 10354, 352, 11, 705, 47033, 10354, 838, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 3858, 34758, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 18747, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 23814, 1298, 19779, 4906, 1298, 366, 8841, 1600, 366, 44709, 1298, 1382, 62, 18893, 22528, 3419, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 220, 220, 220, 220, 11846, 62, 13376, 34758, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 4906, 1298, 366, 8841, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 44709, 1298, 14631, 47924, 1961, 1600, 366, 31502, 1600, 366, 7708, 4146, 1961, 1600, 366, 11929, 62, 10116, 32, 4146, 17534, 33116, 198, 220, 220, 220, 220, 220, 220, 220, 8964, 198, 220, 220, 220, 1267, 628, 220, 220, 220, 12682, 62, 37, 12115, 2751, 796, 705, 3791, 6, 628, 198, 198, 8356, 62, 37540, 13, 7266, 12522, 7, 198, 220, 220, 220, 3253, 82, 62, 37540, 13, 20114, 3525, 62, 37, 17961, 11, 3819, 26198, 6307, 36276, 13, 30238, 62, 31092, 8, 198 ]
2.788823
2,022
ANNOTATION = "annotation" GRIDLINE = "gridline" SHAPE = "shape" SHAPE_TEXT = "shapetext" EDGE = "edge" LINK_LABEL = "linklabel" WIRELESS_EDGE = "wireless" ANTENNA = "antenna" NODE_LABEL = "nodename" NODE = "node" WALLPAPER = "wallpaper" SELECTION = "selectednodes" MARKER = "marker" ORGANIZE_TAGS = [ WALLPAPER, GRIDLINE, SHAPE, SHAPE_TEXT, EDGE, WIRELESS_EDGE, LINK_LABEL, ANTENNA, NODE, NODE_LABEL, SELECTION, MARKER, ] RESET_TAGS = [ EDGE, NODE, NODE_LABEL, WALLPAPER, LINK_LABEL, ANTENNA, WIRELESS_EDGE, SELECTION, SHAPE, SHAPE_TEXT, MARKER, ]
[ 1565, 11929, 6234, 796, 366, 1236, 14221, 1, 198, 10761, 2389, 24027, 796, 366, 25928, 1370, 1, 198, 9693, 45721, 796, 366, 43358, 1, 198, 9693, 45721, 62, 32541, 796, 366, 1477, 499, 316, 2302, 1, 198, 1961, 8264, 796, 366, 14907, 1, 198, 43, 17248, 62, 48780, 3698, 796, 366, 8726, 18242, 1, 198, 36326, 16448, 7597, 62, 1961, 8264, 796, 366, 21809, 1203, 1, 198, 8643, 1677, 4535, 796, 366, 415, 13713, 1, 198, 45, 16820, 62, 48780, 3698, 796, 366, 77, 375, 12453, 1, 198, 45, 16820, 796, 366, 17440, 1, 198, 54, 7036, 47, 2969, 1137, 796, 366, 11930, 20189, 1, 198, 46506, 2849, 796, 366, 34213, 77, 4147, 1, 198, 44, 14175, 1137, 796, 366, 4102, 263, 1, 198, 1581, 45028, 35400, 62, 42197, 50, 796, 685, 198, 220, 220, 220, 370, 7036, 47, 2969, 1137, 11, 198, 220, 220, 220, 10863, 2389, 24027, 11, 198, 220, 220, 220, 6006, 45721, 11, 198, 220, 220, 220, 6006, 45721, 62, 32541, 11, 198, 220, 220, 220, 8392, 8264, 11, 198, 220, 220, 220, 29360, 16448, 7597, 62, 1961, 8264, 11, 198, 220, 220, 220, 34426, 62, 48780, 3698, 11, 198, 220, 220, 220, 3537, 51, 1677, 4535, 11, 198, 220, 220, 220, 399, 16820, 11, 198, 220, 220, 220, 399, 16820, 62, 48780, 3698, 11, 198, 220, 220, 220, 33493, 2849, 11, 198, 220, 220, 220, 39641, 1137, 11, 198, 60, 198, 19535, 2767, 62, 42197, 50, 796, 685, 198, 220, 220, 220, 8392, 8264, 11, 198, 220, 220, 220, 399, 16820, 11, 198, 220, 220, 220, 399, 16820, 62, 48780, 3698, 11, 198, 220, 220, 220, 370, 7036, 47, 2969, 1137, 11, 198, 220, 220, 220, 34426, 62, 48780, 3698, 11, 198, 220, 220, 220, 3537, 51, 1677, 4535, 11, 198, 220, 220, 220, 29360, 16448, 7597, 62, 1961, 8264, 11, 198, 220, 220, 220, 33493, 2849, 11, 198, 220, 220, 220, 6006, 45721, 11, 198, 220, 220, 220, 6006, 45721, 62, 32541, 11, 198, 220, 220, 220, 39641, 1137, 11, 198, 60, 198 ]
1.887906
339
"""Sun2 Sensor.""" from datetime import datetime, time, timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_ELEVATION, CONF_LATITUDE, CONF_LONGITUDE, CONF_MONITORED_CONDITIONS, CONF_TIME_ZONE, DEVICE_CLASS_TIMESTAMP, ) from homeassistant.core import callback from homeassistant.util import dt as dt_util from homeassistant.helpers import config_validation as cv from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import Entity from homeassistant.helpers.event import async_track_point_in_utc_time from homeassistant.util import slugify from .helpers import ( async_init_astral_loc, astral_event, get_local_info, nearest_second, SIG_LOC_UPDATED, ) _LOGGER = logging.getLogger(__name__) _SOLAR_DEPRESSIONS = ("astronomical", "civil", "nautical") _ELEV_RND = 0.5 _ELEV_MAX_ERR = 0.02 _DELTA = timedelta(minutes=5) _ONE_DAY = timedelta(days=1) ATTR_NEXT_CHANGE = "next_change" class Sun2Sensor(Entity): """Sun2 Sensor.""" def __init__(self, hass, sensor_type, icon, info, default_solar_depression=0): """Initialize sensor.""" self.hass = hass if any(sol_dep in sensor_type for sol_dep in _SOLAR_DEPRESSIONS): self._solar_depression, self._event = sensor_type.rsplit("_", 1) else: self._solar_depression = default_solar_depression self._event = sensor_type self._icon = icon self._name = self._orig_name = sensor_type.replace("_", " ").title() self._state = None self._yesterday = None self._today = None self._tomorrow = None self._use_local_info = info is None if self._use_local_info: self._info = get_local_info(hass) else: self._info = info self._unsub_loc_updated = None self._unsub_update = None @property @_info.setter @property def should_poll(self): """Do not poll.""" return False @property def name(self): """Return the name of the entity.""" return self._name @property def state(self): """Return the state of the entity.""" return self._state @property def device_state_attributes(self): """Return device specific state attributes.""" return self._device_state_attributes() @property def icon(self): """Return the icon to use in the frontend.""" return self._icon async def async_loc_updated(self): """Location updated.""" self._loc_updated() async def async_added_to_hass(self): """Subscribe to update signal and set up fixed updating.""" slug = slugify(self._orig_name) object_id = self.entity_id.split('.')[1] if slug != object_id and object_id.endswith(slug): prefix = object_id[:-len(slug)].replace("_", " ").strip().title() self._name = f"{prefix} {self._orig_name}" if self._use_local_info: self._unsub_loc_updated = async_dispatcher_connect( self.hass, SIG_LOC_UPDATED, self.async_loc_updated ) self._setup_fixed_updating() async def async_will_remove_from_hass(self): """Disconnect from update signal and cancel fixed updating.""" if self._unsub_loc_updated: self._unsub_loc_updated() if self._unsub_update: self._unsub_update() self._name = self._orig_name async def async_update(self): """Update state.""" self._update() class Sun2PointInTimeSensor(Sun2Sensor): """Sun2 Point in Time Sensor.""" def __init__(self, hass, sensor_type, icon, info): """Initialize sensor.""" super().__init__(hass, sensor_type, icon, info, "civil") @property def device_class(self): """Return the class of this device.""" return DEVICE_CLASS_TIMESTAMP class Sun2PeriodOfTimeSensor(Sun2Sensor): """Sun2 Period of Time Sensor.""" def __init__(self, hass, sensor_type, icon, info): """Initialize sensor.""" super().__init__(hass, sensor_type, icon, info, 0.833) @property def unit_of_measurement(self): """Return the unit of measurement.""" return "hr" class Sun2MinMaxElevationSensor(Sun2Sensor): """Sun2 Min/Max Elevation Sensor.""" def __init__(self, hass, sensor_type, icon, info, is_min): """Initialize sensor.""" super().__init__(hass, sensor_type, icon, info) self._event = "solar_midnight" if is_min else "solar_noon" @property def unit_of_measurement(self): """Return the unit of measurement.""" return "°" class Sun2MinElevationSensor(Sun2MinMaxElevationSensor): """Sun2 Min Elevation Sensor.""" def __init__(self, hass, sensor_type, icon, info): """Initialize sensor.""" super().__init__(hass, sensor_type, icon, info, is_min=True) class Sun2MaxElevationSensor(Sun2MinMaxElevationSensor): """Sun2 Max Elevation Sensor.""" def __init__(self, hass, sensor_type, icon, info): """Initialize sensor.""" super().__init__(hass, sensor_type, icon, info, is_min=False) class Sun2ElevationSensor(Sun2Sensor): """Sun2 Elevation Sensor.""" def __init__(self, hass, sensor_type, icon, info): """Initialize sensor.""" super().__init__(hass, sensor_type, icon, info) self._reset() @property def device_state_attributes(self): """Return device specific state attributes.""" return {ATTR_NEXT_CHANGE: self._next_change} @property def unit_of_measurement(self): """Return the unit of measurement.""" return "°" def _loc_updated(self): """Location updated.""" self._reset() super()._loc_updated() _SENSOR_TYPES = { # Points in time "solar_midnight": (Sun2PointInTimeSensor, "mdi:weather-night"), "astronomical_dawn": (Sun2PointInTimeSensor, "mdi:weather-sunset-up"), "nautical_dawn": (Sun2PointInTimeSensor, "mdi:weather-sunset-up"), "dawn": (Sun2PointInTimeSensor, "mdi:weather-sunset-up"), "sunrise": (Sun2PointInTimeSensor, "mdi:weather-sunset-up"), "solar_noon": (Sun2PointInTimeSensor, "mdi:weather-sunny"), "sunset": (Sun2PointInTimeSensor, "mdi:weather-sunset-down"), "dusk": (Sun2PointInTimeSensor, "mdi:weather-sunset-down"), "nautical_dusk": (Sun2PointInTimeSensor, "mdi:weather-sunset-down"), "astronomical_dusk": (Sun2PointInTimeSensor, "mdi:weather-sunset-down"), # Time periods "daylight": (Sun2PeriodOfTimeSensor, "mdi:weather-sunny"), "civil_daylight": (Sun2PeriodOfTimeSensor, "mdi:weather-sunny"), "nautical_daylight": (Sun2PeriodOfTimeSensor, "mdi:weather-sunny"), "astronomical_daylight": (Sun2PeriodOfTimeSensor, "mdi:weather-sunny"), "night": (Sun2PeriodOfTimeSensor, "mdi:weather-night"), "civil_night": (Sun2PeriodOfTimeSensor, "mdi:weather-night"), "nautical_night": (Sun2PeriodOfTimeSensor, "mdi:weather-night"), "astronomical_night": (Sun2PeriodOfTimeSensor, "mdi:weather-night"), # Min/Max elevation "min_elevation": (Sun2MinElevationSensor, "mdi:weather-night"), "max_elevation": (Sun2MaxElevationSensor, "mdi:weather-sunny"), # Elevation "elevation": (Sun2ElevationSensor, "mdi:weather-sunny"), } PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Required(CONF_MONITORED_CONDITIONS): vol.All( cv.ensure_list, [vol.In(_SENSOR_TYPES)] ), vol.Inclusive(CONF_LATITUDE, "location"): cv.latitude, vol.Inclusive(CONF_LONGITUDE, "location"): cv.longitude, vol.Inclusive(CONF_TIME_ZONE, "location"): cv.time_zone, vol.Inclusive(CONF_ELEVATION, "location"): vol.Coerce(float), } ) async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up sensors.""" if CONF_LATITUDE in config: info = ( config[CONF_LATITUDE], config[CONF_LONGITUDE], config[CONF_TIME_ZONE], config[CONF_ELEVATION], ) else: info = None async_add_entities( [ _SENSOR_TYPES[event][0](hass, event, _SENSOR_TYPES[event][1], info) for event in config[CONF_MONITORED_CONDITIONS] ], True, )
[ 37811, 16012, 17, 35367, 526, 15931, 198, 6738, 4818, 8079, 1330, 4818, 8079, 11, 640, 11, 28805, 12514, 198, 11748, 18931, 198, 198, 11748, 2322, 37623, 5623, 355, 2322, 198, 198, 6738, 1363, 562, 10167, 13, 5589, 3906, 13, 82, 22854, 1330, 9297, 1404, 21389, 62, 50, 3398, 27630, 198, 6738, 1363, 562, 10167, 13, 9979, 1330, 357, 198, 220, 220, 220, 7102, 37, 62, 36, 2538, 53, 6234, 11, 198, 220, 220, 220, 7102, 37, 62, 43, 1404, 2043, 52, 7206, 11, 198, 220, 220, 220, 7102, 37, 62, 43, 18494, 2043, 52, 7206, 11, 198, 220, 220, 220, 7102, 37, 62, 27857, 2043, 32023, 62, 10943, 49828, 11053, 11, 198, 220, 220, 220, 7102, 37, 62, 34694, 62, 57, 11651, 11, 198, 220, 220, 220, 5550, 27389, 62, 31631, 62, 51, 3955, 6465, 23518, 11, 198, 8, 198, 6738, 1363, 562, 10167, 13, 7295, 1330, 23838, 198, 6738, 1363, 562, 10167, 13, 22602, 1330, 288, 83, 355, 288, 83, 62, 22602, 198, 6738, 1363, 562, 10167, 13, 16794, 364, 1330, 4566, 62, 12102, 341, 355, 269, 85, 198, 6738, 1363, 562, 10167, 13, 16794, 364, 13, 6381, 8071, 2044, 1330, 30351, 62, 6381, 8071, 2044, 62, 8443, 198, 6738, 1363, 562, 10167, 13, 16794, 364, 13, 26858, 1330, 20885, 198, 6738, 1363, 562, 10167, 13, 16794, 364, 13, 15596, 1330, 30351, 62, 11659, 62, 4122, 62, 259, 62, 315, 66, 62, 2435, 198, 6738, 1363, 562, 10167, 13, 22602, 1330, 31065, 1958, 198, 198, 6738, 764, 16794, 364, 1330, 357, 198, 220, 220, 220, 30351, 62, 15003, 62, 459, 1373, 62, 17946, 11, 198, 220, 220, 220, 6468, 1373, 62, 15596, 11, 198, 220, 220, 220, 651, 62, 12001, 62, 10951, 11, 198, 220, 220, 220, 16936, 62, 12227, 11, 198, 220, 220, 220, 33993, 62, 29701, 62, 52, 49316, 11, 198, 8, 198, 198, 62, 25294, 30373, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 198, 62, 50, 3535, 1503, 62, 7206, 32761, 11053, 796, 5855, 459, 1313, 22545, 1600, 366, 37636, 1600, 366, 77, 37073, 4943, 198, 62, 36, 2538, 53, 62, 49, 8575, 796, 657, 13, 20, 198, 62, 36, 2538, 53, 62, 22921, 62, 1137, 49, 796, 657, 13, 2999, 198, 62, 35, 3698, 5603, 796, 28805, 12514, 7, 1084, 1769, 28, 20, 8, 198, 62, 11651, 62, 26442, 796, 28805, 12514, 7, 12545, 28, 16, 8, 198, 198, 1404, 5446, 62, 45, 13918, 62, 3398, 27746, 796, 366, 19545, 62, 3803, 1, 628, 198, 198, 4871, 3825, 17, 47864, 7, 32398, 2599, 198, 220, 220, 220, 37227, 16012, 17, 35367, 526, 15931, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 468, 82, 11, 12694, 62, 4906, 11, 7196, 11, 7508, 11, 4277, 62, 82, 6192, 62, 10378, 2234, 28, 15, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 24243, 1096, 12694, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 71, 562, 796, 468, 82, 198, 220, 220, 220, 220, 220, 220, 220, 611, 597, 7, 34453, 62, 10378, 287, 12694, 62, 4906, 329, 1540, 62, 10378, 287, 4808, 50, 3535, 1503, 62, 7206, 32761, 11053, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 82, 6192, 62, 10378, 2234, 11, 2116, 13557, 15596, 796, 12694, 62, 4906, 13, 3808, 489, 270, 7203, 62, 1600, 352, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 82, 6192, 62, 10378, 2234, 796, 4277, 62, 82, 6192, 62, 10378, 2234, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 15596, 796, 12694, 62, 4906, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 4749, 796, 7196, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 3672, 796, 2116, 13557, 11612, 62, 3672, 796, 12694, 62, 4906, 13, 33491, 7203, 62, 1600, 366, 366, 737, 7839, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 5219, 796, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 8505, 6432, 796, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 40838, 796, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 39532, 6254, 796, 6045, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 1904, 62, 12001, 62, 10951, 796, 7508, 318, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13557, 1904, 62, 12001, 62, 10951, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 10951, 796, 651, 62, 12001, 62, 10951, 7, 71, 562, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 10951, 796, 7508, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 403, 7266, 62, 17946, 62, 43162, 796, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 403, 7266, 62, 19119, 796, 6045, 628, 220, 220, 220, 2488, 26745, 628, 220, 220, 220, 2488, 62, 10951, 13, 2617, 353, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 815, 62, 30393, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 5211, 407, 3278, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 10352, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 1438, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 13615, 262, 1438, 286, 262, 9312, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13557, 3672, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 1181, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 13615, 262, 1181, 286, 262, 9312, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13557, 5219, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 3335, 62, 5219, 62, 1078, 7657, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 13615, 3335, 2176, 1181, 12608, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13557, 25202, 62, 5219, 62, 1078, 7657, 3419, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 7196, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 13615, 262, 7196, 284, 779, 287, 262, 2166, 437, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13557, 4749, 628, 220, 220, 220, 30351, 825, 30351, 62, 17946, 62, 43162, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 14749, 6153, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 17946, 62, 43162, 3419, 628, 220, 220, 220, 30351, 825, 30351, 62, 29373, 62, 1462, 62, 71, 562, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 27125, 284, 4296, 6737, 290, 900, 510, 5969, 19698, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 31065, 796, 31065, 1958, 7, 944, 13557, 11612, 62, 3672, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2134, 62, 312, 796, 2116, 13, 26858, 62, 312, 13, 35312, 10786, 2637, 38381, 16, 60, 198, 220, 220, 220, 220, 220, 220, 220, 611, 31065, 14512, 2134, 62, 312, 290, 2134, 62, 312, 13, 437, 2032, 342, 7, 6649, 1018, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 21231, 796, 2134, 62, 312, 58, 21912, 11925, 7, 6649, 1018, 25295, 33491, 7203, 62, 1600, 366, 366, 737, 36311, 22446, 7839, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 3672, 796, 277, 1, 90, 40290, 92, 1391, 944, 13557, 11612, 62, 3672, 36786, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13557, 1904, 62, 12001, 62, 10951, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 403, 7266, 62, 17946, 62, 43162, 796, 30351, 62, 6381, 8071, 2044, 62, 8443, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 71, 562, 11, 33993, 62, 29701, 62, 52, 49316, 11, 2116, 13, 292, 13361, 62, 17946, 62, 43162, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 40406, 62, 34021, 62, 929, 38734, 3419, 628, 220, 220, 220, 30351, 825, 30351, 62, 10594, 62, 28956, 62, 6738, 62, 71, 562, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 7279, 8443, 422, 4296, 6737, 290, 14241, 5969, 19698, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13557, 403, 7266, 62, 17946, 62, 43162, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 403, 7266, 62, 17946, 62, 43162, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13557, 403, 7266, 62, 19119, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 403, 7266, 62, 19119, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 3672, 796, 2116, 13557, 11612, 62, 3672, 628, 220, 220, 220, 30351, 825, 30351, 62, 19119, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 10260, 1181, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 19119, 3419, 628, 198, 4871, 3825, 17, 12727, 818, 7575, 47864, 7, 16012, 17, 47864, 2599, 198, 220, 220, 220, 37227, 16012, 17, 6252, 287, 3862, 35367, 526, 15931, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 468, 82, 11, 12694, 62, 4906, 11, 7196, 11, 7508, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 24243, 1096, 12694, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 2208, 22446, 834, 15003, 834, 7, 71, 562, 11, 12694, 62, 4906, 11, 7196, 11, 7508, 11, 366, 37636, 4943, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 3335, 62, 4871, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 13615, 262, 1398, 286, 428, 3335, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 5550, 27389, 62, 31631, 62, 51, 3955, 6465, 23518, 628, 198, 198, 4871, 3825, 17, 5990, 2101, 5189, 7575, 47864, 7, 16012, 17, 47864, 2599, 198, 220, 220, 220, 37227, 16012, 17, 18581, 286, 3862, 35367, 526, 15931, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 468, 82, 11, 12694, 62, 4906, 11, 7196, 11, 7508, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 24243, 1096, 12694, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 2208, 22446, 834, 15003, 834, 7, 71, 562, 11, 12694, 62, 4906, 11, 7196, 11, 7508, 11, 657, 13, 48634, 8, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 4326, 62, 1659, 62, 1326, 5015, 434, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 13615, 262, 4326, 286, 15558, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 366, 11840, 1, 628, 198, 4871, 3825, 17, 9452, 11518, 36, 2768, 341, 47864, 7, 16012, 17, 47864, 2599, 198, 220, 220, 220, 37227, 16012, 17, 1855, 14, 11518, 37881, 341, 35367, 526, 15931, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 468, 82, 11, 12694, 62, 4906, 11, 7196, 11, 7508, 11, 318, 62, 1084, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 24243, 1096, 12694, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 2208, 22446, 834, 15003, 834, 7, 71, 562, 11, 12694, 62, 4906, 11, 7196, 11, 7508, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 15596, 796, 366, 82, 6192, 62, 13602, 3847, 1, 611, 318, 62, 1084, 2073, 366, 82, 6192, 62, 6357, 1, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 4326, 62, 1659, 62, 1326, 5015, 434, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 13615, 262, 4326, 286, 15558, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 366, 7200, 1, 628, 198, 4871, 3825, 17, 9452, 36, 2768, 341, 47864, 7, 16012, 17, 9452, 11518, 36, 2768, 341, 47864, 2599, 198, 220, 220, 220, 37227, 16012, 17, 1855, 37881, 341, 35367, 526, 15931, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 468, 82, 11, 12694, 62, 4906, 11, 7196, 11, 7508, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 24243, 1096, 12694, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 2208, 22446, 834, 15003, 834, 7, 71, 562, 11, 12694, 62, 4906, 11, 7196, 11, 7508, 11, 318, 62, 1084, 28, 17821, 8, 628, 198, 4871, 3825, 17, 11518, 36, 2768, 341, 47864, 7, 16012, 17, 9452, 11518, 36, 2768, 341, 47864, 2599, 198, 220, 220, 220, 37227, 16012, 17, 5436, 37881, 341, 35367, 526, 15931, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 468, 82, 11, 12694, 62, 4906, 11, 7196, 11, 7508, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 24243, 1096, 12694, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 2208, 22446, 834, 15003, 834, 7, 71, 562, 11, 12694, 62, 4906, 11, 7196, 11, 7508, 11, 318, 62, 1084, 28, 25101, 8, 628, 628, 198, 4871, 3825, 17, 36, 2768, 341, 47864, 7, 16012, 17, 47864, 2599, 198, 220, 220, 220, 37227, 16012, 17, 37881, 341, 35367, 526, 15931, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 468, 82, 11, 12694, 62, 4906, 11, 7196, 11, 7508, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 24243, 1096, 12694, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 2208, 22446, 834, 15003, 834, 7, 71, 562, 11, 12694, 62, 4906, 11, 7196, 11, 7508, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 42503, 3419, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 3335, 62, 5219, 62, 1078, 7657, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 13615, 3335, 2176, 1181, 12608, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 1391, 1404, 5446, 62, 45, 13918, 62, 3398, 27746, 25, 2116, 13557, 19545, 62, 3803, 92, 628, 220, 220, 220, 2488, 26745, 198, 220, 220, 220, 825, 4326, 62, 1659, 62, 1326, 5015, 434, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 13615, 262, 4326, 286, 15558, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 366, 7200, 1, 628, 220, 220, 220, 825, 4808, 17946, 62, 43162, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 14749, 6153, 526, 15931, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 42503, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 2208, 22446, 62, 17946, 62, 43162, 3419, 628, 198, 62, 50, 16938, 1581, 62, 9936, 47, 1546, 796, 1391, 198, 220, 220, 220, 1303, 11045, 287, 640, 198, 220, 220, 220, 366, 82, 6192, 62, 13602, 3847, 1298, 357, 16012, 17, 12727, 818, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 3847, 12340, 198, 220, 220, 220, 366, 459, 1313, 22545, 62, 67, 3832, 1298, 357, 16012, 17, 12727, 818, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 19155, 2617, 12, 929, 12340, 198, 220, 220, 220, 366, 77, 37073, 62, 67, 3832, 1298, 357, 16012, 17, 12727, 818, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 19155, 2617, 12, 929, 12340, 198, 220, 220, 220, 366, 67, 3832, 1298, 357, 16012, 17, 12727, 818, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 19155, 2617, 12, 929, 12340, 198, 220, 220, 220, 366, 19155, 17163, 1298, 357, 16012, 17, 12727, 818, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 19155, 2617, 12, 929, 12340, 198, 220, 220, 220, 366, 82, 6192, 62, 6357, 1298, 357, 16012, 17, 12727, 818, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 82, 16948, 12340, 198, 220, 220, 220, 366, 19155, 2617, 1298, 357, 16012, 17, 12727, 818, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 19155, 2617, 12, 2902, 12340, 198, 220, 220, 220, 366, 67, 17990, 1298, 357, 16012, 17, 12727, 818, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 19155, 2617, 12, 2902, 12340, 198, 220, 220, 220, 366, 77, 37073, 62, 67, 17990, 1298, 357, 16012, 17, 12727, 818, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 19155, 2617, 12, 2902, 12340, 198, 220, 220, 220, 366, 459, 1313, 22545, 62, 67, 17990, 1298, 357, 16012, 17, 12727, 818, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 19155, 2617, 12, 2902, 12340, 198, 220, 220, 220, 1303, 3862, 9574, 198, 220, 220, 220, 366, 820, 2971, 1298, 357, 16012, 17, 5990, 2101, 5189, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 82, 16948, 12340, 198, 220, 220, 220, 366, 37636, 62, 820, 2971, 1298, 357, 16012, 17, 5990, 2101, 5189, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 82, 16948, 12340, 198, 220, 220, 220, 366, 77, 37073, 62, 820, 2971, 1298, 357, 16012, 17, 5990, 2101, 5189, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 82, 16948, 12340, 198, 220, 220, 220, 366, 459, 1313, 22545, 62, 820, 2971, 1298, 357, 16012, 17, 5990, 2101, 5189, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 82, 16948, 12340, 198, 220, 220, 220, 366, 3847, 1298, 357, 16012, 17, 5990, 2101, 5189, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 3847, 12340, 198, 220, 220, 220, 366, 37636, 62, 3847, 1298, 357, 16012, 17, 5990, 2101, 5189, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 3847, 12340, 198, 220, 220, 220, 366, 77, 37073, 62, 3847, 1298, 357, 16012, 17, 5990, 2101, 5189, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 3847, 12340, 198, 220, 220, 220, 366, 459, 1313, 22545, 62, 3847, 1298, 357, 16012, 17, 5990, 2101, 5189, 7575, 47864, 11, 366, 9132, 72, 25, 23563, 12, 3847, 12340, 198, 220, 220, 220, 1303, 1855, 14, 11518, 22910, 198, 220, 220, 220, 366, 1084, 62, 68, 2768, 341, 1298, 357, 16012, 17, 9452, 36, 2768, 341, 47864, 11, 366, 9132, 72, 25, 23563, 12, 3847, 12340, 198, 220, 220, 220, 366, 9806, 62, 68, 2768, 341, 1298, 357, 16012, 17, 11518, 36, 2768, 341, 47864, 11, 366, 9132, 72, 25, 23563, 12, 82, 16948, 12340, 198, 220, 220, 220, 1303, 37881, 341, 198, 220, 220, 220, 366, 68, 2768, 341, 1298, 357, 16012, 17, 36, 2768, 341, 47864, 11, 366, 9132, 72, 25, 23563, 12, 82, 16948, 12340, 198, 92, 198, 198, 6489, 1404, 21389, 62, 50, 3398, 27630, 796, 9297, 1404, 21389, 62, 50, 3398, 27630, 13, 2302, 437, 7, 198, 220, 220, 220, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 2322, 13, 37374, 7, 10943, 37, 62, 27857, 2043, 32023, 62, 10943, 49828, 11053, 2599, 2322, 13, 3237, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 269, 85, 13, 641, 495, 62, 4868, 11, 685, 10396, 13, 818, 28264, 50, 16938, 1581, 62, 9936, 47, 1546, 15437, 198, 220, 220, 220, 220, 220, 220, 220, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 2322, 13, 818, 5731, 7, 10943, 37, 62, 43, 1404, 2043, 52, 7206, 11, 366, 24886, 1, 2599, 269, 85, 13, 15460, 3984, 11, 198, 220, 220, 220, 220, 220, 220, 220, 2322, 13, 818, 5731, 7, 10943, 37, 62, 43, 18494, 2043, 52, 7206, 11, 366, 24886, 1, 2599, 269, 85, 13, 6511, 3984, 11, 198, 220, 220, 220, 220, 220, 220, 220, 2322, 13, 818, 5731, 7, 10943, 37, 62, 34694, 62, 57, 11651, 11, 366, 24886, 1, 2599, 269, 85, 13, 2435, 62, 11340, 11, 198, 220, 220, 220, 220, 220, 220, 220, 2322, 13, 818, 5731, 7, 10943, 37, 62, 36, 2538, 53, 6234, 11, 366, 24886, 1, 2599, 2322, 13, 7222, 263, 344, 7, 22468, 828, 198, 220, 220, 220, 1782, 198, 8, 628, 198, 292, 13361, 825, 30351, 62, 40406, 62, 24254, 7, 71, 562, 11, 4566, 11, 30351, 62, 2860, 62, 298, 871, 11, 9412, 62, 10951, 28, 14202, 2599, 198, 220, 220, 220, 37227, 7248, 510, 15736, 526, 15931, 198, 220, 220, 220, 611, 7102, 37, 62, 43, 1404, 2043, 52, 7206, 287, 4566, 25, 198, 220, 220, 220, 220, 220, 220, 220, 7508, 796, 357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4566, 58, 10943, 37, 62, 43, 1404, 2043, 52, 7206, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4566, 58, 10943, 37, 62, 43, 18494, 2043, 52, 7206, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4566, 58, 10943, 37, 62, 34694, 62, 57, 11651, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4566, 58, 10943, 37, 62, 36, 2538, 53, 6234, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 7508, 796, 6045, 198, 220, 220, 220, 30351, 62, 2860, 62, 298, 871, 7, 198, 220, 220, 220, 220, 220, 220, 220, 685, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 50, 16938, 1581, 62, 9936, 47, 1546, 58, 15596, 7131, 15, 16151, 71, 562, 11, 1785, 11, 4808, 50, 16938, 1581, 62, 9936, 47, 1546, 58, 15596, 7131, 16, 4357, 7508, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1785, 287, 4566, 58, 10943, 37, 62, 27857, 2043, 32023, 62, 10943, 49828, 11053, 60, 198, 220, 220, 220, 220, 220, 220, 220, 16589, 198, 220, 220, 220, 220, 220, 220, 220, 6407, 11, 198, 220, 220, 220, 1267, 198 ]
2.322757
3,656
#!/usr/bin/env python3 """ Allable """ from applications.database.table import Table from .base import Base from .buildable import Buildable from .jsonable import Jsonable if __name__ == '__main__': from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument('-a', '--arg1', help="An argument.", type=str, default='default') args = parser.parse_args() main(args)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 37811, 198, 3237, 540, 198, 37811, 198, 6738, 5479, 13, 48806, 13, 11487, 1330, 8655, 198, 198, 6738, 764, 8692, 1330, 7308, 198, 6738, 764, 11249, 540, 1330, 10934, 540, 198, 6738, 764, 17752, 540, 1330, 449, 1559, 540, 628, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 422, 1822, 29572, 1330, 45751, 46677, 198, 220, 220, 220, 30751, 796, 45751, 46677, 3419, 628, 220, 220, 220, 30751, 13, 2860, 62, 49140, 10786, 12, 64, 3256, 705, 438, 853, 16, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 2625, 2025, 4578, 33283, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2099, 28, 2536, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4277, 11639, 12286, 11537, 628, 220, 220, 220, 26498, 796, 30751, 13, 29572, 62, 22046, 3419, 198, 220, 220, 220, 1388, 7, 22046, 8, 198 ]
2.360976
205
import sys from distutils.version import LooseVersion from unittest import skipIf, skipUnless from django import VERSION as DJANGO_VERSION from django.urls import clear_url_caches import cms from cms.api import add_plugin, create_page from cms.appresolver import clear_app_resolvers from cms.test_utils.testcases import CMSTestCase # These means "less than or equal" DJANGO_111 = DJANGO_VERSION[:2] >= (1, 11) CMS_3_6 = LooseVersion(cms.__version__) < LooseVersion('4.0')
[ 11748, 25064, 198, 6738, 1233, 26791, 13, 9641, 1330, 6706, 577, 14815, 198, 6738, 555, 715, 395, 1330, 14267, 1532, 11, 14267, 28042, 198, 198, 6738, 42625, 14208, 1330, 44156, 2849, 355, 13004, 1565, 11230, 62, 43717, 198, 6738, 42625, 14208, 13, 6371, 82, 1330, 1598, 62, 6371, 62, 66, 3694, 198, 198, 11748, 269, 907, 198, 6738, 269, 907, 13, 15042, 1330, 751, 62, 33803, 11, 2251, 62, 7700, 198, 6738, 269, 907, 13, 1324, 411, 14375, 1330, 1598, 62, 1324, 62, 411, 349, 690, 198, 6738, 269, 907, 13, 9288, 62, 26791, 13, 9288, 33964, 1330, 16477, 2257, 395, 20448, 628, 198, 2, 2312, 1724, 366, 1203, 621, 393, 4961, 1, 198, 35028, 1565, 11230, 62, 16243, 796, 13004, 1565, 11230, 62, 43717, 58, 25, 17, 60, 18189, 357, 16, 11, 1367, 8, 198, 34, 5653, 62, 18, 62, 21, 796, 6706, 577, 14815, 7, 46406, 13, 834, 9641, 834, 8, 1279, 6706, 577, 14815, 10786, 19, 13, 15, 11537, 628 ]
2.92638
163
#!/usr/bin/env python3 import sys from . import deepl if __name__ == '__main__': try: main() except KeyboardInterrupt: pass
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 11748, 25064, 198, 198, 6738, 764, 1330, 390, 68, 489, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1388, 3419, 198, 220, 220, 220, 2845, 31973, 9492, 3622, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1208, 198 ]
2.235294
68
#!/usr/bin/env python import csv import os import rospy import uuid from babyrobot.lib import utils as br_utils from babyrobot.speech_features import config as sf_config from babyrobot_msgs.msg import SpeechFeatures, Feature from babyrobot_msgs.srv import SpeechFeatureExtraction from babyrobot_msgs.srv import SpeechFeatureExtractionResponse def handle_speech_features(req): ''' Extract speech features upon a client request. Args: req: A request object containing the following fields: audio_segment opensmile_config response_format metadata Returns: A SpeechFeatureExtractionResponse containing a SpeechFeatures ROS message. ''' br_utils.write_wav(req.audio_segment.clip, sf_config.TEMP_FILE.WAV) if req.response_format == 'arff': out_file = sf_config.TEMP_FILE.ARFF_OUTPUT out_file_cmd = '--arffoutput {}'.format(out_file) else: out_file = sf_config.TEMP_FILE.CSV_OUTPUT out_file_cmd = '--csvoutput {}'.format(out_file) opensmile_conf = os.path.join(sf_config.OPENSMILE.CONFIG_DIR, req.opensmile_conf) if not opensmile_conf.endswith('.conf'): opensmile_conf += '.conf' cmd = '{0}/SMILExtract -C {1} -I {2} {3}'.format( sf_config.OPENSMILE.ROOT_DIR, opensmile_conf, sf_config.TEMP_FILE.WAV, out_file_cmd) #rospy.loginfo('Extracting features using "{}"'.format(cmd)) ret_code, stdout, stderr = br_utils.run_cmd(cmd) if ret_code != 0: rospy.logerr('Failed to extract features. Returning empty message') rospy.logerr(stdout) rospy.logerr(stderr) return SpeechFeatureExtractionResponse(SpeechFeatures()) msg = SpeechFeatures() msg.related_segment_id = req.audio_segment.header.id msg.header.id = str(uuid.uuid1()) msg.header.timestamp = rospy.Time.now() with open(out_file, 'r') as out_fd: if req.response_format == 'arff': msg.arff_file = out_fd.read() elif req.response_format in ['list', '']: reader = csv.DictReader(out_fd) data = reader.next() msg.features = [] for d in data.iteritems(): feat = Feature() feat.feature_name = d[0] feat.feature_value = float(d[1]) msg.features.append(feat) else: rospy.logerr('Invalid response format. Returning empty message') return SpeechFeatureExtractionResponse(SpeechFeatures()) return SpeechFeatureExtractionResponse(msg) def speech_features_server(): ''' Initialize a ROS node and run the SpeechFeatureExtraction service Args: Returns: ''' rospy.init_node(sf_config.ROS_CONFIG.SERVER_NODE) rospy.Service(sf_config.ROS_CONFIG.SERVICE_NAME, SpeechFeatureExtraction, handle_speech_features) #rospy.loginfo("Speech Features server started.") rospy.spin() if __name__ == "__main__": speech_features_server()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 11748, 269, 21370, 198, 11748, 28686, 198, 11748, 686, 2777, 88, 198, 11748, 334, 27112, 198, 198, 6738, 5156, 305, 13645, 13, 8019, 1330, 3384, 4487, 355, 865, 62, 26791, 198, 6738, 5156, 305, 13645, 13, 45862, 62, 40890, 1330, 4566, 355, 264, 69, 62, 11250, 198, 6738, 5156, 305, 13645, 62, 907, 14542, 13, 19662, 1330, 24709, 23595, 11, 27018, 198, 6738, 5156, 305, 13645, 62, 907, 14542, 13, 27891, 85, 1330, 24709, 38816, 11627, 7861, 198, 6738, 5156, 305, 13645, 62, 907, 14542, 13, 27891, 85, 1330, 24709, 38816, 11627, 7861, 31077, 628, 198, 4299, 5412, 62, 45862, 62, 40890, 7, 42180, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 29677, 4046, 3033, 2402, 257, 5456, 2581, 13, 628, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 43089, 25, 317, 2581, 2134, 7268, 262, 1708, 7032, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6597, 62, 325, 5154, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 9808, 18085, 62, 11250, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2882, 62, 18982, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 20150, 198, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 317, 24709, 38816, 11627, 7861, 31077, 7268, 257, 24709, 23595, 198, 220, 220, 220, 220, 220, 220, 220, 48263, 3275, 13, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 865, 62, 26791, 13, 13564, 62, 45137, 7, 42180, 13, 24051, 62, 325, 5154, 13, 15036, 11, 264, 69, 62, 11250, 13, 51, 39494, 62, 25664, 13, 54, 10116, 8, 198, 220, 220, 220, 611, 43089, 13, 26209, 62, 18982, 6624, 705, 283, 487, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 7753, 796, 264, 69, 62, 11250, 13, 51, 39494, 62, 25664, 13, 1503, 5777, 62, 2606, 7250, 3843, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 7753, 62, 28758, 796, 705, 438, 283, 487, 22915, 23884, 4458, 18982, 7, 448, 62, 7753, 8, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 7753, 796, 264, 69, 62, 11250, 13, 51, 39494, 62, 25664, 13, 7902, 53, 62, 2606, 7250, 3843, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 7753, 62, 28758, 796, 705, 438, 40664, 22915, 23884, 4458, 18982, 7, 448, 62, 7753, 8, 628, 220, 220, 220, 9808, 18085, 62, 10414, 796, 28686, 13, 6978, 13, 22179, 7, 28202, 62, 11250, 13, 3185, 16938, 8895, 2538, 13, 10943, 16254, 62, 34720, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 43089, 13, 44813, 18085, 62, 10414, 8, 198, 220, 220, 220, 611, 407, 9808, 18085, 62, 10414, 13, 437, 2032, 342, 7, 4458, 10414, 6, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 9808, 18085, 62, 10414, 15853, 45302, 10414, 6, 198, 220, 220, 220, 23991, 796, 705, 90, 15, 92, 14, 50, 8895, 2538, 742, 974, 532, 34, 1391, 16, 92, 532, 40, 1391, 17, 92, 1391, 18, 92, 4458, 18982, 7, 198, 220, 220, 220, 220, 220, 220, 220, 264, 69, 62, 11250, 13, 3185, 16938, 8895, 2538, 13, 13252, 2394, 62, 34720, 11, 198, 220, 220, 220, 220, 220, 220, 220, 9808, 18085, 62, 10414, 11, 198, 220, 220, 220, 220, 220, 220, 220, 264, 69, 62, 11250, 13, 51, 39494, 62, 25664, 13, 54, 10116, 11, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 7753, 62, 28758, 8, 198, 220, 220, 220, 1303, 305, 2777, 88, 13, 6404, 10951, 10786, 11627, 974, 278, 3033, 1262, 45144, 36786, 4458, 18982, 7, 28758, 4008, 628, 220, 220, 220, 1005, 62, 8189, 11, 14367, 448, 11, 336, 1082, 81, 796, 865, 62, 26791, 13, 5143, 62, 28758, 7, 28758, 8, 198, 220, 220, 220, 611, 1005, 62, 8189, 14512, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 686, 2777, 88, 13, 6404, 8056, 10786, 37, 6255, 284, 7925, 3033, 13, 42882, 6565, 3275, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 686, 2777, 88, 13, 6404, 8056, 7, 19282, 448, 8, 198, 220, 220, 220, 220, 220, 220, 220, 686, 2777, 88, 13, 6404, 8056, 7, 301, 1082, 81, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 24709, 38816, 11627, 7861, 31077, 7, 5248, 3055, 23595, 28955, 628, 220, 220, 220, 31456, 796, 24709, 23595, 3419, 198, 220, 220, 220, 31456, 13, 5363, 62, 325, 5154, 62, 312, 796, 43089, 13, 24051, 62, 325, 5154, 13, 25677, 13, 312, 198, 220, 220, 220, 31456, 13, 25677, 13, 312, 796, 965, 7, 12303, 312, 13, 12303, 312, 16, 28955, 198, 220, 220, 220, 31456, 13, 25677, 13, 16514, 27823, 796, 686, 2777, 88, 13, 7575, 13, 2197, 3419, 628, 220, 220, 220, 351, 1280, 7, 448, 62, 7753, 11, 705, 81, 11537, 355, 503, 62, 16344, 25, 198, 220, 220, 220, 220, 220, 220, 220, 611, 43089, 13, 26209, 62, 18982, 6624, 705, 283, 487, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 31456, 13, 283, 487, 62, 7753, 796, 503, 62, 16344, 13, 961, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 43089, 13, 26209, 62, 18982, 287, 37250, 4868, 3256, 10148, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 9173, 796, 269, 21370, 13, 35, 713, 33634, 7, 448, 62, 16344, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1366, 796, 9173, 13, 19545, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 31456, 13, 40890, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 288, 287, 1366, 13, 2676, 23814, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2218, 796, 27018, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2218, 13, 30053, 62, 3672, 796, 288, 58, 15, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2218, 13, 30053, 62, 8367, 796, 12178, 7, 67, 58, 16, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 31456, 13, 40890, 13, 33295, 7, 27594, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 686, 2777, 88, 13, 6404, 8056, 10786, 44651, 2882, 5794, 13, 42882, 6565, 3275, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 24709, 38816, 11627, 7861, 31077, 7, 5248, 3055, 23595, 28955, 628, 220, 220, 220, 1441, 24709, 38816, 11627, 7861, 31077, 7, 19662, 8, 628, 198, 4299, 4046, 62, 40890, 62, 15388, 33529, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 20768, 1096, 257, 48263, 10139, 290, 1057, 262, 24709, 38816, 11627, 7861, 2139, 628, 220, 220, 220, 943, 14542, 25, 628, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 686, 2777, 88, 13, 15003, 62, 17440, 7, 28202, 62, 11250, 13, 49, 2640, 62, 10943, 16254, 13, 35009, 5959, 62, 45, 16820, 8, 198, 220, 220, 220, 686, 2777, 88, 13, 16177, 7, 28202, 62, 11250, 13, 49, 2640, 62, 10943, 16254, 13, 35009, 27389, 62, 20608, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 24709, 38816, 11627, 7861, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5412, 62, 45862, 62, 40890, 8, 198, 220, 220, 220, 1303, 305, 2777, 88, 13, 6404, 10951, 7203, 5248, 3055, 17571, 4382, 2067, 19570, 198, 220, 220, 220, 686, 2777, 88, 13, 39706, 3419, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 4046, 62, 40890, 62, 15388, 3419, 198 ]
2.250363
1,378
total = 0 with open("input.txt") as f: total = sum(calculate_paper(gift) for gift in f.readlines()) print(total)
[ 201, 198, 201, 198, 201, 198, 201, 198, 23350, 796, 657, 201, 198, 4480, 1280, 7203, 15414, 13, 14116, 4943, 355, 277, 25, 201, 198, 220, 220, 220, 2472, 796, 2160, 7, 9948, 3129, 378, 62, 20189, 7, 70, 2135, 8, 329, 6979, 287, 277, 13, 961, 6615, 28955, 201, 198, 201, 198, 4798, 7, 23350, 8, 201, 198 ]
2.220339
59
# -*- coding: utf-8 -*- # (c) [2014] LinkedIn Corp. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. import avro.io import avro.schema import six from unittest import TestCase if six.PY2: from avro.schema import make_avsc_object else: from avro.schema import SchemaFromJSONData as make_avsc_object long = int from avro_json_serializer import AvroJsonSerializer, AvroJsonDeserializer
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 2, 357, 66, 8, 685, 4967, 60, 27133, 11421, 13, 1439, 2489, 10395, 13, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 447, 101, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 447, 101, 198, 2, 921, 743, 7330, 257, 4866, 286, 262, 13789, 379, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 198, 2, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 447, 101, 198, 2, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 447, 101, 198, 2, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 198, 198, 11748, 1196, 305, 13, 952, 198, 11748, 1196, 305, 13, 15952, 2611, 198, 11748, 2237, 198, 6738, 555, 715, 395, 1330, 6208, 20448, 198, 198, 361, 2237, 13, 47, 56, 17, 25, 198, 220, 220, 220, 422, 1196, 305, 13, 15952, 2611, 1330, 787, 62, 615, 1416, 62, 15252, 198, 17772, 25, 198, 220, 220, 220, 422, 1196, 305, 13, 15952, 2611, 1330, 10011, 2611, 4863, 40386, 6601, 355, 787, 62, 615, 1416, 62, 15252, 198, 220, 220, 220, 890, 796, 493, 198, 198, 6738, 1196, 305, 62, 17752, 62, 46911, 7509, 1330, 5184, 305, 41, 1559, 32634, 7509, 11, 5184, 305, 41, 1559, 5960, 48499, 7509, 628 ]
3.111538
260
from vve_cli.main import run __version__ = "0.0.1" __all__ = ["run"]
[ 6738, 410, 303, 62, 44506, 13, 12417, 1330, 1057, 201, 198, 201, 198, 834, 9641, 834, 796, 366, 15, 13, 15, 13, 16, 1, 201, 198, 834, 439, 834, 796, 14631, 5143, 8973, 201, 198 ]
2.114286
35
from . import driver from ... import exceptions def Factory(settings): """@todo docstring""" return driver.DBDriver(settings)
[ 6738, 764, 1330, 4639, 198, 6738, 2644, 1330, 13269, 198, 198, 4299, 19239, 7, 33692, 2599, 198, 220, 220, 220, 37227, 31, 83, 24313, 2205, 8841, 37811, 198, 220, 220, 220, 1441, 4639, 13, 11012, 32103, 7, 33692, 8 ]
3.435897
39
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """Unit test for the gtest_xml_output module""" import datetime import errno import os import re import sys from xml.dom import minidom import gtest_test_utils import gtest_xml_test_utils GTEST_FILTER_FLAG = '--gtest_filter' GTEST_LIST_TESTS_FLAG = '--gtest_list_tests' GTEST_OUTPUT_FLAG = '--gtest_output' GTEST_DEFAULT_OUTPUT_FILE = 'test_detail.xml' GTEST_PROGRAM_NAME = 'gtest_xml_output_unittest_' # The flag indicating stacktraces are not supported NO_STACKTRACE_SUPPORT_FLAG = '--no_stacktrace_support' # The environment variables for test sharding. TOTAL_SHARDS_ENV_VAR = 'GTEST_TOTAL_SHARDS' SHARD_INDEX_ENV_VAR = 'GTEST_SHARD_INDEX' SHARD_STATUS_FILE_ENV_VAR = 'GTEST_SHARD_STATUS_FILE' SUPPORTS_STACK_TRACES = NO_STACKTRACE_SUPPORT_FLAG not in sys.argv if SUPPORTS_STACK_TRACES: STACK_TRACE_TEMPLATE = '\nStack trace:\n*' else: STACK_TRACE_TEMPLATE = '' # unittest.main() can't handle unknown flags sys.argv.remove(NO_STACKTRACE_SUPPORT_FLAG) EXPECTED_NON_EMPTY_XML = """<?xml version="1.0" encoding="UTF-8"?> <testsuites tests="24" failures="4" disabled="2" errors="0" time="*" timestamp="*" name="AllTests" ad_hoc_property="42"> <testsuite name="SuccessfulTest" tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="Succeeds" status="run" result="completed" time="*" timestamp="*" classname="SuccessfulTest"/> </testsuite> <testsuite name="FailedTest" tests="1" failures="1" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="Fails" status="run" result="completed" time="*" timestamp="*" classname="FailedTest"> <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Expected equality of these values:&#x0A; 1&#x0A; 2" type=""><![CDATA[gtest_xml_output_unittest_.cc:* Expected equality of these values: 1 2%(stack)s]]></failure> </testcase> </testsuite> <testsuite name="MixedResultTest" tests="3" failures="1" disabled="1" errors="0" time="*" timestamp="*"> <testcase name="Succeeds" status="run" result="completed" time="*" timestamp="*" classname="MixedResultTest"/> <testcase name="Fails" status="run" result="completed" time="*" timestamp="*" classname="MixedResultTest"> <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Expected equality of these values:&#x0A; 1&#x0A; 2" type=""><![CDATA[gtest_xml_output_unittest_.cc:* Expected equality of these values: 1 2%(stack)s]]></failure> <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Expected equality of these values:&#x0A; 2&#x0A; 3" type=""><![CDATA[gtest_xml_output_unittest_.cc:* Expected equality of these values: 2 3%(stack)s]]></failure> </testcase> <testcase name="DISABLED_test" status="notrun" result="suppressed" time="*" timestamp="*" classname="MixedResultTest"/> </testsuite> <testsuite name="XmlQuotingTest" tests="1" failures="1" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="OutputsCData" status="run" result="completed" time="*" timestamp="*" classname="XmlQuotingTest"> <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Failed&#x0A;XML output: &lt;?xml encoding=&quot;utf-8&quot;&gt;&lt;top&gt;&lt;![CDATA[cdata text]]&gt;&lt;/top&gt;" type=""><![CDATA[gtest_xml_output_unittest_.cc:* Failed XML output: <?xml encoding="utf-8"><top><![CDATA[cdata text]]>]]&gt;<![CDATA[</top>%(stack)s]]></failure> </testcase> </testsuite> <testsuite name="InvalidCharactersTest" tests="1" failures="1" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="InvalidCharactersInMessage" status="run" result="completed" time="*" timestamp="*" classname="InvalidCharactersTest"> <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Failed&#x0A;Invalid characters in brackets []" type=""><![CDATA[gtest_xml_output_unittest_.cc:* Failed Invalid characters in brackets []%(stack)s]]></failure> </testcase> </testsuite> <testsuite name="DisabledTest" tests="1" failures="0" disabled="1" errors="0" time="*" timestamp="*"> <testcase name="DISABLED_test_not_run" status="notrun" result="suppressed" time="*" timestamp="*" classname="DisabledTest"/> </testsuite> <testsuite name="SkippedTest" tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="Skipped" status="run" result="skipped" time="*" timestamp="*" classname="SkippedTest"/> </testsuite> <testsuite name="PropertyRecordingTest" tests="4" failures="0" disabled="0" errors="0" time="*" timestamp="*" SetUpTestSuite="yes" TearDownTestSuite="aye"> <testcase name="OneProperty" status="run" result="completed" time="*" timestamp="*" classname="PropertyRecordingTest"> <properties> <property name="key_1" value="1"/> </properties> </testcase> <testcase name="IntValuedProperty" status="run" result="completed" time="*" timestamp="*" classname="PropertyRecordingTest"> <properties> <property name="key_int" value="1"/> </properties> </testcase> <testcase name="ThreeProperties" status="run" result="completed" time="*" timestamp="*" classname="PropertyRecordingTest"> <properties> <property name="key_1" value="1"/> <property name="key_2" value="2"/> <property name="key_3" value="3"/> </properties> </testcase> <testcase name="TwoValuesForOneKeyUsesLastValue" status="run" result="completed" time="*" timestamp="*" classname="PropertyRecordingTest"> <properties> <property name="key_1" value="2"/> </properties> </testcase> </testsuite> <testsuite name="NoFixtureTest" tests="3" failures="0" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="RecordProperty" status="run" result="completed" time="*" timestamp="*" classname="NoFixtureTest"> <properties> <property name="key" value="1"/> </properties> </testcase> <testcase name="ExternalUtilityThatCallsRecordIntValuedProperty" status="run" result="completed" time="*" timestamp="*" classname="NoFixtureTest"> <properties> <property name="key_for_utility_int" value="1"/> </properties> </testcase> <testcase name="ExternalUtilityThatCallsRecordStringValuedProperty" status="run" result="completed" time="*" timestamp="*" classname="NoFixtureTest"> <properties> <property name="key_for_utility_string" value="1"/> </properties> </testcase> </testsuite> <testsuite name="Single/ValueParamTest" tests="4" failures="0" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="HasValueParamAttribute/0" value_param="33" status="run" result="completed" time="*" timestamp="*" classname="Single/ValueParamTest" /> <testcase name="HasValueParamAttribute/1" value_param="42" status="run" result="completed" time="*" timestamp="*" classname="Single/ValueParamTest" /> <testcase name="AnotherTestThatHasValueParamAttribute/0" value_param="33" status="run" result="completed" time="*" timestamp="*" classname="Single/ValueParamTest" /> <testcase name="AnotherTestThatHasValueParamAttribute/1" value_param="42" status="run" result="completed" time="*" timestamp="*" classname="Single/ValueParamTest" /> </testsuite> <testsuite name="TypedTest/0" tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="HasTypeParamAttribute" type_param="*" status="run" result="completed" time="*" timestamp="*" classname="TypedTest/0" /> </testsuite> <testsuite name="TypedTest/1" tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="HasTypeParamAttribute" type_param="*" status="run" result="completed" time="*" timestamp="*" classname="TypedTest/1" /> </testsuite> <testsuite name="Single/TypeParameterizedTestSuite/0" tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="HasTypeParamAttribute" type_param="*" status="run" result="completed" time="*" timestamp="*" classname="Single/TypeParameterizedTestSuite/0" /> </testsuite> <testsuite name="Single/TypeParameterizedTestSuite/1" tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="HasTypeParamAttribute" type_param="*" status="run" result="completed" time="*" timestamp="*" classname="Single/TypeParameterizedTestSuite/1" /> </testsuite> </testsuites>""" % { 'stack': STACK_TRACE_TEMPLATE } EXPECTED_FILTERED_TEST_XML = """<?xml version="1.0" encoding="UTF-8"?> <testsuites tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*" name="AllTests" ad_hoc_property="42"> <testsuite name="SuccessfulTest" tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="Succeeds" status="run" result="completed" time="*" timestamp="*" classname="SuccessfulTest"/> </testsuite> </testsuites>""" EXPECTED_SHARDED_TEST_XML = """<?xml version="1.0" encoding="UTF-8"?> <testsuites tests="3" failures="0" disabled="0" errors="0" time="*" timestamp="*" name="AllTests" ad_hoc_property="42"> <testsuite name="SuccessfulTest" tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="Succeeds" status="run" result="completed" time="*" timestamp="*" classname="SuccessfulTest"/> </testsuite> <testsuite name="PropertyRecordingTest" tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*" SetUpTestSuite="yes" TearDownTestSuite="aye"> <testcase name="TwoValuesForOneKeyUsesLastValue" status="run" result="completed" time="*" timestamp="*" classname="PropertyRecordingTest"> <properties> <property name="key_1" value="2"/> </properties> </testcase> </testsuite> <testsuite name="Single/ValueParamTest" tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*"> <testcase name="AnotherTestThatHasValueParamAttribute/0" value_param="33" status="run" result="completed" time="*" timestamp="*" classname="Single/ValueParamTest" /> </testsuite> </testsuites>""" EXPECTED_EMPTY_XML = """<?xml version="1.0" encoding="UTF-8"?> <testsuites tests="0" failures="0" disabled="0" errors="0" time="*" timestamp="*" name="AllTests"> </testsuites>""" GTEST_PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath(GTEST_PROGRAM_NAME) SUPPORTS_TYPED_TESTS = 'TypedTest' in gtest_test_utils.Subprocess( [GTEST_PROGRAM_PATH, GTEST_LIST_TESTS_FLAG], capture_stderr=False).output class GTestXMLOutputUnitTest(gtest_xml_test_utils.GTestXMLTestCase): """ Unit test for Google Test's XML output functionality. """ # This test currently breaks on platforms that do not support typed and # type-parameterized tests, so we don't run it under them. if SUPPORTS_TYPED_TESTS: def testNonEmptyXmlOutput(self): """ Runs a test program that generates a non-empty XML output, and tests that the XML output is expected. """ self._TestXmlOutput(GTEST_PROGRAM_NAME, EXPECTED_NON_EMPTY_XML, 1) def testEmptyXmlOutput(self): """Verifies XML output for a Google Test binary without actual tests. Runs a test program that generates an empty XML output, and tests that the XML output is expected. """ self._TestXmlOutput('gtest_no_test_unittest', EXPECTED_EMPTY_XML, 0) def testTimestampValue(self): """Checks whether the timestamp attribute in the XML output is valid. Runs a test program that generates an empty XML output, and checks if the timestamp attribute in the testsuites tag is valid. """ actual = self._GetXmlOutput('gtest_no_test_unittest', [], {}, 0) date_time_str = actual.documentElement.getAttributeNode('timestamp').value # datetime.strptime() is only available in Python 2.5+ so we have to # parse the expected datetime manually. match = re.match(r'(\d+)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)', date_time_str) self.assertTrue( re.match, 'XML datettime string %s has incorrect format' % date_time_str) date_time_from_xml = datetime.datetime( year=int(match.group(1)), month=int(match.group(2)), day=int(match.group(3)), hour=int(match.group(4)), minute=int(match.group(5)), second=int(match.group(6))) time_delta = abs(datetime.datetime.now() - date_time_from_xml) # timestamp value should be near the current local time self.assertTrue(time_delta < datetime.timedelta(seconds=600), 'time_delta is %s' % time_delta) actual.unlink() def testDefaultOutputFile(self): """ Confirms that Google Test produces an XML output file with the expected default name if no name is explicitly specified. """ output_file = os.path.join(gtest_test_utils.GetTempDir(), GTEST_DEFAULT_OUTPUT_FILE) gtest_prog_path = gtest_test_utils.GetTestExecutablePath( 'gtest_no_test_unittest') try: os.remove(output_file) except OSError: e = sys.exc_info()[1] if e.errno != errno.ENOENT: raise p = gtest_test_utils.Subprocess( [gtest_prog_path, '%s=xml' % GTEST_OUTPUT_FLAG], working_dir=gtest_test_utils.GetTempDir()) self.assert_(p.exited) self.assertEquals(0, p.exit_code) self.assert_(os.path.isfile(output_file)) def testSuppressedXmlOutput(self): """ Tests that no XML file is generated if the default XML listener is shut down before RUN_ALL_TESTS is invoked. """ xml_path = os.path.join(gtest_test_utils.GetTempDir(), GTEST_PROGRAM_NAME + 'out.xml') if os.path.isfile(xml_path): os.remove(xml_path) command = [GTEST_PROGRAM_PATH, '%s=xml:%s' % (GTEST_OUTPUT_FLAG, xml_path), '--shut_down_xml'] p = gtest_test_utils.Subprocess(command) if p.terminated_by_signal: # p.signal is available only if p.terminated_by_signal is True. self.assertFalse( p.terminated_by_signal, '%s was killed by signal %d' % (GTEST_PROGRAM_NAME, p.signal)) else: self.assert_(p.exited) self.assertEquals(1, p.exit_code, "'%s' exited with code %s, which doesn't match " 'the expected exit code %s.' % (command, p.exit_code, 1)) self.assert_(not os.path.isfile(xml_path)) def testFilteredTestXmlOutput(self): """Verifies XML output when a filter is applied. Runs a test program that executes only some tests and verifies that non-selected tests do not show up in the XML output. """ self._TestXmlOutput(GTEST_PROGRAM_NAME, EXPECTED_FILTERED_TEST_XML, 0, extra_args=['%s=SuccessfulTest.*' % GTEST_FILTER_FLAG]) def testShardedTestXmlOutput(self): """Verifies XML output when run using multiple shards. Runs a test program that executes only one shard and verifies that tests from other shards do not show up in the XML output. """ self._TestXmlOutput( GTEST_PROGRAM_NAME, EXPECTED_SHARDED_TEST_XML, 0, extra_env={SHARD_INDEX_ENV_VAR: '0', TOTAL_SHARDS_ENV_VAR: '10'}) def _GetXmlOutput(self, gtest_prog_name, extra_args, extra_env, expected_exit_code): """ Returns the xml output generated by running the program gtest_prog_name. Furthermore, the program's exit code must be expected_exit_code. """ xml_path = os.path.join(gtest_test_utils.GetTempDir(), gtest_prog_name + 'out.xml') gtest_prog_path = gtest_test_utils.GetTestExecutablePath(gtest_prog_name) command = ([gtest_prog_path, '%s=xml:%s' % (GTEST_OUTPUT_FLAG, xml_path)] + extra_args) environ_copy = os.environ.copy() if extra_env: environ_copy.update(extra_env) p = gtest_test_utils.Subprocess(command, env=environ_copy) if p.terminated_by_signal: self.assert_(False, '%s was killed by signal %d' % (gtest_prog_name, p.signal)) else: self.assert_(p.exited) self.assertEquals(expected_exit_code, p.exit_code, "'%s' exited with code %s, which doesn't match " 'the expected exit code %s.' % (command, p.exit_code, expected_exit_code)) actual = minidom.parse(xml_path) return actual def _TestXmlOutput(self, gtest_prog_name, expected_xml, expected_exit_code, extra_args=None, extra_env=None): """ Asserts that the XML document generated by running the program gtest_prog_name matches expected_xml, a string containing another XML document. Furthermore, the program's exit code must be expected_exit_code. """ actual = self._GetXmlOutput(gtest_prog_name, extra_args or [], extra_env or {}, expected_exit_code) expected = minidom.parseString(expected_xml) self.NormalizeXml(actual.documentElement) self.AssertEquivalentNodes(expected.documentElement, actual.documentElement) expected.unlink() actual.unlink() if __name__ == '__main__': os.environ['GTEST_STACK_TRACE_DEPTH'] = '1' gtest_test_utils.Main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 198, 2, 15069, 4793, 11, 3012, 3457, 13, 198, 2, 1439, 2489, 10395, 13, 198, 2, 198, 2, 2297, 396, 3890, 290, 779, 287, 2723, 290, 13934, 5107, 11, 351, 393, 1231, 198, 2, 17613, 11, 389, 10431, 2810, 326, 262, 1708, 3403, 389, 198, 2, 1138, 25, 198, 2, 198, 2, 220, 220, 220, 220, 1635, 2297, 396, 2455, 507, 286, 2723, 2438, 1276, 12377, 262, 2029, 6634, 198, 2, 4003, 11, 428, 1351, 286, 3403, 290, 262, 1708, 37592, 13, 198, 2, 220, 220, 220, 220, 1635, 2297, 396, 2455, 507, 287, 13934, 1296, 1276, 22919, 262, 2029, 198, 2, 6634, 4003, 11, 428, 1351, 286, 3403, 290, 262, 1708, 37592, 198, 2, 287, 262, 10314, 290, 14, 273, 584, 5696, 2810, 351, 262, 198, 2, 6082, 13, 198, 2, 220, 220, 220, 220, 1635, 16126, 262, 1438, 286, 3012, 3457, 13, 4249, 262, 3891, 286, 663, 198, 2, 20420, 743, 307, 973, 284, 11438, 393, 7719, 3186, 10944, 422, 198, 2, 428, 3788, 1231, 2176, 3161, 3194, 7170, 13, 198, 2, 198, 2, 12680, 47466, 3180, 36592, 2389, 1961, 11050, 3336, 27975, 38162, 9947, 367, 15173, 4877, 5357, 27342, 9865, 3843, 20673, 198, 2, 366, 1921, 3180, 1, 5357, 15529, 7788, 32761, 6375, 8959, 49094, 34764, 11015, 11, 47783, 2751, 11, 21728, 5626, 198, 2, 40880, 5390, 11, 3336, 8959, 49094, 34764, 11015, 3963, 34482, 3398, 1565, 5603, 25382, 5357, 376, 46144, 7473, 198, 2, 317, 16652, 2149, 37232, 33079, 48933, 15986, 13954, 48778, 1961, 13, 3268, 8005, 49261, 50163, 3336, 27975, 38162, 9947, 198, 2, 47210, 21479, 6375, 27342, 9865, 3843, 20673, 9348, 43031, 19146, 7473, 15529, 42242, 11, 3268, 17931, 23988, 11, 19387, 25256, 1847, 11, 198, 2, 38846, 11, 7788, 3620, 6489, 13153, 11, 6375, 7102, 5188, 10917, 3525, 12576, 29506, 25552, 357, 1268, 39149, 2751, 11, 21728, 5626, 198, 2, 40880, 5390, 11, 41755, 11335, 10979, 3963, 28932, 2257, 2043, 37780, 21090, 50, 6375, 49254, 26, 406, 18420, 3963, 23210, 11, 198, 2, 42865, 11, 6375, 4810, 19238, 29722, 26, 6375, 43949, 44180, 23255, 49, 8577, 24131, 8, 29630, 36, 5959, 7257, 2937, 1961, 5357, 6177, 15529, 198, 2, 3336, 15513, 3963, 43031, 25382, 11, 7655, 2767, 16879, 3268, 27342, 10659, 11, 19269, 18379, 43031, 25382, 11, 6375, 309, 9863, 198, 2, 357, 1268, 39149, 2751, 399, 7156, 43, 3528, 18310, 6375, 25401, 54, 24352, 8, 5923, 1797, 2751, 3268, 15529, 34882, 16289, 3963, 3336, 23210, 198, 2, 3963, 12680, 47466, 11, 45886, 16876, 5984, 29817, 1961, 3963, 3336, 28069, 11584, 25382, 3963, 13558, 3398, 29506, 11879, 13, 198, 198, 37811, 26453, 1332, 329, 262, 308, 9288, 62, 19875, 62, 22915, 8265, 37811, 198, 198, 11748, 4818, 8079, 198, 11748, 11454, 3919, 198, 11748, 28686, 198, 11748, 302, 198, 11748, 25064, 198, 6738, 35555, 13, 3438, 1330, 949, 312, 296, 198, 198, 11748, 308, 9288, 62, 9288, 62, 26791, 198, 11748, 308, 9288, 62, 19875, 62, 9288, 62, 26791, 198, 198, 19555, 6465, 62, 46700, 5781, 62, 38948, 796, 705, 438, 70, 9288, 62, 24455, 6, 198, 19555, 6465, 62, 45849, 62, 51, 1546, 4694, 62, 38948, 796, 705, 438, 70, 9288, 62, 4868, 62, 41989, 6, 198, 19555, 6465, 62, 2606, 7250, 3843, 62, 38948, 796, 705, 438, 70, 9288, 62, 22915, 6, 198, 19555, 6465, 62, 7206, 38865, 62, 2606, 7250, 3843, 62, 25664, 796, 705, 9288, 62, 49170, 13, 19875, 6, 198, 19555, 6465, 62, 4805, 7730, 24115, 62, 20608, 796, 705, 70, 9288, 62, 19875, 62, 22915, 62, 403, 715, 395, 62, 6, 198, 198, 2, 383, 6056, 12739, 8931, 2213, 2114, 389, 407, 4855, 198, 15285, 62, 2257, 8120, 5446, 11598, 62, 40331, 15490, 62, 38948, 796, 705, 438, 3919, 62, 25558, 40546, 62, 11284, 6, 198, 198, 2, 383, 2858, 9633, 329, 1332, 427, 13493, 13, 198, 51, 27510, 62, 9693, 48294, 62, 1677, 53, 62, 53, 1503, 796, 705, 19555, 6465, 62, 51, 27510, 62, 9693, 48294, 6, 198, 9693, 9795, 62, 12115, 6369, 62, 1677, 53, 62, 53, 1503, 796, 705, 19555, 6465, 62, 9693, 9795, 62, 12115, 6369, 6, 198, 9693, 9795, 62, 35744, 2937, 62, 25664, 62, 1677, 53, 62, 53, 1503, 796, 705, 19555, 6465, 62, 9693, 9795, 62, 35744, 2937, 62, 25664, 6, 198, 198, 40331, 47, 33002, 62, 2257, 8120, 62, 5446, 2246, 1546, 796, 8005, 62, 2257, 8120, 5446, 11598, 62, 40331, 15490, 62, 38948, 407, 287, 25064, 13, 853, 85, 198, 198, 361, 19549, 47, 33002, 62, 2257, 8120, 62, 5446, 2246, 1546, 25, 198, 220, 3563, 8120, 62, 5446, 11598, 62, 51, 3620, 6489, 6158, 796, 705, 59, 77, 25896, 12854, 7479, 77, 9, 6, 198, 17772, 25, 198, 220, 3563, 8120, 62, 5446, 11598, 62, 51, 3620, 6489, 6158, 796, 10148, 198, 220, 1303, 555, 715, 395, 13, 12417, 3419, 460, 470, 5412, 6439, 9701, 198, 220, 25064, 13, 853, 85, 13, 28956, 7, 15285, 62, 2257, 8120, 5446, 11598, 62, 40331, 15490, 62, 38948, 8, 198, 198, 49864, 9782, 1961, 62, 45, 1340, 62, 39494, 9936, 62, 55, 5805, 796, 37227, 47934, 19875, 2196, 2625, 16, 13, 15, 1, 21004, 2625, 48504, 12, 23, 13984, 29, 198, 27, 9288, 2385, 2737, 5254, 2625, 1731, 1, 15536, 2625, 19, 1, 10058, 2625, 17, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1438, 2625, 3237, 51, 3558, 1, 512, 62, 71, 420, 62, 26745, 2625, 3682, 5320, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 33244, 913, 14402, 1, 5254, 2625, 16, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 50, 1229, 2707, 82, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 33244, 913, 14402, 26700, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 37, 6255, 14402, 1, 5254, 2625, 16, 1, 15536, 2625, 16, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 37, 1768, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 37, 6255, 14402, 5320, 198, 220, 220, 220, 220, 220, 1279, 32165, 495, 3275, 2625, 70, 9288, 62, 19875, 62, 22915, 62, 403, 715, 395, 44807, 535, 25, 9, 5, 2, 87, 15, 32, 26, 3109, 7254, 10537, 286, 777, 3815, 25, 5, 2, 87, 15, 32, 26, 220, 352, 5, 2, 87, 15, 32, 26, 220, 362, 1, 2099, 2625, 22039, 0, 58, 8610, 13563, 58, 70, 9288, 62, 19875, 62, 22915, 62, 403, 715, 395, 44807, 535, 25, 9, 198, 3109, 7254, 10537, 286, 777, 3815, 25, 198, 220, 352, 198, 220, 362, 4, 7, 25558, 8, 82, 11907, 12240, 32165, 495, 29, 198, 220, 220, 220, 7359, 9288, 7442, 29, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 44, 2966, 23004, 14402, 1, 5254, 2625, 18, 1, 15536, 2625, 16, 1, 10058, 2625, 16, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 50, 1229, 2707, 82, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 44, 2966, 23004, 14402, 26700, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 37, 1768, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 44, 2966, 23004, 14402, 5320, 198, 220, 220, 220, 220, 220, 1279, 32165, 495, 3275, 2625, 70, 9288, 62, 19875, 62, 22915, 62, 403, 715, 395, 44807, 535, 25, 9, 5, 2, 87, 15, 32, 26, 3109, 7254, 10537, 286, 777, 3815, 25, 5, 2, 87, 15, 32, 26, 220, 352, 5, 2, 87, 15, 32, 26, 220, 362, 1, 2099, 2625, 22039, 0, 58, 8610, 13563, 58, 70, 9288, 62, 19875, 62, 22915, 62, 403, 715, 395, 44807, 535, 25, 9, 198, 3109, 7254, 10537, 286, 777, 3815, 25, 198, 220, 352, 198, 220, 362, 4, 7, 25558, 8, 82, 11907, 12240, 32165, 495, 29, 198, 220, 220, 220, 220, 220, 1279, 32165, 495, 3275, 2625, 70, 9288, 62, 19875, 62, 22915, 62, 403, 715, 395, 44807, 535, 25, 9, 5, 2, 87, 15, 32, 26, 3109, 7254, 10537, 286, 777, 3815, 25, 5, 2, 87, 15, 32, 26, 220, 362, 5, 2, 87, 15, 32, 26, 220, 513, 1, 2099, 2625, 22039, 0, 58, 8610, 13563, 58, 70, 9288, 62, 19875, 62, 22915, 62, 403, 715, 395, 44807, 535, 25, 9, 198, 3109, 7254, 10537, 286, 777, 3815, 25, 198, 220, 362, 198, 220, 513, 4, 7, 25558, 8, 82, 11907, 12240, 32165, 495, 29, 198, 220, 220, 220, 7359, 9288, 7442, 29, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 26288, 6242, 30465, 62, 9288, 1, 3722, 2625, 1662, 5143, 1, 1255, 2625, 18608, 2790, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 44, 2966, 23004, 14402, 26700, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 55, 4029, 4507, 10720, 14402, 1, 5254, 2625, 16, 1, 15536, 2625, 16, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 26410, 82, 34, 6601, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 55, 4029, 4507, 10720, 14402, 5320, 198, 220, 220, 220, 220, 220, 1279, 32165, 495, 3275, 2625, 70, 9288, 62, 19875, 62, 22915, 62, 403, 715, 395, 44807, 535, 25, 9, 5, 2, 87, 15, 32, 26, 37, 6255, 5, 2, 87, 15, 32, 26, 55, 5805, 5072, 25, 1222, 2528, 26, 30, 19875, 21004, 28, 5, 421, 313, 26, 40477, 12, 23, 5, 421, 313, 26, 5, 13655, 26, 5, 2528, 26, 4852, 5, 13655, 26, 5, 2528, 26, 0, 58, 8610, 13563, 58, 66, 7890, 2420, 11907, 5, 13655, 26, 5, 2528, 26, 14, 4852, 5, 13655, 26033, 2099, 2625, 22039, 0, 58, 8610, 13563, 58, 70, 9288, 62, 19875, 62, 22915, 62, 403, 715, 395, 44807, 535, 25, 9, 198, 37, 6255, 198, 55, 5805, 5072, 25, 1279, 30, 19875, 21004, 2625, 40477, 12, 23, 22039, 4852, 6927, 0, 58, 8610, 13563, 58, 66, 7890, 2420, 11907, 29, 11907, 5, 13655, 26, 27, 0, 58, 8610, 13563, 58, 3556, 4852, 29, 4, 7, 25558, 8, 82, 11907, 12240, 32165, 495, 29, 198, 220, 220, 220, 7359, 9288, 7442, 29, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 44651, 48393, 14402, 1, 5254, 2625, 16, 1, 15536, 2625, 16, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 44651, 48393, 818, 12837, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 44651, 48393, 14402, 5320, 198, 220, 220, 220, 220, 220, 1279, 32165, 495, 3275, 2625, 70, 9288, 62, 19875, 62, 22915, 62, 403, 715, 395, 44807, 535, 25, 9, 5, 2, 87, 15, 32, 26, 37, 6255, 5, 2, 87, 15, 32, 26, 44651, 3435, 287, 28103, 17635, 1, 2099, 2625, 22039, 0, 58, 8610, 13563, 58, 70, 9288, 62, 19875, 62, 22915, 62, 403, 715, 395, 44807, 535, 25, 9, 198, 37, 6255, 198, 44651, 3435, 287, 28103, 17635, 4, 7, 25558, 8, 82, 11907, 12240, 32165, 495, 29, 198, 220, 220, 220, 7359, 9288, 7442, 29, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 7279, 4510, 14402, 1, 5254, 2625, 16, 1, 15536, 2625, 15, 1, 10058, 2625, 16, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 26288, 6242, 30465, 62, 9288, 62, 1662, 62, 5143, 1, 3722, 2625, 1662, 5143, 1, 1255, 2625, 18608, 2790, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 7279, 4510, 14402, 26700, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 15739, 3949, 14402, 1, 5254, 2625, 16, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 15739, 3949, 1, 3722, 2625, 5143, 1, 1255, 2625, 8135, 3949, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 15739, 3949, 14402, 26700, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 21746, 6690, 1284, 14402, 1, 5254, 2625, 19, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 5345, 4933, 14402, 5606, 578, 2625, 8505, 1, 309, 451, 8048, 14402, 5606, 578, 2625, 48822, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 3198, 21746, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 21746, 6690, 1284, 14402, 5320, 198, 220, 220, 220, 220, 220, 1279, 48310, 29, 198, 220, 220, 220, 220, 220, 220, 220, 1279, 26745, 1438, 2625, 2539, 62, 16, 1, 1988, 2625, 16, 26700, 198, 220, 220, 220, 220, 220, 7359, 48310, 29, 198, 220, 220, 220, 7359, 9288, 7442, 29, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 5317, 7762, 1739, 21746, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 21746, 6690, 1284, 14402, 5320, 198, 220, 220, 220, 220, 220, 1279, 48310, 29, 198, 220, 220, 220, 220, 220, 220, 220, 1279, 26745, 1438, 2625, 2539, 62, 600, 1, 1988, 2625, 16, 26700, 198, 220, 220, 220, 220, 220, 7359, 48310, 29, 198, 220, 220, 220, 7359, 9288, 7442, 29, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 12510, 2964, 18200, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 21746, 6690, 1284, 14402, 5320, 198, 220, 220, 220, 220, 220, 1279, 48310, 29, 198, 220, 220, 220, 220, 220, 220, 220, 1279, 26745, 1438, 2625, 2539, 62, 16, 1, 1988, 2625, 16, 26700, 198, 220, 220, 220, 220, 220, 220, 220, 1279, 26745, 1438, 2625, 2539, 62, 17, 1, 1988, 2625, 17, 26700, 198, 220, 220, 220, 220, 220, 220, 220, 1279, 26745, 1438, 2625, 2539, 62, 18, 1, 1988, 2625, 18, 26700, 198, 220, 220, 220, 220, 220, 7359, 48310, 29, 198, 220, 220, 220, 7359, 9288, 7442, 29, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 7571, 40161, 1890, 3198, 9218, 5842, 274, 5956, 11395, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 21746, 6690, 1284, 14402, 5320, 198, 220, 220, 220, 220, 220, 1279, 48310, 29, 198, 220, 220, 220, 220, 220, 220, 220, 1279, 26745, 1438, 2625, 2539, 62, 16, 1, 1988, 2625, 17, 26700, 198, 220, 220, 220, 220, 220, 7359, 48310, 29, 198, 220, 220, 220, 7359, 9288, 7442, 29, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 2949, 37, 9602, 14402, 1, 5254, 2625, 18, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 23739, 21746, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 2949, 37, 9602, 14402, 5320, 198, 220, 220, 220, 220, 220, 220, 1279, 48310, 29, 198, 220, 220, 220, 220, 220, 220, 220, 220, 1279, 26745, 1438, 2625, 2539, 1, 1988, 2625, 16, 26700, 198, 220, 220, 220, 220, 220, 220, 7359, 48310, 29, 198, 220, 220, 220, 220, 7359, 9288, 7442, 29, 198, 220, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 41506, 18274, 879, 2504, 34, 5691, 23739, 5317, 7762, 1739, 21746, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 2949, 37, 9602, 14402, 5320, 198, 220, 220, 220, 220, 220, 220, 1279, 48310, 29, 198, 220, 220, 220, 220, 220, 220, 220, 220, 1279, 26745, 1438, 2625, 2539, 62, 1640, 62, 315, 879, 62, 600, 1, 1988, 2625, 16, 26700, 198, 220, 220, 220, 220, 220, 220, 7359, 48310, 29, 198, 220, 220, 220, 220, 7359, 9288, 7442, 29, 198, 220, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 41506, 18274, 879, 2504, 34, 5691, 23739, 10100, 7762, 1739, 21746, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 2949, 37, 9602, 14402, 5320, 198, 220, 220, 220, 220, 220, 220, 1279, 48310, 29, 198, 220, 220, 220, 220, 220, 220, 220, 220, 1279, 26745, 1438, 2625, 2539, 62, 1640, 62, 315, 879, 62, 8841, 1, 1988, 2625, 16, 26700, 198, 220, 220, 220, 220, 220, 220, 7359, 48310, 29, 198, 220, 220, 220, 220, 7359, 9288, 7442, 29, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 28008, 14, 11395, 22973, 14402, 1, 5254, 2625, 19, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 19242, 11395, 22973, 33682, 14, 15, 1, 1988, 62, 17143, 2625, 2091, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 28008, 14, 11395, 22973, 14402, 1, 11037, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 19242, 11395, 22973, 33682, 14, 16, 1, 1988, 62, 17143, 2625, 3682, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 28008, 14, 11395, 22973, 14402, 1, 11037, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 6610, 14402, 2504, 19242, 11395, 22973, 33682, 14, 15, 1, 1988, 62, 17143, 2625, 2091, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 28008, 14, 11395, 22973, 14402, 1, 11037, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 6610, 14402, 2504, 19242, 11395, 22973, 33682, 14, 16, 1, 1988, 62, 17143, 2625, 3682, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 28008, 14, 11395, 22973, 14402, 1, 11037, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 31467, 276, 14402, 14, 15, 1, 5254, 2625, 16, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 19242, 6030, 22973, 33682, 1, 2099, 62, 17143, 2625, 9, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 31467, 276, 14402, 14, 15, 1, 11037, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 31467, 276, 14402, 14, 16, 1, 5254, 2625, 16, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 19242, 6030, 22973, 33682, 1, 2099, 62, 17143, 2625, 9, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 31467, 276, 14402, 14, 16, 1, 11037, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 28008, 14, 6030, 36301, 1143, 14402, 5606, 578, 14, 15, 1, 5254, 2625, 16, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 19242, 6030, 22973, 33682, 1, 2099, 62, 17143, 2625, 9, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 28008, 14, 6030, 36301, 1143, 14402, 5606, 578, 14, 15, 1, 11037, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 28008, 14, 6030, 36301, 1143, 14402, 5606, 578, 14, 16, 1, 5254, 2625, 16, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 19242, 6030, 22973, 33682, 1, 2099, 62, 17143, 2625, 9, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 28008, 14, 6030, 36301, 1143, 14402, 5606, 578, 14, 16, 1, 11037, 198, 220, 7359, 9288, 2385, 578, 29, 198, 3556, 9288, 2385, 2737, 29, 37811, 4064, 1391, 198, 220, 220, 220, 705, 25558, 10354, 3563, 8120, 62, 5446, 11598, 62, 51, 3620, 6489, 6158, 198, 92, 198, 198, 49864, 9782, 1961, 62, 46700, 5781, 1961, 62, 51, 6465, 62, 55, 5805, 796, 37227, 47934, 19875, 2196, 2625, 16, 13, 15, 1, 21004, 2625, 48504, 12, 23, 13984, 29, 198, 27, 9288, 2385, 2737, 5254, 2625, 16, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 41033, 2625, 9, 1, 1438, 2625, 3237, 51, 3558, 1, 512, 62, 71, 420, 62, 26745, 2625, 3682, 5320, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 33244, 913, 14402, 1, 5254, 2625, 16, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 50, 1229, 2707, 82, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 33244, 913, 14402, 26700, 198, 220, 7359, 9288, 2385, 578, 29, 198, 3556, 9288, 2385, 2737, 29, 37811, 198, 198, 49864, 9782, 1961, 62, 9693, 9795, 1961, 62, 51, 6465, 62, 55, 5805, 796, 37227, 47934, 19875, 2196, 2625, 16, 13, 15, 1, 21004, 2625, 48504, 12, 23, 13984, 29, 198, 27, 9288, 2385, 2737, 5254, 2625, 18, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1438, 2625, 3237, 51, 3558, 1, 512, 62, 71, 420, 62, 26745, 2625, 3682, 5320, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 33244, 913, 14402, 1, 5254, 2625, 16, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 50, 1229, 2707, 82, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 33244, 913, 14402, 26700, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 21746, 6690, 1284, 14402, 1, 5254, 2625, 16, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 5345, 4933, 14402, 5606, 578, 2625, 8505, 1, 309, 451, 8048, 14402, 5606, 578, 2625, 48822, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 7571, 40161, 1890, 3198, 9218, 5842, 274, 5956, 11395, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 21746, 6690, 1284, 14402, 5320, 198, 220, 220, 220, 220, 220, 1279, 48310, 29, 198, 220, 220, 220, 220, 220, 220, 220, 1279, 26745, 1438, 2625, 2539, 62, 16, 1, 1988, 2625, 17, 26700, 198, 220, 220, 220, 220, 220, 7359, 48310, 29, 198, 220, 220, 220, 7359, 9288, 7442, 29, 198, 220, 7359, 9288, 2385, 578, 29, 198, 220, 1279, 9288, 2385, 578, 1438, 2625, 28008, 14, 11395, 22973, 14402, 1, 5254, 2625, 16, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 41033, 2625, 9, 5320, 198, 220, 220, 220, 1279, 9288, 7442, 1438, 2625, 6610, 14402, 2504, 19242, 11395, 22973, 33682, 14, 15, 1, 1988, 62, 17143, 2625, 2091, 1, 3722, 2625, 5143, 1, 1255, 2625, 785, 16838, 1, 640, 2625, 9, 1, 41033, 2625, 9, 1, 1398, 3672, 2625, 28008, 14, 11395, 22973, 14402, 1, 11037, 198, 220, 7359, 9288, 2385, 578, 29, 198, 3556, 9288, 2385, 2737, 29, 37811, 198, 198, 49864, 9782, 1961, 62, 39494, 9936, 62, 55, 5805, 796, 37227, 47934, 19875, 2196, 2625, 16, 13, 15, 1, 21004, 2625, 48504, 12, 23, 13984, 29, 198, 27, 9288, 2385, 2737, 5254, 2625, 15, 1, 15536, 2625, 15, 1, 10058, 2625, 15, 1, 8563, 2625, 15, 1, 640, 2625, 9, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 41033, 2625, 9, 1, 1438, 2625, 3237, 51, 3558, 5320, 198, 3556, 9288, 2385, 2737, 29, 37811, 198, 198, 19555, 6465, 62, 4805, 7730, 24115, 62, 34219, 796, 308, 9288, 62, 9288, 62, 26791, 13, 3855, 14402, 23002, 18187, 15235, 7, 19555, 6465, 62, 4805, 7730, 24115, 62, 20608, 8, 198, 198, 40331, 47, 33002, 62, 9936, 47, 1961, 62, 51, 1546, 4694, 796, 705, 31467, 276, 14402, 6, 287, 308, 9288, 62, 9288, 62, 26791, 13, 7004, 14681, 7, 198, 220, 220, 220, 685, 19555, 6465, 62, 4805, 7730, 24115, 62, 34219, 11, 7963, 6465, 62, 45849, 62, 51, 1546, 4694, 62, 38948, 4357, 8006, 62, 301, 1082, 81, 28, 25101, 737, 22915, 628, 198, 4871, 7963, 395, 55, 5805, 26410, 26453, 14402, 7, 70, 9288, 62, 19875, 62, 9288, 62, 26791, 13, 38, 14402, 55, 5805, 14402, 20448, 2599, 198, 220, 37227, 198, 220, 11801, 1332, 329, 3012, 6208, 338, 23735, 5072, 11244, 13, 198, 220, 37227, 628, 220, 1303, 770, 1332, 3058, 9457, 319, 9554, 326, 466, 407, 1104, 25683, 290, 198, 220, 1303, 2099, 12, 17143, 2357, 1143, 5254, 11, 523, 356, 836, 470, 1057, 340, 739, 606, 13, 198, 220, 611, 19549, 47, 33002, 62, 9936, 47, 1961, 62, 51, 1546, 4694, 25, 198, 220, 220, 220, 825, 1332, 15419, 40613, 55, 4029, 26410, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 44743, 257, 1332, 1430, 326, 18616, 257, 1729, 12, 28920, 23735, 5072, 11, 290, 198, 220, 220, 220, 220, 220, 5254, 326, 262, 23735, 5072, 318, 2938, 13, 198, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 2116, 13557, 14402, 55, 4029, 26410, 7, 19555, 6465, 62, 4805, 7730, 24115, 62, 20608, 11, 25703, 9782, 1961, 62, 45, 1340, 62, 39494, 9936, 62, 55, 5805, 11, 352, 8, 628, 220, 825, 1332, 40613, 55, 4029, 26410, 7, 944, 2599, 198, 220, 220, 220, 37227, 13414, 6945, 23735, 5072, 329, 257, 3012, 6208, 13934, 1231, 4036, 5254, 13, 628, 220, 220, 220, 44743, 257, 1332, 1430, 326, 18616, 281, 6565, 23735, 5072, 11, 290, 198, 220, 220, 220, 5254, 326, 262, 23735, 5072, 318, 2938, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 2116, 13557, 14402, 55, 4029, 26410, 10786, 70, 9288, 62, 3919, 62, 9288, 62, 403, 715, 395, 3256, 25703, 9782, 1961, 62, 39494, 9936, 62, 55, 5805, 11, 657, 8, 628, 220, 825, 1332, 14967, 27823, 11395, 7, 944, 2599, 198, 220, 220, 220, 37227, 7376, 4657, 1771, 262, 41033, 11688, 287, 262, 23735, 5072, 318, 4938, 13, 628, 220, 220, 220, 44743, 257, 1332, 1430, 326, 18616, 281, 6565, 23735, 5072, 11, 290, 8794, 611, 198, 220, 220, 220, 262, 41033, 11688, 287, 262, 1332, 2385, 2737, 7621, 318, 4938, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 4036, 796, 2116, 13557, 3855, 55, 4029, 26410, 10786, 70, 9288, 62, 3919, 62, 9288, 62, 403, 715, 395, 3256, 685, 4357, 1391, 5512, 657, 8, 198, 220, 220, 220, 3128, 62, 2435, 62, 2536, 796, 4036, 13, 22897, 20180, 13, 1136, 33682, 19667, 10786, 16514, 27823, 27691, 8367, 198, 220, 220, 220, 1303, 4818, 8079, 13, 2536, 457, 524, 3419, 318, 691, 1695, 287, 11361, 362, 13, 20, 10, 523, 356, 423, 284, 198, 220, 220, 220, 1303, 21136, 262, 2938, 4818, 8079, 14500, 13, 198, 220, 220, 220, 2872, 796, 302, 13, 15699, 7, 81, 6, 38016, 67, 10, 13219, 38016, 67, 59, 67, 13219, 38016, 67, 59, 67, 8, 51, 38016, 67, 59, 67, 2599, 38016, 67, 59, 67, 2599, 38016, 67, 59, 67, 8, 3256, 3128, 62, 2435, 62, 2536, 8, 198, 220, 220, 220, 2116, 13, 30493, 17821, 7, 198, 220, 220, 220, 220, 220, 220, 220, 302, 13, 15699, 11, 198, 220, 220, 220, 220, 220, 220, 220, 705, 55, 5805, 4818, 316, 2435, 4731, 4064, 82, 468, 11491, 5794, 6, 4064, 3128, 62, 2435, 62, 2536, 8, 198, 220, 220, 220, 3128, 62, 2435, 62, 6738, 62, 19875, 796, 4818, 8079, 13, 19608, 8079, 7, 198, 220, 220, 220, 220, 220, 220, 220, 614, 28, 600, 7, 15699, 13, 8094, 7, 16, 36911, 1227, 28, 600, 7, 15699, 13, 8094, 7, 17, 36911, 198, 220, 220, 220, 220, 220, 220, 220, 1110, 28, 600, 7, 15699, 13, 8094, 7, 18, 36911, 1711, 28, 600, 7, 15699, 13, 8094, 7, 19, 36911, 198, 220, 220, 220, 220, 220, 220, 220, 5664, 28, 600, 7, 15699, 13, 8094, 7, 20, 36911, 1218, 28, 600, 7, 15699, 13, 8094, 7, 21, 22305, 628, 220, 220, 220, 640, 62, 67, 12514, 796, 2352, 7, 19608, 8079, 13, 19608, 8079, 13, 2197, 3419, 532, 3128, 62, 2435, 62, 6738, 62, 19875, 8, 198, 220, 220, 220, 1303, 41033, 1988, 815, 307, 1474, 262, 1459, 1957, 640, 198, 220, 220, 220, 2116, 13, 30493, 17821, 7, 2435, 62, 67, 12514, 1279, 4818, 8079, 13, 16514, 276, 12514, 7, 43012, 28, 8054, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 2435, 62, 67, 12514, 318, 4064, 82, 6, 4064, 640, 62, 67, 12514, 8, 198, 220, 220, 220, 4036, 13, 403, 8726, 3419, 628, 220, 825, 1332, 19463, 26410, 8979, 7, 944, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 7326, 8789, 326, 3012, 6208, 11073, 281, 23735, 5072, 2393, 351, 262, 2938, 198, 220, 220, 220, 4277, 1438, 611, 645, 1438, 318, 11777, 7368, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5072, 62, 7753, 796, 28686, 13, 6978, 13, 22179, 7, 70, 9288, 62, 9288, 62, 26791, 13, 3855, 30782, 35277, 22784, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7963, 6465, 62, 7206, 38865, 62, 2606, 7250, 3843, 62, 25664, 8, 198, 220, 220, 220, 308, 9288, 62, 1676, 70, 62, 6978, 796, 308, 9288, 62, 9288, 62, 26791, 13, 3855, 14402, 23002, 18187, 15235, 7, 198, 220, 220, 220, 220, 220, 220, 220, 705, 70, 9288, 62, 3919, 62, 9288, 62, 403, 715, 395, 11537, 198, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 28686, 13, 28956, 7, 22915, 62, 7753, 8, 198, 220, 220, 220, 2845, 440, 5188, 81, 1472, 25, 198, 220, 220, 220, 220, 220, 304, 796, 25064, 13, 41194, 62, 10951, 3419, 58, 16, 60, 198, 220, 220, 220, 220, 220, 611, 304, 13, 8056, 3919, 14512, 11454, 3919, 13, 1677, 46, 3525, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 628, 220, 220, 220, 279, 796, 308, 9288, 62, 9288, 62, 26791, 13, 7004, 14681, 7, 198, 220, 220, 220, 220, 220, 220, 220, 685, 70, 9288, 62, 1676, 70, 62, 6978, 11, 705, 4, 82, 28, 19875, 6, 4064, 7963, 6465, 62, 2606, 7250, 3843, 62, 38948, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 1762, 62, 15908, 28, 70, 9288, 62, 9288, 62, 26791, 13, 3855, 30782, 35277, 28955, 198, 220, 220, 220, 2116, 13, 30493, 41052, 79, 13, 1069, 863, 8, 198, 220, 220, 220, 2116, 13, 30493, 23588, 874, 7, 15, 11, 279, 13, 37023, 62, 8189, 8, 198, 220, 220, 220, 2116, 13, 30493, 41052, 418, 13, 6978, 13, 4468, 576, 7, 22915, 62, 7753, 4008, 628, 220, 825, 1332, 15979, 2790, 55, 4029, 26410, 7, 944, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 30307, 326, 645, 23735, 2393, 318, 7560, 611, 262, 4277, 23735, 24783, 318, 198, 220, 220, 220, 4423, 866, 878, 32494, 62, 7036, 62, 51, 1546, 4694, 318, 24399, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 35555, 62, 6978, 796, 28686, 13, 6978, 13, 22179, 7, 70, 9288, 62, 9288, 62, 26791, 13, 3855, 30782, 35277, 22784, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7963, 6465, 62, 4805, 7730, 24115, 62, 20608, 1343, 705, 448, 13, 19875, 11537, 198, 220, 220, 220, 611, 28686, 13, 6978, 13, 4468, 576, 7, 19875, 62, 6978, 2599, 198, 220, 220, 220, 220, 220, 28686, 13, 28956, 7, 19875, 62, 6978, 8, 628, 220, 220, 220, 3141, 796, 685, 19555, 6465, 62, 4805, 7730, 24115, 62, 34219, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 4, 82, 28, 19875, 25, 4, 82, 6, 4064, 357, 19555, 6465, 62, 2606, 7250, 3843, 62, 38948, 11, 35555, 62, 6978, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 438, 49625, 62, 2902, 62, 19875, 20520, 198, 220, 220, 220, 279, 796, 308, 9288, 62, 9288, 62, 26791, 13, 7004, 14681, 7, 21812, 8, 198, 220, 220, 220, 611, 279, 13, 23705, 515, 62, 1525, 62, 12683, 282, 25, 198, 220, 220, 220, 220, 220, 1303, 279, 13, 12683, 282, 318, 1695, 691, 611, 279, 13, 23705, 515, 62, 1525, 62, 12683, 282, 318, 6407, 13, 198, 220, 220, 220, 220, 220, 2116, 13, 30493, 25101, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 279, 13, 23705, 515, 62, 1525, 62, 12683, 282, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 4, 82, 373, 2923, 416, 6737, 4064, 67, 6, 4064, 357, 19555, 6465, 62, 4805, 7730, 24115, 62, 20608, 11, 279, 13, 12683, 282, 4008, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 2116, 13, 30493, 41052, 79, 13, 1069, 863, 8, 198, 220, 220, 220, 220, 220, 2116, 13, 30493, 23588, 874, 7, 16, 11, 279, 13, 37023, 62, 8189, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 24018, 4, 82, 6, 34710, 351, 2438, 4064, 82, 11, 543, 1595, 470, 2872, 366, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 1169, 2938, 8420, 2438, 4064, 82, 2637, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4064, 357, 21812, 11, 279, 13, 37023, 62, 8189, 11, 352, 4008, 628, 220, 220, 220, 2116, 13, 30493, 41052, 1662, 28686, 13, 6978, 13, 4468, 576, 7, 19875, 62, 6978, 4008, 628, 220, 825, 1332, 11928, 4400, 14402, 55, 4029, 26410, 7, 944, 2599, 198, 220, 220, 220, 37227, 13414, 6945, 23735, 5072, 618, 257, 8106, 318, 5625, 13, 628, 220, 220, 220, 44743, 257, 1332, 1430, 326, 42985, 691, 617, 5254, 290, 3326, 6945, 326, 198, 220, 220, 220, 1729, 12, 34213, 5254, 466, 407, 905, 510, 287, 262, 23735, 5072, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 2116, 13557, 14402, 55, 4029, 26410, 7, 19555, 6465, 62, 4805, 7730, 24115, 62, 20608, 11, 25703, 9782, 1961, 62, 46700, 5781, 1961, 62, 51, 6465, 62, 55, 5805, 11, 657, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3131, 62, 22046, 28, 17816, 4, 82, 28, 33244, 913, 14402, 15885, 6, 4064, 7963, 6465, 62, 46700, 5781, 62, 38948, 12962, 628, 220, 825, 1332, 2484, 10676, 14402, 55, 4029, 26410, 7, 944, 2599, 198, 220, 220, 220, 37227, 13414, 6945, 23735, 5072, 618, 1057, 1262, 3294, 39991, 13, 628, 220, 220, 220, 44743, 257, 1332, 1430, 326, 42985, 691, 530, 427, 446, 290, 3326, 6945, 326, 5254, 198, 220, 220, 220, 422, 584, 39991, 466, 407, 905, 510, 287, 262, 23735, 5072, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 2116, 13557, 14402, 55, 4029, 26410, 7, 198, 220, 220, 220, 220, 220, 220, 220, 7963, 6465, 62, 4805, 7730, 24115, 62, 20608, 11, 198, 220, 220, 220, 220, 220, 220, 220, 25703, 9782, 1961, 62, 9693, 9795, 1961, 62, 51, 6465, 62, 55, 5805, 11, 198, 220, 220, 220, 220, 220, 220, 220, 657, 11, 198, 220, 220, 220, 220, 220, 220, 220, 3131, 62, 24330, 34758, 9693, 9795, 62, 12115, 6369, 62, 1677, 53, 62, 53, 1503, 25, 705, 15, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 36247, 62, 9693, 48294, 62, 1677, 53, 62, 53, 1503, 25, 705, 940, 6, 30072, 628, 220, 825, 4808, 3855, 55, 4029, 26410, 7, 944, 11, 308, 9288, 62, 1676, 70, 62, 3672, 11, 3131, 62, 22046, 11, 3131, 62, 24330, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2938, 62, 37023, 62, 8189, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 16409, 262, 35555, 5072, 7560, 416, 2491, 262, 1430, 308, 9288, 62, 1676, 70, 62, 3672, 13, 198, 220, 220, 220, 11399, 11, 262, 1430, 338, 8420, 2438, 1276, 307, 2938, 62, 37023, 62, 8189, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 35555, 62, 6978, 796, 28686, 13, 6978, 13, 22179, 7, 70, 9288, 62, 9288, 62, 26791, 13, 3855, 30782, 35277, 22784, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 308, 9288, 62, 1676, 70, 62, 3672, 1343, 705, 448, 13, 19875, 11537, 198, 220, 220, 220, 308, 9288, 62, 1676, 70, 62, 6978, 796, 308, 9288, 62, 9288, 62, 26791, 13, 3855, 14402, 23002, 18187, 15235, 7, 70, 9288, 62, 1676, 70, 62, 3672, 8, 628, 220, 220, 220, 3141, 796, 29565, 70, 9288, 62, 1676, 70, 62, 6978, 11, 705, 4, 82, 28, 19875, 25, 4, 82, 6, 4064, 357, 19555, 6465, 62, 2606, 7250, 3843, 62, 38948, 11, 35555, 62, 6978, 15437, 1343, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3131, 62, 22046, 8, 198, 220, 220, 220, 551, 2268, 62, 30073, 796, 28686, 13, 268, 2268, 13, 30073, 3419, 198, 220, 220, 220, 611, 3131, 62, 24330, 25, 198, 220, 220, 220, 220, 220, 551, 2268, 62, 30073, 13, 19119, 7, 26086, 62, 24330, 8, 198, 220, 220, 220, 279, 796, 308, 9288, 62, 9288, 62, 26791, 13, 7004, 14681, 7, 21812, 11, 17365, 28, 268, 2268, 62, 30073, 8, 628, 220, 220, 220, 611, 279, 13, 23705, 515, 62, 1525, 62, 12683, 282, 25, 198, 220, 220, 220, 220, 220, 2116, 13, 30493, 41052, 25101, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 4, 82, 373, 2923, 416, 6737, 4064, 67, 6, 4064, 357, 70, 9288, 62, 1676, 70, 62, 3672, 11, 279, 13, 12683, 282, 4008, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 2116, 13, 30493, 41052, 79, 13, 1069, 863, 8, 198, 220, 220, 220, 220, 220, 2116, 13, 30493, 23588, 874, 7, 40319, 62, 37023, 62, 8189, 11, 279, 13, 37023, 62, 8189, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 24018, 4, 82, 6, 34710, 351, 2438, 4064, 82, 11, 543, 1595, 470, 2872, 366, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 1169, 2938, 8420, 2438, 4064, 82, 2637, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4064, 357, 21812, 11, 279, 13, 37023, 62, 8189, 11, 2938, 62, 37023, 62, 8189, 4008, 198, 220, 220, 220, 4036, 796, 949, 312, 296, 13, 29572, 7, 19875, 62, 6978, 8, 198, 220, 220, 220, 1441, 4036, 628, 220, 825, 4808, 14402, 55, 4029, 26410, 7, 944, 11, 308, 9288, 62, 1676, 70, 62, 3672, 11, 2938, 62, 19875, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2938, 62, 37023, 62, 8189, 11, 3131, 62, 22046, 28, 14202, 11, 3131, 62, 24330, 28, 14202, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2195, 861, 82, 326, 262, 23735, 3188, 7560, 416, 2491, 262, 1430, 198, 220, 220, 220, 308, 9288, 62, 1676, 70, 62, 3672, 7466, 2938, 62, 19875, 11, 257, 4731, 7268, 1194, 198, 220, 220, 220, 23735, 3188, 13, 220, 11399, 11, 262, 1430, 338, 8420, 2438, 1276, 307, 198, 220, 220, 220, 2938, 62, 37023, 62, 8189, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 4036, 796, 2116, 13557, 3855, 55, 4029, 26410, 7, 70, 9288, 62, 1676, 70, 62, 3672, 11, 3131, 62, 22046, 393, 685, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3131, 62, 24330, 393, 1391, 5512, 2938, 62, 37023, 62, 8189, 8, 198, 220, 220, 220, 2938, 796, 949, 312, 296, 13, 29572, 10100, 7, 40319, 62, 19875, 8, 198, 220, 220, 220, 2116, 13, 26447, 1096, 55, 4029, 7, 50039, 13, 22897, 20180, 8, 198, 220, 220, 220, 2116, 13, 8021, 861, 23588, 29540, 45, 4147, 7, 40319, 13, 22897, 20180, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4036, 13, 22897, 20180, 8, 198, 220, 220, 220, 2938, 13, 403, 8726, 3419, 198, 220, 220, 220, 4036, 13, 403, 8726, 3419, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 28686, 13, 268, 2268, 17816, 19555, 6465, 62, 2257, 8120, 62, 5446, 11598, 62, 46162, 4221, 20520, 796, 705, 16, 6, 198, 220, 308, 9288, 62, 9288, 62, 26791, 13, 13383, 3419, 198 ]
2.578745
7,283
import os import inspect import shutil import math import tensorflow as tf import numpy as np from tensorflow.examples.tutorials.mnist import input_data as mnist_data tf.set_random_seed(0) # Calculate LOG_DIR according to current file CUR_FILE = inspect.getfile(inspect.currentframe()) LOG_DIR = os.path.join( os.path.dirname(os.path.abspath(CUR_FILE)), 'logs', os.path.splitext(os.path.basename(CUR_FILE))[0]) LOG_DIR_TRAIN = os.path.join(LOG_DIR, 'train') LOG_DIR_VALID = os.path.join(LOG_DIR, 'valid') LOG_DIR_TEST = os.path.join(LOG_DIR, 'test') # Check is the LOG_DIR empty. If not ask for clean. clean_logs(LOG_DIR, False) print('TensorFlow Version: ' + tf.__version__) ###################################################################### # Main _DEBUG_GRAPH = False MNIST_WIDTH = 28 MNIST_HEIGHT = 28 MNIST_CHANNEL = 1 NUM_CLASSES = 10 BATCH_SIZE = 100 EPOCH_NUM = 20 LEARNING_RATE = 5e-3 TRAIN_SIZE = 55000 VALID_SIZE = 5000 TEST_SIZE = 10000 ###################################################################### # The Model # neural network with 5 layers # # · · · · · · · · · · (input data, flattened pixels) X [batch, 784] # 784 = 28*28 # \x/x\x/x\x/x\x/x\x/ -- fully connected layer (relu) W1 [784, 200] B1[200] # · · · · · · · · · Y1 [batch, 200] # \x/x\x/x\x/x\x/ -- fully connected layer (relu) W2 [200, 100] B2[100] # · · · · · · · Y2 [batch, 100] # \x/x\x/x\x/ -- fully connected layer (relu) W3 [100, 60] B3[60] # · · · · · Y3 [batch, 60] # \x/x\x/ -- fully connected layer (relu) W4 [60, 30] B4[30] # · · · Y4 [batch, 30] # \x/ -- fully connected layer (softmax) W5 [30, 10] B5[10] # · Y5 [batch, 10] # ###################################################################### mnist = mnist_data.read_data_sets("data", one_hot=True, reshape=False) with tf.name_scope('Input'): x = tf.placeholder(tf.float32, [None, MNIST_HEIGHT, MNIST_WIDTH, MNIST_CHANNEL], name='X') y = tf.placeholder(tf.float32, [None, NUM_CLASSES], name='Y') x_flatten = tf.reshape(x, [-1, MNIST_HEIGHT*MNIST_WIDTH], name='X_Flatten') last_output = x_flatten layer_size = [MNIST_HEIGHT*MNIST_WIDTH, 200, 100, 60, 30] for layer in range(4): name = "layer_{}".format(layer) last_output = create_fc_layer(last_output, layer_size[layer], layer_size[layer+1], name=name) with tf.name_scope('Output'): W = tf.Variable(tf.truncated_normal([layer_size[-1], NUM_CLASSES], stddev=0.1), name='Weights') b = tf.Variable(tf.zeros([NUM_CLASSES]), name='Biases') logits = tf.matmul(last_output, W) + b y_pred = tf.argmax(logits) tf.summary.histogram('weight', W) tf.summary.histogram('bias', b) tf.summary.histogram('logits', logits) with tf.name_scope('Loss'): # loss function: cross-entropy = - sum( Y_true * log(Y_pred) ) xent = tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=y) xent = tf.reduce_mean(xent) * BATCH_SIZE tf.summary.scalar('xent', xent) with tf.name_scope('Accuracy'): correct_pred = tf.equal(tf.argmax(logits, axis=1), tf.argmax(y, axis=1)) accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32)) tf.summary.scalar('accuracy', accuracy) with tf.name_scope('Optimizer'): lr = tf.placeholder(tf.float32, name='lr') optimize = tf.train.AdamOptimizer(lr).minimize(xent) with tf.name_scope('Status'): global_step = tf.Variable(tf.constant(0), 'step') with tf.name_scope('Summaries'): all_summaries = tf.summary.merge_all() with tf.name_scope('Global_Ops'): init = tf.global_variables_initializer() inc_step = global_step.assign_add(1) if _DEBUG_GRAPH: writer = tf.summary.FileWriter(LOG_DIR, tf.get_default_graph()) writer.flush() writer.close() else: with tf.Session() as sess: train_writer = tf.summary.FileWriter(LOG_DIR_TRAIN, sess.graph) # valid_writer = tf.summary.FileWriter(LOG_DIR_VALID, sess.graph) test_writer = tf.summary.FileWriter(LOG_DIR_TEST, sess.graph) sess.run(init) best_acc = 0 for epoch in range(EPOCH_NUM + 1): for i in range(TRAIN_SIZE//BATCH_SIZE + 1): max_lr = 3e-3 min_lr = 1e-4 declay_speed = 2000. learning_rate = min_lr + (max_lr - min_lr) * math.exp(-i/declay_speed) # Train x_batch, y_batch = mnist.train.next_batch(BATCH_SIZE) step_, _ = sess.run([inc_step, optimize], feed_dict = {x: x_batch, y: y_batch, lr: learning_rate}) if step_ % 10 == 0 or step_ == 1: acc_, xent_, summ_ = sess.run([accuracy, xent, all_summaries], feed_dict = {x: x_batch, y: y_batch}) print("Train Accuracy: {}, Train loss: {}, step: {}, epoch: {}, iter: {}".format(acc_, xent_, step_, epoch, i)) train_writer.add_summary(summ_, global_step=step_) if step_ % 100 == 0 or step_ == 1: # acc_, xent_, summ_ = sess.run([accuracy, xent, all_summaries], feed_dict = {x: mnist.validation.images, y: mnist.validation.labels}) # print("Validation Accuracy: {}, Validation loss: {}, step: {}, epoch: {}, iter: {}".format(acc_, xent_, step_, epoch, i)) # valid_writer.add_summary(summ_, global_step=step_) acc_, xent_, summ_ = sess.run([accuracy, xent, all_summaries], feed_dict = {x: mnist.test.images, y: mnist.test.labels}) test_writer.add_summary(summ_, global_step=step_) if acc_ > best_acc: best_acc = acc_ print("******** Epoch: {} ********: Test Accuracy: {}, Test Loss: {}".format(epoch, acc_, xent_)) print("All Done. Best accuracy: {}".format(best_acc)) train_writer.flush() train_writer.close() test_writer.flush() test_writer.close() # End of Main ###################################################################### # Automatically show TensorBoard if needed. show_tensorboard(True)
[ 11748, 28686, 201, 198, 11748, 10104, 201, 198, 11748, 4423, 346, 201, 198, 11748, 10688, 201, 198, 11748, 11192, 273, 11125, 355, 48700, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 6738, 11192, 273, 11125, 13, 1069, 12629, 13, 83, 44917, 82, 13, 10295, 396, 1330, 5128, 62, 7890, 355, 285, 77, 396, 62, 7890, 201, 198, 201, 198, 27110, 13, 2617, 62, 25120, 62, 28826, 7, 15, 8, 201, 198, 201, 198, 2, 27131, 378, 41605, 62, 34720, 1864, 284, 1459, 2393, 201, 198, 34, 4261, 62, 25664, 796, 10104, 13, 1136, 7753, 7, 1040, 806, 13, 14421, 14535, 28955, 201, 198, 25294, 62, 34720, 796, 28686, 13, 6978, 13, 22179, 7, 201, 198, 418, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 397, 2777, 776, 7, 34, 4261, 62, 25664, 36911, 705, 6404, 82, 3256, 201, 198, 418, 13, 6978, 13, 22018, 578, 742, 7, 418, 13, 6978, 13, 12093, 12453, 7, 34, 4261, 62, 25664, 4008, 58, 15, 12962, 201, 198, 201, 198, 25294, 62, 34720, 62, 51, 3861, 1268, 796, 28686, 13, 6978, 13, 22179, 7, 25294, 62, 34720, 11, 705, 27432, 11537, 201, 198, 25294, 62, 34720, 62, 23428, 2389, 796, 28686, 13, 6978, 13, 22179, 7, 25294, 62, 34720, 11, 705, 12102, 11537, 201, 198, 25294, 62, 34720, 62, 51, 6465, 796, 28686, 13, 6978, 13, 22179, 7, 25294, 62, 34720, 11, 705, 9288, 11537, 201, 198, 201, 198, 2, 6822, 318, 262, 41605, 62, 34720, 6565, 13, 1002, 407, 1265, 329, 3424, 13, 201, 198, 201, 198, 27773, 62, 6404, 82, 7, 25294, 62, 34720, 11, 10352, 8, 201, 198, 201, 198, 4798, 10786, 51, 22854, 37535, 10628, 25, 705, 1343, 48700, 13, 834, 9641, 834, 8, 201, 198, 201, 198, 29113, 29113, 4242, 2235, 201, 198, 2, 8774, 201, 198, 201, 198, 62, 30531, 62, 10761, 31300, 796, 10352, 201, 198, 201, 198, 39764, 8808, 62, 54, 2389, 4221, 796, 2579, 201, 198, 39764, 8808, 62, 13909, 9947, 796, 2579, 201, 198, 39764, 8808, 62, 3398, 22846, 3698, 796, 352, 201, 198, 41359, 62, 31631, 1546, 796, 838, 201, 198, 201, 198, 33, 11417, 62, 33489, 796, 1802, 201, 198, 8905, 46, 3398, 62, 41359, 796, 1160, 201, 198, 2538, 1503, 15871, 62, 49, 6158, 796, 642, 68, 12, 18, 201, 198, 201, 198, 51, 3861, 1268, 62, 33489, 796, 5996, 830, 201, 198, 23428, 2389, 62, 33489, 796, 23336, 201, 198, 51, 6465, 62, 33489, 796, 33028, 201, 198, 201, 198, 29113, 29113, 4242, 2235, 201, 198, 2, 383, 9104, 201, 198, 2, 17019, 3127, 351, 642, 11685, 201, 198, 2, 201, 198, 2, 14128, 14128, 14128, 14128, 14128, 14128, 14128, 14128, 14128, 14128, 220, 220, 220, 220, 220, 220, 220, 220, 220, 357, 15414, 1366, 11, 45096, 17848, 8, 220, 220, 220, 220, 220, 220, 1395, 685, 43501, 11, 767, 5705, 60, 220, 220, 1303, 767, 5705, 796, 2579, 9, 2078, 201, 198, 2, 3467, 87, 14, 87, 59, 87, 14, 87, 59, 87, 14, 87, 59, 87, 14, 87, 59, 87, 14, 220, 220, 220, 220, 220, 220, 1377, 3938, 5884, 7679, 357, 260, 2290, 8, 220, 220, 220, 220, 220, 220, 220, 220, 370, 16, 685, 37688, 11, 939, 60, 220, 220, 220, 220, 220, 347, 16, 58, 2167, 60, 201, 198, 2, 220, 14128, 14128, 14128, 14128, 14128, 14128, 14128, 14128, 14128, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 575, 16, 685, 43501, 11, 939, 60, 201, 198, 2, 220, 220, 3467, 87, 14, 87, 59, 87, 14, 87, 59, 87, 14, 87, 59, 87, 14, 220, 220, 220, 220, 220, 220, 220, 220, 1377, 3938, 5884, 7679, 357, 260, 2290, 8, 220, 220, 220, 220, 220, 220, 220, 220, 370, 17, 685, 2167, 11, 1802, 60, 220, 220, 220, 220, 220, 347, 17, 58, 3064, 60, 201, 198, 2, 220, 220, 220, 14128, 14128, 14128, 14128, 14128, 14128, 14128, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 575, 17, 685, 43501, 11, 1802, 60, 201, 198, 2, 220, 220, 220, 220, 3467, 87, 14, 87, 59, 87, 14, 87, 59, 87, 14, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1377, 3938, 5884, 7679, 357, 260, 2290, 8, 220, 220, 220, 220, 220, 220, 220, 220, 370, 18, 685, 3064, 11, 3126, 60, 220, 220, 220, 220, 220, 220, 347, 18, 58, 1899, 60, 201, 198, 2, 220, 220, 220, 220, 220, 14128, 14128, 14128, 14128, 14128, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 575, 18, 685, 43501, 11, 3126, 60, 201, 198, 2, 220, 220, 220, 220, 220, 220, 3467, 87, 14, 87, 59, 87, 14, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1377, 3938, 5884, 7679, 357, 260, 2290, 8, 220, 220, 220, 220, 220, 220, 220, 220, 370, 19, 685, 1899, 11, 1542, 60, 220, 220, 220, 220, 220, 220, 220, 347, 19, 58, 1270, 60, 201, 198, 2, 220, 220, 220, 220, 220, 220, 220, 14128, 14128, 14128, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 575, 19, 685, 43501, 11, 1542, 60, 201, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 3467, 87, 14, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1377, 3938, 5884, 7679, 357, 4215, 9806, 8, 220, 220, 220, 220, 220, 370, 20, 685, 1270, 11, 838, 60, 220, 220, 220, 220, 220, 220, 220, 347, 20, 58, 940, 60, 201, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 14128, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 575, 20, 685, 43501, 11, 838, 60, 201, 198, 2, 201, 198, 29113, 29113, 4242, 2235, 201, 198, 201, 198, 10295, 396, 796, 285, 77, 396, 62, 7890, 13, 961, 62, 7890, 62, 28709, 7203, 7890, 1600, 530, 62, 8940, 28, 17821, 11, 27179, 1758, 28, 25101, 8, 201, 198, 201, 198, 4480, 48700, 13, 3672, 62, 29982, 10786, 20560, 6, 2599, 201, 198, 220, 220, 220, 2124, 796, 48700, 13, 5372, 13829, 7, 27110, 13, 22468, 2624, 11, 685, 14202, 11, 29060, 8808, 62, 13909, 9947, 11, 29060, 8808, 62, 54, 2389, 4221, 11, 29060, 8808, 62, 3398, 22846, 3698, 4357, 1438, 11639, 55, 11537, 201, 198, 220, 220, 220, 331, 796, 48700, 13, 5372, 13829, 7, 27110, 13, 22468, 2624, 11, 685, 14202, 11, 36871, 62, 31631, 1546, 4357, 1438, 11639, 56, 11537, 201, 198, 220, 220, 220, 2124, 62, 2704, 41769, 796, 48700, 13, 3447, 1758, 7, 87, 11, 25915, 16, 11, 29060, 8808, 62, 13909, 9947, 9, 39764, 8808, 62, 54, 2389, 4221, 4357, 1438, 11639, 55, 62, 7414, 41769, 11537, 201, 198, 201, 198, 12957, 62, 22915, 796, 2124, 62, 2704, 41769, 201, 198, 29289, 62, 7857, 796, 685, 39764, 8808, 62, 13909, 9947, 9, 39764, 8808, 62, 54, 2389, 4221, 11, 939, 11, 1802, 11, 3126, 11, 1542, 60, 201, 198, 1640, 7679, 287, 2837, 7, 19, 2599, 201, 198, 220, 220, 220, 1438, 796, 366, 29289, 23330, 92, 1911, 18982, 7, 29289, 8, 201, 198, 220, 220, 220, 938, 62, 22915, 796, 2251, 62, 16072, 62, 29289, 7, 12957, 62, 22915, 11, 7679, 62, 7857, 58, 29289, 4357, 7679, 62, 7857, 58, 29289, 10, 16, 4357, 1438, 28, 3672, 8, 201, 198, 201, 198, 4480, 48700, 13, 3672, 62, 29982, 10786, 26410, 6, 2599, 201, 198, 220, 220, 220, 370, 796, 48700, 13, 43015, 7, 27110, 13, 2213, 19524, 515, 62, 11265, 26933, 29289, 62, 7857, 58, 12, 16, 4357, 36871, 62, 31631, 1546, 4357, 336, 1860, 1990, 28, 15, 13, 16, 828, 1438, 11639, 1135, 2337, 11537, 201, 198, 220, 220, 220, 275, 796, 48700, 13, 43015, 7, 27110, 13, 9107, 418, 26933, 41359, 62, 31631, 1546, 46570, 1438, 11639, 23286, 1386, 11537, 201, 198, 220, 220, 220, 2604, 896, 796, 48700, 13, 6759, 76, 377, 7, 12957, 62, 22915, 11, 370, 8, 1343, 275, 201, 198, 220, 220, 220, 331, 62, 28764, 796, 48700, 13, 853, 9806, 7, 6404, 896, 8, 201, 198, 201, 198, 220, 220, 220, 48700, 13, 49736, 13, 10034, 21857, 10786, 6551, 3256, 370, 8, 201, 198, 220, 220, 220, 48700, 13, 49736, 13, 10034, 21857, 10786, 65, 4448, 3256, 275, 8, 201, 198, 220, 220, 220, 48700, 13, 49736, 13, 10034, 21857, 10786, 6404, 896, 3256, 2604, 896, 8, 201, 198, 201, 198, 4480, 48700, 13, 3672, 62, 29982, 10786, 43, 793, 6, 2599, 201, 198, 220, 220, 220, 1303, 2994, 2163, 25, 3272, 12, 298, 28338, 796, 532, 2160, 7, 575, 62, 7942, 1635, 2604, 7, 56, 62, 28764, 8, 1267, 201, 198, 220, 220, 220, 2124, 298, 796, 48700, 13, 20471, 13, 4215, 9806, 62, 19692, 62, 298, 28338, 62, 4480, 62, 6404, 896, 7, 6404, 896, 28, 6404, 896, 11, 14722, 28, 88, 8, 201, 198, 220, 220, 220, 2124, 298, 796, 48700, 13, 445, 7234, 62, 32604, 7, 87, 298, 8, 1635, 347, 11417, 62, 33489, 201, 198, 201, 198, 220, 220, 220, 48700, 13, 49736, 13, 1416, 282, 283, 10786, 87, 298, 3256, 2124, 298, 8, 201, 198, 201, 198, 4480, 48700, 13, 3672, 62, 29982, 10786, 17320, 23843, 6, 2599, 201, 198, 220, 220, 220, 3376, 62, 28764, 796, 48700, 13, 40496, 7, 27110, 13, 853, 9806, 7, 6404, 896, 11, 16488, 28, 16, 828, 48700, 13, 853, 9806, 7, 88, 11, 16488, 28, 16, 4008, 201, 198, 220, 220, 220, 9922, 796, 48700, 13, 445, 7234, 62, 32604, 7, 27110, 13, 2701, 7, 30283, 62, 28764, 11, 48700, 13, 22468, 2624, 4008, 201, 198, 201, 198, 220, 220, 220, 48700, 13, 49736, 13, 1416, 282, 283, 10786, 4134, 23843, 3256, 9922, 8, 201, 198, 201, 198, 4480, 48700, 13, 3672, 62, 29982, 10786, 27871, 320, 7509, 6, 2599, 201, 198, 220, 220, 220, 300, 81, 796, 48700, 13, 5372, 13829, 7, 27110, 13, 22468, 2624, 11, 1438, 11639, 14050, 11537, 201, 198, 220, 220, 220, 27183, 796, 48700, 13, 27432, 13, 23159, 27871, 320, 7509, 7, 14050, 737, 1084, 48439, 7, 87, 298, 8, 201, 198, 201, 198, 4480, 48700, 13, 3672, 62, 29982, 10786, 19580, 6, 2599, 201, 198, 220, 220, 220, 3298, 62, 9662, 796, 48700, 13, 43015, 7, 27110, 13, 9979, 415, 7, 15, 828, 705, 9662, 11537, 201, 198, 201, 198, 4480, 48700, 13, 3672, 62, 29982, 10786, 13065, 76, 3166, 6, 2599, 201, 198, 220, 220, 220, 477, 62, 82, 13929, 3166, 796, 48700, 13, 49736, 13, 647, 469, 62, 439, 3419, 201, 198, 201, 198, 4480, 48700, 13, 3672, 62, 29982, 10786, 22289, 62, 41472, 6, 2599, 201, 198, 220, 220, 220, 2315, 796, 48700, 13, 20541, 62, 25641, 2977, 62, 36733, 7509, 3419, 201, 198, 220, 220, 220, 753, 62, 9662, 796, 3298, 62, 9662, 13, 562, 570, 62, 2860, 7, 16, 8, 201, 198, 201, 198, 361, 4808, 30531, 62, 10761, 31300, 25, 201, 198, 220, 220, 220, 6260, 796, 48700, 13, 49736, 13, 8979, 34379, 7, 25294, 62, 34720, 11, 48700, 13, 1136, 62, 12286, 62, 34960, 28955, 201, 198, 220, 220, 220, 6260, 13, 25925, 3419, 201, 198, 220, 220, 220, 6260, 13, 19836, 3419, 201, 198, 17772, 25, 201, 198, 220, 220, 220, 351, 48700, 13, 36044, 3419, 355, 264, 408, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 4512, 62, 16002, 796, 48700, 13, 49736, 13, 8979, 34379, 7, 25294, 62, 34720, 62, 51, 3861, 1268, 11, 264, 408, 13, 34960, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 4938, 62, 16002, 796, 48700, 13, 49736, 13, 8979, 34379, 7, 25294, 62, 34720, 62, 23428, 2389, 11, 264, 408, 13, 34960, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1332, 62, 16002, 796, 48700, 13, 49736, 13, 8979, 34379, 7, 25294, 62, 34720, 62, 51, 6465, 11, 264, 408, 13, 34960, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 264, 408, 13, 5143, 7, 15003, 8, 201, 198, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1266, 62, 4134, 796, 657, 201, 198, 220, 220, 220, 220, 220, 220, 220, 329, 36835, 287, 2837, 7, 8905, 46, 3398, 62, 41359, 1343, 352, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 2837, 7, 51, 3861, 1268, 62, 33489, 1003, 33, 11417, 62, 33489, 1343, 352, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3509, 62, 14050, 796, 513, 68, 12, 18, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 949, 62, 14050, 796, 352, 68, 12, 19, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2377, 323, 62, 12287, 796, 4751, 13, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4673, 62, 4873, 796, 949, 62, 14050, 1343, 357, 9806, 62, 14050, 532, 949, 62, 14050, 8, 1635, 10688, 13, 11201, 32590, 72, 14, 32446, 323, 62, 12287, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 16835, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2124, 62, 43501, 11, 331, 62, 43501, 796, 285, 77, 396, 13, 27432, 13, 19545, 62, 43501, 7, 33, 11417, 62, 33489, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2239, 62, 11, 220, 4808, 796, 264, 408, 13, 5143, 26933, 1939, 62, 9662, 11, 27183, 4357, 3745, 62, 11600, 796, 1391, 87, 25, 2124, 62, 43501, 11, 331, 25, 331, 62, 43501, 11, 300, 81, 25, 4673, 62, 4873, 30072, 201, 198, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 2239, 62, 4064, 838, 6624, 657, 393, 2239, 62, 6624, 352, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 697, 62, 11, 2124, 298, 62, 11, 30114, 62, 796, 264, 408, 13, 5143, 26933, 4134, 23843, 11, 2124, 298, 11, 477, 62, 82, 13929, 3166, 4357, 3745, 62, 11600, 796, 1391, 87, 25, 2124, 62, 43501, 11, 331, 25, 331, 62, 43501, 30072, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 44077, 33222, 25, 1391, 5512, 16835, 2994, 25, 1391, 5512, 2239, 25, 1391, 5512, 36835, 25, 1391, 5512, 11629, 25, 23884, 1911, 18982, 7, 4134, 62, 11, 2124, 298, 62, 11, 2239, 62, 11, 36835, 11, 1312, 4008, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4512, 62, 16002, 13, 2860, 62, 49736, 7, 82, 13929, 62, 11, 3298, 62, 9662, 28, 9662, 62, 8, 201, 198, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 2239, 62, 4064, 1802, 6624, 657, 393, 2239, 62, 6624, 352, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 697, 62, 11, 2124, 298, 62, 11, 30114, 62, 796, 264, 408, 13, 5143, 26933, 4134, 23843, 11, 2124, 298, 11, 477, 62, 82, 13929, 3166, 4357, 3745, 62, 11600, 796, 1391, 87, 25, 285, 77, 396, 13, 12102, 341, 13, 17566, 11, 331, 25, 285, 77, 396, 13, 12102, 341, 13, 23912, 1424, 30072, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 3601, 7203, 7762, 24765, 33222, 25, 1391, 5512, 3254, 24765, 2994, 25, 1391, 5512, 2239, 25, 1391, 5512, 36835, 25, 1391, 5512, 11629, 25, 23884, 1911, 18982, 7, 4134, 62, 11, 2124, 298, 62, 11, 2239, 62, 11, 36835, 11, 1312, 4008, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 4938, 62, 16002, 13, 2860, 62, 49736, 7, 82, 13929, 62, 11, 3298, 62, 9662, 28, 9662, 62, 8, 201, 198, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 697, 62, 11, 2124, 298, 62, 11, 30114, 62, 796, 264, 408, 13, 5143, 26933, 4134, 23843, 11, 2124, 298, 11, 477, 62, 82, 13929, 3166, 4357, 3745, 62, 11600, 796, 1391, 87, 25, 285, 77, 396, 13, 9288, 13, 17566, 11, 331, 25, 285, 77, 396, 13, 9288, 13, 23912, 1424, 30072, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1332, 62, 16002, 13, 2860, 62, 49736, 7, 82, 13929, 62, 11, 3298, 62, 9662, 28, 9662, 62, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 697, 62, 1875, 1266, 62, 4134, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1266, 62, 4134, 796, 697, 62, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 4557, 4551, 5374, 25, 23884, 220, 4557, 25, 6208, 33222, 25, 1391, 5512, 6208, 22014, 25, 23884, 1911, 18982, 7, 538, 5374, 11, 697, 62, 11, 2124, 298, 62, 4008, 201, 198, 201, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 3237, 24429, 13, 6705, 9922, 25, 23884, 1911, 18982, 7, 13466, 62, 4134, 4008, 201, 198, 220, 220, 220, 220, 220, 220, 220, 4512, 62, 16002, 13, 25925, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 4512, 62, 16002, 13, 19836, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1332, 62, 16002, 13, 25925, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1332, 62, 16002, 13, 19836, 3419, 201, 198, 201, 198, 201, 198, 2, 5268, 286, 8774, 201, 198, 29113, 29113, 4242, 2235, 201, 198, 201, 198, 2, 17406, 4142, 905, 309, 22854, 29828, 611, 2622, 13, 201, 198, 12860, 62, 83, 22854, 3526, 7, 17821, 8, 201, 198 ]
2.029114
3,263
#!/usr/bin/env python3 from aws_cdk import cdk from %name%.%name%_stack import PyStack app = cdk.App() PyStack(app, "%name%-cdk-1") app.run()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 6738, 3253, 82, 62, 10210, 74, 1330, 22927, 74, 198, 198, 6738, 4064, 3672, 7225, 4, 3672, 4, 62, 25558, 1330, 9485, 25896, 628, 198, 1324, 796, 22927, 74, 13, 4677, 3419, 198, 20519, 25896, 7, 1324, 11, 36521, 3672, 33963, 10210, 74, 12, 16, 4943, 198, 198, 1324, 13, 5143, 3419, 198 ]
2.296875
64
from oembed.tests.tests.consumer import * from oembed.tests.tests.models import * from oembed.tests.tests.parsers import * from oembed.tests.tests.providers import * from oembed.tests.tests.resources import * from oembed.tests.tests.sites import * from oembed.tests.tests.templatetags import * from oembed.tests.tests.utils import * from oembed.tests.tests.views import *
[ 6738, 267, 20521, 13, 41989, 13, 41989, 13, 49827, 1330, 1635, 198, 6738, 267, 20521, 13, 41989, 13, 41989, 13, 27530, 1330, 1635, 198, 6738, 267, 20521, 13, 41989, 13, 41989, 13, 79, 945, 364, 1330, 1635, 198, 6738, 267, 20521, 13, 41989, 13, 41989, 13, 15234, 4157, 1330, 1635, 198, 6738, 267, 20521, 13, 41989, 13, 41989, 13, 37540, 1330, 1635, 198, 6738, 267, 20521, 13, 41989, 13, 41989, 13, 49315, 1330, 1635, 198, 6738, 267, 20521, 13, 41989, 13, 41989, 13, 11498, 489, 265, 316, 3775, 1330, 1635, 198, 6738, 267, 20521, 13, 41989, 13, 41989, 13, 26791, 1330, 1635, 198, 6738, 267, 20521, 13, 41989, 13, 41989, 13, 33571, 1330, 1635, 198 ]
3.234783
115
# -*- coding: utf-8 -*- """ A collection of functions that can extract additional data fields from the work and passage fields of a Cts object. Which additional fields are possible depends on the namespace. The "parse_cts" function recognizes the namespace and decides which function to use for the extraction. At the end of the whole process the Cts object with its additional data fields will be returned. Created on Thu Sep 17 17:58:49 2020 @author: muell018 """ import re def zotero_parser(zt): """ Treats the Cts object as a Zotero cts object. """ #print("zotero_parser") #print(zt) if zt.m.group(4) != '': zt.mode = zt.m.group(4) zt.number = zt.m.group(6) #print(f"Zotero extras: mode = {zt.mode}, number = {zt.number}") return zt def transkribus_parser(tr): """ Treats the Cts object as a Transkribus cts object. """ #print("transkribus_parser") #print(tr) tr.col = tr.m.group(2) tr.doc = tr.m.group(3) tr.page = tr.m.group(5) #print(f"Transkribus extras:\ncol = {tr.col}\ndoc = {tr.doc}\npage = {tr.page}") if tr.m.group(6) != '': tr.rl = '' p = re.compile(r'r(\d?)l?(\d?)') m = p.match(tr.m.group(6)) if m.group(1): tr.region = m.group(1) tr.rl += "r"+tr.region #print(f"region = {tr.region}") if m.group(2): tr.line = m.group(2) tr.rl += "l"+tr.line #print(f"line = {tr.line}") if tr.subreference != '': tr.word = tr.subreference #print(f"word = {tr.word}") return tr def censorship_parser(zs): """ Treats the Cts object as a censorship cts. """ #print("censorship_parser: yet to be programmed... ") if __name__ == "__main__": main()
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 37811, 201, 198, 32, 4947, 286, 5499, 326, 460, 7925, 3224, 1366, 7032, 422, 220, 201, 198, 1169, 670, 290, 10066, 7032, 286, 257, 327, 912, 2134, 13, 9022, 3224, 7032, 220, 201, 198, 533, 1744, 8338, 319, 262, 25745, 13, 383, 366, 29572, 62, 310, 82, 1, 2163, 21570, 201, 198, 1169, 25745, 290, 13267, 543, 2163, 284, 779, 329, 262, 22236, 13, 220, 201, 198, 2953, 262, 886, 286, 262, 2187, 1429, 262, 327, 912, 2134, 351, 663, 3224, 1366, 7032, 201, 198, 10594, 307, 4504, 13, 201, 198, 201, 198, 41972, 319, 26223, 8621, 1596, 1596, 25, 3365, 25, 2920, 12131, 201, 198, 201, 198, 31, 9800, 25, 285, 518, 297, 29159, 201, 198, 37811, 201, 198, 201, 198, 11748, 302, 201, 198, 201, 198, 4299, 1976, 313, 3529, 62, 48610, 7, 89, 83, 2599, 201, 198, 220, 220, 220, 37227, 11217, 82, 262, 327, 912, 2134, 355, 257, 22621, 3529, 269, 912, 2134, 13, 37227, 201, 198, 220, 220, 220, 1303, 4798, 7203, 89, 313, 3529, 62, 48610, 4943, 201, 198, 220, 220, 220, 1303, 4798, 7, 89, 83, 8, 201, 198, 220, 220, 220, 611, 1976, 83, 13, 76, 13, 8094, 7, 19, 8, 14512, 10148, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1976, 83, 13, 14171, 796, 1976, 83, 13, 76, 13, 8094, 7, 19, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1976, 83, 13, 17618, 796, 1976, 83, 13, 76, 13, 8094, 7, 21, 8, 201, 198, 220, 220, 220, 1303, 4798, 7, 69, 1, 57, 313, 3529, 33849, 25, 4235, 796, 1391, 89, 83, 13, 14171, 5512, 1271, 796, 1391, 89, 83, 13, 17618, 92, 4943, 201, 198, 220, 220, 220, 220, 201, 198, 220, 220, 220, 1441, 1976, 83, 201, 198, 220, 220, 220, 220, 201, 198, 4299, 1007, 74, 822, 385, 62, 48610, 7, 2213, 2599, 201, 198, 220, 220, 220, 37227, 11217, 82, 262, 327, 912, 2134, 355, 257, 3602, 74, 822, 385, 269, 912, 2134, 13, 37227, 201, 198, 220, 220, 220, 1303, 4798, 7203, 7645, 74, 822, 385, 62, 48610, 4943, 201, 198, 220, 220, 220, 1303, 4798, 7, 2213, 8, 201, 198, 220, 220, 220, 491, 13, 4033, 796, 491, 13, 76, 13, 8094, 7, 17, 8, 201, 198, 220, 220, 220, 491, 13, 15390, 796, 491, 13, 76, 13, 8094, 7, 18, 8, 201, 198, 220, 220, 220, 491, 13, 7700, 796, 491, 13, 76, 13, 8094, 7, 20, 8, 201, 198, 220, 220, 220, 1303, 4798, 7, 69, 1, 8291, 74, 822, 385, 33849, 7479, 77, 4033, 796, 1391, 2213, 13, 4033, 32239, 358, 420, 796, 1391, 2213, 13, 15390, 32239, 77, 7700, 796, 1391, 2213, 13, 7700, 92, 4943, 201, 198, 220, 220, 220, 611, 491, 13, 76, 13, 8094, 7, 21, 8, 14512, 10148, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 491, 13, 45895, 796, 10148, 201, 198, 220, 220, 220, 220, 220, 220, 220, 279, 796, 302, 13, 5589, 576, 7, 81, 6, 81, 38016, 67, 10091, 75, 30, 38016, 67, 10091, 11537, 201, 198, 220, 220, 220, 220, 220, 220, 220, 285, 796, 279, 13, 15699, 7, 2213, 13, 76, 13, 8094, 7, 21, 4008, 201, 198, 220, 220, 220, 220, 220, 220, 220, 611, 285, 13, 8094, 7, 16, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 491, 13, 36996, 796, 285, 13, 8094, 7, 16, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 491, 13, 45895, 15853, 366, 81, 1, 10, 2213, 13, 36996, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 4798, 7, 69, 1, 36996, 796, 1391, 2213, 13, 36996, 92, 4943, 201, 198, 220, 220, 220, 220, 220, 220, 220, 611, 285, 13, 8094, 7, 17, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 491, 13, 1370, 796, 285, 13, 8094, 7, 17, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 491, 13, 45895, 15853, 366, 75, 1, 10, 2213, 13, 1370, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 4798, 7, 69, 1, 1370, 796, 1391, 2213, 13, 1370, 92, 4943, 201, 198, 220, 220, 220, 611, 491, 13, 7266, 35790, 14512, 10148, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 491, 13, 4775, 796, 491, 13, 7266, 35790, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 4798, 7, 69, 1, 4775, 796, 1391, 2213, 13, 4775, 92, 4943, 201, 198, 220, 220, 220, 220, 201, 198, 220, 220, 220, 1441, 491, 201, 198, 220, 220, 220, 220, 201, 198, 4299, 21185, 62, 48610, 7, 89, 82, 2599, 201, 198, 220, 220, 220, 37227, 11217, 82, 262, 327, 912, 2134, 355, 257, 21185, 269, 912, 13, 37227, 201, 198, 220, 220, 220, 1303, 4798, 7203, 42595, 11094, 62, 48610, 25, 1865, 284, 307, 27402, 986, 366, 8, 201, 198, 201, 198, 201, 198, 201, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 201, 198, 220, 220, 220, 1388, 3419 ]
2.125
872
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Handler for accessing files and folders on sharepoint. This handler includes all the functions needed to access and modify files and folders on sharepoint. """ import glob import io import os import pathlib import zipfile from typing import List from absl import app from absl import flags from absl import logging from googleapiclient import http from utils import config from utils import service_account_credentials FLAGS = flags.FLAGS def _download_file(service: object, file_id: str, file_name: str, download_path: str): """Download files to the specified path.""" request = service.files().get_media(fileId=file_id) fh = io.BytesIO() downloader = http.MediaIoBaseDownload(fh, request) done = False while not done: status, done = downloader.next_chunk() with open(f'{download_path}/{file_name}', 'wb') as f: f.write(fh.getvalue()) def download_invoices(folder_id: str, download_path: str): """Downloads invoices from the given drive folder id to the specified path.""" # Check that the destination folder exists. pathlib.Path(download_path).mkdir(parents=True, exist_ok=True) service = service_account_credentials.get_drive_service() files = service.files().list( q=f'(\'{folder_id}\' in parents) and (mimeType != \'application/vnd.google-apps.folder\')', ).execute() for f in files['files']: _download_file(service, f['id'], f['name'], download_path) def extract_zip_files(download_path: str, extract_path: str): """Extracts the zip files of the invoices downloaded.""" for f in glob.glob(os.path.join(download_path, '*.zip')): with zipfile.ZipFile(f) as zf: zf.extractall(extract_path) def get_files(extract_path: str): """Fetch the paths to all the files.""" files = [] for f in glob.glob(os.path.join(extract_path, '*.csv')): files.append(f) return files def delete_downloaded_files(folder_paths: List[str]): """Deletes downloaded files.""" for folder_path in folder_paths: for f in glob.glob(os.path.join(folder_path, '*')): logging.info('Deleting %s', f) pathlib.Path(f).unlink() def _move_drive_file_to_completed(service: object, file_obj: object, completed_folder_id: str): """Moves the file object to the completed drive folder.""" file_id = file_obj['id'] previous_parents = ','.join(file_obj['parents']) service.files().update( fileId=file_id, addParents=completed_folder_id, removeParents=previous_parents, fields='id, parents', ).execute() def mark_drive_files_completed(folder_id, completed_folder_id): """Marks all the files in the folder as completed.""" logging.info('Marking all drive files completed.') service = service_account_credentials.get_drive_service() files = service.files().list( q=f'(\'{folder_id}\' in parents) and (mimeType != \'application/vnd.google-apps.folder\')', fields='files(id, parents)', ).execute() for f in files['files']: _move_drive_file_to_completed(service, f, completed_folder_id)
[ 2, 15069, 12131, 3012, 11419, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 921, 743, 7330, 257, 4866, 286, 262, 13789, 379, 198, 2, 198, 2, 220, 220, 220, 220, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 2, 198, 2, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 3788, 198, 2, 9387, 739, 262, 13789, 318, 9387, 319, 281, 366, 1921, 3180, 1, 29809, 1797, 11, 198, 2, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 198, 2, 4091, 262, 13789, 329, 262, 2176, 3303, 15030, 21627, 290, 198, 2, 11247, 739, 262, 13789, 13, 198, 37811, 25060, 329, 22534, 3696, 290, 24512, 319, 2648, 4122, 13, 198, 198, 1212, 21360, 3407, 477, 262, 5499, 2622, 284, 1895, 290, 13096, 3696, 290, 198, 11379, 364, 319, 2648, 4122, 13, 198, 37811, 198, 11748, 15095, 198, 11748, 33245, 198, 11748, 28686, 198, 11748, 3108, 8019, 198, 11748, 19974, 7753, 198, 198, 6738, 19720, 1330, 7343, 198, 198, 6738, 2352, 75, 1330, 598, 198, 6738, 2352, 75, 1330, 9701, 198, 6738, 2352, 75, 1330, 18931, 198, 198, 6738, 23645, 499, 291, 75, 1153, 1330, 2638, 198, 198, 6738, 3384, 4487, 1330, 4566, 198, 6738, 3384, 4487, 1330, 2139, 62, 23317, 62, 66, 445, 14817, 198, 198, 38948, 50, 796, 9701, 13, 38948, 50, 628, 198, 4299, 4808, 15002, 62, 7753, 7, 15271, 25, 2134, 11, 2393, 62, 312, 25, 965, 11, 2393, 62, 3672, 25, 965, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4321, 62, 6978, 25, 965, 2599, 198, 220, 37227, 10002, 3696, 284, 262, 7368, 3108, 526, 15931, 198, 220, 2581, 796, 2139, 13, 16624, 22446, 1136, 62, 11431, 7, 7753, 7390, 28, 7753, 62, 312, 8, 198, 220, 277, 71, 796, 33245, 13, 45992, 9399, 3419, 198, 220, 4321, 263, 796, 2638, 13, 13152, 40, 78, 14881, 10002, 7, 69, 71, 11, 2581, 8, 198, 220, 1760, 796, 10352, 628, 220, 981, 407, 1760, 25, 198, 220, 220, 220, 3722, 11, 1760, 796, 4321, 263, 13, 19545, 62, 354, 2954, 3419, 628, 220, 351, 1280, 7, 69, 6, 90, 15002, 62, 6978, 92, 14, 90, 7753, 62, 3672, 92, 3256, 705, 39346, 11537, 355, 277, 25, 198, 220, 220, 220, 277, 13, 13564, 7, 69, 71, 13, 1136, 8367, 28955, 628, 198, 4299, 4321, 62, 259, 13038, 1063, 7, 43551, 62, 312, 25, 965, 11, 4321, 62, 6978, 25, 965, 2599, 198, 220, 37227, 10002, 82, 800, 78, 1063, 422, 262, 1813, 3708, 9483, 4686, 284, 262, 7368, 3108, 526, 15931, 198, 220, 1303, 6822, 326, 262, 10965, 9483, 7160, 13, 198, 220, 3108, 8019, 13, 15235, 7, 15002, 62, 6978, 737, 28015, 15908, 7, 23743, 28, 17821, 11, 2152, 62, 482, 28, 17821, 8, 198, 220, 2139, 796, 2139, 62, 23317, 62, 66, 445, 14817, 13, 1136, 62, 19472, 62, 15271, 3419, 628, 220, 3696, 796, 2139, 13, 16624, 22446, 4868, 7, 198, 220, 220, 220, 220, 220, 10662, 28, 69, 6, 38016, 6, 90, 43551, 62, 312, 32239, 6, 287, 3397, 8, 290, 357, 76, 524, 6030, 14512, 34373, 31438, 14, 85, 358, 13, 13297, 12, 18211, 13, 43551, 59, 11537, 3256, 198, 220, 6739, 41049, 3419, 628, 220, 329, 277, 287, 3696, 17816, 16624, 6, 5974, 198, 220, 220, 220, 4808, 15002, 62, 7753, 7, 15271, 11, 277, 17816, 312, 6, 4357, 277, 17816, 3672, 6, 4357, 4321, 62, 6978, 8, 628, 198, 4299, 7925, 62, 13344, 62, 16624, 7, 15002, 62, 6978, 25, 965, 11, 7925, 62, 6978, 25, 965, 2599, 198, 220, 37227, 11627, 974, 82, 262, 19974, 3696, 286, 262, 800, 78, 1063, 15680, 526, 15931, 198, 220, 329, 277, 287, 15095, 13, 4743, 672, 7, 418, 13, 6978, 13, 22179, 7, 15002, 62, 6978, 11, 705, 24620, 13344, 11537, 2599, 198, 220, 220, 220, 351, 19974, 7753, 13, 41729, 8979, 7, 69, 8, 355, 1976, 69, 25, 198, 220, 220, 220, 220, 220, 1976, 69, 13, 2302, 974, 439, 7, 2302, 974, 62, 6978, 8, 628, 198, 4299, 651, 62, 16624, 7, 2302, 974, 62, 6978, 25, 965, 2599, 198, 220, 37227, 37, 7569, 262, 13532, 284, 477, 262, 3696, 526, 15931, 198, 220, 3696, 796, 17635, 198, 220, 329, 277, 287, 15095, 13, 4743, 672, 7, 418, 13, 6978, 13, 22179, 7, 2302, 974, 62, 6978, 11, 705, 24620, 40664, 11537, 2599, 198, 220, 220, 220, 3696, 13, 33295, 7, 69, 8, 628, 220, 1441, 3696, 628, 198, 4299, 12233, 62, 2902, 14578, 62, 16624, 7, 43551, 62, 6978, 82, 25, 7343, 58, 2536, 60, 2599, 198, 220, 37227, 5005, 40676, 15680, 3696, 526, 15931, 198, 220, 329, 9483, 62, 6978, 287, 9483, 62, 6978, 82, 25, 198, 220, 220, 220, 329, 277, 287, 15095, 13, 4743, 672, 7, 418, 13, 6978, 13, 22179, 7, 43551, 62, 6978, 11, 705, 9, 11537, 2599, 198, 220, 220, 220, 220, 220, 18931, 13, 10951, 10786, 5005, 293, 889, 4064, 82, 3256, 277, 8, 198, 220, 220, 220, 220, 220, 3108, 8019, 13, 15235, 7, 69, 737, 403, 8726, 3419, 628, 198, 4299, 4808, 21084, 62, 19472, 62, 7753, 62, 1462, 62, 785, 16838, 7, 15271, 25, 2134, 11, 2393, 62, 26801, 25, 2134, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5668, 62, 43551, 62, 312, 25, 965, 2599, 198, 220, 37227, 44, 5241, 262, 2393, 2134, 284, 262, 5668, 3708, 9483, 526, 15931, 198, 220, 2393, 62, 312, 796, 2393, 62, 26801, 17816, 312, 20520, 198, 220, 2180, 62, 23743, 796, 705, 4032, 13, 22179, 7, 7753, 62, 26801, 17816, 23743, 6, 12962, 198, 220, 2139, 13, 16624, 22446, 19119, 7, 198, 220, 220, 220, 220, 220, 2393, 7390, 28, 7753, 62, 312, 11, 198, 220, 220, 220, 220, 220, 751, 42969, 28, 785, 16838, 62, 43551, 62, 312, 11, 198, 220, 220, 220, 220, 220, 4781, 42969, 28, 3866, 1442, 62, 23743, 11, 198, 220, 220, 220, 220, 220, 7032, 11639, 312, 11, 3397, 3256, 198, 220, 6739, 41049, 3419, 628, 198, 4299, 1317, 62, 19472, 62, 16624, 62, 785, 16838, 7, 43551, 62, 312, 11, 5668, 62, 43551, 62, 312, 2599, 198, 220, 37227, 44, 5558, 477, 262, 3696, 287, 262, 9483, 355, 5668, 526, 15931, 198, 220, 18931, 13, 10951, 10786, 9704, 278, 477, 3708, 3696, 5668, 2637, 8, 198, 220, 2139, 796, 2139, 62, 23317, 62, 66, 445, 14817, 13, 1136, 62, 19472, 62, 15271, 3419, 198, 220, 3696, 796, 2139, 13, 16624, 22446, 4868, 7, 198, 220, 220, 220, 220, 220, 10662, 28, 69, 6, 38016, 6, 90, 43551, 62, 312, 32239, 6, 287, 3397, 8, 290, 357, 76, 524, 6030, 14512, 34373, 31438, 14, 85, 358, 13, 13297, 12, 18211, 13, 43551, 59, 11537, 3256, 198, 220, 220, 220, 220, 220, 7032, 11639, 16624, 7, 312, 11, 3397, 8, 3256, 198, 220, 6739, 41049, 3419, 628, 220, 329, 277, 287, 3696, 17816, 16624, 6, 5974, 198, 220, 220, 220, 4808, 21084, 62, 19472, 62, 7753, 62, 1462, 62, 785, 16838, 7, 15271, 11, 277, 11, 5668, 62, 43551, 62, 312, 8, 198 ]
2.919936
1,249
import random # Efetua 1000 testes: for _ in range(1000): # Gera um conjunto de 10 números inteiros entre 0 e 9: a = set(random.randint(0, 9) for __ in range(10)) # Verifica se o conjunto é igual à sua respectiva lista sortida: if list(a) != sorted(a): # Se for diferente, exibe o conjunto: print(a)
[ 11748, 4738, 198, 198, 2, 412, 34045, 6413, 8576, 1332, 274, 25, 198, 1640, 4808, 287, 2837, 7, 12825, 2599, 628, 220, 220, 220, 1303, 402, 8607, 23781, 11644, 403, 1462, 390, 838, 299, 21356, 647, 418, 493, 20295, 4951, 920, 260, 657, 304, 860, 25, 198, 220, 220, 220, 257, 796, 900, 7, 25120, 13, 25192, 600, 7, 15, 11, 860, 8, 329, 11593, 287, 2837, 7, 940, 4008, 628, 220, 220, 220, 1303, 4643, 811, 64, 384, 267, 11644, 403, 1462, 38251, 45329, 723, 28141, 424, 64, 2461, 12151, 1351, 64, 3297, 3755, 25, 198, 220, 220, 220, 611, 1351, 7, 64, 8, 14512, 23243, 7, 64, 2599, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 1001, 329, 288, 361, 9100, 68, 11, 409, 32438, 267, 11644, 403, 1462, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 64, 8 ]
2.310345
145
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import *
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 11748, 33918, 198, 198, 6738, 435, 541, 323, 13, 64, 404, 13, 15042, 13, 9979, 415, 13, 22973, 34184, 1187, 1330, 1635, 628, 628 ]
2.446809
47
"""empty message Revision ID: 4b01613bfbed Revises: 406cccb640c3 Create Date: 2014-02-07 00:29:22.150808 """ # revision identifiers, used by Alembic. revision = '4b01613bfbed' down_revision = '406cccb640c3' from alembic import op import sqlalchemy as sa
[ 37811, 28920, 3275, 198, 198, 18009, 1166, 4522, 25, 604, 65, 27037, 1485, 19881, 3077, 198, 18009, 2696, 25, 45439, 535, 21101, 31102, 66, 18, 198, 16447, 7536, 25, 1946, 12, 2999, 12, 2998, 3571, 25, 1959, 25, 1828, 13, 8628, 28362, 198, 198, 37811, 198, 198, 2, 18440, 42814, 11, 973, 416, 9300, 2022, 291, 13, 198, 260, 10178, 796, 705, 19, 65, 27037, 1485, 19881, 3077, 6, 198, 2902, 62, 260, 10178, 796, 705, 29703, 535, 21101, 31102, 66, 18, 6, 198, 198, 6738, 31341, 2022, 291, 1330, 1034, 198, 11748, 44161, 282, 26599, 355, 473, 628, 198 ]
2.6
100
from __future__ import absolute_import # for python 2.7 from django.conf import settings from django.core.mail import send_mail as django_send_mail try: from celery.task import task except ImportError: task = func_add_delay @task
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 220, 1303, 329, 21015, 362, 13, 22, 198, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 7295, 13, 4529, 1330, 3758, 62, 4529, 355, 42625, 14208, 62, 21280, 62, 4529, 198, 198, 28311, 25, 198, 220, 220, 220, 422, 18725, 1924, 13, 35943, 1330, 4876, 198, 198, 16341, 17267, 12331, 25, 198, 220, 220, 220, 4876, 796, 25439, 62, 2860, 62, 40850, 628, 198, 31, 35943, 198 ]
3.05
80
import torch import argparse import os import os.path as osp import torch.backends.cudnn as cudnn from torchsummary import summary from torch.nn.parallel.data_parallel import DataParallel from config import cfg from model import get_pose_net from thop import profile from thop import clever_format from ptflops import get_model_complexity_info # argument parsing args = parse_args() cfg.set_args(args.gpu_ids) cudnn.benchmark = True # joint set joint_num = args.joint joints_name = ('Head_top', 'Thorax', 'R_Shoulder', 'R_Elbow', 'R_Wrist', 'L_Shoulder', 'L_Elbow', 'L_Wrist', 'R_Hip', 'R_Knee', 'R_Ankle', 'L_Hip', 'L_Knee', 'L_Ankle', 'Pelvis', 'Spine', 'Head', 'R_Hand', 'L_Hand', 'R_Toe', 'L_Toe') flip_pairs = ( (2, 5), (3, 6), (4, 7), (8, 11), (9, 12), (10, 13), (17, 18), (19, 20) ) if joint_num == 18: skeleton = ( (0, 7), (7, 8), (8, 9), (9, 10), (8, 11), (11, 12), (12, 13), (8, 14), (14, 15), (15, 16), (0, 1), (1, 2), (2, 3), (0, 4), (4, 5), (5, 6) ) if joint_num == 21: skeleton = ( (0, 16), (16, 1), (1, 15), (15, 14), (14, 8), (14, 11), (8, 9), (9, 10), (10, 19), (11, 12), (12, 13), (13, 20), (1, 2), (2, 3), (3, 4), (4, 17), (1, 5), (5, 6), (6, 7), (7, 18) ) # snapshot load model_path = os.path.join(cfg.model_dir, 'snapshot_%d.pth.tar' % args.test_epoch) assert osp.exists(model_path), 'Cannot find model at ' + model_path model = get_pose_net(args.backbone, args.frontbone, False, joint_num) model = DataParallel(model).cuda() ckpt = torch.load(model_path) model.load_state_dict(ckpt['network']) single_model = model.module summary(single_model, (3, 256, 256)) input = torch.randn(1, 3, 256, 256).cuda() macs, params = profile(single_model, inputs=(input,)) macs, params = clever_format([macs, params], "%.3f") flops, params1 = get_model_complexity_info(single_model, (3, 256, 256),as_strings=True, print_per_layer_stat=False) print('{:<30} {:<8}'.format('Computational complexity: ', flops)) print('{:<30} {:<8}'.format('Computational complexity: ', macs)) print('{:<30} {:<8}'.format('Number of parameters: ', params)) print('{:<30} {:<8}'.format('Number of parameters: ', params1))
[ 11748, 28034, 198, 11748, 1822, 29572, 198, 11748, 28686, 198, 11748, 28686, 13, 6978, 355, 267, 2777, 198, 11748, 28034, 13, 1891, 2412, 13, 66, 463, 20471, 355, 269, 463, 20471, 198, 6738, 28034, 49736, 1330, 10638, 198, 6738, 28034, 13, 20471, 13, 1845, 29363, 13, 7890, 62, 1845, 29363, 1330, 6060, 10044, 29363, 198, 6738, 4566, 1330, 30218, 70, 198, 6738, 2746, 1330, 651, 62, 3455, 62, 3262, 198, 6738, 294, 404, 1330, 7034, 198, 6738, 294, 404, 1330, 14169, 62, 18982, 198, 6738, 42975, 2704, 2840, 1330, 651, 62, 19849, 62, 41887, 414, 62, 10951, 198, 198, 2, 4578, 32096, 198, 22046, 796, 21136, 62, 22046, 3419, 198, 37581, 13, 2617, 62, 22046, 7, 22046, 13, 46999, 62, 2340, 8, 198, 66, 463, 20471, 13, 26968, 4102, 796, 6407, 198, 198, 2, 6466, 900, 198, 73, 1563, 62, 22510, 796, 26498, 13, 73, 1563, 198, 73, 1563, 82, 62, 3672, 796, 19203, 13847, 62, 4852, 3256, 705, 46765, 897, 3256, 705, 49, 62, 2484, 17601, 3256, 705, 49, 62, 9527, 8176, 3256, 705, 49, 62, 54, 1585, 3256, 705, 43, 62, 2484, 17601, 3256, 705, 43, 62, 9527, 8176, 3256, 705, 43, 62, 54, 1585, 3256, 705, 49, 62, 39, 541, 3256, 705, 49, 62, 42, 21381, 3256, 705, 49, 62, 2025, 74, 293, 3256, 705, 43, 62, 39, 541, 3256, 705, 43, 62, 42, 21381, 3256, 705, 43, 62, 2025, 74, 293, 3256, 705, 47, 417, 4703, 3256, 705, 4561, 500, 3256, 705, 13847, 3256, 705, 49, 62, 12885, 3256, 705, 43, 62, 12885, 3256, 705, 49, 62, 2514, 68, 3256, 705, 43, 62, 2514, 68, 11537, 198, 2704, 541, 62, 79, 3468, 796, 357, 357, 17, 11, 642, 828, 357, 18, 11, 718, 828, 357, 19, 11, 767, 828, 357, 23, 11, 1367, 828, 357, 24, 11, 1105, 828, 357, 940, 11, 1511, 828, 357, 1558, 11, 1248, 828, 357, 1129, 11, 1160, 8, 1267, 198, 361, 6466, 62, 22510, 6624, 1248, 25, 198, 220, 220, 220, 18328, 796, 357, 357, 15, 11, 767, 828, 357, 22, 11, 807, 828, 357, 23, 11, 860, 828, 357, 24, 11, 838, 828, 357, 23, 11, 1367, 828, 357, 1157, 11, 1105, 828, 357, 1065, 11, 1511, 828, 357, 23, 11, 1478, 828, 357, 1415, 11, 1315, 828, 357, 1314, 11, 1467, 828, 357, 15, 11, 352, 828, 357, 16, 11, 362, 828, 357, 17, 11, 513, 828, 357, 15, 11, 604, 828, 357, 19, 11, 642, 828, 357, 20, 11, 718, 8, 1267, 198, 361, 6466, 62, 22510, 6624, 2310, 25, 198, 220, 220, 220, 18328, 796, 357, 357, 15, 11, 1467, 828, 357, 1433, 11, 352, 828, 357, 16, 11, 1315, 828, 357, 1314, 11, 1478, 828, 357, 1415, 11, 807, 828, 357, 1415, 11, 1367, 828, 357, 23, 11, 860, 828, 357, 24, 11, 838, 828, 357, 940, 11, 678, 828, 357, 1157, 11, 1105, 828, 357, 1065, 11, 1511, 828, 357, 1485, 11, 1160, 828, 357, 16, 11, 362, 828, 357, 17, 11, 513, 828, 357, 18, 11, 604, 828, 357, 19, 11, 1596, 828, 357, 16, 11, 642, 828, 357, 20, 11, 718, 828, 357, 21, 11, 767, 828, 357, 22, 11, 1248, 8, 1267, 198, 198, 2, 27479, 3440, 198, 19849, 62, 6978, 796, 28686, 13, 6978, 13, 22179, 7, 37581, 13, 19849, 62, 15908, 11, 705, 45380, 9442, 62, 4, 67, 13, 79, 400, 13, 18870, 6, 4064, 26498, 13, 9288, 62, 538, 5374, 8, 198, 30493, 267, 2777, 13, 1069, 1023, 7, 19849, 62, 6978, 828, 705, 34, 34574, 1064, 2746, 379, 705, 1343, 2746, 62, 6978, 198, 19849, 796, 651, 62, 3455, 62, 3262, 7, 22046, 13, 1891, 15992, 11, 26498, 13, 8534, 15992, 11, 10352, 11, 6466, 62, 22510, 8, 198, 19849, 796, 6060, 10044, 29363, 7, 19849, 737, 66, 15339, 3419, 198, 694, 457, 796, 28034, 13, 2220, 7, 19849, 62, 6978, 8, 198, 19849, 13, 2220, 62, 5219, 62, 11600, 7, 694, 457, 17816, 27349, 6, 12962, 198, 198, 29762, 62, 19849, 796, 2746, 13, 21412, 198, 198, 49736, 7, 29762, 62, 19849, 11, 357, 18, 11, 17759, 11, 17759, 4008, 198, 198, 15414, 796, 28034, 13, 25192, 77, 7, 16, 11, 513, 11, 17759, 11, 17759, 737, 66, 15339, 3419, 198, 76, 16436, 11, 42287, 796, 7034, 7, 29762, 62, 19849, 11, 17311, 16193, 15414, 11, 4008, 198, 76, 16436, 11, 42287, 796, 14169, 62, 18982, 26933, 76, 16436, 11, 42287, 4357, 366, 7225, 18, 69, 4943, 198, 2704, 2840, 11, 42287, 16, 796, 651, 62, 19849, 62, 41887, 414, 62, 10951, 7, 29762, 62, 19849, 11, 357, 18, 11, 17759, 11, 17759, 828, 292, 62, 37336, 28, 17821, 11, 3601, 62, 525, 62, 29289, 62, 14269, 28, 25101, 8, 198, 4798, 10786, 90, 25, 27, 1270, 92, 220, 46110, 27, 23, 92, 4458, 18982, 10786, 5377, 1996, 864, 13357, 25, 46083, 781, 2840, 4008, 198, 4798, 10786, 90, 25, 27, 1270, 92, 220, 46110, 27, 23, 92, 4458, 18982, 10786, 5377, 1996, 864, 13357, 25, 46083, 8352, 82, 4008, 198, 4798, 10786, 90, 25, 27, 1270, 92, 220, 46110, 27, 23, 92, 4458, 18982, 10786, 15057, 286, 10007, 25, 46083, 42287, 4008, 198, 4798, 10786, 90, 25, 27, 1270, 92, 220, 46110, 27, 23, 92, 4458, 18982, 10786, 15057, 286, 10007, 25, 46083, 42287, 16, 4008, 198 ]
2.407029
882
# -*- coding: utf-8 -*- from dataclasses import dataclass, field from pathlib import Path from typing import List, Union from fastflix.models.base import BaseDataClass @dataclass @dataclass @dataclass @dataclass @dataclass @dataclass @dataclass @dataclass @dataclass @dataclass @dataclass @dataclass @dataclass
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 4818, 330, 28958, 1330, 4818, 330, 31172, 11, 2214, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 19720, 1330, 7343, 11, 4479, 198, 198, 6738, 3049, 10046, 13, 27530, 13, 8692, 1330, 7308, 6601, 9487, 628, 198, 31, 19608, 330, 31172, 628, 198, 31, 19608, 330, 31172, 628, 198, 31, 19608, 330, 31172, 628, 198, 31, 19608, 330, 31172, 628, 198, 31, 19608, 330, 31172, 628, 198, 31, 19608, 330, 31172, 628, 198, 31, 19608, 330, 31172, 628, 198, 31, 19608, 330, 31172, 628, 198, 31, 19608, 330, 31172, 628, 198, 31, 19608, 330, 31172, 628, 198, 31, 19608, 330, 31172, 628, 198, 31, 19608, 330, 31172, 628, 198, 31, 19608, 330, 31172, 198 ]
2.620155
129
import numpy as np import pandas as pd import argparse import glob import os import time import re from multiprocessing import Pool ''' **************************************************************** GLOBAL VARIABLES **************************************************************** ''' MAX_ENTITY_LENGTH = 20 MAX_ENTITY_WORD_LENGTH = 8 NUM_FEATURES = 20 globalVerbSet = set() with open('../data/verbs.txt', 'r') as f: for line in f: globalVerbSet.add(line.strip()) instituteKeywords = re.compile(r'\b(Inc|Incorporation|Corp|Corporation|Institute|\ University|School|College|Department|Org|Organization|Times|Committee|Foundation|\ Party|Agency|Council|News)\b', re.I) badKeywords = re.compile(r'\b(the|an|as|be|am|is|are|was|were|has|have|had|\ at|from|to|in|under|before|after|near|far|away|\ that|them|there|their|they|his|her|hers|him|it|you|your|yours|\ ceo|chairman|founder|head|director|\ email)\b', re.I) #allow . - _ & : ' ` and " inside entity words. As these are there while marking up badpunc = re.compile(r'\~|\!|\@|\#|\$|\%|\^|\*|\(|\)|\+|\=|\{|\}|\[|\]|\;|\<|\>|\,|\?|\/|\\') endSentence = re.compile(r'(\d\s*\.\s*\D)|([a-z]\s*\.)') domain = re.compile(r'\.\s*(com|org)\b') globalCount = 0 missedTuples = [] ''' **************************************************************** PROGRAM FUNCTION SCRIPTS **************************************************************** ''' ''' This function accepts a list of strings, where each string represents a single line in a text file (which has been pre-processed with at most 1 word on each line. @:param fileContents List with every line of the file contents. @:return A pandas dataframe object that has ''' ''' Feature list: F0: "[The]" occurs 1 or two lines before string. F1: Number of capitol Letters. F2: Verb occurs 1 or two lines after the string. F3: Total character length F4: Total number of words F5: Number of capitol letters before the string. F5: Number of capitol letters in line after this string. F6: "on" comes before F7: "called" comes before # shouldn't the verb have taken care of it? F8: "they" comes after F9: .?! comes in the middle of and entry# should no longer be true ever F10: Number of "."s F11: "," is in the raw string "NOTE: This feature reliably improves precision!", #should no longer be True ever F12: "," is in the first or last raw string position "NOTE: This feature reliably improves precision!", #should no lenger be True ever F13: "." is in the first or last raw string position. F14: "as", "a", "an" is in the raw string., # Invalid as discussed, to be removed F15: The faction of the number of words where only the first character is capitalized to all words. F16: The rawString has a Single capitalized word after it. F17: Contains a keyword F18: fraction of capital letters to wordCount F19: Contains bad punctuation in raw string. Each "tuple" object is a Pandas series with first entry tuple[0] the index, and all following entries the entries of each row from the string tuples dataframe. ''' ''' **************************************************************** PROGRAM RUNNING AND MANAGEMENT SCRIPTS **************************************************************** ''' ''' For each file in the directory provided to the program, generate all of the possible feature sets. ''' if __name__ == '__main__': #Parse command line arguments parser = argparse.ArgumentParser(description="""Fake news feature generator. Generates features from files whos' words have been split to multiple lines. It also handles files where entities have been pre-marked.""") parser.add_argument('FileFolder', metavar='f', type=str) parser.add_argument('Mode', metavar='m', type=str, help="""U is for update, and C is for create""") parser.add_argument('UpdateListString', metavar='--l', type=str, default="", help="""Use a string 'F0 F12 F13' of features, or '' empty string if no features. """) args = parser.parse_args() main(args)
[ 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 1822, 29572, 198, 11748, 15095, 198, 11748, 28686, 198, 11748, 640, 198, 11748, 302, 198, 6738, 18540, 305, 919, 278, 1330, 19850, 628, 198, 7061, 6, 198, 17174, 17174, 198, 8763, 9864, 1847, 569, 1503, 3539, 9148, 1546, 198, 17174, 17174, 198, 7061, 6, 198, 22921, 62, 3525, 9050, 62, 43, 49494, 796, 1160, 198, 22921, 62, 3525, 9050, 62, 54, 12532, 62, 43, 49494, 796, 807, 198, 41359, 62, 15112, 47471, 796, 1160, 198, 20541, 13414, 65, 7248, 796, 900, 3419, 198, 4480, 1280, 10786, 40720, 7890, 14, 46211, 13, 14116, 3256, 705, 81, 11537, 355, 277, 25, 198, 220, 220, 220, 329, 1627, 287, 277, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3298, 13414, 65, 7248, 13, 2860, 7, 1370, 13, 36311, 28955, 198, 198, 8625, 3678, 9218, 10879, 796, 302, 13, 5589, 576, 7, 81, 6, 59, 65, 7, 25517, 91, 818, 10215, 1819, 341, 91, 45680, 91, 10606, 1819, 341, 91, 6310, 3678, 91, 59, 198, 21009, 91, 26130, 91, 38951, 91, 36261, 91, 46808, 91, 26121, 1634, 91, 28595, 91, 6935, 2979, 91, 21077, 341, 91, 59, 198, 33553, 91, 32, 4949, 91, 40940, 91, 9980, 19415, 65, 3256, 302, 13, 40, 8, 198, 14774, 9218, 10879, 796, 302, 13, 5589, 576, 7, 81, 6, 59, 65, 7, 1169, 91, 272, 91, 292, 91, 1350, 91, 321, 91, 271, 91, 533, 91, 9776, 91, 22474, 91, 10134, 91, 14150, 91, 18108, 91, 59, 198, 265, 91, 6738, 91, 1462, 91, 259, 91, 4625, 91, 19052, 91, 8499, 91, 40093, 91, 16370, 91, 8272, 91, 59, 198, 5562, 91, 18855, 91, 8117, 91, 24571, 91, 9930, 91, 14363, 91, 372, 91, 7084, 91, 38400, 91, 270, 91, 5832, 91, 14108, 91, 88, 4662, 91, 59, 198, 344, 78, 91, 16337, 805, 91, 15454, 91, 2256, 91, 35248, 91, 59, 198, 12888, 19415, 65, 3256, 302, 13, 40, 8, 198, 2, 12154, 764, 532, 4808, 1222, 1058, 705, 4600, 290, 366, 2641, 9312, 2456, 13, 1081, 777, 389, 612, 981, 18730, 510, 198, 14774, 79, 19524, 796, 302, 13, 5589, 576, 7, 81, 6, 59, 93, 91, 59, 0, 91, 59, 31, 91, 59, 2, 91, 59, 3, 91, 59, 4, 91, 59, 61, 91, 59, 9, 91, 59, 7, 91, 59, 14726, 59, 10, 91, 59, 28, 91, 59, 90, 91, 59, 92, 91, 59, 58, 91, 59, 60, 91, 59, 26, 91, 49778, 91, 59, 29, 91, 59, 11, 91, 59, 30, 91, 11139, 91, 6852, 11537, 198, 437, 31837, 594, 796, 302, 13, 5589, 576, 7, 81, 6, 38016, 67, 59, 82, 9, 17405, 59, 82, 9, 59, 35, 14726, 26933, 64, 12, 89, 60, 59, 82, 9, 59, 2014, 11537, 198, 27830, 796, 302, 13, 5589, 576, 7, 81, 6, 17405, 59, 82, 9, 7, 785, 91, 2398, 19415, 65, 11537, 198, 198, 20541, 12332, 796, 657, 198, 3927, 276, 47247, 2374, 796, 17635, 198, 7061, 6, 198, 17174, 17174, 198, 4805, 7730, 24115, 29397, 4177, 2849, 6374, 32618, 4694, 198, 17174, 17174, 198, 7061, 6, 198, 7061, 6, 198, 198, 1212, 2163, 18178, 257, 1351, 286, 13042, 11, 810, 1123, 198, 8841, 6870, 257, 2060, 1627, 287, 257, 2420, 2393, 357, 4758, 468, 198, 47436, 662, 12, 14681, 276, 351, 379, 749, 352, 1573, 319, 1123, 198, 1370, 13, 198, 198, 31, 25, 17143, 2393, 15842, 7343, 351, 790, 1627, 286, 262, 2393, 10154, 13, 198, 31, 25, 7783, 317, 19798, 292, 1366, 14535, 2134, 326, 468, 198, 198, 7061, 6, 628, 198, 198, 7061, 6, 628, 198, 38816, 1351, 25, 198, 220, 220, 220, 376, 15, 25, 12878, 464, 30866, 8833, 352, 393, 734, 3951, 878, 4731, 13, 198, 220, 220, 220, 376, 16, 25, 7913, 286, 1451, 11650, 24501, 13, 198, 220, 220, 220, 376, 17, 25, 49973, 8833, 352, 393, 734, 3951, 706, 262, 4731, 13, 198, 220, 220, 220, 376, 18, 25, 7472, 2095, 4129, 198, 220, 220, 220, 376, 19, 25, 7472, 1271, 286, 2456, 198, 220, 220, 220, 376, 20, 25, 7913, 286, 1451, 11650, 7475, 878, 262, 4731, 13, 198, 220, 220, 220, 376, 20, 25, 7913, 286, 1451, 11650, 7475, 287, 1627, 706, 428, 4731, 13, 198, 220, 220, 220, 376, 21, 25, 366, 261, 1, 2058, 878, 198, 220, 220, 220, 376, 22, 25, 366, 7174, 1, 2058, 878, 1303, 6584, 470, 262, 15942, 423, 2077, 1337, 286, 340, 30, 198, 220, 220, 220, 376, 23, 25, 366, 9930, 1, 2058, 706, 198, 220, 220, 220, 376, 24, 25, 764, 12248, 2058, 287, 262, 3504, 286, 290, 5726, 2, 815, 645, 2392, 307, 2081, 1683, 198, 220, 220, 220, 376, 940, 25, 7913, 286, 366, 526, 82, 198, 220, 220, 220, 376, 1157, 25, 366, 553, 318, 287, 262, 8246, 4731, 366, 16580, 25, 770, 3895, 26995, 19575, 15440, 40754, 1303, 21754, 645, 2392, 307, 6407, 1683, 198, 220, 220, 220, 376, 1065, 25, 366, 553, 318, 287, 262, 717, 393, 938, 8246, 4731, 2292, 366, 16580, 25, 770, 3895, 26995, 19575, 15440, 40754, 1303, 21754, 645, 300, 6540, 307, 6407, 1683, 198, 220, 220, 220, 376, 1485, 25, 366, 526, 318, 287, 262, 717, 393, 938, 8246, 4731, 2292, 13, 198, 220, 220, 220, 376, 1415, 25, 366, 292, 1600, 366, 64, 1600, 366, 272, 1, 318, 287, 262, 8246, 4731, 1539, 1303, 17665, 355, 6693, 11, 284, 307, 4615, 198, 220, 220, 220, 376, 1314, 25, 383, 17710, 286, 262, 1271, 286, 2456, 810, 691, 262, 717, 2095, 318, 3139, 1143, 284, 477, 2456, 13, 198, 220, 220, 220, 376, 1433, 25, 383, 8246, 10100, 468, 257, 14206, 3139, 1143, 1573, 706, 340, 13, 198, 220, 220, 220, 376, 1558, 25, 49850, 257, 21179, 198, 220, 220, 220, 376, 1507, 25, 13390, 286, 3139, 7475, 284, 1573, 12332, 198, 220, 220, 220, 376, 1129, 25, 49850, 2089, 21025, 2288, 287, 8246, 4731, 13, 198, 198, 10871, 366, 83, 29291, 1, 2134, 318, 257, 16492, 292, 2168, 351, 717, 5726, 46545, 58, 15, 60, 262, 6376, 11, 290, 198, 220, 220, 220, 477, 1708, 12784, 262, 12784, 286, 1123, 5752, 422, 262, 4731, 12777, 2374, 1366, 14535, 13, 198, 198, 7061, 6, 628, 628, 198, 7061, 6, 198, 17174, 17174, 198, 4805, 7730, 24115, 32494, 15871, 5357, 17254, 4760, 12529, 6374, 32618, 4694, 198, 17174, 17174, 198, 7061, 6, 198, 198, 7061, 6, 198, 198, 1890, 1123, 2393, 287, 262, 8619, 2810, 284, 262, 1430, 11, 7716, 477, 286, 262, 198, 79, 4733, 3895, 5621, 13, 198, 198, 7061, 6, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1303, 10044, 325, 3141, 1627, 7159, 198, 220, 220, 220, 30751, 796, 1822, 29572, 13, 28100, 1713, 46677, 7, 11213, 2625, 15931, 49233, 1705, 3895, 17301, 13, 2980, 689, 3033, 422, 3696, 198, 220, 220, 220, 348, 418, 6, 2456, 423, 587, 6626, 284, 3294, 3951, 13, 632, 635, 17105, 3696, 810, 12066, 423, 587, 662, 12, 23505, 32203, 4943, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 10786, 8979, 41092, 3256, 1138, 615, 283, 11639, 69, 3256, 2099, 28, 2536, 8, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 10786, 19076, 3256, 1138, 615, 283, 11639, 76, 3256, 2099, 28, 2536, 11, 1037, 2625, 15931, 52, 318, 329, 4296, 11, 290, 327, 318, 329, 2251, 15931, 4943, 198, 220, 220, 220, 30751, 13, 2860, 62, 49140, 10786, 10260, 8053, 10100, 3256, 1138, 615, 283, 11639, 438, 75, 3256, 2099, 28, 2536, 11, 4277, 2625, 1600, 1037, 2625, 15931, 11041, 257, 4731, 705, 37, 15, 376, 1065, 376, 1485, 6, 286, 3033, 11, 393, 10148, 6565, 4731, 611, 645, 3033, 13, 13538, 4943, 198, 220, 220, 220, 26498, 796, 30751, 13, 29572, 62, 22046, 3419, 198, 220, 220, 220, 1388, 7, 22046, 8, 628 ]
3.115443
1,308
import collections import logging from math import sqrt from wordnik import swagger, WordApi from .utils import weighted_choice """corpus.py: Generates horoscopes based provided corpuses""" __author__ = "Project Zodiacy" __copyright__ = "Copyright 2015, Project Zodiacy" logger = logging.getLogger('root') class Corpus(): """ Generates a corpus from the provided database Args: zodiac_sign: select only entries for a specific zodiac sign keyword: select only entries for a specific keyword with_rating: weight entries after a predefined rating threshold: minimal amount of entries needed for a valid corpus with_synonyms: query wordnik for synonyms wordnik_api_url: Wordnik API URL wordnik_api_key: Wordnik API Key """ def __str__(self): """ dumps the class on print - useful for debugging """ return str(self.__dict__) def _get_zodiac_sign(self, zodiac_sign=None): """ converts the string representation of a zodiac sign into a ordinal one Arguments: zodiac_sign: sign as string Returns: ordinal zodiac sign (from 0 to 12) """ zodiac_signs = dict(zip(['general', 'aries', 'taurus', 'gemini', 'cancer', 'leo', 'virgo', 'libra', 'scorpio', 'sagittarius', 'capricorn', 'aquarius', 'pisces'], range(13))) if zodiac_sign not in zodiac_signs: if zodiac_sign is not None: raise ValueError('Invalid zodiac sign') else: return zodiac_signs[zodiac_sign] def _add_filter(self, filter_sql, filter_value): """ help method to add a new filter Arguments: filter_sql: SQL string (with '?' for parameters) filter_value: parameters to bind to the SQL string (either a single value or list) """ self._filters.append(filter_sql) if isinstance(filter_value, collections.MutableSequence): assert filter_sql.count("?") == len(filter_value) self._filters_values += filter_value else: assert filter_sql.count("?") == 1 self._filters_values.append(filter_value) def _create_filters(self): """ builds all filters """ self._filters = [] self._filters_values = [] if self.zodiac_sign is not None: self._add_filter("sign=?", self.zodiac_sign_ordinal) if self.with_synonyms: present_synonyms = self.get_present_synonyms() if len(present_synonyms) == 0: logger.warn("No related synonyms found") present_synonyms.append(self.keyword) synonyms_sql_array = ','.join(('?' for _ in present_synonyms)) self._add_filter('keyword in (%s)' % synonyms_sql_array, present_synonyms) elif self.keyword is not None: # synonyms is already filtering on keyword self._add_filter("keyword=?", self.keyword) def _build_filters(self): """ concatenates all available filter to SQL """ filters = "" if len(self._filters) > 0: filters += " WHERE " filters += " AND ".join(self._filters) return filters def _execute_and_log(self, base_stmt, values=[]): """ execute logs the entire SQL string This is expensive as we need to make a request to our SQLite database. Hence it is only performed when the debugging is enabled - the level of the root logger needs to be logging.DEBUG or less""" if logger.getEffectiveLevel() <= logging.DEBUG: sql_with_vals = base_stmt if len(values) > 0: self.cursor.execute( "SELECT " + ", ".join(["quote(?)" for i in values]), values) quoted_values = self.cursor.fetchone() for quoted_value in quoted_values: sql_with_vals = sql_with_vals.replace( '?', str(quoted_value), 1) logger.debug("query: %s", sql_with_vals) self.cursor.execute(base_stmt, values) def _execute_query(self): """ Builds and executes the SQL query to fetch the corpus """ columns = 'interp' columns += ',rating' if self.with_rating or self.with_synonyms else '' columns += ',keyword' if self.keyword else '' base_stmt = 'SELECT %s from %s' % (columns, self._table_name) base_stmt += self._build_filters() self._execute_and_log(base_stmt, self._filters_values) def _count_entries(self): """ Returns the number of found entries in the database Reason: cursor.rowcount returns -1 until all results have been fetched """ base_stmt = 'SELECT COUNT(*) from %s' % self._table_name base_stmt += self._build_filters() self.cursor.execute(base_stmt, self._filters_values) return self.cursor.fetchone()[0] def _build(self): """ Returns a cursor with all horoscopes for the given parameters """ self._create_filters() nr_entries = self._count_entries() if nr_entries < self.threshold: raise ValueError("Found %d matches" % nr_entries) logger.debug("%d entries found in corpus db", nr_entries) self._execute_query() def __iter__(self): """ Lazy corpus iterator """ self._build() return self def __next__(self): """ returns the corpus lazy """ row = next(self.cursor, None) if row is None or row[0] is None: # maybe someone wants to access the results again raise StopIteration rating = None if self.with_rating: rating = row[1] if self.with_synonyms: if row[0] is None: # filter invalid entries logger.debug("invalid row %s", row) return self.__next__() if row[0] == self.keyword or len(self.synonyms) == 0: rating = row[1] else: rating = self.synonym_influence * \ row[1] * sqrt(len(self.synonyms)) if rating is None: return (row[0],) else: return (row[0], rating) def list_keywords(self): """ lists all available keywords """ self._execute_and_log(("SELECT keyword, count(*) as count FROM horoscopes " "WHERE length(keyword) > 0 GROUP BY keyword ORDER BY count desc")) return self.cursor.fetchall() def select_keyword_range(self, min_val=0, max_val=1, val=1): """ evenly maps a val with min and max to the keywords As the mapping is surjective the remaining slice is then weighted_chosen""" kws = [k for k in self.list_keywords() if k[1] >= self.threshold] val_range = max_val - min_val factor = int(len(kws) / val_range) upper_end = val * factor if upper_end < factor: upper_end = factor lower_end = upper_end - factor self.keyword = weighted_choice(kws[lower_end:upper_end]) logger.debug("moon keyword selected: %s", self.keyword) def _get_synonyms(self, keyword): """ Queries Wordnik for synonyms """ client = swagger.ApiClient(self.wordnik_api_key, self.wordnik_api_url) word_api = WordApi.WordApi(client) words = word_api.getRelatedWords(keyword, relationshipTypes='synonym') if words is None or len(words) == 0: return [] else: return words[0].words def get_present_synonyms(self): """ Compares Wordnik result with present synonyms in DB Returns: List of synonyms occurring in the database """ self.synonyms = self._get_synonyms(self.keyword) logger.debug("found %d synonyms", len(self.synonyms)) if len(self.synonyms) > 0: self._execute_and_log('SELECT keyword FROM horoscopes WHERE keyword IN (%s) GROUP BY keyword' % ','.join('?' for _ in self.synonyms), tuple(self.synonyms)) return [row[0] for row in self.cursor if row is not None] else: return []
[ 11748, 17268, 198, 11748, 18931, 198, 6738, 10688, 1330, 19862, 17034, 198, 6738, 1573, 17187, 1330, 1509, 7928, 11, 9678, 32, 14415, 198, 6738, 764, 26791, 1330, 26356, 62, 25541, 198, 198, 37811, 10215, 79, 385, 13, 9078, 25, 2980, 689, 3076, 17500, 13920, 1912, 2810, 24614, 2664, 37811, 198, 198, 834, 9800, 834, 796, 366, 16775, 1168, 23130, 1590, 1, 198, 834, 22163, 4766, 834, 796, 366, 15269, 1853, 11, 4935, 1168, 23130, 1590, 1, 198, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 10786, 15763, 11537, 628, 198, 4871, 44874, 33529, 628, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2980, 689, 257, 35789, 422, 262, 2810, 6831, 628, 220, 220, 220, 220, 220, 220, 220, 943, 14542, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1976, 40096, 62, 12683, 25, 2922, 691, 12784, 329, 257, 2176, 1976, 40096, 1051, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 21179, 25, 2922, 691, 12784, 329, 257, 2176, 21179, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 351, 62, 8821, 25, 3463, 12784, 706, 257, 2747, 18156, 7955, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 11387, 25, 10926, 2033, 286, 12784, 2622, 329, 257, 4938, 35789, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 351, 62, 28869, 43612, 25, 12405, 1573, 17187, 329, 6171, 43612, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1573, 17187, 62, 15042, 62, 6371, 25, 9678, 17187, 7824, 10289, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1573, 17187, 62, 15042, 62, 2539, 25, 9678, 17187, 7824, 7383, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 825, 11593, 2536, 834, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 45514, 262, 1398, 319, 3601, 532, 4465, 329, 28769, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 965, 7, 944, 13, 834, 11600, 834, 8, 628, 220, 220, 220, 825, 4808, 1136, 62, 89, 40096, 62, 12683, 7, 944, 11, 1976, 40096, 62, 12683, 28, 14202, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 26161, 262, 4731, 10552, 286, 257, 1976, 40096, 1051, 656, 257, 2760, 1292, 530, 198, 220, 220, 220, 220, 220, 220, 220, 20559, 2886, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1976, 40096, 62, 12683, 25, 1051, 355, 4731, 198, 220, 220, 220, 220, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2760, 1292, 1976, 40096, 1051, 357, 6738, 657, 284, 1105, 8, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 1976, 40096, 62, 12683, 82, 796, 8633, 7, 13344, 7, 17816, 24622, 3256, 705, 3166, 3256, 705, 83, 22302, 3256, 705, 24090, 5362, 3256, 705, 48870, 3256, 705, 293, 78, 3256, 705, 37040, 2188, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 8019, 430, 3256, 705, 1416, 16300, 952, 3256, 705, 82, 363, 715, 19897, 3256, 705, 11128, 1173, 1211, 3256, 705, 36129, 19897, 3256, 705, 79, 271, 728, 6, 4357, 2837, 7, 1485, 22305, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1976, 40096, 62, 12683, 407, 287, 1976, 40096, 62, 12683, 82, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 1976, 40096, 62, 12683, 318, 407, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5298, 11052, 12331, 10786, 44651, 1976, 40096, 1051, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 1976, 40096, 62, 12683, 82, 58, 89, 40096, 62, 12683, 60, 628, 220, 220, 220, 825, 4808, 2860, 62, 24455, 7, 944, 11, 8106, 62, 25410, 11, 8106, 62, 8367, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 1037, 2446, 284, 751, 257, 649, 8106, 198, 220, 220, 220, 220, 220, 220, 220, 20559, 2886, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8106, 62, 25410, 25, 16363, 4731, 357, 4480, 705, 8348, 329, 10007, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8106, 62, 8367, 25, 10007, 284, 11007, 284, 262, 16363, 4731, 357, 31336, 257, 2060, 1988, 393, 1351, 8, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 10379, 1010, 13, 33295, 7, 24455, 62, 25410, 8, 198, 220, 220, 220, 220, 220, 220, 220, 611, 318, 39098, 7, 24455, 62, 8367, 11, 17268, 13, 44, 18187, 44015, 594, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6818, 8106, 62, 25410, 13, 9127, 7203, 1701, 8, 6624, 18896, 7, 24455, 62, 8367, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 10379, 1010, 62, 27160, 15853, 8106, 62, 8367, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6818, 8106, 62, 25410, 13, 9127, 7203, 1701, 8, 6624, 352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 10379, 1010, 62, 27160, 13, 33295, 7, 24455, 62, 8367, 8, 628, 220, 220, 220, 825, 4808, 17953, 62, 10379, 1010, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 12188, 477, 16628, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 10379, 1010, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 10379, 1010, 62, 27160, 796, 17635, 628, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 89, 40096, 62, 12683, 318, 407, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 2860, 62, 24455, 7203, 12683, 28, 35379, 2116, 13, 89, 40096, 62, 12683, 62, 585, 1292, 8, 628, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 4480, 62, 28869, 43612, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1944, 62, 28869, 43612, 796, 2116, 13, 1136, 62, 25579, 62, 28869, 43612, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 18896, 7, 25579, 62, 28869, 43612, 8, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 40539, 7203, 2949, 3519, 6171, 43612, 1043, 4943, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1944, 62, 28869, 43612, 13, 33295, 7, 944, 13, 2539, 4775, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6171, 43612, 62, 25410, 62, 18747, 796, 705, 4032, 13, 22179, 7, 10786, 8348, 329, 4808, 287, 1944, 62, 28869, 43612, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 2860, 62, 24455, 10786, 2539, 4775, 287, 37633, 82, 33047, 4064, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6171, 43612, 62, 25410, 62, 18747, 11, 1944, 62, 28869, 43612, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 2116, 13, 2539, 4775, 318, 407, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 6171, 43612, 318, 1541, 25431, 319, 21179, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 2860, 62, 24455, 7203, 2539, 4775, 28, 35379, 2116, 13, 2539, 4775, 8, 628, 220, 220, 220, 825, 4808, 11249, 62, 10379, 1010, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 1673, 36686, 689, 477, 1695, 8106, 284, 16363, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 16628, 796, 13538, 198, 220, 220, 220, 220, 220, 220, 220, 611, 18896, 7, 944, 13557, 10379, 1010, 8, 1875, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16628, 15853, 366, 33411, 366, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 16628, 15853, 366, 5357, 27071, 22179, 7, 944, 13557, 10379, 1010, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 16628, 628, 220, 220, 220, 825, 4808, 41049, 62, 392, 62, 6404, 7, 944, 11, 2779, 62, 301, 16762, 11, 3815, 28, 21737, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 12260, 17259, 262, 2104, 16363, 4731, 198, 220, 220, 220, 220, 220, 220, 220, 770, 318, 5789, 355, 356, 761, 284, 787, 257, 2581, 284, 674, 16363, 578, 6831, 13, 198, 220, 220, 220, 220, 220, 220, 220, 16227, 340, 318, 691, 6157, 618, 262, 28769, 318, 9343, 532, 262, 1241, 198, 220, 220, 220, 220, 220, 220, 220, 286, 262, 6808, 49706, 2476, 284, 307, 18931, 13, 30531, 393, 1342, 37811, 198, 220, 220, 220, 220, 220, 220, 220, 611, 49706, 13, 1136, 44831, 4971, 3419, 19841, 18931, 13, 30531, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 44161, 62, 4480, 62, 12786, 796, 2779, 62, 301, 16762, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 18896, 7, 27160, 8, 1875, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 66, 21471, 13, 41049, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 46506, 366, 1343, 33172, 27071, 22179, 7, 14692, 22708, 7, 10091, 1, 329, 1312, 287, 3815, 46570, 3815, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10947, 62, 27160, 796, 2116, 13, 66, 21471, 13, 69, 7569, 505, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 10947, 62, 8367, 287, 10947, 62, 27160, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 44161, 62, 4480, 62, 12786, 796, 44161, 62, 4480, 62, 12786, 13, 33491, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 30, 3256, 965, 7, 421, 5191, 62, 8367, 828, 352, 8, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 24442, 7203, 22766, 25, 4064, 82, 1600, 44161, 62, 4480, 62, 12786, 8, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 66, 21471, 13, 41049, 7, 8692, 62, 301, 16762, 11, 3815, 8, 628, 220, 220, 220, 825, 4808, 41049, 62, 22766, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 10934, 82, 290, 42985, 262, 16363, 12405, 284, 21207, 262, 35789, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 15180, 796, 705, 3849, 79, 6, 198, 220, 220, 220, 220, 220, 220, 220, 15180, 15853, 46083, 8821, 6, 611, 2116, 13, 4480, 62, 8821, 393, 2116, 13, 4480, 62, 28869, 43612, 2073, 10148, 198, 220, 220, 220, 220, 220, 220, 220, 15180, 15853, 46083, 2539, 4775, 6, 611, 2116, 13, 2539, 4775, 2073, 10148, 198, 220, 220, 220, 220, 220, 220, 220, 2779, 62, 301, 16762, 796, 705, 46506, 4064, 82, 422, 4064, 82, 6, 4064, 357, 28665, 82, 11, 2116, 13557, 11487, 62, 3672, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2779, 62, 301, 16762, 15853, 2116, 13557, 11249, 62, 10379, 1010, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 41049, 62, 392, 62, 6404, 7, 8692, 62, 301, 16762, 11, 2116, 13557, 10379, 1010, 62, 27160, 8, 628, 220, 220, 220, 825, 4808, 9127, 62, 298, 1678, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 16409, 262, 1271, 286, 1043, 12784, 287, 262, 6831, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 23219, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 23493, 13, 808, 9127, 5860, 532, 16, 1566, 477, 2482, 423, 587, 11351, 1740, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2779, 62, 301, 16762, 796, 705, 46506, 327, 28270, 7, 28104, 422, 4064, 82, 6, 4064, 2116, 13557, 11487, 62, 3672, 198, 220, 220, 220, 220, 220, 220, 220, 2779, 62, 301, 16762, 15853, 2116, 13557, 11249, 62, 10379, 1010, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 66, 21471, 13, 41049, 7, 8692, 62, 301, 16762, 11, 2116, 13557, 10379, 1010, 62, 27160, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 66, 21471, 13, 69, 7569, 505, 3419, 58, 15, 60, 628, 220, 220, 220, 825, 4808, 11249, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 16409, 257, 23493, 351, 477, 3076, 17500, 13920, 329, 262, 1813, 10007, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 17953, 62, 10379, 1010, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 299, 81, 62, 298, 1678, 796, 2116, 13557, 9127, 62, 298, 1678, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 611, 299, 81, 62, 298, 1678, 1279, 2116, 13, 400, 10126, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5298, 11052, 12331, 7203, 21077, 4064, 67, 7466, 1, 4064, 299, 81, 62, 298, 1678, 8, 628, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 24442, 7203, 4, 67, 12784, 1043, 287, 35789, 20613, 1600, 299, 81, 62, 298, 1678, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 41049, 62, 22766, 3419, 628, 220, 220, 220, 825, 11593, 2676, 834, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 406, 12582, 35789, 41313, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 11249, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 628, 220, 220, 220, 825, 11593, 19545, 834, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 5860, 262, 35789, 16931, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 5752, 796, 1306, 7, 944, 13, 66, 21471, 11, 6045, 8, 198, 220, 220, 220, 220, 220, 220, 220, 611, 5752, 318, 6045, 393, 5752, 58, 15, 60, 318, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 3863, 2130, 3382, 284, 1895, 262, 2482, 757, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5298, 13707, 29993, 341, 628, 220, 220, 220, 220, 220, 220, 220, 7955, 796, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 4480, 62, 8821, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7955, 796, 5752, 58, 16, 60, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 4480, 62, 28869, 43612, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5752, 58, 15, 60, 318, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 8106, 12515, 12784, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 24442, 7203, 259, 12102, 5752, 4064, 82, 1600, 5752, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 834, 19545, 834, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5752, 58, 15, 60, 6624, 2116, 13, 2539, 4775, 393, 18896, 7, 944, 13, 28869, 43612, 8, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7955, 796, 5752, 58, 16, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7955, 796, 2116, 13, 28869, 5177, 62, 10745, 23079, 1635, 3467, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5752, 58, 16, 60, 1635, 19862, 17034, 7, 11925, 7, 944, 13, 28869, 43612, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 611, 7955, 318, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 357, 808, 58, 15, 4357, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 357, 808, 58, 15, 4357, 7955, 8, 628, 220, 220, 220, 825, 1351, 62, 2539, 10879, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 8341, 477, 1695, 26286, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 41049, 62, 392, 62, 6404, 7, 7203, 46506, 21179, 11, 954, 7, 28104, 355, 954, 16034, 3076, 17500, 13920, 366, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 47357, 4129, 7, 2539, 4775, 8, 1875, 657, 44441, 11050, 21179, 38678, 11050, 954, 1715, 48774, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 66, 21471, 13, 69, 7569, 439, 3419, 628, 220, 220, 220, 825, 2922, 62, 2539, 4775, 62, 9521, 7, 944, 11, 949, 62, 2100, 28, 15, 11, 3509, 62, 2100, 28, 16, 11, 1188, 28, 16, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 21894, 8739, 257, 1188, 351, 949, 290, 3509, 284, 262, 26286, 198, 220, 220, 220, 220, 220, 220, 220, 1081, 262, 16855, 318, 969, 752, 425, 262, 5637, 16416, 318, 788, 26356, 62, 354, 5233, 37811, 198, 220, 220, 220, 220, 220, 220, 220, 479, 18504, 796, 685, 74, 329, 479, 287, 2116, 13, 4868, 62, 2539, 10879, 3419, 611, 479, 58, 16, 60, 18189, 2116, 13, 400, 10126, 60, 198, 220, 220, 220, 220, 220, 220, 220, 1188, 62, 9521, 796, 3509, 62, 2100, 532, 949, 62, 2100, 198, 220, 220, 220, 220, 220, 220, 220, 5766, 796, 493, 7, 11925, 7, 74, 18504, 8, 1220, 1188, 62, 9521, 8, 198, 220, 220, 220, 220, 220, 220, 220, 6727, 62, 437, 796, 1188, 1635, 5766, 198, 220, 220, 220, 220, 220, 220, 220, 611, 6727, 62, 437, 1279, 5766, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6727, 62, 437, 796, 5766, 198, 220, 220, 220, 220, 220, 220, 220, 2793, 62, 437, 796, 6727, 62, 437, 532, 5766, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 2539, 4775, 796, 26356, 62, 25541, 7, 74, 18504, 58, 21037, 62, 437, 25, 45828, 62, 437, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 24442, 7203, 22977, 21179, 6163, 25, 4064, 82, 1600, 2116, 13, 2539, 4775, 8, 628, 220, 220, 220, 825, 4808, 1136, 62, 28869, 43612, 7, 944, 11, 21179, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 2264, 10640, 9678, 17187, 329, 6171, 43612, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 5456, 796, 1509, 7928, 13, 32, 14415, 11792, 7, 944, 13, 4775, 17187, 62, 15042, 62, 2539, 11, 2116, 13, 4775, 17187, 62, 15042, 62, 6371, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1573, 62, 15042, 796, 9678, 32, 14415, 13, 26449, 32, 14415, 7, 16366, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2456, 796, 1573, 62, 15042, 13, 1136, 9819, 37117, 7, 2539, 4775, 11, 2776, 31431, 11639, 28869, 5177, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2456, 318, 6045, 393, 18896, 7, 10879, 8, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 2456, 58, 15, 4083, 10879, 628, 220, 220, 220, 825, 651, 62, 25579, 62, 28869, 43612, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 3082, 3565, 9678, 17187, 1255, 351, 1944, 6171, 43612, 287, 20137, 198, 220, 220, 220, 220, 220, 220, 220, 16409, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7343, 286, 6171, 43612, 14963, 287, 262, 6831, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 28869, 43612, 796, 2116, 13557, 1136, 62, 28869, 43612, 7, 944, 13, 2539, 4775, 8, 198, 220, 220, 220, 220, 220, 220, 220, 49706, 13, 24442, 7203, 9275, 4064, 67, 6171, 43612, 1600, 18896, 7, 944, 13, 28869, 43612, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 611, 18896, 7, 944, 13, 28869, 43612, 8, 1875, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13557, 41049, 62, 392, 62, 6404, 10786, 46506, 21179, 16034, 3076, 17500, 13920, 33411, 21179, 3268, 37633, 82, 8, 44441, 11050, 21179, 6, 4064, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 4032, 13, 22179, 10786, 8348, 329, 4808, 287, 2116, 13, 28869, 43612, 828, 46545, 7, 944, 13, 28869, 43612, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 685, 808, 58, 15, 60, 329, 5752, 287, 2116, 13, 66, 21471, 611, 5752, 318, 407, 6045, 60, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 17635, 198 ]
2.264085
3,692
import boto3 import json import logging import os logger = logging.getLogger() logger.setLevel(logging.INFO)
[ 11748, 275, 2069, 18, 198, 11748, 33918, 198, 11748, 18931, 198, 11748, 28686, 198, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 3419, 198, 6404, 1362, 13, 2617, 4971, 7, 6404, 2667, 13, 10778, 8, 198 ]
2.972973
37
import numpy import numpy as np from mindspore import Tensor, dtype from mindspore.train.serialization import export, save_checkpoint import mindspore.dataset as ds import mindspore.context as context import mindspore.ops as ops import mindspore.nn as N import mindspore.numpy as mnp
[ 11748, 299, 32152, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 2000, 2777, 382, 1330, 309, 22854, 11, 288, 4906, 198, 6738, 2000, 2777, 382, 13, 27432, 13, 46911, 1634, 1330, 10784, 11, 3613, 62, 9122, 4122, 198, 11748, 2000, 2777, 382, 13, 19608, 292, 316, 355, 288, 82, 198, 11748, 2000, 2777, 382, 13, 22866, 355, 4732, 198, 11748, 2000, 2777, 382, 13, 2840, 355, 39628, 198, 11748, 2000, 2777, 382, 13, 20471, 355, 399, 198, 11748, 2000, 2777, 382, 13, 77, 32152, 355, 285, 37659, 628 ]
3.238636
88
"""Test cases for _gates module.""" from unittest.mock import Mock import pytest import sympy from zquantum.core.wip.circuits import _builtin_gates from zquantum.core.wip.circuits._gates import GateOperation, MatrixFactoryGate GATES_REPRESENTATIVES = [ _builtin_gates.X, _builtin_gates.Y, _builtin_gates.Z, _builtin_gates.T, _builtin_gates.H, _builtin_gates.I, _builtin_gates.RX(sympy.Symbol("theta")), _builtin_gates.RY(0.5), _builtin_gates.RZ(0), _builtin_gates.PHASE(sympy.pi / 5), _builtin_gates.CZ, _builtin_gates.CNOT, _builtin_gates.SWAP, _builtin_gates.ISWAP, _builtin_gates.XX(sympy.cos(sympy.Symbol("phi"))), _builtin_gates.YY(sympy.pi), _builtin_gates.ZZ(sympy.Symbol("x") + sympy.Symbol("y")), _builtin_gates.CPHASE(1.5), ] @pytest.mark.parametrize("gate", GATES_REPRESENTATIVES) @pytest.mark.parametrize("gate", GATES_REPRESENTATIVES)
[ 37811, 14402, 2663, 329, 4808, 70, 689, 8265, 526, 15931, 198, 6738, 555, 715, 395, 13, 76, 735, 1330, 44123, 198, 198, 11748, 12972, 9288, 198, 11748, 10558, 88, 198, 6738, 1976, 40972, 388, 13, 7295, 13, 86, 541, 13, 21170, 15379, 1330, 4808, 18780, 259, 62, 70, 689, 198, 6738, 1976, 40972, 388, 13, 7295, 13, 86, 541, 13, 21170, 15379, 13557, 70, 689, 1330, 12816, 32180, 11, 24936, 22810, 22628, 198, 198, 38, 29462, 62, 2200, 48296, 3525, 1404, 42472, 796, 685, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 55, 11, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 56, 11, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 57, 11, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 51, 11, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 39, 11, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 40, 11, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 49, 55, 7, 1837, 3149, 88, 13, 13940, 23650, 7203, 1169, 8326, 4943, 828, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 18276, 7, 15, 13, 20, 828, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 49, 57, 7, 15, 828, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 11909, 11159, 7, 1837, 3149, 88, 13, 14415, 1220, 642, 828, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 34, 57, 11, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 34, 11929, 11, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 17887, 2969, 11, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 1797, 54, 2969, 11, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 8051, 7, 1837, 3149, 88, 13, 6966, 7, 1837, 3149, 88, 13, 13940, 23650, 7203, 34846, 48774, 828, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 26314, 7, 1837, 3149, 88, 13, 14415, 828, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 30148, 7, 1837, 3149, 88, 13, 13940, 23650, 7203, 87, 4943, 1343, 10558, 88, 13, 13940, 23650, 7203, 88, 4943, 828, 198, 220, 220, 220, 4808, 18780, 259, 62, 70, 689, 13, 8697, 39, 11159, 7, 16, 13, 20, 828, 198, 60, 628, 628, 198, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 10494, 1600, 402, 29462, 62, 2200, 48296, 3525, 1404, 42472, 8, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 10494, 1600, 402, 29462, 62, 2200, 48296, 3525, 1404, 42472, 8, 198 ]
2.059867
451
from game.game import Game from heapq import heappush, heappop import time import itertools import time if __name__ == '__main__': algorithm = Manhanttan() algorithm.run()
[ 6738, 983, 13, 6057, 1330, 3776, 198, 6738, 24575, 80, 1330, 339, 1324, 1530, 11, 339, 1324, 404, 198, 11748, 640, 198, 11748, 340, 861, 10141, 198, 11748, 640, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 11862, 796, 1869, 71, 415, 38006, 3419, 198, 220, 220, 220, 11862, 13, 5143, 3419, 198, 220, 220, 220, 220 ]
2.861538
65
from optimizers import * import gc import time def experiment_runner(args, x_0_dict): """ Runner routine which performs the whole experiment set. Parameters ---------- args : populated namespace object from ArgumentParser The system of equations evaluated at point x. x_0_dict : dict The dictionary of initial points x. Returns ------- dict Aggregated experiment data. """ gc.enable() gc.collect() exp_res_dict = dict() if args.verbose: print("Started DetGNM!") exp_res_dict['DetGNM'] = dict() for oracle_class, name in [(NesterovSkokovOracle, 'Nesterov-Skokov'), (HatOracle, 'Hat'), (PLOracle, 'PL')]: if args.verbose: print('Oracle:', name) exp_res_dict['DetGNM'][name] = dict() for n in args.n_dims: if args.verbose: print(' n:', n) exp_res_dict['DetGNM'][name][n] = dict() for i in range(args.n_starts): if args.verbose: print(' start #:', i + 1) start = time.time() _, f_vals, nabla_f_2_norm_vals, _, _ = DetGNM(oracle_class(n), args.N_iter, x_0_dict[n][i], args.L_0, True, None) start = time.time() - start exp_res_dict['DetGNM'][name][n][i] = {'f_vals': f_vals, 'nabla_f_2_norm_vals': nabla_f_2_norm_vals, 'avg_time_s': start / len(f_vals), 'time_s': start} del _, f_vals, nabla_f_2_norm_vals, start gc.collect() if args.verbose: print("Started ArmijoAccDetGNM!") exp_res_dict['ArmijoAccDetGNM'] = dict() for oracle_class, name in [(NesterovSkokovOracle, 'Nesterov-Skokov'), (HatOracle, 'Hat'), (PLOracle, 'PL')]: if args.verbose: print('Oracle:', name) exp_res_dict['ArmijoAccDetGNM'][name] = dict() for n in args.n_dims: if args.verbose: print(' n:', n) exp_res_dict['ArmijoAccDetGNM'][name][n] = dict() for pair_num, (c1, c2) in enumerate(zip(args.c1_list, args.c2_list)): if args.verbose: print(' c1 = {:.4f}, c2 = {:.4f}:'.format(c1, c2)) exp_res_dict['ArmijoAccDetGNM'][name][n][pair_num] = dict() for i in range(args.n_starts): if args.verbose: print(' start #:', i + 1) start = time.time() _, f_vals, nabla_f_2_norm_vals, _, _, local_steps_list, spec_steps_list = AccDetGNM(oracle_class(n), args.N_iter, x_0_dict[n][i], args.L_0, True, None, "Armijo", c1=c1, c2=c2) start = time.time() - start exp_res_dict['ArmijoAccDetGNM'][name][n][pair_num][i] = {'f_vals': f_vals, 'nabla_f_2_norm_vals': nabla_f_2_norm_vals, 'local_steps_list': local_steps_list, 'spec_steps_list': spec_steps_list, 'avg_time_s': start / len(f_vals), 'time_s': start} del _, f_vals, nabla_f_2_norm_vals, local_steps_list, spec_steps_list, start gc.collect() if args.verbose: print("Started ExtrapolationAccDetGNM!") exp_res_dict['ExtrapolationAccDetGNM'] = dict() for oracle_class, name in [(NesterovSkokovOracle, 'Nesterov-Skokov'), (HatOracle, 'Hat'), (PLOracle, 'PL')]: if args.verbose: print('Oracle:', name) exp_res_dict['ExtrapolationAccDetGNM'][name] = dict() for n in args.n_dims: if args.verbose: print(' n:', n) exp_res_dict['ExtrapolationAccDetGNM'][name][n] = dict() for i in range(args.n_starts): if args.verbose: print(' start #:', i + 1) start = time.time() _, f_vals, nabla_f_2_norm_vals, _, _, n_iter_list = AccDetGNM(oracle_class(n), args.N_iter, x_0_dict[n][i], args.L_0, True, None, "Extrapolation") start = time.time() - start exp_res_dict['ExtrapolationAccDetGNM'][name][n][i] = {'f_vals': f_vals, 'nabla_f_2_norm_vals': nabla_f_2_norm_vals, 'n_iter_list': n_iter_list, 'avg_time_s': start / len(f_vals), 'time_s': start} del _, f_vals, nabla_f_2_norm_vals, n_iter_list, start gc.collect() if args.verbose: print("Started InterpolationAccDetGNM!") exp_res_dict['InterpolationAccDetGNM'] = dict() for oracle_class, name in [(NesterovSkokovOracle, 'Nesterov-Skokov'), (HatOracle, 'Hat'), (PLOracle, 'PL')]: if args.verbose: print('Oracle:', name) exp_res_dict['InterpolationAccDetGNM'][name] = dict() for n in args.n_dims: if args.verbose: print(' n:', n) exp_res_dict['InterpolationAccDetGNM'][name][n] = dict() for n_points in args.n_points_list: if args.verbose: print(' n_points:', n_points) exp_res_dict['InterpolationAccDetGNM'][name][n][n_points] = dict() for i in range(args.n_starts): if args.verbose: print(' start #:', i + 1) start = time.time() _, f_vals, nabla_f_2_norm_vals, _, _ = AccDetGNM(oracle_class(n), args.N_iter, x_0_dict[n][i], args.L_0, True, None, "Interpolation") start = time.time() - start exp_res_dict['InterpolationAccDetGNM'][name][n][n_points][i] = {'f_vals': f_vals, 'nabla_f_2_norm_vals': nabla_f_2_norm_vals, 'avg_time_s': start / len(f_vals), 'time_s': start} del _, f_vals, nabla_f_2_norm_vals, start gc.collect() if args.verbose: print("Started SamplingAccDetGNM!") exp_res_dict['SamplingAccDetGNM'] = dict() for oracle_class, name in [(NesterovSkokovOracle, 'Nesterov-Skokov'), (HatOracle, 'Hat'), (PLOracle, 'PL')]: if args.verbose: print('Oracle:', name) exp_res_dict['SamplingAccDetGNM'][name] = dict() for n in args.n_dims: if args.verbose: print(' n:', n) exp_res_dict['SamplingAccDetGNM'][name][n] = dict() for n_points in args.n_points_list: if args.verbose: print(' n_points:', n_points) exp_res_dict['SamplingAccDetGNM'][name][n][n_points] = dict() for i in range(args.n_starts): if args.verbose: print(' start #:', i + 1) start = time.time() _, f_vals, nabla_f_2_norm_vals, _, _ = AccDetGNM(oracle_class(n), args.N_iter, x_0_dict[n][i], args.L_0, True, None, "Sampling") start = time.time() - start exp_res_dict['SamplingAccDetGNM'][name][n][n_points][i] = {'f_vals': f_vals, 'nabla_f_2_norm_vals': nabla_f_2_norm_vals, 'avg_time_s': start / len(f_vals), 'time_s': start} del _, f_vals, nabla_f_2_norm_vals, start gc.collect() if args.verbose: print("Started GoldenRatioAccDetGNM!") exp_res_dict['GoldenRatioAccDetGNM'] = dict() for oracle_class, name in [(NesterovSkokovOracle, 'Nesterov-Skokov'), (HatOracle, 'Hat'), (PLOracle, 'PL')]: if args.verbose: print('Oracle:', name) exp_res_dict['GoldenRatioAccDetGNM'][name] = dict() for n in args.n_dims: if args.verbose: print(' n:', n) exp_res_dict['GoldenRatioAccDetGNM'][name][n] = dict() for i in range(args.n_starts): if args.verbose: print(' start #:', i + 1) start = time.time() _, f_vals, nabla_f_2_norm_vals, _, _, n_iter_list = AccDetGNM(oracle_class(n), args.N_iter, x_0_dict[n][i], args.L_0, True, None, "GoldenRatio") start = time.time() - start exp_res_dict['GoldenRatioAccDetGNM'][name][n][i] = {'f_vals': f_vals, 'nabla_f_2_norm_vals': nabla_f_2_norm_vals, 'n_iter_list': n_iter_list, 'avg_time_s': start / len(f_vals), 'time_s': start} del _, f_vals, nabla_f_2_norm_vals, n_iter_list, start gc.collect() return exp_res_dict
[ 6738, 6436, 11341, 1330, 1635, 198, 11748, 308, 66, 198, 11748, 640, 628, 198, 4299, 6306, 62, 16737, 7, 22046, 11, 2124, 62, 15, 62, 11600, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 21529, 8027, 543, 17706, 262, 2187, 6306, 900, 13, 198, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 26498, 1058, 22331, 25745, 2134, 422, 45751, 46677, 198, 220, 220, 220, 220, 220, 220, 220, 383, 1080, 286, 27490, 16726, 379, 966, 2124, 13, 198, 220, 220, 220, 2124, 62, 15, 62, 11600, 1058, 8633, 198, 220, 220, 220, 220, 220, 220, 220, 383, 22155, 286, 4238, 2173, 2124, 13, 198, 220, 220, 220, 16409, 198, 220, 220, 220, 35656, 198, 220, 220, 220, 8633, 198, 220, 220, 220, 220, 220, 220, 220, 19015, 2301, 515, 6306, 1366, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 308, 66, 13, 21633, 3419, 198, 220, 220, 220, 308, 66, 13, 33327, 3419, 198, 220, 220, 220, 220, 198, 220, 220, 220, 1033, 62, 411, 62, 11600, 796, 8633, 3419, 198, 220, 220, 220, 220, 198, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 10434, 276, 4614, 16630, 44, 2474, 8, 198, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 11242, 16630, 44, 20520, 796, 8633, 3419, 198, 220, 220, 220, 329, 393, 6008, 62, 4871, 11, 1438, 287, 47527, 45, 7834, 709, 15739, 482, 709, 48625, 11, 705, 45, 7834, 709, 12, 15739, 482, 709, 33809, 357, 40483, 48625, 11, 705, 40483, 33809, 357, 6489, 48625, 11, 705, 6489, 11537, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 48625, 25, 3256, 1438, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 11242, 16630, 44, 6, 7131, 3672, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 329, 299, 287, 26498, 13, 77, 62, 67, 12078, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 299, 25, 3256, 299, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 2837, 7, 22046, 13, 77, 62, 301, 5889, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 220, 220, 220, 220, 923, 1303, 25, 3256, 1312, 1343, 352, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 11, 277, 62, 12786, 11, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 4808, 11, 4808, 796, 4614, 16630, 44, 7, 273, 6008, 62, 4871, 7, 77, 828, 26498, 13, 45, 62, 2676, 11, 2124, 62, 15, 62, 11600, 58, 77, 7131, 72, 4357, 26498, 13, 43, 62, 15, 11, 6407, 11, 6045, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 532, 923, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 7131, 72, 60, 796, 1391, 6, 69, 62, 12786, 10354, 277, 62, 12786, 11, 705, 77, 397, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 10354, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 705, 615, 70, 62, 2435, 62, 82, 10354, 923, 1220, 18896, 7, 69, 62, 12786, 828, 705, 2435, 62, 82, 10354, 923, 92, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1619, 4808, 11, 277, 62, 12786, 11, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 923, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 308, 66, 13, 33327, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 10434, 276, 7057, 2926, 78, 17320, 11242, 16630, 44, 2474, 8, 198, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 26560, 2926, 78, 17320, 11242, 16630, 44, 20520, 796, 8633, 3419, 198, 220, 220, 220, 329, 393, 6008, 62, 4871, 11, 1438, 287, 47527, 45, 7834, 709, 15739, 482, 709, 48625, 11, 705, 45, 7834, 709, 12, 15739, 482, 709, 33809, 357, 40483, 48625, 11, 705, 40483, 33809, 357, 6489, 48625, 11, 705, 6489, 11537, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 48625, 25, 3256, 1438, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 26560, 2926, 78, 17320, 11242, 16630, 44, 6, 7131, 3672, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 329, 299, 287, 26498, 13, 77, 62, 67, 12078, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 299, 25, 3256, 299, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 26560, 2926, 78, 17320, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 5166, 62, 22510, 11, 357, 66, 16, 11, 269, 17, 8, 287, 27056, 378, 7, 13344, 7, 22046, 13, 66, 16, 62, 4868, 11, 26498, 13, 66, 17, 62, 4868, 8, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 220, 220, 220, 220, 269, 16, 796, 46110, 13, 19, 69, 5512, 269, 17, 796, 46110, 13, 19, 69, 38362, 4458, 18982, 7, 66, 16, 11, 269, 17, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 26560, 2926, 78, 17320, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 7131, 24874, 62, 22510, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 2837, 7, 22046, 13, 77, 62, 301, 5889, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 1303, 25, 3256, 1312, 1343, 352, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 11, 277, 62, 12786, 11, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 4808, 11, 4808, 11, 1957, 62, 20214, 62, 4868, 11, 1020, 62, 20214, 62, 4868, 796, 6366, 11242, 16630, 44, 7, 273, 6008, 62, 4871, 7, 77, 828, 26498, 13, 45, 62, 2676, 11, 2124, 62, 15, 62, 11600, 58, 77, 7131, 72, 4357, 26498, 13, 43, 62, 15, 11, 6407, 11, 6045, 11, 366, 26560, 2926, 78, 1600, 269, 16, 28, 66, 16, 11, 269, 17, 28, 66, 17, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 532, 923, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 26560, 2926, 78, 17320, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 7131, 24874, 62, 22510, 7131, 72, 60, 796, 1391, 6, 69, 62, 12786, 10354, 277, 62, 12786, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 77, 397, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 10354, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 12001, 62, 20214, 62, 4868, 10354, 1957, 62, 20214, 62, 4868, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 16684, 62, 20214, 62, 4868, 10354, 1020, 62, 20214, 62, 4868, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 615, 70, 62, 2435, 62, 82, 10354, 923, 1220, 18896, 7, 69, 62, 12786, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 2435, 62, 82, 10354, 923, 92, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1619, 4808, 11, 277, 62, 12786, 11, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 1957, 62, 20214, 62, 4868, 11, 1020, 62, 20214, 62, 4868, 11, 923, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 308, 66, 13, 33327, 3419, 198, 220, 220, 220, 220, 198, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 10434, 276, 5683, 2416, 21417, 17320, 11242, 16630, 44, 2474, 8, 198, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 11627, 2416, 21417, 17320, 11242, 16630, 44, 20520, 796, 8633, 3419, 198, 220, 220, 220, 329, 393, 6008, 62, 4871, 11, 1438, 287, 47527, 45, 7834, 709, 15739, 482, 709, 48625, 11, 705, 45, 7834, 709, 12, 15739, 482, 709, 33809, 357, 40483, 48625, 11, 705, 40483, 33809, 357, 6489, 48625, 11, 705, 6489, 11537, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 48625, 25, 3256, 1438, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 11627, 2416, 21417, 17320, 11242, 16630, 44, 6, 7131, 3672, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 329, 299, 287, 26498, 13, 77, 62, 67, 12078, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 299, 25, 3256, 299, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 11627, 2416, 21417, 17320, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 2837, 7, 22046, 13, 77, 62, 301, 5889, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 220, 220, 220, 220, 923, 1303, 25, 3256, 1312, 1343, 352, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 11, 277, 62, 12786, 11, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 4808, 11, 4808, 11, 299, 62, 2676, 62, 4868, 796, 6366, 11242, 16630, 44, 7, 273, 6008, 62, 4871, 7, 77, 828, 26498, 13, 45, 62, 2676, 11, 2124, 62, 15, 62, 11600, 58, 77, 7131, 72, 4357, 26498, 13, 43, 62, 15, 11, 6407, 11, 6045, 11, 366, 11627, 2416, 21417, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 532, 923, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 11627, 2416, 21417, 17320, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 7131, 72, 60, 796, 1391, 6, 69, 62, 12786, 10354, 277, 62, 12786, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 77, 397, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 10354, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 77, 62, 2676, 62, 4868, 10354, 299, 62, 2676, 62, 4868, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 615, 70, 62, 2435, 62, 82, 10354, 923, 1220, 18896, 7, 69, 62, 12786, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 2435, 62, 82, 10354, 923, 92, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1619, 4808, 11, 277, 62, 12786, 11, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 299, 62, 2676, 62, 4868, 11, 923, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 308, 66, 13, 33327, 3419, 198, 220, 220, 220, 220, 198, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 10434, 276, 4225, 16104, 341, 17320, 11242, 16630, 44, 2474, 8, 198, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 9492, 16104, 341, 17320, 11242, 16630, 44, 20520, 796, 8633, 3419, 198, 220, 220, 220, 329, 393, 6008, 62, 4871, 11, 1438, 287, 47527, 45, 7834, 709, 15739, 482, 709, 48625, 11, 705, 45, 7834, 709, 12, 15739, 482, 709, 33809, 357, 40483, 48625, 11, 705, 40483, 33809, 357, 6489, 48625, 11, 705, 6489, 11537, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 48625, 25, 3256, 1438, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 9492, 16104, 341, 17320, 11242, 16630, 44, 6, 7131, 3672, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 329, 299, 287, 26498, 13, 77, 62, 67, 12078, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 299, 25, 3256, 299, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 9492, 16104, 341, 17320, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 299, 62, 13033, 287, 26498, 13, 77, 62, 13033, 62, 4868, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 220, 220, 220, 220, 299, 62, 13033, 25, 3256, 299, 62, 13033, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 9492, 16104, 341, 17320, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 7131, 77, 62, 13033, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 2837, 7, 22046, 13, 77, 62, 301, 5889, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 1303, 25, 3256, 1312, 1343, 352, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 11, 277, 62, 12786, 11, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 4808, 11, 4808, 796, 6366, 11242, 16630, 44, 7, 273, 6008, 62, 4871, 7, 77, 828, 26498, 13, 45, 62, 2676, 11, 2124, 62, 15, 62, 11600, 58, 77, 7131, 72, 4357, 26498, 13, 43, 62, 15, 11, 6407, 11, 6045, 11, 366, 9492, 16104, 341, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 532, 923, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 9492, 16104, 341, 17320, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 7131, 77, 62, 13033, 7131, 72, 60, 796, 1391, 6, 69, 62, 12786, 10354, 277, 62, 12786, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 77, 397, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 10354, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 615, 70, 62, 2435, 62, 82, 10354, 923, 1220, 18896, 7, 69, 62, 12786, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 2435, 62, 82, 10354, 923, 92, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1619, 4808, 11, 277, 62, 12786, 11, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 923, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 308, 66, 13, 33327, 3419, 198, 220, 220, 220, 220, 198, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 10434, 276, 3409, 11347, 17320, 11242, 16630, 44, 2474, 8, 198, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 16305, 11347, 17320, 11242, 16630, 44, 20520, 796, 8633, 3419, 198, 220, 220, 220, 329, 393, 6008, 62, 4871, 11, 1438, 287, 47527, 45, 7834, 709, 15739, 482, 709, 48625, 11, 705, 45, 7834, 709, 12, 15739, 482, 709, 33809, 357, 40483, 48625, 11, 705, 40483, 33809, 357, 6489, 48625, 11, 705, 6489, 11537, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 48625, 25, 3256, 1438, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 16305, 11347, 17320, 11242, 16630, 44, 6, 7131, 3672, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 329, 299, 287, 26498, 13, 77, 62, 67, 12078, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 299, 25, 3256, 299, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 16305, 11347, 17320, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 299, 62, 13033, 287, 26498, 13, 77, 62, 13033, 62, 4868, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 220, 220, 220, 220, 299, 62, 13033, 25, 3256, 299, 62, 13033, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 16305, 11347, 17320, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 7131, 77, 62, 13033, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 2837, 7, 22046, 13, 77, 62, 301, 5889, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 1303, 25, 3256, 1312, 1343, 352, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 11, 277, 62, 12786, 11, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 4808, 11, 4808, 796, 6366, 11242, 16630, 44, 7, 273, 6008, 62, 4871, 7, 77, 828, 26498, 13, 45, 62, 2676, 11, 2124, 62, 15, 62, 11600, 58, 77, 7131, 72, 4357, 26498, 13, 43, 62, 15, 11, 6407, 11, 6045, 11, 366, 16305, 11347, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 532, 923, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 16305, 11347, 17320, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 7131, 77, 62, 13033, 7131, 72, 60, 796, 1391, 6, 69, 62, 12786, 10354, 277, 62, 12786, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 77, 397, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 10354, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 615, 70, 62, 2435, 62, 82, 10354, 923, 1220, 18896, 7, 69, 62, 12786, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 2435, 62, 82, 10354, 923, 92, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1619, 4808, 11, 277, 62, 12786, 11, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 923, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 308, 66, 13, 33327, 3419, 198, 220, 220, 220, 220, 198, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 10434, 276, 8407, 29665, 952, 17320, 11242, 16630, 44, 2474, 8, 198, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 32378, 29665, 952, 17320, 11242, 16630, 44, 20520, 796, 8633, 3419, 198, 220, 220, 220, 329, 393, 6008, 62, 4871, 11, 1438, 287, 47527, 45, 7834, 709, 15739, 482, 709, 48625, 11, 705, 45, 7834, 709, 12, 15739, 482, 709, 33809, 357, 40483, 48625, 11, 705, 40483, 33809, 357, 6489, 48625, 11, 705, 6489, 11537, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 48625, 25, 3256, 1438, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 32378, 29665, 952, 17320, 11242, 16630, 44, 6, 7131, 3672, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 329, 299, 287, 26498, 13, 77, 62, 67, 12078, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 299, 25, 3256, 299, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 32378, 29665, 952, 17320, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 60, 796, 8633, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 2837, 7, 22046, 13, 77, 62, 301, 5889, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 26498, 13, 19011, 577, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 220, 220, 220, 220, 220, 220, 220, 923, 1303, 25, 3256, 1312, 1343, 352, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4808, 11, 277, 62, 12786, 11, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 4808, 11, 4808, 11, 299, 62, 2676, 62, 4868, 796, 6366, 11242, 16630, 44, 7, 273, 6008, 62, 4871, 7, 77, 828, 26498, 13, 45, 62, 2676, 11, 2124, 62, 15, 62, 11600, 58, 77, 7131, 72, 4357, 26498, 13, 43, 62, 15, 11, 6407, 11, 6045, 11, 366, 32378, 29665, 952, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 532, 923, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 411, 62, 11600, 17816, 32378, 29665, 952, 17320, 11242, 16630, 44, 6, 7131, 3672, 7131, 77, 7131, 72, 60, 796, 1391, 6, 69, 62, 12786, 10354, 277, 62, 12786, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 77, 397, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 10354, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 77, 62, 2676, 62, 4868, 10354, 299, 62, 2676, 62, 4868, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 615, 70, 62, 2435, 62, 82, 10354, 923, 1220, 18896, 7, 69, 62, 12786, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 2435, 62, 82, 10354, 923, 92, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1619, 4808, 11, 277, 62, 12786, 11, 47822, 5031, 62, 69, 62, 17, 62, 27237, 62, 12786, 11, 299, 62, 2676, 62, 4868, 11, 923, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 308, 66, 13, 33327, 3419, 198, 220, 220, 220, 220, 198, 220, 220, 220, 1441, 1033, 62, 411, 62, 11600, 628 ]
1.646419
5,976
import time
[ 11748, 640, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 198 ]
1.321429
28
import dash_bootstrap_components as dbc from dash import Input, Output, html button = html.Div( [ dbc.Button( "Click me", id="example-button", className="me-2", n_clicks=0 ), html.Span(id="example-output", style={"verticalAlign": "middle"}), ] ) @app.callback( Output("example-output", "children"), [Input("example-button", "n_clicks")] )
[ 11748, 14470, 62, 18769, 26418, 62, 5589, 3906, 355, 288, 15630, 198, 6738, 14470, 1330, 23412, 11, 25235, 11, 27711, 198, 198, 16539, 796, 27711, 13, 24095, 7, 198, 220, 220, 220, 685, 198, 220, 220, 220, 220, 220, 220, 220, 288, 15630, 13, 21864, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 8164, 502, 1600, 4686, 2625, 20688, 12, 16539, 1600, 1398, 5376, 2625, 1326, 12, 17, 1600, 299, 62, 565, 3378, 28, 15, 198, 220, 220, 220, 220, 220, 220, 220, 10612, 198, 220, 220, 220, 220, 220, 220, 220, 27711, 13, 4561, 272, 7, 312, 2625, 20688, 12, 22915, 1600, 3918, 28, 4895, 1851, 605, 2348, 570, 1298, 366, 27171, 20662, 828, 198, 220, 220, 220, 2361, 198, 8, 628, 198, 31, 1324, 13, 47423, 7, 198, 220, 220, 220, 25235, 7203, 20688, 12, 22915, 1600, 366, 17197, 12340, 685, 20560, 7203, 20688, 12, 16539, 1600, 366, 77, 62, 565, 3378, 4943, 60, 198, 8, 198 ]
2.363636
165
from django import forms from .models import Bark
[ 6738, 42625, 14208, 1330, 5107, 198, 198, 6738, 764, 27530, 1330, 20511, 628, 220, 220, 220, 220 ]
3.294118
17
# 等额本金和等额本息贷款计算 import math area = float(input('请输入房屋面积(m^2): ')) unit_price = float(input('请输入单价(元): ')) year_interest = float(input('请输入贷款利率(%): ')) # ''' # 等额本金的每月还款情况文件,格式如下: # 1月,5700.79(元) # 2月,5691.69(元) # 3月,5682.59(元) # 4月,5673.5(元) # ...... # # ''' # # # # 读取文件内容,即每个月的还款数据 # def get_average_capital(): # file_path = input('请输入等额本金文件路径: ') # average_capital_data = [] # file_object = open(file_path, 'r') # try: # for line in file_object: # average_capital_data.append(float(line[line.find(',') + 1:line.find('(')])) # finally: # file_object.close() # print(average_capital_data) # return average_capital_data ''' 等额本金还款法: 设:A=贷款额 B=贷款月利率 C=贷款月数 D=每月还款额 E=还款利息总和 每月应还本金=贷款额÷还款月数=A÷C 第一月还款利息=剩余本金×月利率=A×B 第二月还款利息:(贷款额-第一月已归还本金额)×月利率=(A-A÷C)×B 第三月还款利息:(A-2×A÷C)×B ... 第C月还款利息:(A-(C-1)×A÷C)×B 求以上和得E=B(AC-[A+2A+3A+...+(C-1)A]÷C)=B(AC-A(C-1)÷2)=A×B×(C+1)÷2 每n月还款:D=本金+第n月利息=A÷C+(A-(n-1)×A÷C)×B=(1+B(C-n+1))×A÷C ''' # 等额本金计算,默认30年 ''' 等额本息还款法: 设:A=贷款额 B=贷款月利率 C=贷款月数 D=每月还款额 E=还款利息总和 第一月还款利息为【贷款额×月利率】:A×B 第二月还款利息为【[贷款额-第一个月已还本金]×月利率】:〔A-(D-A×B)〕×B=(A×B-D)×(1+B)^1+D 第三月还款利息为:{A-(D-A×B)-〔D-(A×B-D)×(1+B)^1-D〕}×B=(A×B-D)×(1+B)^2+D 第四月还款利息为:=(A×B-D)×(1+B)^3+D ..... 第C月还款利息为:=(A×B-D)×(1+B)^(C-1)+D 求以上和为:E=(A×B-D)[(1+B)^0+(1+B)^1+...+(1+B)^(C-1)]+C×D=(A×B-D)×〔(1+B)^C-1〕÷B+C×D 而利息总和E=C×D-A,两项E值相等求得 月均还款:D=A×B×(1+B)^C÷〔(1+B)^C-1〕 支付利息总和:E=C×D-A=C×A×B×(1+B)^C÷〔(1+B)^C-1〕-A 还款总额:E+A=C×A×B×(1+B)^C÷〔(1+B)^C-1〕 附注:a^b表示a的b次方。 ''' # 等额本息计算,默认30年 total = unit_price * area loan = int((total - total * 0.3) / 10000) * 10000 first_pay = total - loan print('房屋总价:', total, '贷款额:', loan, '首付款:', first_pay) print("===============等额本金已还款总额(本金+利息)================") for j in range(1, 31): # print(first_pay + prepayment_average_capital(j), first_pay + prepayment_average_capital_plus_interest(j), total) print(first_pay + prepayment_average_capital(j)) print("===============等额本息已还款总额(本金+利息)=================") for k in range(1, 31): print(first_pay + prepayment_average_capital_plus_interest(k)) print("===============等额本息已还款总额-等额本金已还款总额======") for m in range(1, 31): print(prepayment_average_capital_plus_interest(m) - prepayment_average_capital(m)) print("===============一次性还清剩余贷款本金======") for n in range(1, 31): print(loan - (n / 30) * loan) print("===============总房价=================") for l in range(1, 31): print(total) print("===============等额本金总还款额======") for o in range(1, 31): t1 = first_pay + prepayment_average_capital(o) t2 = loan - (o / 30) * loan print(t1 + t2) print("===============等额本息总还款额======") for p in range(1, 31): t1 = first_pay + prepayment_average_capital_plus_interest(p) t2 = loan - (p / 30) * loan print(t1 + t2) # # 输入年份计算等额本金已经付给银行的钱,默认15年(提前还) # prepayment_average_capital_data = prepayment_average_capital() # # 输入年份计算等额本息已经付给银行的钱,默认15年(提前还) # prepayment_average_capital_plus_interest_data = prepayment_average_capital_plus_interest() # # print('等额本金总耗资:', first_pay + prepayment_average_capital_data) # print('等额本息总耗资:', first_pay + prepayment_average_capital_plus_interest_data) # print('少还利息:', prepayment_average_capital_plus_interest_data - prepayment_average_capital_data)
[ 2, 13328, 255, 231, 165, 95, 251, 17312, 105, 34932, 239, 161, 240, 234, 163, 255, 231, 165, 95, 251, 17312, 105, 162, 223, 107, 164, 112, 115, 162, 105, 122, 164, 106, 94, 163, 106, 245, 628, 198, 11748, 10688, 198, 198, 20337, 796, 12178, 7, 15414, 10786, 46237, 115, 164, 122, 241, 17739, 98, 22755, 123, 161, 109, 233, 165, 251, 95, 163, 100, 107, 7, 76, 61, 17, 2599, 705, 4008, 198, 20850, 62, 20888, 796, 12178, 7, 15414, 10786, 46237, 115, 164, 122, 241, 17739, 98, 39355, 243, 20015, 115, 7, 17739, 225, 2599, 705, 4008, 198, 1941, 62, 9446, 796, 12178, 7, 15414, 10786, 46237, 115, 164, 122, 241, 17739, 98, 164, 112, 115, 162, 105, 122, 26344, 102, 163, 236, 229, 7, 4, 2599, 705, 4008, 198, 198, 2, 705, 7061, 198, 2, 13328, 255, 231, 165, 95, 251, 17312, 105, 34932, 239, 21410, 162, 107, 237, 17312, 230, 32573, 246, 162, 105, 122, 46349, 227, 37863, 113, 23877, 229, 20015, 114, 171, 120, 234, 43718, 120, 28156, 237, 36685, 224, 10310, 233, 171, 120, 248, 198, 2, 352, 17312, 230, 11, 3553, 405, 13, 3720, 7, 17739, 225, 8, 198, 2, 362, 17312, 230, 11, 20, 49541, 13, 3388, 7, 17739, 225, 8, 198, 2, 513, 17312, 230, 11, 20, 43950, 13, 3270, 7, 17739, 225, 8, 198, 2, 604, 17312, 230, 11, 20, 45758, 13, 20, 7, 17739, 225, 8, 198, 2, 47082, 198, 2, 198, 2, 705, 7061, 198, 2, 198, 2, 198, 2, 1303, 5525, 107, 119, 20998, 244, 23877, 229, 20015, 114, 37863, 227, 22522, 117, 171, 120, 234, 39355, 111, 162, 107, 237, 10310, 103, 17312, 230, 21410, 32573, 246, 162, 105, 122, 46763, 108, 162, 235, 106, 198, 2, 825, 651, 62, 23913, 62, 27544, 33529, 198, 2, 220, 220, 220, 220, 2393, 62, 6978, 796, 5128, 10786, 46237, 115, 164, 122, 241, 17739, 98, 163, 255, 231, 165, 95, 251, 17312, 105, 34932, 239, 23877, 229, 20015, 114, 164, 115, 107, 36181, 226, 25, 705, 8, 198, 2, 220, 220, 220, 220, 2811, 62, 27544, 62, 7890, 796, 17635, 198, 2, 220, 220, 220, 220, 2393, 62, 15252, 796, 1280, 7, 7753, 62, 6978, 11, 705, 81, 11537, 198, 2, 220, 220, 220, 220, 1949, 25, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1627, 287, 2393, 62, 15252, 25, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2811, 62, 27544, 62, 7890, 13, 33295, 7, 22468, 7, 1370, 58, 1370, 13, 19796, 7, 3256, 11537, 1343, 352, 25, 1370, 13, 19796, 10786, 10786, 15437, 4008, 198, 2, 220, 220, 220, 220, 3443, 25, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 2393, 62, 15252, 13, 19836, 3419, 198, 2, 220, 220, 220, 220, 3601, 7, 23913, 62, 27544, 62, 7890, 8, 198, 2, 220, 220, 220, 220, 1441, 2811, 62, 27544, 62, 7890, 628, 198, 7061, 6, 198, 163, 255, 231, 165, 95, 251, 17312, 105, 34932, 239, 32573, 246, 162, 105, 122, 37345, 243, 25, 198, 164, 106, 122, 171, 120, 248, 32, 28, 164, 112, 115, 162, 105, 122, 165, 95, 251, 347, 28, 164, 112, 115, 162, 105, 122, 17312, 230, 26344, 102, 163, 236, 229, 327, 28, 164, 112, 115, 162, 105, 122, 17312, 230, 46763, 108, 360, 28, 162, 107, 237, 17312, 230, 32573, 246, 162, 105, 122, 165, 95, 251, 412, 28, 32573, 246, 162, 105, 122, 26344, 102, 162, 223, 107, 45250, 119, 161, 240, 234, 198, 162, 107, 237, 17312, 230, 41753, 242, 32573, 246, 17312, 105, 34932, 239, 28, 164, 112, 115, 162, 105, 122, 165, 95, 251, 127, 115, 32573, 246, 162, 105, 122, 17312, 230, 46763, 108, 28, 32, 127, 115, 34, 198, 163, 105, 105, 31660, 17312, 230, 32573, 246, 162, 105, 122, 26344, 102, 162, 223, 107, 28, 30298, 102, 19526, 247, 17312, 105, 34932, 239, 12906, 17312, 230, 26344, 102, 163, 236, 229, 28, 32, 12906, 33, 198, 163, 105, 105, 12859, 234, 17312, 230, 32573, 246, 162, 105, 122, 26344, 102, 162, 223, 107, 37498, 164, 112, 115, 162, 105, 122, 165, 95, 251, 12, 163, 105, 105, 31660, 17312, 230, 32432, 110, 37605, 240, 32573, 246, 17312, 105, 34932, 239, 165, 95, 251, 8, 12906, 17312, 230, 26344, 102, 163, 236, 229, 16193, 32, 12, 32, 127, 115, 34, 8, 12906, 33, 198, 163, 105, 105, 49011, 17312, 230, 32573, 246, 162, 105, 122, 26344, 102, 162, 223, 107, 37498, 32, 12, 17, 12906, 32, 127, 115, 34, 8, 12906, 33, 198, 986, 198, 163, 105, 105, 34, 17312, 230, 32573, 246, 162, 105, 122, 26344, 102, 162, 223, 107, 37498, 32, 30420, 34, 12, 16, 8, 12906, 32, 127, 115, 34, 8, 12906, 33, 198, 162, 109, 224, 20015, 98, 41468, 161, 240, 234, 36181, 245, 36, 28, 33, 7, 2246, 49146, 32, 10, 17, 32, 10, 18, 32, 10, 986, 33747, 34, 12, 16, 8, 32, 60, 127, 115, 34, 47505, 33, 7, 2246, 12, 32, 7, 34, 12, 16, 8, 127, 115, 17, 47505, 32, 12906, 33, 12906, 7, 34, 10, 16, 8, 127, 115, 17, 198, 162, 107, 237, 77, 17312, 230, 32573, 246, 162, 105, 122, 25, 35, 28, 17312, 105, 34932, 239, 10, 163, 105, 105, 77, 17312, 230, 26344, 102, 162, 223, 107, 28, 32, 127, 115, 34, 33747, 32, 30420, 77, 12, 16, 8, 12906, 32, 127, 115, 34, 8, 12906, 33, 16193, 16, 10, 33, 7, 34, 12, 77, 10, 16, 4008, 12906, 32, 127, 115, 34, 198, 7061, 6, 628, 198, 198, 2, 13328, 255, 231, 165, 95, 251, 17312, 105, 34932, 239, 164, 106, 94, 163, 106, 245, 171, 120, 234, 165, 119, 246, 164, 106, 97, 1270, 33176, 112, 628, 198, 7061, 6, 198, 163, 255, 231, 165, 95, 251, 17312, 105, 162, 223, 107, 32573, 246, 162, 105, 122, 37345, 243, 171, 120, 248, 198, 164, 106, 122, 171, 120, 248, 32, 28, 164, 112, 115, 162, 105, 122, 165, 95, 251, 347, 28, 164, 112, 115, 162, 105, 122, 17312, 230, 26344, 102, 163, 236, 229, 327, 28, 164, 112, 115, 162, 105, 122, 17312, 230, 46763, 108, 360, 28, 162, 107, 237, 17312, 230, 32573, 246, 162, 105, 122, 165, 95, 251, 412, 28, 32573, 246, 162, 105, 122, 26344, 102, 162, 223, 107, 45250, 119, 161, 240, 234, 198, 163, 105, 105, 31660, 17312, 230, 32573, 246, 162, 105, 122, 26344, 102, 162, 223, 107, 10310, 118, 31854, 164, 112, 115, 162, 105, 122, 165, 95, 251, 12906, 17312, 230, 26344, 102, 163, 236, 229, 31817, 171, 120, 248, 32, 12906, 33, 198, 163, 105, 105, 12859, 234, 17312, 230, 32573, 246, 162, 105, 122, 26344, 102, 162, 223, 107, 10310, 118, 31854, 58, 164, 112, 115, 162, 105, 122, 165, 95, 251, 12, 163, 105, 105, 31660, 10310, 103, 17312, 230, 32432, 110, 32573, 246, 17312, 105, 34932, 239, 60, 12906, 17312, 230, 26344, 102, 163, 236, 229, 31817, 171, 120, 248, 5099, 242, 32, 171, 120, 235, 171, 120, 230, 35, 171, 120, 235, 32, 12906, 33, 171, 120, 231, 5099, 243, 12906, 33, 171, 120, 251, 171, 120, 230, 32, 12906, 33, 171, 120, 235, 35, 171, 120, 231, 12906, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 16, 171, 120, 233, 35, 198, 163, 105, 105, 49011, 17312, 230, 32573, 246, 162, 105, 122, 26344, 102, 162, 223, 107, 10310, 118, 171, 120, 248, 171, 121, 249, 32, 171, 120, 235, 171, 120, 230, 35, 171, 120, 235, 32, 12906, 33, 171, 120, 231, 171, 120, 235, 5099, 242, 35, 171, 120, 235, 171, 120, 230, 32, 12906, 33, 171, 120, 235, 35, 171, 120, 231, 12906, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 16, 171, 120, 235, 35, 5099, 243, 171, 121, 251, 12906, 33, 171, 120, 251, 171, 120, 230, 32, 12906, 33, 171, 120, 235, 35, 171, 120, 231, 12906, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 17, 171, 120, 233, 35, 198, 163, 105, 105, 32368, 249, 17312, 230, 32573, 246, 162, 105, 122, 26344, 102, 162, 223, 107, 10310, 118, 171, 120, 248, 171, 120, 251, 171, 120, 230, 32, 12906, 33, 171, 120, 235, 35, 171, 120, 231, 12906, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 18, 171, 120, 233, 35, 198, 12359, 198, 163, 105, 105, 34, 17312, 230, 32573, 246, 162, 105, 122, 26344, 102, 162, 223, 107, 10310, 118, 171, 120, 248, 171, 120, 251, 171, 120, 230, 32, 12906, 33, 171, 120, 235, 35, 171, 120, 231, 12906, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 171, 120, 230, 34, 171, 120, 235, 16, 171, 120, 231, 171, 120, 233, 35, 198, 162, 109, 224, 20015, 98, 41468, 161, 240, 234, 10310, 118, 171, 120, 248, 36, 171, 120, 251, 171, 120, 230, 32, 12906, 33, 171, 120, 235, 35, 171, 120, 231, 58, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 15, 10, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 16, 10, 986, 10, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 171, 120, 230, 34, 171, 120, 235, 16, 171, 120, 231, 48688, 34, 12906, 35, 28, 171, 120, 230, 32, 12906, 33, 171, 120, 235, 35, 171, 120, 231, 12906, 5099, 242, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 34, 171, 120, 235, 16, 5099, 243, 127, 115, 33, 171, 120, 233, 34, 12906, 35, 198, 32003, 234, 26344, 102, 162, 223, 107, 45250, 119, 161, 240, 234, 36, 171, 120, 251, 34, 12906, 35, 171, 120, 235, 32, 171, 120, 234, 10310, 97, 165, 94, 117, 36, 161, 222, 120, 33566, 116, 163, 255, 231, 162, 109, 224, 36181, 245, 198, 17312, 230, 161, 251, 229, 32573, 246, 162, 105, 122, 25, 35, 171, 120, 251, 32, 12906, 33, 12906, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 34, 127, 115, 5099, 242, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 34, 171, 120, 235, 16, 5099, 243, 198, 162, 242, 107, 20015, 246, 26344, 102, 162, 223, 107, 45250, 119, 161, 240, 234, 25, 36, 171, 120, 251, 34, 12906, 35, 12, 32, 28, 34, 12906, 32, 12906, 33, 12906, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 34, 127, 115, 5099, 242, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 34, 171, 120, 235, 16, 5099, 243, 171, 120, 235, 32, 198, 32573, 246, 162, 105, 122, 45250, 119, 165, 95, 251, 25, 36, 10, 32, 28, 34, 12906, 32, 12906, 33, 12906, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 34, 127, 115, 5099, 242, 171, 120, 230, 16, 171, 120, 233, 33, 171, 120, 231, 61, 34, 171, 120, 235, 16, 5099, 243, 198, 198, 165, 247, 226, 37345, 101, 25, 64, 61, 65, 26193, 101, 163, 97, 118, 64, 21410, 65, 162, 105, 94, 43095, 16764, 198, 7061, 6, 628, 198, 2, 13328, 255, 231, 165, 95, 251, 17312, 105, 162, 223, 107, 164, 106, 94, 163, 106, 245, 171, 120, 234, 165, 119, 246, 164, 106, 97, 1270, 33176, 112, 628, 198, 23350, 796, 4326, 62, 20888, 1635, 1989, 198, 5439, 272, 796, 493, 19510, 23350, 532, 2472, 1635, 657, 13, 18, 8, 1220, 33028, 8, 1635, 33028, 198, 11085, 62, 15577, 796, 2472, 532, 8063, 198, 198, 4798, 10786, 22755, 123, 161, 109, 233, 45250, 119, 20015, 115, 25, 3256, 2472, 11, 705, 164, 112, 115, 162, 105, 122, 165, 95, 251, 25, 3256, 8063, 11, 705, 165, 99, 244, 20015, 246, 162, 105, 122, 25, 3256, 717, 62, 15577, 8, 198, 198, 4798, 7203, 25609, 18604, 163, 255, 231, 165, 95, 251, 17312, 105, 34932, 239, 32432, 110, 32573, 246, 162, 105, 122, 45250, 119, 165, 95, 251, 7, 17312, 105, 34932, 239, 10, 26344, 102, 162, 223, 107, 8, 4770, 4943, 198, 1640, 474, 287, 2837, 7, 16, 11, 3261, 2599, 198, 220, 220, 220, 1303, 3601, 7, 11085, 62, 15577, 1343, 3143, 323, 434, 62, 23913, 62, 27544, 7, 73, 828, 717, 62, 15577, 1343, 3143, 323, 434, 62, 23913, 62, 27544, 62, 9541, 62, 9446, 7, 73, 828, 2472, 8, 198, 220, 220, 220, 3601, 7, 11085, 62, 15577, 1343, 3143, 323, 434, 62, 23913, 62, 27544, 7, 73, 4008, 198, 198, 4798, 7203, 25609, 18604, 163, 255, 231, 165, 95, 251, 17312, 105, 162, 223, 107, 32432, 110, 32573, 246, 162, 105, 122, 45250, 119, 165, 95, 251, 7, 17312, 105, 34932, 239, 10, 26344, 102, 162, 223, 107, 8, 4770, 2625, 8, 198, 1640, 479, 287, 2837, 7, 16, 11, 3261, 2599, 198, 220, 220, 220, 3601, 7, 11085, 62, 15577, 1343, 3143, 323, 434, 62, 23913, 62, 27544, 62, 9541, 62, 9446, 7, 74, 4008, 198, 198, 4798, 7203, 25609, 18604, 163, 255, 231, 165, 95, 251, 17312, 105, 162, 223, 107, 32432, 110, 32573, 246, 162, 105, 122, 45250, 119, 165, 95, 251, 12, 163, 255, 231, 165, 95, 251, 17312, 105, 34932, 239, 32432, 110, 32573, 246, 162, 105, 122, 45250, 119, 165, 95, 251, 50155, 4943, 198, 1640, 285, 287, 2837, 7, 16, 11, 3261, 2599, 198, 220, 220, 220, 3601, 7, 3866, 37301, 62, 23913, 62, 27544, 62, 9541, 62, 9446, 7, 76, 8, 532, 3143, 323, 434, 62, 23913, 62, 27544, 7, 76, 4008, 198, 198, 4798, 7203, 25609, 18604, 31660, 162, 105, 94, 45250, 100, 32573, 246, 162, 116, 227, 30298, 102, 19526, 247, 164, 112, 115, 162, 105, 122, 17312, 105, 34932, 239, 50155, 4943, 198, 1640, 299, 287, 2837, 7, 16, 11, 3261, 2599, 198, 220, 220, 220, 3601, 7, 5439, 272, 532, 357, 77, 1220, 1542, 8, 1635, 8063, 8, 198, 198, 4798, 7203, 25609, 18604, 45250, 119, 22755, 123, 20015, 115, 4770, 2625, 8, 198, 1640, 300, 287, 2837, 7, 16, 11, 3261, 2599, 198, 220, 220, 220, 3601, 7, 23350, 8, 198, 198, 4798, 7203, 25609, 18604, 163, 255, 231, 165, 95, 251, 17312, 105, 34932, 239, 45250, 119, 32573, 246, 162, 105, 122, 165, 95, 251, 50155, 4943, 198, 1640, 267, 287, 2837, 7, 16, 11, 3261, 2599, 198, 220, 220, 220, 256, 16, 796, 717, 62, 15577, 1343, 3143, 323, 434, 62, 23913, 62, 27544, 7, 78, 8, 198, 220, 220, 220, 256, 17, 796, 8063, 532, 357, 78, 1220, 1542, 8, 1635, 8063, 198, 220, 220, 220, 3601, 7, 83, 16, 1343, 256, 17, 8, 198, 198, 4798, 7203, 25609, 18604, 163, 255, 231, 165, 95, 251, 17312, 105, 162, 223, 107, 45250, 119, 32573, 246, 162, 105, 122, 165, 95, 251, 50155, 4943, 198, 1640, 279, 287, 2837, 7, 16, 11, 3261, 2599, 198, 220, 220, 220, 256, 16, 796, 717, 62, 15577, 1343, 3143, 323, 434, 62, 23913, 62, 27544, 62, 9541, 62, 9446, 7, 79, 8, 198, 220, 220, 220, 256, 17, 796, 8063, 532, 357, 79, 1220, 1542, 8, 1635, 8063, 198, 220, 220, 220, 3601, 7, 83, 16, 1343, 256, 17, 8, 198, 2, 1303, 5525, 122, 241, 17739, 98, 33176, 112, 20015, 121, 164, 106, 94, 163, 106, 245, 163, 255, 231, 165, 95, 251, 17312, 105, 34932, 239, 32432, 110, 163, 119, 237, 20015, 246, 163, 119, 247, 165, 241, 114, 26193, 234, 21410, 165, 240, 109, 171, 120, 234, 165, 119, 246, 164, 106, 97, 1314, 33176, 112, 7, 162, 237, 238, 30298, 235, 32573, 246, 8, 198, 2, 3143, 323, 434, 62, 23913, 62, 27544, 62, 7890, 796, 3143, 323, 434, 62, 23913, 62, 27544, 3419, 198, 2, 1303, 5525, 122, 241, 17739, 98, 33176, 112, 20015, 121, 164, 106, 94, 163, 106, 245, 163, 255, 231, 165, 95, 251, 17312, 105, 162, 223, 107, 32432, 110, 163, 119, 237, 20015, 246, 163, 119, 247, 165, 241, 114, 26193, 234, 21410, 165, 240, 109, 171, 120, 234, 165, 119, 246, 164, 106, 97, 1314, 33176, 112, 7, 162, 237, 238, 30298, 235, 32573, 246, 8, 198, 2, 3143, 323, 434, 62, 23913, 62, 27544, 62, 9541, 62, 9446, 62, 7890, 796, 3143, 323, 434, 62, 23913, 62, 27544, 62, 9541, 62, 9446, 3419, 198, 2, 198, 2, 3601, 10786, 163, 255, 231, 165, 95, 251, 17312, 105, 34932, 239, 45250, 119, 32003, 245, 164, 113, 226, 171, 120, 248, 3256, 717, 62, 15577, 1343, 3143, 323, 434, 62, 23913, 62, 27544, 62, 7890, 8, 198, 2, 3601, 10786, 163, 255, 231, 165, 95, 251, 17312, 105, 162, 223, 107, 45250, 119, 32003, 245, 164, 113, 226, 171, 120, 248, 3256, 717, 62, 15577, 1343, 3143, 323, 434, 62, 23913, 62, 27544, 62, 9541, 62, 9446, 62, 7890, 8, 198, 2, 3601, 10786, 22887, 239, 32573, 246, 26344, 102, 162, 223, 107, 171, 120, 248, 3256, 3143, 323, 434, 62, 23913, 62, 27544, 62, 9541, 62, 9446, 62, 7890, 532, 3143, 323, 434, 62, 23913, 62, 27544, 62, 7890, 8, 198 ]
1.134198
2,854
# flake8: noqa # -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models
[ 2, 781, 539, 23, 25, 645, 20402, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 11748, 4818, 8079, 198, 6738, 5366, 13, 9945, 1330, 20613, 198, 6738, 5366, 13, 85, 17, 1330, 10011, 2611, 44, 4254, 198, 6738, 42625, 14208, 13, 9945, 1330, 4981, 628 ]
2.807692
52
# # DeepRacer Guru # # Version 3.0 onwards # # Copyright (c) 2021 dmh23 # import threading import time import src.utils.geometry as geometry import tkinter as tk from src.analyze.track.track_analyzer import TrackAnalyzer from src.episode.episode import Episode from src.graphics.track_graphics import TrackGraphics from src.analyze.core.controls import VideoControls, LapTimeControl from src.personalize.configuration.appearance import RACE_COLOURS
[ 2, 198, 2, 10766, 49, 11736, 38749, 198, 2, 198, 2, 10628, 513, 13, 15, 31719, 198, 2, 198, 2, 15069, 357, 66, 8, 33448, 288, 76, 71, 1954, 198, 2, 198, 198, 11748, 4704, 278, 198, 11748, 640, 198, 11748, 12351, 13, 26791, 13, 469, 15748, 355, 22939, 198, 198, 11748, 256, 74, 3849, 355, 256, 74, 198, 198, 6738, 12351, 13, 38200, 2736, 13, 11659, 13, 11659, 62, 38200, 9107, 1330, 17762, 37702, 9107, 198, 6738, 12351, 13, 38668, 13, 38668, 1330, 7922, 198, 6738, 12351, 13, 70, 11549, 13, 11659, 62, 70, 11549, 1330, 17762, 18172, 198, 198, 6738, 12351, 13, 38200, 2736, 13, 7295, 13, 13716, 82, 1330, 7623, 15988, 82, 11, 26944, 7575, 15988, 198, 6738, 12351, 13, 22682, 1096, 13, 11250, 3924, 13, 1324, 23435, 1330, 371, 11598, 62, 25154, 2606, 6998, 628 ]
3.266187
139
import sys cover = [[[0, 0], [1, 0], [0, 1]], [[0, 0], [0, 1], [1, 1]], [[0, 0], [1, 0], [1, 1]], [[0, 0], [1, 0], [1, -1]]] #rl = lambda: sys.stdin.readline() rl = input C = int(rl()) for _ in range(C): H, W = map(int, rl().split()) block_list = [] white, black = 0, 0 for __ in range(H): block_row = rl() tmp_list = [] for b in block_row: if b == '#': black += 1 tmp_list.append(1) else: white += 1 tmp_list.append(0) block_list.append(tmp_list) if white % 3 != 0: print(0) continue if black == (W*H): print(1) continue print(cover_block(block_list))
[ 11748, 25064, 198, 198, 9631, 796, 16410, 58, 15, 11, 657, 4357, 685, 16, 11, 657, 4357, 685, 15, 11, 352, 60, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 16410, 15, 11, 657, 4357, 685, 15, 11, 352, 4357, 685, 16, 11, 352, 60, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 16410, 15, 11, 657, 4357, 685, 16, 11, 657, 4357, 685, 16, 11, 352, 60, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 16410, 15, 11, 657, 4357, 685, 16, 11, 657, 4357, 685, 16, 11, 532, 16, 11907, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 628, 198, 2, 45895, 796, 37456, 25, 25064, 13, 19282, 259, 13, 961, 1370, 3419, 198, 45895, 796, 5128, 198, 34, 796, 493, 7, 45895, 28955, 198, 198, 1640, 4808, 287, 2837, 7, 34, 2599, 198, 220, 220, 220, 367, 11, 370, 796, 3975, 7, 600, 11, 374, 75, 22446, 35312, 28955, 198, 220, 220, 220, 2512, 62, 4868, 796, 17635, 198, 220, 220, 220, 2330, 11, 2042, 796, 657, 11, 657, 198, 220, 220, 220, 329, 11593, 287, 2837, 7, 39, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 2512, 62, 808, 796, 374, 75, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 45218, 62, 4868, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 329, 275, 287, 2512, 62, 808, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 275, 6624, 705, 2, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2042, 15853, 352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 45218, 62, 4868, 13, 33295, 7, 16, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2330, 15853, 352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 45218, 62, 4868, 13, 33295, 7, 15, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2512, 62, 4868, 13, 33295, 7, 22065, 62, 4868, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 611, 2330, 4064, 513, 14512, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 15, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2555, 198, 220, 220, 220, 220, 198, 220, 220, 220, 611, 2042, 6624, 357, 54, 9, 39, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 16, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2555, 198, 220, 220, 220, 220, 198, 220, 220, 220, 3601, 7, 9631, 62, 9967, 7, 9967, 62, 4868, 4008, 198, 220, 220, 220, 220, 198 ]
1.661885
488
from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from .models import SoundCloud, COLORS from django.conf import settings from django.utils.translation import ugettext as _ from django.utils.safestring import mark_safe # use CMSPLUGIN_SOUNDCLOUD_PARAMS to override PARAMS PARAMS = getattr(settings, 'CMSPLUGIN_SOUNDCLOUD_PARAMS', 'width="100%" height="166" scrolling="no" frameborder="no"') plugin_pool.register_plugin(SoundCloudPlugin)
[ 6738, 269, 907, 13, 33803, 62, 8692, 1330, 40773, 37233, 14881, 198, 6738, 269, 907, 13, 33803, 62, 7742, 1330, 13877, 62, 7742, 198, 198, 6738, 764, 27530, 1330, 9506, 18839, 11, 20444, 20673, 198, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 26791, 13, 41519, 1330, 334, 1136, 5239, 355, 4808, 198, 6738, 42625, 14208, 13, 26791, 13, 49585, 395, 1806, 1330, 1317, 62, 21230, 198, 198, 2, 779, 16477, 4303, 43, 7340, 1268, 62, 50, 15919, 5097, 2606, 35, 62, 27082, 40834, 284, 20957, 29463, 40834, 198, 27082, 40834, 796, 651, 35226, 7, 33692, 11, 705, 24187, 4303, 43, 7340, 1268, 62, 50, 15919, 5097, 2606, 35, 62, 27082, 40834, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 10394, 2625, 3064, 39658, 6001, 2625, 23055, 1, 28659, 2625, 3919, 1, 5739, 20192, 2625, 3919, 1, 11537, 628, 198, 198, 33803, 62, 7742, 13, 30238, 62, 33803, 7, 21369, 18839, 37233, 8, 628 ]
2.9
170
s = Solution() print s.findMin([4, 5, 5, 6, 7, 0, 1, 2, 2, 2])
[ 198, 198, 82, 796, 28186, 3419, 198, 4798, 264, 13, 19796, 9452, 26933, 19, 11, 642, 11, 642, 11, 718, 11, 767, 11, 657, 11, 352, 11, 362, 11, 362, 11, 362, 12962, 198 ]
1.911765
34
#!/usr/bin/env python3 # # Cross Platform and Multi Architecture Advanced Binary Emulation Framework # from qiling.const import * from qiling.os.linux.thread import * from qiling.const import * from qiling.os.posix.filestruct import * from qiling.os.filestruct import * from qiling.os.posix.const_mapping import * from qiling.exception import *
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 198, 2, 6372, 19193, 290, 15237, 29778, 13435, 45755, 2295, 1741, 25161, 198, 2, 628, 198, 6738, 10662, 4386, 13, 9979, 1330, 1635, 198, 6738, 10662, 4386, 13, 418, 13, 23289, 13, 16663, 1330, 1635, 198, 6738, 10662, 4386, 13, 9979, 1330, 1635, 198, 6738, 10662, 4386, 13, 418, 13, 1930, 844, 13, 10379, 395, 1356, 1330, 1635, 198, 6738, 10662, 4386, 13, 418, 13, 10379, 395, 1356, 1330, 1635, 198, 6738, 10662, 4386, 13, 418, 13, 1930, 844, 13, 9979, 62, 76, 5912, 1330, 1635, 198, 6738, 10662, 4386, 13, 1069, 4516, 1330, 1635, 628, 628, 198 ]
3.220183
109
#!/usr/bin/python # Classification (U) """Program: add_miss_slaves.py Description: Unit testing of add_miss_slaves in mysql_rep_admin.py. Usage: test/unit/mysql_rep_admin/add_miss_slaves.py Arguments: """ # Libraries and Global Variables # Standard import sys import os if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest # Third-party # Local sys.path.append(os.getcwd()) import mysql_rep_admin import version __version__ = version.__version__ class MasterRep(object): """Class: MasterRep Description: Class stub holder for mysql_class.MasterRep class. Methods: __init__ show_slv_hosts """ def __init__(self): """Method: __init__ Description: Class initialization. Arguments: """ self.name = "Master_Name" self.slv_hosts = [{"Host": "slave1"}, {"Host": "slave2"}, {"Host": "slave3"}] def show_slv_hosts(self): """Method: show_slv_hosts Description: Stub method holder for SlaveRep.get_err_stat. Arguments: """ return self.slv_hosts class UnitTest(unittest.TestCase): """Class: UnitTest Description: Class which is a representation of a unit testing. Methods: setUp test_no_slv_miss test_one_slv_miss """ def setUp(self): """Function: setUp Description: Initialization for unit testing. Arguments: """ self.master = MasterRep() self.outdata = {"Slaves": [{"Name": "slave1", "LagTime": None}, {"Name": "slave2", "LagTime": None}]} self.outdata2 = {"Slaves": [{"Name": "slave1", "LagTime": None}, {"Name": "slave2", "LagTime": None}, {"Name": "slave3", "LagTime": None}]} self.final_list = {"Slaves": [{"Name": "slave1", "LagTime": None}, {"Name": "slave2", "LagTime": None}, {"Name": "slave3", "LagTime": None}]} def test_no_slv_miss(self): """Function: test_no_slv_miss Description: Test with no slave missing. Arguments: """ self.assertEqual(mysql_rep_admin.add_miss_slaves(self.master, self.outdata2), self.final_list) def test_one_slv_miss(self): """Function: test_one_slv_miss Description: Test with one slave missing. Arguments: """ self.assertEqual(mysql_rep_admin.add_miss_slaves(self.master, self.outdata), self.final_list) if __name__ == "__main__": unittest.main()
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 2, 40984, 357, 52, 8, 198, 198, 37811, 15167, 25, 220, 751, 62, 3927, 62, 6649, 3080, 13, 9078, 628, 220, 220, 220, 12489, 25, 220, 11801, 4856, 286, 751, 62, 3927, 62, 6649, 3080, 287, 48761, 62, 7856, 62, 28482, 13, 9078, 13, 628, 220, 220, 220, 29566, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1332, 14, 20850, 14, 28744, 13976, 62, 7856, 62, 28482, 14, 2860, 62, 3927, 62, 6649, 3080, 13, 9078, 628, 220, 220, 220, 20559, 2886, 25, 198, 198, 37811, 198, 198, 2, 46267, 290, 8060, 15965, 2977, 198, 198, 2, 8997, 198, 11748, 25064, 198, 11748, 28686, 198, 198, 361, 25064, 13, 9641, 62, 10951, 1279, 357, 17, 11, 767, 2599, 198, 220, 220, 220, 1330, 555, 715, 395, 17, 355, 555, 715, 395, 198, 17772, 25, 198, 220, 220, 220, 1330, 555, 715, 395, 198, 198, 2, 10467, 12, 10608, 198, 198, 2, 10714, 198, 17597, 13, 6978, 13, 33295, 7, 418, 13, 1136, 66, 16993, 28955, 198, 11748, 48761, 62, 7856, 62, 28482, 198, 11748, 2196, 198, 198, 834, 9641, 834, 796, 2196, 13, 834, 9641, 834, 628, 198, 4871, 5599, 6207, 7, 15252, 2599, 628, 220, 220, 220, 37227, 9487, 25, 220, 5599, 6207, 628, 220, 220, 220, 12489, 25, 220, 5016, 17071, 15762, 329, 48761, 62, 4871, 13, 18254, 6207, 1398, 13, 628, 220, 220, 220, 25458, 25, 198, 220, 220, 220, 220, 220, 220, 220, 11593, 15003, 834, 198, 220, 220, 220, 220, 220, 220, 220, 905, 62, 6649, 85, 62, 4774, 82, 628, 220, 220, 220, 37227, 628, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 2599, 628, 220, 220, 220, 220, 220, 220, 220, 37227, 17410, 25, 220, 11593, 15003, 834, 628, 220, 220, 220, 220, 220, 220, 220, 12489, 25, 220, 5016, 37588, 13, 628, 220, 220, 220, 220, 220, 220, 220, 20559, 2886, 25, 628, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 3672, 796, 366, 18254, 62, 5376, 1, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 6649, 85, 62, 4774, 82, 796, 685, 4895, 17932, 1298, 366, 36341, 16, 25719, 19779, 17932, 1298, 366, 36341, 17, 25719, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19779, 17932, 1298, 366, 36341, 18, 20662, 60, 628, 220, 220, 220, 825, 905, 62, 6649, 85, 62, 4774, 82, 7, 944, 2599, 628, 220, 220, 220, 220, 220, 220, 220, 37227, 17410, 25, 220, 905, 62, 6649, 85, 62, 4774, 82, 628, 220, 220, 220, 220, 220, 220, 220, 12489, 25, 220, 41135, 2446, 15762, 329, 38795, 6207, 13, 1136, 62, 8056, 62, 14269, 13, 628, 220, 220, 220, 220, 220, 220, 220, 20559, 2886, 25, 628, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 6649, 85, 62, 4774, 82, 628, 198, 4871, 11801, 14402, 7, 403, 715, 395, 13, 14402, 20448, 2599, 628, 220, 220, 220, 37227, 9487, 25, 220, 11801, 14402, 628, 220, 220, 220, 12489, 25, 220, 5016, 543, 318, 257, 10552, 286, 257, 4326, 4856, 13, 628, 220, 220, 220, 25458, 25, 198, 220, 220, 220, 220, 220, 220, 220, 900, 4933, 198, 220, 220, 220, 220, 220, 220, 220, 1332, 62, 3919, 62, 6649, 85, 62, 3927, 198, 220, 220, 220, 220, 220, 220, 220, 1332, 62, 505, 62, 6649, 85, 62, 3927, 628, 220, 220, 220, 37227, 628, 220, 220, 220, 825, 900, 4933, 7, 944, 2599, 628, 220, 220, 220, 220, 220, 220, 220, 37227, 22203, 25, 220, 900, 4933, 628, 220, 220, 220, 220, 220, 220, 220, 12489, 25, 220, 20768, 1634, 329, 4326, 4856, 13, 628, 220, 220, 220, 220, 220, 220, 220, 20559, 2886, 25, 628, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 9866, 796, 5599, 6207, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 448, 7890, 796, 19779, 11122, 3080, 1298, 685, 4895, 5376, 1298, 366, 36341, 16, 1600, 366, 43, 363, 7575, 1298, 6045, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19779, 5376, 1298, 366, 36341, 17, 1600, 366, 43, 363, 7575, 1298, 6045, 92, 48999, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 448, 7890, 17, 796, 19779, 11122, 3080, 1298, 685, 4895, 5376, 1298, 366, 36341, 16, 1600, 366, 43, 363, 7575, 1298, 6045, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19779, 5376, 1298, 366, 36341, 17, 1600, 366, 43, 363, 7575, 1298, 6045, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19779, 5376, 1298, 366, 36341, 18, 1600, 366, 43, 363, 7575, 1298, 6045, 92, 48999, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 20311, 62, 4868, 796, 19779, 11122, 3080, 1298, 685, 4895, 5376, 1298, 366, 36341, 16, 1600, 366, 43, 363, 7575, 1298, 6045, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19779, 5376, 1298, 366, 36341, 17, 1600, 366, 43, 363, 7575, 1298, 6045, 5512, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 19779, 5376, 1298, 366, 36341, 18, 1600, 366, 43, 363, 7575, 1298, 6045, 92, 48999, 628, 220, 220, 220, 825, 1332, 62, 3919, 62, 6649, 85, 62, 3927, 7, 944, 2599, 628, 220, 220, 220, 220, 220, 220, 220, 37227, 22203, 25, 220, 1332, 62, 3919, 62, 6649, 85, 62, 3927, 628, 220, 220, 220, 220, 220, 220, 220, 12489, 25, 220, 6208, 351, 645, 11778, 4814, 13, 628, 220, 220, 220, 220, 220, 220, 220, 20559, 2886, 25, 628, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 28744, 13976, 62, 7856, 62, 28482, 13, 2860, 62, 3927, 62, 6649, 3080, 7, 944, 13, 9866, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 448, 7890, 17, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 20311, 62, 4868, 8, 628, 220, 220, 220, 825, 1332, 62, 505, 62, 6649, 85, 62, 3927, 7, 944, 2599, 628, 220, 220, 220, 220, 220, 220, 220, 37227, 22203, 25, 220, 1332, 62, 505, 62, 6649, 85, 62, 3927, 628, 220, 220, 220, 220, 220, 220, 220, 12489, 25, 220, 6208, 351, 530, 11778, 4814, 13, 628, 220, 220, 220, 220, 220, 220, 220, 20559, 2886, 25, 628, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 28744, 13976, 62, 7856, 62, 28482, 13, 2860, 62, 3927, 62, 6649, 3080, 7, 944, 13, 9866, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 448, 7890, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 20311, 62, 4868, 8, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
2.005525
1,448
# -*- coding: utf-8 -*- """ Created on Fri Dec 4 17:53:50 2020 @author: behnood """ from __future__ import print_function import matplotlib.pyplot as plt #%matplotlib inline import os #os.environ['CUDA_VISIBLE_DEVICES'] = '3' import numpy as np from models import * import torch import torch.optim from skimage.measure import compare_psnr from skimage.measure import compare_mse from utils.denoising_utils import * from skimage._shared import * from skimage.util import * from skimage.metrics.simple_metrics import _as_floats from skimage.metrics.simple_metrics import mean_squared_error from UtilityMine import * from utils.sr_utils import tv_loss from numpy import linalg as LA torch.backends.cudnn.enabled = True torch.backends.cudnn.benchmark =True dtype = torch.cuda.FloatTensor PLOT = False import scipy.io #%% #%% fname2 = "Data/DC2/Y_clean.mat" mat2 = scipy.io.loadmat(fname2) img_np_gt = mat2["Y_clean"] img_np_gt = img_np_gt.transpose(2,0,1) [p1, nr1, nc1] = img_np_gt.shape #%% fname3 = "Data/DC2/XT.mat" mat3 = scipy.io.loadmat(fname3) A_true_np = mat3["XT"] #%% fname4 = "Data/DC2/EE.mat" mat4 = scipy.io.loadmat(fname4) EE = mat4["EE"] #%% LibS=EE.shape[1] #%% npar=np.zeros((1,3)) npar[0,0]=14.7 npar[0,1]=46.5 npar[0,2]=147 #npar[0,3]=367 tol1=npar.shape[1] tol2=1 save_result=False import time from tqdm import tqdm rmax=9 for fi in tqdm(range(tol1)): for fj in tqdm(range(tol2)): #%% img_np_gt=np.clip(img_np_gt, 0, 1) img_noisy_np = add_noise(img_np_gt, 1/npar[0,fi])#11.55 20 dB, 36.7 30 dB, 116.5 40 dB print(compare_snr(img_np_gt, img_noisy_np)) img_resh=np.reshape(img_noisy_np,(p1,nr1*nc1)) V, SS, U = scipy.linalg.svd(img_resh, full_matrices=False) PC=np.diag(SS)@U img_resh_DN=V[:,:rmax]@PC[:rmax,:] img_noisy_np=np.reshape(np.clip(img_resh_DN, 0, 1),(p1,nr1,nc1)) INPUT = 'noise' # 'meshgrid' pad = 'reflection' need_bias=True OPT_OVER = 'net' # 'net,input' # reg_noise_std = 0.0 LR1 = 0.001 OPTIMIZER1='adam'# 'RMSprop'#'adam' # 'LBFGS' show_every = 500 exp_weight=0.99 if fi==0: num_iter1 = 4000 elif fi==1: num_iter1 = 8000 elif fi==2: num_iter1 = 12000 input_depth =img_noisy_np.shape[0] net1 = CAE_AbEst() net1.cuda() print(net1) # Compute number of parameters s = sum([np.prod(list(p11.size())) for p11 in net1.parameters()]); print ('Number of params: %d' % s) # Loss mse = torch.nn.MSELoss().type(dtype) img_noisy_torch = np_to_torch(img_noisy_np).type(dtype) # if fk==0: net_input1 = get_noise(input_depth, INPUT, (img_noisy_np.shape[1], img_noisy_np.shape[2])).type(dtype).detach() # net_input1 = img_noisy_torch E_torch = np_to_torch(EE).type(dtype) #%% net_input_saved = net_input1.detach().clone() noise = net_input1.detach().clone() out_avg = None out_HR_avg= None last_net = None RMSE_LR_last = 0 loss=np.zeros((num_iter1,1)) AE=np.zeros((num_iter1,1)) i = 0 p11 = get_params(OPT_OVER, net1, net_input1) optimize(OPTIMIZER1, p11, closure1, LR1, num_iter1) if 1: out_LR_np = out_LR.detach().cpu().squeeze().numpy() out_avg_np = out_avg.detach().cpu().squeeze().numpy() MAE_LR_avg= 100*np.mean(abs(A_true_np.astype(np.float32)- np.clip(out_avg_np, 0, 1))) MAE_LR= 100*np.mean(abs(A_true_np.astype(np.float32)- np.clip(out_LR_np, 0, 1))) SRE=10*np.log10(LA.norm(A_true_np.astype(np.float32).reshape((EE.shape[1],nr1*nc1)),'fro')/LA.norm((A_true_np.astype(np.float32)- np.clip(out_LR_np, 0, 1)).reshape((EE.shape[1],nr1*nc1)),'fro')) SRE_avg=10*np.log10(LA.norm(A_true_np.astype(np.float32).reshape((EE.shape[1],nr1*nc1)),'fro')/LA.norm((A_true_np.astype(np.float32)- np.clip(out_avg_np, 0, 1)).reshape((EE.shape[1],nr1*nc1)),'fro')) print ('Iteration %05d MAE_LR: %f MAE_LR_avg: %f SRE: %f SRE_avg: %f ' % (i, MAE_LR, MAE_LR_avg, SRE, SRE_avg), '\r', end='') # if save_result is True: # scipy.io.savemat("C:/Users/behnood/Desktop/Sparse Unmixing/Results/Sim2/demo1/10runs/out_avg_np%01d%01d.mat" % (fi+2,fj+1), # {'out_avg_np%01d%01d' % (fi+2, fj+1):out_avg_np.transpose(1,2,0)}) # scipy.io.savemat("C:/Users/behnood/Desktop/Sparse Unmixing/Results/Sim2/demo1/10runs/out_LR_np%01d%01d.mat" % (fi+2,fj+1), # {'out_LR_np%01d%01d' % (fi+2, fj+1):out_LR_np.transpose(1,2,0)}) #%%
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 37811, 201, 198, 41972, 319, 19480, 4280, 220, 604, 1596, 25, 4310, 25, 1120, 12131, 201, 198, 201, 198, 31, 9800, 25, 1372, 77, 702, 201, 198, 37811, 201, 198, 201, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 201, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 201, 198, 2, 4, 6759, 29487, 8019, 26098, 201, 198, 201, 198, 11748, 28686, 201, 198, 2, 418, 13, 268, 2268, 17816, 43633, 5631, 62, 29817, 34563, 62, 39345, 34444, 20520, 796, 705, 18, 6, 201, 198, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 6738, 4981, 1330, 1635, 201, 198, 201, 198, 11748, 28034, 201, 198, 11748, 28034, 13, 40085, 201, 198, 201, 198, 6738, 1341, 9060, 13, 1326, 5015, 1330, 8996, 62, 862, 48624, 201, 198, 6738, 1341, 9060, 13, 1326, 5015, 1330, 8996, 62, 76, 325, 201, 198, 6738, 3384, 4487, 13, 6559, 78, 1710, 62, 26791, 1330, 1635, 201, 198, 201, 198, 6738, 1341, 9060, 13557, 28710, 1330, 1635, 201, 198, 6738, 1341, 9060, 13, 22602, 1330, 1635, 201, 198, 6738, 1341, 9060, 13, 4164, 10466, 13, 36439, 62, 4164, 10466, 1330, 4808, 292, 62, 48679, 1381, 201, 198, 6738, 1341, 9060, 13, 4164, 10466, 13, 36439, 62, 4164, 10466, 1330, 1612, 62, 16485, 1144, 62, 18224, 201, 198, 201, 198, 201, 198, 6738, 34030, 24461, 1330, 1635, 201, 198, 6738, 3384, 4487, 13, 27891, 62, 26791, 1330, 31557, 62, 22462, 201, 198, 6738, 299, 32152, 1330, 300, 1292, 70, 355, 9131, 201, 198, 201, 198, 13165, 354, 13, 1891, 2412, 13, 66, 463, 20471, 13, 25616, 796, 6407, 201, 198, 13165, 354, 13, 1891, 2412, 13, 66, 463, 20471, 13, 26968, 4102, 796, 17821, 201, 198, 67, 4906, 796, 28034, 13, 66, 15339, 13, 43879, 51, 22854, 201, 198, 201, 198, 6489, 2394, 796, 10352, 201, 198, 201, 198, 11748, 629, 541, 88, 13, 952, 201, 198, 2, 16626, 201, 198, 2, 16626, 201, 198, 69, 3672, 17, 220, 796, 366, 6601, 14, 9697, 17, 14, 56, 62, 27773, 13, 6759, 1, 201, 198, 6759, 17, 796, 629, 541, 88, 13, 952, 13, 2220, 6759, 7, 69, 3672, 17, 8, 201, 198, 9600, 62, 37659, 62, 13655, 796, 2603, 17, 14692, 56, 62, 27773, 8973, 201, 198, 9600, 62, 37659, 62, 13655, 796, 33705, 62, 37659, 62, 13655, 13, 7645, 3455, 7, 17, 11, 15, 11, 16, 8, 201, 198, 58, 79, 16, 11, 299, 81, 16, 11, 299, 66, 16, 60, 796, 33705, 62, 37659, 62, 13655, 13, 43358, 201, 198, 2, 16626, 201, 198, 69, 3672, 18, 220, 796, 366, 6601, 14, 9697, 17, 14, 25010, 13, 6759, 1, 201, 198, 6759, 18, 796, 629, 541, 88, 13, 952, 13, 2220, 6759, 7, 69, 3672, 18, 8, 201, 198, 32, 62, 7942, 62, 37659, 796, 2603, 18, 14692, 25010, 8973, 201, 198, 201, 198, 2, 16626, 201, 198, 69, 3672, 19, 220, 796, 366, 6601, 14, 9697, 17, 14, 6500, 13, 6759, 1, 201, 198, 6759, 19, 796, 629, 541, 88, 13, 952, 13, 2220, 6759, 7, 69, 3672, 19, 8, 201, 198, 6500, 796, 2603, 19, 14692, 6500, 8973, 201, 198, 2, 16626, 201, 198, 25835, 50, 28, 6500, 13, 43358, 58, 16, 60, 201, 198, 2, 16626, 201, 198, 77, 1845, 28, 37659, 13, 9107, 418, 19510, 16, 11, 18, 4008, 201, 198, 77, 1845, 58, 15, 11, 15, 22241, 1415, 13, 22, 201, 198, 77, 1845, 58, 15, 11, 16, 22241, 3510, 13, 20, 201, 198, 77, 1845, 58, 15, 11, 17, 22241, 20198, 201, 198, 2, 77, 1845, 58, 15, 11, 18, 22241, 27824, 201, 198, 83, 349, 16, 28, 77, 1845, 13, 43358, 58, 16, 60, 201, 198, 83, 349, 17, 28, 16, 201, 198, 21928, 62, 20274, 28, 25101, 201, 198, 11748, 640, 201, 198, 6738, 256, 80, 36020, 1330, 256, 80, 36020, 201, 198, 81, 9806, 28, 24, 201, 198, 1640, 25912, 287, 256, 80, 36020, 7, 9521, 7, 83, 349, 16, 8, 2599, 201, 198, 220, 220, 220, 329, 277, 73, 287, 256, 80, 36020, 7, 9521, 7, 83, 349, 17, 8, 2599, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 16626, 201, 198, 220, 220, 220, 220, 220, 220, 220, 33705, 62, 37659, 62, 13655, 28, 37659, 13, 15036, 7, 9600, 62, 37659, 62, 13655, 11, 657, 11, 352, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 33705, 62, 3919, 13560, 62, 37659, 796, 751, 62, 3919, 786, 7, 9600, 62, 37659, 62, 13655, 11, 352, 14, 77, 1845, 58, 15, 11, 12463, 12962, 2, 1157, 13, 2816, 1160, 30221, 11, 4570, 13, 22, 1542, 30221, 11, 18693, 13, 20, 2319, 30221, 201, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 5589, 533, 62, 16184, 81, 7, 9600, 62, 37659, 62, 13655, 11, 33705, 62, 3919, 13560, 62, 37659, 4008, 201, 198, 220, 220, 220, 220, 220, 220, 220, 33705, 62, 3447, 28, 37659, 13, 3447, 1758, 7, 9600, 62, 3919, 13560, 62, 37659, 11, 7, 79, 16, 11, 48624, 16, 9, 10782, 16, 4008, 201, 198, 220, 220, 220, 220, 220, 220, 220, 569, 11, 6723, 11, 471, 796, 629, 541, 88, 13, 75, 1292, 70, 13, 82, 20306, 7, 9600, 62, 3447, 11, 1336, 62, 6759, 45977, 28, 25101, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 4217, 28, 37659, 13, 10989, 363, 7, 5432, 8, 31, 52, 201, 198, 220, 220, 220, 220, 220, 220, 220, 33705, 62, 3447, 62, 35504, 28, 53, 58, 45299, 25, 81, 9806, 60, 31, 5662, 58, 25, 81, 9806, 11, 47715, 201, 198, 220, 220, 220, 220, 220, 220, 220, 33705, 62, 3919, 13560, 62, 37659, 28, 37659, 13, 3447, 1758, 7, 37659, 13, 15036, 7, 9600, 62, 3447, 62, 35504, 11, 657, 11, 352, 828, 7, 79, 16, 11, 48624, 16, 11, 10782, 16, 4008, 201, 198, 220, 220, 220, 220, 220, 220, 220, 3268, 30076, 796, 705, 3919, 786, 6, 1303, 705, 76, 5069, 25928, 6, 201, 198, 220, 220, 220, 220, 220, 220, 220, 14841, 796, 705, 5420, 1564, 6, 201, 198, 220, 220, 220, 220, 220, 220, 220, 761, 62, 65, 4448, 28, 17821, 201, 198, 220, 220, 220, 220, 220, 220, 220, 39852, 62, 41983, 796, 705, 3262, 6, 1303, 705, 3262, 11, 15414, 6, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 842, 62, 3919, 786, 62, 19282, 796, 657, 13, 15, 201, 198, 220, 220, 220, 220, 220, 220, 220, 37491, 16, 796, 657, 13, 8298, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 39852, 3955, 14887, 1137, 16, 11639, 324, 321, 6, 2, 705, 49, 5653, 22930, 6, 2, 6, 324, 321, 6, 1303, 705, 43, 29499, 14313, 6, 201, 198, 220, 220, 220, 220, 220, 220, 220, 905, 62, 16833, 796, 5323, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1033, 62, 6551, 28, 15, 13, 2079, 201, 198, 220, 220, 220, 220, 220, 220, 220, 611, 25912, 855, 15, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 997, 62, 2676, 16, 796, 30123, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 25912, 855, 16, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 997, 62, 2676, 16, 796, 38055, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 25912, 855, 17, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 997, 62, 2676, 16, 796, 1105, 830, 201, 198, 220, 220, 220, 220, 220, 220, 220, 5128, 62, 18053, 796, 9600, 62, 3919, 13560, 62, 37659, 13, 43358, 58, 15, 60, 201, 198, 201, 198, 220, 220, 220, 220, 220, 220, 220, 2010, 16, 796, 7257, 36, 62, 4826, 22362, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 2010, 16, 13, 66, 15339, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7, 3262, 16, 8, 201, 198, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 3082, 1133, 1271, 286, 10007, 201, 198, 220, 220, 220, 220, 220, 220, 220, 264, 220, 796, 2160, 26933, 37659, 13, 1676, 67, 7, 4868, 7, 79, 1157, 13, 7857, 3419, 4008, 329, 279, 1157, 287, 2010, 16, 13, 17143, 7307, 3419, 36563, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 19203, 15057, 286, 42287, 25, 4064, 67, 6, 4064, 264, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 22014, 201, 198, 220, 220, 220, 220, 220, 220, 220, 285, 325, 796, 28034, 13, 20471, 13, 5653, 3698, 793, 22446, 4906, 7, 67, 4906, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 33705, 62, 3919, 13560, 62, 13165, 354, 796, 45941, 62, 1462, 62, 13165, 354, 7, 9600, 62, 3919, 13560, 62, 37659, 737, 4906, 7, 67, 4906, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 611, 277, 74, 855, 15, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 2010, 62, 15414, 16, 796, 651, 62, 3919, 786, 7, 15414, 62, 18053, 11, 3268, 30076, 11, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 357, 9600, 62, 3919, 13560, 62, 37659, 13, 43358, 58, 16, 4357, 33705, 62, 3919, 13560, 62, 37659, 13, 43358, 58, 17, 12962, 737, 4906, 7, 67, 4906, 737, 15255, 620, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 2010, 62, 15414, 16, 796, 33705, 62, 3919, 13560, 62, 13165, 354, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 412, 62, 13165, 354, 796, 45941, 62, 1462, 62, 13165, 354, 7, 6500, 737, 4906, 7, 67, 4906, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 16626, 201, 198, 220, 220, 220, 220, 220, 220, 220, 2010, 62, 15414, 62, 82, 9586, 796, 2010, 62, 15414, 16, 13, 15255, 620, 22446, 21018, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 7838, 796, 2010, 62, 15414, 16, 13, 15255, 620, 22446, 21018, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 615, 70, 796, 6045, 201, 198, 220, 220, 220, 220, 220, 220, 220, 503, 62, 17184, 62, 615, 70, 28, 6045, 201, 198, 220, 220, 220, 220, 220, 220, 220, 938, 62, 3262, 796, 6045, 201, 198, 220, 220, 220, 220, 220, 220, 220, 29820, 5188, 62, 35972, 62, 12957, 796, 657, 201, 198, 220, 220, 220, 220, 220, 220, 220, 2994, 28, 37659, 13, 9107, 418, 19510, 22510, 62, 2676, 16, 11, 16, 4008, 201, 198, 220, 220, 220, 220, 220, 220, 220, 25603, 28, 37659, 13, 9107, 418, 19510, 22510, 62, 2676, 16, 11, 16, 4008, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1312, 796, 657, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 201, 198, 220, 220, 220, 220, 220, 220, 220, 279, 1157, 796, 651, 62, 37266, 7, 3185, 51, 62, 41983, 11, 2010, 16, 11, 2010, 62, 15414, 16, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 27183, 7, 3185, 51, 3955, 14887, 1137, 16, 11, 279, 1157, 11, 16512, 16, 11, 37491, 16, 11, 997, 62, 2676, 16, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 611, 352, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 35972, 62, 37659, 796, 503, 62, 35972, 13, 15255, 620, 22446, 36166, 22446, 16485, 1453, 2736, 22446, 77, 32152, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 503, 62, 615, 70, 62, 37659, 796, 503, 62, 615, 70, 13, 15255, 620, 22446, 36166, 22446, 16485, 1453, 2736, 22446, 77, 32152, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8779, 36, 62, 35972, 62, 615, 70, 28, 1802, 9, 37659, 13, 32604, 7, 8937, 7, 32, 62, 7942, 62, 37659, 13, 459, 2981, 7, 37659, 13, 22468, 2624, 13219, 45941, 13, 15036, 7, 448, 62, 615, 70, 62, 37659, 11, 657, 11, 352, 22305, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8779, 36, 62, 35972, 28, 1802, 9, 37659, 13, 32604, 7, 8937, 7, 32, 62, 7942, 62, 37659, 13, 459, 2981, 7, 37659, 13, 22468, 2624, 13219, 45941, 13, 15036, 7, 448, 62, 35972, 62, 37659, 11, 657, 11, 352, 22305, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 311, 2200, 28, 940, 9, 37659, 13, 6404, 940, 7, 13534, 13, 27237, 7, 32, 62, 7942, 62, 37659, 13, 459, 2981, 7, 37659, 13, 22468, 2624, 737, 3447, 1758, 19510, 6500, 13, 43358, 58, 16, 4357, 48624, 16, 9, 10782, 16, 36911, 6, 69, 305, 11537, 14, 13534, 13, 27237, 19510, 32, 62, 7942, 62, 37659, 13, 459, 2981, 7, 37659, 13, 22468, 2624, 13219, 45941, 13, 15036, 7, 448, 62, 35972, 62, 37659, 11, 657, 11, 352, 29720, 3447, 1758, 19510, 6500, 13, 43358, 58, 16, 4357, 48624, 16, 9, 10782, 16, 36911, 6, 69, 305, 6, 4008, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 311, 2200, 62, 615, 70, 28, 940, 9, 37659, 13, 6404, 940, 7, 13534, 13, 27237, 7, 32, 62, 7942, 62, 37659, 13, 459, 2981, 7, 37659, 13, 22468, 2624, 737, 3447, 1758, 19510, 6500, 13, 43358, 58, 16, 4357, 48624, 16, 9, 10782, 16, 36911, 6, 69, 305, 11537, 14, 13534, 13, 27237, 19510, 32, 62, 7942, 62, 37659, 13, 459, 2981, 7, 37659, 13, 22468, 2624, 13219, 45941, 13, 15036, 7, 448, 62, 615, 70, 62, 37659, 11, 657, 11, 352, 29720, 3447, 1758, 19510, 6500, 13, 43358, 58, 16, 4357, 48624, 16, 9, 10782, 16, 36911, 6, 69, 305, 6, 4008, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 19203, 29993, 341, 4064, 2713, 67, 220, 8779, 36, 62, 35972, 25, 4064, 69, 8779, 36, 62, 35972, 62, 615, 70, 25, 4064, 69, 220, 311, 2200, 25, 4064, 69, 311, 2200, 62, 615, 70, 25, 4064, 69, 705, 4064, 357, 72, 11, 8779, 36, 62, 35972, 11, 8779, 36, 62, 35972, 62, 615, 70, 11, 311, 2200, 11, 311, 2200, 62, 615, 70, 828, 705, 59, 81, 3256, 886, 28, 7061, 8, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 611, 220, 3613, 62, 20274, 318, 6407, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 629, 541, 88, 13, 952, 13, 21928, 6759, 7203, 34, 14079, 14490, 14, 20709, 77, 702, 14, 36881, 14, 50, 29572, 791, 19816, 278, 14, 25468, 14, 8890, 17, 14, 9536, 78, 16, 14, 940, 48381, 14, 448, 62, 615, 70, 62, 37659, 4, 486, 67, 4, 486, 67, 13, 6759, 1, 4064, 357, 12463, 10, 17, 11, 69, 73, 10, 16, 828, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1391, 6, 448, 62, 615, 70, 62, 37659, 4, 486, 67, 4, 486, 67, 6, 4064, 357, 12463, 10, 17, 11, 277, 73, 10, 16, 2599, 448, 62, 615, 70, 62, 37659, 13, 7645, 3455, 7, 16, 11, 17, 11, 15, 8, 30072, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 629, 541, 88, 13, 952, 13, 21928, 6759, 7203, 34, 14079, 14490, 14, 20709, 77, 702, 14, 36881, 14, 50, 29572, 791, 19816, 278, 14, 25468, 14, 8890, 17, 14, 9536, 78, 16, 14, 940, 48381, 14, 448, 62, 35972, 62, 37659, 4, 486, 67, 4, 486, 67, 13, 6759, 1, 4064, 357, 12463, 10, 17, 11, 69, 73, 10, 16, 828, 201, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1391, 6, 448, 62, 35972, 62, 37659, 4, 486, 67, 4, 486, 67, 6, 4064, 357, 12463, 10, 17, 11, 277, 73, 10, 16, 2599, 448, 62, 35972, 62, 37659, 13, 7645, 3455, 7, 16, 11, 17, 11, 15, 8, 30072, 201, 198, 2, 16626, 201, 198 ]
1.796438
2,751
if __name__ == '__main__': run()
[ 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1057, 3419 ]
2.166667
18
''' Created : Jan 16, 2017 Last major update : June 29, 2017 @author: Alexandre Day Purpose: Fast density clustering ''' import numpy as np import time from numpy.random import random import sys, os from .density_estimation import KDE import pickle from collections import OrderedDict as OD from sklearn.neighbors import NearestNeighbors import multiprocessing class FDC: """ Fast Density Clustering via kernel density modelling for low-dimensional data (D <~ 8) Parameters ---------- nh_size : int, optional (default = 'auto') Neighborhood size. This is the scale used for identifying the initial modes in the density distribution, regardless of the covariance. If a point has the maximum density among it's nh_size neighbors, it is marked as a potential cluster center. 'auto' means that the nh_size is scaled with number of samples. We use nh_size = 100 for 10000 samples. The minimum neighborhood size is set to 10. eta : float, optional (default = 0.4) Noise threshold used to merge clusters. This is done by quenching directly to the specified noise threshold (as opposed to progressively coarse-graining). The noise threshold determines the extended neighborhood of cluster centers. Points that have a relative density difference of less than "noise_threshold" and that are density-reachable, are part of the extended neighborhood. random_state: int, optional (default = 0) Random number for seeding random number generator. By default, the method generates the same results. This random is used to seed the cross-validation (set partitions) which will in turn affect the bandwitdth value test_ratio_size: float, optional (default = 0.8) Ratio size of the test set used when performing maximum likehood estimation. In order to have smooth density estimations (prevent overfitting), it is recommended to use a large test_ratio_size (closer to 1.0) rather than a small one. verbose: int, optional (default = 1) Set to 0 if you don't want to see print to screen. bandwidth: float, optional (default = None) If you want the bandwidth for kernel density to be set automatically or want to set it yourself. By default it is set automatically. merge: bool, optinal (default = True) Optional merging at zero noise threshold, merges overlapping minimal clusters atol: float, optional (default = 0.000005) kernel density estimate precision parameter. determines the precision used for kde. smaller values leads to slower execution but better precision rtol: float, optional (default = 0.00005) kernel density estimate precision parameter. determines the precision used for kde. smaller values leads to slower execution but better precision xtol: float, optional (default = 0.01) precision parameter for optimizing the bandwidth using maximum likelihood on a test set search_size: int, optional (default = 20) when performing search over neighborhoods, size of each local neighborhood to check when expanding. This drastically slows the coarse-graining if chosen to be too big ! kernel: str, optional (default='gaussian') Type of Kernel to use for density estimates. Other options are {'epanechnikov'|'linear','tophat'}. """ def fit(self, X): """ Performs density clustering on given data set Parameters ---------- X : array, (n_sample, n_feature) Data to cluster. Returns ---------- self : fdc object To obtain new cluster labels use self.cluster_label """ t = time.time() self.X = X # shallow copy self.n_sample = X.shape[0] if self.n_sample < 10: assert False, "Too few samples for computing densities !" if self.nh_size is 'auto': self.nh_size = max([int(25*np.log10(self.n_sample)), 10]) if self.search_size > self.nh_size: self.search_size = self.nh_size if self.verbose == 0: blockPrint() self.display_main_parameters() print("[fdc] Starting clustering with n=%i samples..." % X.shape[0]) start = time.time() print("[fdc] Fitting kernel model for density estimation ...") self.fit_density(X) #print("here") print("[fdc] Finding centers ...") self.compute_delta(X, self.rho) print("[fdc] Found %i potential centers ..." % self.idx_centers_unmerged.shape[0]) # temporary idx for the centers : self.idx_centers = self.idx_centers_unmerged self.cluster_label = assign_cluster(self.idx_centers_unmerged, self.nn_delta, self.density_graph) if self.merge: # usually by default one should perform this minimal merging .. print("[fdc] Merging overlapping minimal clusters ...") self.check_cluster_stability_fast(X, 0.) # given if self.eta >= 1e-3 : print("[fdc] Iterating up to specified noise threshold ...") self.check_cluster_stability_fast(X, self.eta) # merging 'unstable' clusters print("[fdc] Done in %.3f s" % (time.time()-start)) enablePrint() return self def save(self, name=None): """ Saves current model to specified path 'name' """ if name is None: fname = self.make_file_name() else: fname = name fopen = open(fname,'wb') pickle.dump(self,fopen) fopen.close() return fname def f_tmp(self, X_, i_): """evaluating density and keeping track of threading order""" return (i_, self.density_model.evaluate_density(X_)) #@profile def coarse_grain(self, noise_iterable): """Started from an initial noise scale, progressively merges clusters. If specified, saves the cluster assignments at every level of the coarse graining. Parameters ----------- noise_iterable : iterable of floats Should be an iterable containg noise values at which to perform coarse graining. Usually one should start from 0 and go to larger values by small increments. The whole clustering information is stored in self.hierarchy Return ------ self """ if self.verbose == 0: blockPrint() print("[fdc] Coarse graining until desired noise threshold ...") noise_range = [n for n in noise_iterable] #hierarchy = [] self.max_noise = -1 n_cluster = 0 # note to self, if no merger is done, no need to store hierarchy ... just work with noise_range dict ... for nt in noise_range: if self.n_cluster_init is not None: if len(self.idx_centers) <= self.n_cluster_init: print("[fdc.py] Reached number of specified clusters [= %i] (or close to), n_cluster = %i"%(self.n_cluster_init,len(self.idx_centers))) break self.check_cluster_stability_fast(self.X, eta = nt) #hierarchy.append(OD({'idx_centers': self.idx_centers, 'cluster_labels': self.cluster_label})) # -> the only required information <- if len(self.idx_centers) != n_cluster: n_cluster = len(self.idx_centers) self.max_noise = nt #self.hierarchy = hierarchy self.noise_range = noise_range self.noise_threshold = noise_range[-1] enablePrint() return self #@profile def compute_delta(self, X, rho = None): """ Purpose: Computes distance to nearest-neighbor with higher density Return: delta,nn_delta,idx_centers,density_graph :delta: distance to n.n. with higher density (within some neighborhood cutoff) :nn_delta: index of n.n. with ... :idx_centers: list of points that have the largest density in their neigborhood cutoff :density_graph: for every point, list of points are incoming (via the density gradient) """ if rho is None: rho = self.rho n_sample, n_feature = X.shape maxdist = np.linalg.norm([np.max(X[:,i])-np.min(X[:,i]) for i in range(n_feature)]) delta = maxdist*np.ones(n_sample, dtype=np.float) nn_delta = np.ones(n_sample, dtype=np.int) density_graph = [[] for i in range(n_sample)] # store incoming leaves ### -----------> nn_list = self.nn_list # restricted over neighborhood (nh_size) ### -----------> for i in range(n_sample): idx = index_greater(rho[nn_list[i]]) if idx: density_graph[nn_list[i,idx]].append(i) nn_delta[i] = nn_list[i,idx] delta[i] = self.nn_dist[i,idx] else: nn_delta[i]=-1 idx_centers=np.array(range(n_sample))[delta > 0.999*maxdist] self.delta = delta self.nn_delta = nn_delta self.idx_centers_unmerged = idx_centers self.density_graph = density_graph return self def estimate_eta(self): """ Based on the density distribution, computes a scale for eta Need more experimenting, this is not quite working ... """ from matplotlib import pyplot as plt idx = int(self.n_sample/10.) idx = np.argsort(self.rho)[:-5*idx]#[2:idx:4*idx] drho = [] for i in idx: rho_init = self.rho[i] nn_i = self.nn_delta[i] while nn_i != -1: rho_c = self.rho[nn_i] nn_i = self.nn_delta[nn_i] drho.append(rho_c- rho_init) """ plt.his(drho,bins=60) plt.show() exit() """ eta = np.mean(drho)#+0.5*np.std(drho) self.cout("Using std eta of %.3f"%eta) return eta """ def get_cluster_info(self, eta = None): if eta is None: return self.cluster_label, self.idx_centers else: pos = np.argmin(np.abs(np.array(self.noise_range)-eta)) #delta_ = self.noise_range[pos] #idx_centers = self.hierarchy[pos]['idx_centers'] cluster_label = self.hierarchy[pos]['cluster_labels'] idx_center = self.hierarchy[pos]['idx_centers'] return cluster_label, idx_center """ """ def update_labels(self, idx_centers, cluster_label): self.idx_centers = idx_centers self.cluster_label = cluster_label """ #@profile def find_NH_tree_search(self, idx, eta, cluster_label): """ Function for searching for nearest neighbors within some density threshold. NH should be an empty set for the inital function call. Note to myself : lots of optimization, this is pretty time/memory consumming ! Parameters ----------- idx : int index of the cluster centroid to start from eta : float maximum density you can spill over (this is "density_center - eta") cluster_label: array of int cluster label for every datapoint. Returns ----------- List of points in the neighborhood of point idx : 1D array """ rho = self.rho zero_array = np.zeros(len(self.nn_list),dtype=bool) nn_list = self.nn_list zero_array[nn_list[idx, :self.search_size]] = True new_leaves = zero_array is_NH = (rho > eta) & (new_leaves) current_label = cluster_label[idx] # This could probably be improved, but at least it's fully vectorized and scalable (NlogN in time and N in memory) while True: update = False leaves=np.copy(new_leaves) #y_leave = cluster_label[leaves] leaves_cluster = (leaves) & (cluster_label == current_label) new_leaves=np.zeros(len(self.nn_list), dtype=bool) nn_leaf = np.unique(nn_list[leaves_cluster][:self.search_size].flatten()) res = nn_leaf[is_NH[nn_leaf]==False] pos = np.where(rho[res] > eta)[0] if len(pos) > 0: update=True is_NH[res[pos]] = True new_leaves[res[pos]] = True if update is False: break return np.where(is_NH)[0] def find_NH_tree_search_v1(self, idx, eta, cluster_label): """ Function for searching for nearest neighbors within some density threshold. NH should be an empty set for the inital function call. Note to myself : lots of optimization, this is pretty time consumming ! Returns ----------- List of points in the neighborhood of point idx : 1D array """ rho = self.rho nn_list = self.nn_list new_leaves=nn_list[idx][:self.search_size] is_NH = np.zeros(len(self.nn_list),dtype=np.int) is_NH[new_leaves[rho[new_leaves] > eta]] = 1 current_label = cluster_label[idx] # ideally here we cythonize what's below... this is highly ineficient ... while True: update = False leaves=np.hstack(new_leaves) new_leaves=[] y_leave = cluster_label[leaves] leaves_cluster = leaves[y_leave == current_label] nn_leaf = nn_list[leaves_cluster] for i in range(1, self.search_size): res = nn_leaf[is_NH[nn_leaf[:,i]] == 0, i] pos = np.where(rho[res] > eta)[0] if len(pos) > 0: update=True is_NH[res[pos]] = 1 new_leaves.append(res[pos]) if update is False: break return np.where(is_NH == 1)[0] """ def compute_coarse_grain_graph(self): graph = {} for idx in self.idx_centers: # at some scale NH = self.find_NH_tree_search(idx, eta, cluster_label) label_centers_nn = np.unique([cluster_label[ni] for ni in NH]) """ ##################################################### ##################################################### ############ utility functions below ################ ##################################################### ##################################################### def check_cluster_stability(self, X, threshold): """ Given the identified cluster centers, performs a more rigourous neighborhood search (based on some noise threshold) for points with higher densities. This is vaguely similar to a watershed cuts in image segmentation and basically makes sure we haven't identified spurious cluster centers w.r.t to some noise threshold (false positive). This has bad memory complexity, needs improvement if we want to run on N>10^5 data points. """ density_graph = self.density_graph nn_delta = self.nn_delta delta = self.delta rho = self.rho nn_list = self.nn_list idx_centers = self.idx_centers_unmerged cluster_label = self.cluster_label n_false_pos = 0 idx_true_centers = [] for idx in idx_centers: rho_center = rho[idx] delta_rho = rho_center - threshold if threshold < 1e-3: # just check nn_list ... NH=nn_list[idx][1:self.search_size] else: NH = self.find_NH_tree_search(idx, delta_rho, cluster_label) #print(len(NH)) label_centers_nn = np.unique(self.cluster_label[NH])#[cluster_label[ni] for ni in NH]) idx_max = idx_centers[ label_centers_nn[np.argmax(rho[idx_centers[label_centers_nn]])] ] rho_current = rho[idx] if ( rho_current < rho[idx_max] ) & ( idx != idx_max ) : nn_delta[idx] = idx_max delta[idx] = np.linalg.norm(X[idx_max]-X[idx]) density_graph[idx_max].append(idx) n_false_pos+=1 else: idx_true_centers.append(idx) return np.array(idx_true_centers,dtype=np.int), n_false_pos def assign_cluster(idx_centers, nn_delta, density_graph): """ Given the cluster centers and the local gradients (nn_delta) assign to every point a cluster label """ n_center = idx_centers.shape[0] n_sample = nn_delta.shape[0] cluster_label = -1*np.ones(n_sample,dtype=np.int) # reinitialized every time. for c, label in zip(idx_centers, range(n_center) ): cluster_label[c] = label assign_cluster_deep(density_graph[c], cluster_label, density_graph, label) return cluster_label def assign_cluster_deep(root,cluster_label,density_graph,label): """ Recursive function for assigning labels for a tree graph. Stopping condition is met when the root is empty (i.e. a leaf has been reached) """ if not root: # then must be a leaf ! return else: for child in root: cluster_label[child]=label assign_cluster_deep(density_graph[child],cluster_label,density_graph,label) def index_greater(array, prec=1e-8): """ Purpose: Function for finding first item in an array that has a value greater than the first element in that array If no element is found, returns None Precision: 1e-8 Return: int or None """ item=array[0] for idx, val in np.ndenumerate(array): # slow ! : could be cythonized if val > (item + prec): return idx[0] def blockPrint(): """Blocks printing to screen""" sys.stdout = open(os.devnull, 'w') def enablePrint(): """Enables printing to screen""" sys.stdout = sys.__stdout__
[ 7061, 6, 198, 41972, 1058, 2365, 1467, 11, 2177, 198, 5956, 1688, 4296, 1058, 2795, 2808, 11, 2177, 198, 198, 31, 9800, 25, 21000, 260, 3596, 628, 220, 220, 220, 32039, 25, 198, 220, 220, 220, 220, 220, 220, 220, 12549, 12109, 32966, 1586, 198, 7061, 6, 628, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 640, 198, 6738, 299, 32152, 13, 25120, 1330, 4738, 198, 11748, 25064, 11, 28686, 198, 6738, 764, 43337, 62, 395, 18991, 1330, 36632, 198, 11748, 2298, 293, 198, 6738, 17268, 1330, 14230, 1068, 35, 713, 355, 31245, 198, 6738, 1341, 35720, 13, 710, 394, 32289, 1330, 3169, 12423, 46445, 32289, 198, 11748, 18540, 305, 919, 278, 198, 220, 220, 220, 220, 198, 4871, 376, 9697, 25, 628, 220, 220, 220, 37227, 12549, 360, 6377, 1012, 436, 1586, 2884, 9720, 12109, 38591, 329, 1877, 12, 19577, 1366, 357, 35, 1279, 93, 807, 8, 628, 220, 220, 220, 40117, 198, 220, 220, 220, 24200, 438, 628, 220, 220, 220, 299, 71, 62, 7857, 1058, 493, 11, 11902, 357, 12286, 796, 705, 23736, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 37914, 2546, 13, 770, 318, 262, 5046, 973, 329, 13720, 262, 4238, 12881, 287, 262, 12109, 6082, 11, 7692, 198, 220, 220, 220, 220, 220, 220, 220, 286, 262, 44829, 590, 13, 1002, 257, 966, 468, 262, 5415, 12109, 1871, 340, 338, 299, 71, 62, 7857, 12020, 11, 340, 318, 7498, 355, 220, 198, 220, 220, 220, 220, 220, 220, 220, 257, 2785, 13946, 3641, 13, 705, 23736, 6, 1724, 326, 262, 299, 71, 62, 7857, 318, 27464, 351, 1271, 286, 8405, 13, 775, 220, 198, 220, 220, 220, 220, 220, 220, 220, 779, 299, 71, 62, 7857, 796, 1802, 329, 33028, 8405, 13, 383, 5288, 6232, 2546, 318, 900, 284, 838, 13, 198, 220, 220, 220, 220, 198, 220, 220, 220, 2123, 64, 1058, 12178, 11, 11902, 357, 12286, 796, 657, 13, 19, 8, 198, 220, 220, 220, 220, 220, 220, 220, 30964, 11387, 973, 284, 20121, 23163, 13, 770, 318, 1760, 416, 627, 268, 10813, 3264, 284, 262, 7368, 7838, 11387, 198, 220, 220, 220, 220, 220, 220, 220, 357, 292, 6886, 284, 34322, 36076, 12, 2164, 1397, 737, 383, 7838, 11387, 15947, 262, 7083, 220, 198, 220, 220, 220, 220, 220, 220, 220, 6232, 286, 13946, 10399, 13, 11045, 326, 423, 257, 3585, 12109, 3580, 286, 1342, 621, 220, 198, 220, 220, 220, 220, 220, 220, 220, 366, 3919, 786, 62, 400, 10126, 1, 290, 326, 389, 12109, 12, 16250, 540, 11, 389, 636, 286, 262, 7083, 6232, 13, 628, 220, 220, 220, 4738, 62, 5219, 25, 493, 11, 11902, 357, 12286, 796, 657, 8, 198, 220, 220, 220, 220, 220, 220, 220, 14534, 1271, 329, 384, 8228, 4738, 1271, 17301, 13, 2750, 4277, 11, 262, 198, 220, 220, 220, 220, 220, 220, 220, 2446, 18616, 262, 976, 2482, 13, 770, 4738, 318, 973, 284, 9403, 198, 220, 220, 220, 220, 220, 220, 220, 262, 3272, 12, 12102, 341, 357, 2617, 43869, 8, 543, 481, 287, 1210, 2689, 262, 4097, 39289, 67, 400, 1988, 628, 220, 220, 220, 1332, 62, 10366, 952, 62, 7857, 25, 12178, 11, 11902, 357, 12286, 796, 657, 13, 23, 8, 198, 220, 220, 220, 220, 220, 220, 220, 33956, 2546, 286, 262, 1332, 900, 973, 618, 9489, 5415, 588, 2894, 31850, 13, 198, 220, 220, 220, 220, 220, 220, 220, 554, 1502, 284, 423, 7209, 12109, 3959, 602, 357, 3866, 1151, 625, 32232, 828, 340, 318, 7151, 284, 198, 220, 220, 220, 220, 220, 220, 220, 779, 257, 1588, 1332, 62, 10366, 952, 62, 7857, 357, 565, 13416, 284, 352, 13, 15, 8, 2138, 621, 257, 1402, 530, 13, 628, 220, 220, 220, 15942, 577, 25, 493, 11, 11902, 357, 12286, 796, 352, 8, 198, 220, 220, 220, 220, 220, 220, 220, 5345, 284, 657, 611, 345, 836, 470, 765, 284, 766, 3601, 284, 3159, 13, 628, 220, 220, 220, 19484, 25, 12178, 11, 11902, 357, 12286, 796, 6045, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1002, 345, 765, 262, 19484, 329, 9720, 12109, 284, 307, 900, 6338, 393, 765, 284, 900, 340, 3511, 13, 198, 220, 220, 220, 220, 220, 220, 220, 2750, 4277, 340, 318, 900, 6338, 13, 198, 220, 220, 220, 220, 198, 220, 220, 220, 20121, 25, 20512, 11, 2172, 1292, 357, 12286, 796, 6407, 8, 198, 220, 220, 220, 220, 220, 220, 220, 32233, 35981, 379, 6632, 7838, 11387, 11, 4017, 3212, 32997, 10926, 23163, 198, 220, 220, 220, 220, 198, 220, 220, 220, 379, 349, 25, 12178, 11, 11902, 357, 12286, 796, 657, 13, 20483, 20, 8, 198, 220, 220, 220, 220, 220, 220, 220, 9720, 12109, 8636, 15440, 11507, 13, 15947, 262, 15440, 973, 329, 479, 2934, 13, 198, 220, 220, 220, 220, 220, 220, 220, 4833, 3815, 5983, 284, 13611, 9706, 475, 1365, 15440, 198, 220, 220, 220, 220, 198, 220, 220, 220, 374, 83, 349, 25, 12178, 11, 11902, 357, 12286, 796, 657, 13, 2388, 20, 8, 198, 220, 220, 220, 220, 220, 220, 220, 9720, 12109, 8636, 15440, 11507, 13, 15947, 262, 15440, 973, 329, 479, 2934, 13, 198, 220, 220, 220, 220, 220, 220, 220, 4833, 3815, 5983, 284, 13611, 9706, 475, 1365, 15440, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 742, 349, 25, 12178, 11, 11902, 357, 12286, 796, 657, 13, 486, 8, 198, 220, 220, 220, 220, 220, 220, 220, 15440, 11507, 329, 45780, 262, 19484, 1262, 5415, 14955, 319, 257, 1332, 900, 198, 220, 220, 220, 220, 198, 220, 220, 220, 2989, 62, 7857, 25, 493, 11, 11902, 357, 12286, 796, 1160, 8, 198, 220, 220, 220, 220, 220, 220, 220, 618, 9489, 2989, 625, 14287, 11, 2546, 286, 1123, 1957, 6232, 284, 2198, 618, 198, 220, 220, 220, 220, 220, 220, 220, 11581, 13, 770, 22188, 33019, 262, 36076, 12, 2164, 1397, 611, 7147, 284, 307, 1165, 1263, 5145, 628, 220, 220, 220, 9720, 25, 965, 11, 11902, 357, 12286, 11639, 4908, 31562, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 5994, 286, 32169, 284, 779, 329, 12109, 7746, 13, 3819, 3689, 389, 1391, 6, 538, 1531, 1349, 1134, 709, 6, 91, 6, 29127, 41707, 83, 2522, 265, 6, 27422, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 825, 4197, 7, 944, 11, 1395, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 2448, 23914, 12109, 32966, 1586, 319, 1813, 1366, 900, 628, 220, 220, 220, 220, 220, 220, 220, 40117, 198, 220, 220, 220, 220, 220, 220, 220, 24200, 438, 628, 220, 220, 220, 220, 220, 220, 220, 1395, 1058, 7177, 11, 357, 77, 62, 39873, 11, 299, 62, 30053, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6060, 284, 13946, 13, 220, 628, 220, 220, 220, 220, 220, 220, 220, 16409, 198, 220, 220, 220, 220, 220, 220, 220, 24200, 438, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 1058, 277, 17896, 2134, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1675, 7330, 649, 13946, 14722, 779, 2116, 13, 565, 5819, 62, 18242, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 256, 796, 640, 13, 2435, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 55, 796, 1395, 220, 1303, 19337, 4866, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 77, 62, 39873, 796, 1395, 13, 43358, 58, 15, 60, 628, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 77, 62, 39873, 1279, 838, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6818, 10352, 11, 366, 23307, 1178, 8405, 329, 14492, 29509, 871, 220, 2474, 628, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 77, 71, 62, 7857, 318, 705, 23736, 10354, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 77, 71, 62, 7857, 796, 3509, 26933, 600, 7, 1495, 9, 37659, 13, 6404, 940, 7, 944, 13, 77, 62, 39873, 36911, 838, 12962, 628, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 12947, 62, 7857, 1875, 2116, 13, 77, 71, 62, 7857, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 12947, 62, 7857, 796, 2116, 13, 77, 71, 62, 7857, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 19011, 577, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2512, 18557, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 13812, 62, 12417, 62, 17143, 7307, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 58, 16344, 66, 60, 17962, 32966, 1586, 351, 299, 28, 4, 72, 8405, 9313, 4064, 1395, 13, 43358, 58, 15, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 923, 796, 640, 13, 2435, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 58, 16344, 66, 60, 376, 2535, 9720, 2746, 329, 12109, 31850, 35713, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 11147, 62, 43337, 7, 55, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 4798, 7203, 1456, 4943, 628, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 58, 16344, 66, 60, 27063, 10399, 35713, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 5589, 1133, 62, 67, 12514, 7, 55, 11, 2116, 13, 81, 8873, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 58, 16344, 66, 60, 4062, 4064, 72, 2785, 10399, 35713, 4064, 2116, 13, 312, 87, 62, 1087, 364, 62, 403, 647, 2004, 13, 43358, 58, 15, 12962, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 8584, 4686, 87, 329, 262, 10399, 1058, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 312, 87, 62, 1087, 364, 796, 2116, 13, 312, 87, 62, 1087, 364, 62, 403, 647, 2004, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 565, 5819, 62, 18242, 796, 8333, 62, 565, 5819, 7, 944, 13, 312, 87, 62, 1087, 364, 62, 403, 647, 2004, 11, 2116, 13, 20471, 62, 67, 12514, 11, 2116, 13, 43337, 62, 34960, 8, 628, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 647, 469, 25, 1303, 3221, 416, 4277, 530, 815, 1620, 428, 10926, 35981, 11485, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 58, 16344, 66, 60, 4638, 2667, 32997, 10926, 23163, 35713, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 9122, 62, 565, 5819, 62, 301, 1799, 62, 7217, 7, 55, 11, 657, 2014, 1303, 1813, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 17167, 18189, 352, 68, 12, 18, 1058, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 58, 16344, 66, 60, 40806, 803, 510, 284, 7368, 7838, 11387, 35713, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 9122, 62, 565, 5819, 62, 301, 1799, 62, 7217, 7, 55, 11, 2116, 13, 17167, 8, 1303, 35981, 705, 403, 31284, 6, 23163, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 58, 16344, 66, 60, 24429, 287, 4064, 13, 18, 69, 264, 1, 4064, 357, 2435, 13, 2435, 3419, 12, 9688, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 7139, 18557, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 628, 220, 220, 220, 825, 3613, 7, 944, 11, 1438, 28, 14202, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 311, 3080, 1459, 2746, 284, 7368, 3108, 705, 3672, 6, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1438, 318, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 3672, 796, 2116, 13, 15883, 62, 7753, 62, 3672, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 277, 3672, 796, 1438, 628, 220, 220, 220, 220, 220, 220, 220, 277, 9654, 796, 1280, 7, 69, 3672, 4032, 39346, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 2298, 293, 13, 39455, 7, 944, 11, 69, 9654, 8, 198, 220, 220, 220, 220, 220, 220, 220, 277, 9654, 13, 19836, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 277, 3672, 628, 220, 220, 220, 220, 198, 220, 220, 220, 825, 277, 62, 22065, 7, 944, 11, 1395, 62, 11, 1312, 62, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 18206, 11927, 12109, 290, 5291, 2610, 286, 4704, 278, 1502, 37811, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 357, 72, 62, 11, 2116, 13, 43337, 62, 19849, 13, 49786, 62, 43337, 7, 55, 62, 4008, 628, 220, 220, 220, 1303, 31, 13317, 198, 220, 220, 220, 825, 36076, 62, 48270, 7, 944, 11, 7838, 62, 2676, 540, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 10434, 276, 422, 281, 4238, 7838, 5046, 11, 34322, 4017, 3212, 23163, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1002, 7368, 11, 16031, 262, 13946, 25815, 379, 790, 1241, 286, 262, 36076, 1036, 1397, 13, 628, 220, 220, 220, 220, 220, 220, 220, 40117, 198, 220, 220, 220, 220, 220, 220, 220, 24200, 6329, 198, 220, 220, 220, 220, 220, 220, 220, 7838, 62, 2676, 540, 1058, 11629, 540, 286, 36016, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 10358, 307, 281, 11629, 540, 542, 64, 278, 7838, 3815, 379, 543, 284, 1620, 36076, 1036, 1397, 13, 19672, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 530, 815, 923, 422, 657, 290, 467, 284, 4025, 3815, 416, 1402, 41867, 13, 383, 2187, 32966, 1586, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1321, 318, 8574, 287, 2116, 13, 71, 959, 9282, 628, 220, 220, 220, 220, 220, 220, 220, 8229, 198, 220, 220, 220, 220, 220, 220, 220, 40103, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 19011, 577, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2512, 18557, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 58, 16344, 66, 60, 1766, 17208, 1036, 1397, 1566, 10348, 7838, 11387, 35713, 8, 628, 220, 220, 220, 220, 220, 220, 220, 7838, 62, 9521, 796, 685, 77, 329, 299, 287, 7838, 62, 2676, 540, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 71, 959, 9282, 796, 17635, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 9806, 62, 3919, 786, 796, 532, 16, 198, 220, 220, 220, 220, 220, 220, 220, 299, 62, 565, 5819, 796, 657, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 3465, 284, 2116, 11, 611, 645, 24589, 318, 1760, 11, 645, 761, 284, 3650, 18911, 2644, 655, 670, 351, 7838, 62, 9521, 8633, 2644, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 329, 299, 83, 287, 7838, 62, 9521, 25, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 2116, 13, 77, 62, 565, 5819, 62, 15003, 318, 407, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 18896, 7, 944, 13, 312, 87, 62, 1087, 364, 8, 19841, 2116, 13, 77, 62, 565, 5819, 62, 15003, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 7203, 58, 16344, 66, 13, 9078, 60, 220, 220, 220, 13618, 1271, 286, 7368, 23163, 685, 28, 4064, 72, 60, 357, 273, 1969, 284, 828, 299, 62, 565, 5819, 796, 4064, 72, 1, 4, 7, 944, 13, 77, 62, 565, 5819, 62, 15003, 11, 11925, 7, 944, 13, 312, 87, 62, 1087, 364, 22305, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 9122, 62, 565, 5819, 62, 301, 1799, 62, 7217, 7, 944, 13, 55, 11, 2123, 64, 796, 299, 83, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 71, 959, 9282, 13, 33295, 7, 3727, 15090, 6, 312, 87, 62, 1087, 364, 10354, 2116, 13, 312, 87, 62, 1087, 364, 11, 705, 565, 5819, 62, 23912, 1424, 10354, 2116, 13, 565, 5819, 62, 18242, 92, 4008, 1303, 4613, 262, 691, 2672, 1321, 24293, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 18896, 7, 944, 13, 312, 87, 62, 1087, 364, 8, 14512, 299, 62, 565, 5819, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 62, 565, 5819, 796, 18896, 7, 944, 13, 312, 87, 62, 1087, 364, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 9806, 62, 3919, 786, 796, 299, 83, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 944, 13, 71, 959, 9282, 796, 18911, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 3919, 786, 62, 9521, 796, 7838, 62, 9521, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 3919, 786, 62, 400, 10126, 796, 7838, 62, 9521, 58, 12, 16, 60, 628, 220, 220, 220, 220, 220, 220, 220, 7139, 18557, 3419, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 220, 198, 220, 220, 220, 220, 198, 220, 220, 220, 1303, 31, 13317, 198, 220, 220, 220, 825, 24061, 62, 67, 12514, 7, 944, 11, 1395, 11, 374, 8873, 796, 6045, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 32039, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3082, 1769, 5253, 284, 16936, 12, 710, 394, 2865, 351, 2440, 12109, 198, 220, 220, 220, 220, 220, 220, 220, 8229, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 25979, 11, 20471, 62, 67, 12514, 11, 312, 87, 62, 1087, 364, 11, 43337, 62, 34960, 628, 220, 220, 220, 220, 220, 220, 220, 1058, 67, 12514, 25, 5253, 284, 299, 13, 77, 13, 351, 2440, 12109, 357, 33479, 617, 6232, 45616, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 20471, 62, 67, 12514, 25, 6376, 286, 299, 13, 77, 13, 351, 2644, 220, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 312, 87, 62, 1087, 364, 25, 1351, 286, 2173, 326, 423, 262, 4387, 12109, 287, 511, 497, 328, 2865, 2894, 45616, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 43337, 62, 34960, 25, 329, 790, 966, 11, 1351, 286, 2173, 389, 15619, 357, 8869, 262, 12109, 31312, 8, 628, 220, 220, 220, 220, 220, 220, 220, 37227, 628, 220, 220, 220, 220, 220, 220, 220, 611, 374, 8873, 318, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 8873, 796, 2116, 13, 81, 8873, 628, 220, 220, 220, 220, 220, 220, 220, 299, 62, 39873, 11, 299, 62, 30053, 796, 1395, 13, 43358, 628, 220, 220, 220, 220, 220, 220, 220, 3509, 17080, 796, 45941, 13, 75, 1292, 70, 13, 27237, 26933, 37659, 13, 9806, 7, 55, 58, 45299, 72, 12962, 12, 37659, 13, 1084, 7, 55, 58, 45299, 72, 12962, 329, 1312, 287, 2837, 7, 77, 62, 30053, 8, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 25979, 796, 3509, 17080, 9, 37659, 13, 1952, 7, 77, 62, 39873, 11, 288, 4906, 28, 37659, 13, 22468, 8, 198, 220, 220, 220, 220, 220, 220, 220, 299, 77, 62, 67, 12514, 796, 45941, 13, 1952, 7, 77, 62, 39873, 11, 288, 4906, 28, 37659, 13, 600, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 12109, 62, 34960, 796, 16410, 60, 329, 1312, 287, 2837, 7, 77, 62, 39873, 15437, 1303, 3650, 15619, 5667, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 44386, 24200, 438, 3784, 198, 220, 220, 220, 220, 220, 220, 220, 299, 77, 62, 4868, 796, 2116, 13, 20471, 62, 4868, 1303, 10770, 625, 6232, 357, 77, 71, 62, 7857, 8, 198, 220, 220, 220, 220, 220, 220, 220, 44386, 24200, 438, 3784, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 2837, 7, 77, 62, 39873, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4686, 87, 796, 6376, 62, 18223, 263, 7, 81, 8873, 58, 20471, 62, 4868, 58, 72, 11907, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 4686, 87, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 12109, 62, 34960, 58, 20471, 62, 4868, 58, 72, 11, 312, 87, 60, 4083, 33295, 7, 72, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 77, 62, 67, 12514, 58, 72, 60, 796, 299, 77, 62, 4868, 58, 72, 11, 312, 87, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 25979, 58, 72, 60, 796, 2116, 13, 20471, 62, 17080, 58, 72, 11, 312, 87, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 77, 62, 67, 12514, 58, 72, 60, 10779, 16, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 4686, 87, 62, 1087, 364, 28, 37659, 13, 18747, 7, 9521, 7, 77, 62, 39873, 4008, 58, 67, 12514, 1875, 657, 13, 17032, 9, 9806, 17080, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 67, 12514, 796, 25979, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 20471, 62, 67, 12514, 796, 299, 77, 62, 67, 12514, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 312, 87, 62, 1087, 364, 62, 403, 647, 2004, 796, 4686, 87, 62, 1087, 364, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 43337, 62, 34960, 796, 12109, 62, 34960, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 198, 220, 220, 220, 220, 198, 220, 220, 220, 825, 8636, 62, 17167, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 13403, 319, 262, 12109, 6082, 11, 552, 1769, 257, 5046, 329, 2123, 64, 198, 220, 220, 220, 220, 220, 220, 220, 10664, 517, 27826, 11, 428, 318, 407, 2407, 1762, 2644, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 220, 198, 220, 220, 220, 220, 220, 220, 220, 422, 2603, 29487, 8019, 1330, 12972, 29487, 355, 458, 83, 628, 220, 220, 220, 220, 220, 220, 220, 4686, 87, 796, 493, 7, 944, 13, 77, 62, 39873, 14, 940, 2014, 198, 220, 220, 220, 220, 220, 220, 220, 4686, 87, 796, 45941, 13, 22046, 419, 7, 944, 13, 81, 8873, 38381, 21912, 20, 9, 312, 87, 60, 2, 58, 17, 25, 312, 87, 25, 19, 9, 312, 87, 60, 198, 220, 220, 220, 220, 220, 220, 220, 1553, 8873, 796, 17635, 628, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 4686, 87, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 8873, 62, 15003, 796, 2116, 13, 81, 8873, 58, 72, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 77, 62, 72, 796, 2116, 13, 20471, 62, 67, 12514, 58, 72, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 981, 299, 77, 62, 72, 14512, 532, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 8873, 62, 66, 796, 2116, 13, 81, 8873, 58, 20471, 62, 72, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 77, 62, 72, 796, 2116, 13, 20471, 62, 67, 12514, 58, 20471, 62, 72, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1553, 8873, 13, 33295, 7, 81, 8873, 62, 66, 12, 374, 8873, 62, 15003, 8, 628, 220, 220, 220, 220, 220, 220, 220, 37227, 458, 83, 13, 14363, 7, 7109, 8873, 11, 65, 1040, 28, 1899, 8, 198, 220, 220, 220, 220, 220, 220, 220, 458, 83, 13, 12860, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 8420, 3419, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 2123, 64, 796, 45941, 13, 32604, 7, 7109, 8873, 8, 2, 10, 15, 13, 20, 9, 37659, 13, 19282, 7, 7109, 8873, 8, 628, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 66, 448, 7203, 12814, 14367, 2123, 64, 286, 4064, 13, 18, 69, 1, 4, 17167, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 2123, 64, 628, 198, 220, 220, 220, 37227, 825, 651, 62, 565, 5819, 62, 10951, 7, 944, 11, 2123, 64, 796, 6045, 2599, 628, 220, 220, 220, 220, 220, 220, 220, 611, 2123, 64, 318, 6045, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 2116, 13, 565, 5819, 62, 18242, 11, 2116, 13, 312, 87, 62, 1087, 364, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1426, 796, 45941, 13, 853, 1084, 7, 37659, 13, 8937, 7, 37659, 13, 18747, 7, 944, 13, 3919, 786, 62, 9521, 13219, 17167, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 67, 12514, 62, 796, 2116, 13, 3919, 786, 62, 9521, 58, 1930, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 312, 87, 62, 1087, 364, 796, 2116, 13, 71, 959, 9282, 58, 1930, 7131, 6, 312, 87, 62, 1087, 364, 20520, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 13946, 62, 18242, 796, 2116, 13, 71, 959, 9282, 58, 1930, 7131, 6, 565, 5819, 62, 23912, 1424, 20520, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4686, 87, 62, 16159, 796, 2116, 13, 71, 959, 9282, 58, 1930, 7131, 6, 312, 87, 62, 1087, 364, 20520, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 13946, 62, 18242, 11, 4686, 87, 62, 16159, 37227, 628, 220, 220, 220, 37227, 825, 4296, 62, 23912, 1424, 7, 944, 11, 4686, 87, 62, 1087, 364, 11, 13946, 62, 18242, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 312, 87, 62, 1087, 364, 796, 4686, 87, 62, 1087, 364, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 565, 5819, 62, 18242, 796, 13946, 62, 18242, 37227, 628, 220, 220, 220, 1303, 31, 13317, 198, 220, 220, 220, 825, 1064, 62, 33863, 62, 21048, 62, 12947, 7, 944, 11, 4686, 87, 11, 2123, 64, 11, 13946, 62, 18242, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 15553, 329, 10342, 329, 16936, 12020, 1626, 617, 12109, 11387, 13, 220, 198, 220, 220, 220, 220, 220, 220, 220, 24451, 815, 307, 281, 6565, 900, 329, 262, 287, 1287, 2163, 869, 13, 198, 220, 220, 220, 220, 220, 220, 220, 5740, 284, 3589, 1058, 6041, 286, 23989, 11, 428, 318, 2495, 640, 14, 31673, 2784, 2229, 5145, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 40117, 198, 220, 220, 220, 220, 220, 220, 220, 24200, 6329, 198, 220, 220, 220, 220, 220, 220, 220, 4686, 87, 1058, 493, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6376, 286, 262, 13946, 1247, 3882, 284, 923, 422, 198, 220, 220, 220, 220, 220, 220, 220, 2123, 64, 1058, 12178, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5415, 12109, 345, 460, 19431, 625, 357, 5661, 318, 366, 43337, 62, 16159, 532, 2123, 64, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 13946, 62, 18242, 25, 7177, 286, 493, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 13946, 6167, 329, 790, 4818, 499, 1563, 13, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 16409, 198, 220, 220, 220, 220, 220, 220, 220, 24200, 6329, 198, 220, 220, 220, 220, 220, 220, 220, 7343, 286, 2173, 287, 262, 6232, 286, 966, 4686, 87, 1058, 352, 35, 7177, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 374, 8873, 796, 2116, 13, 81, 8873, 628, 220, 220, 220, 220, 220, 220, 220, 6632, 62, 18747, 796, 45941, 13, 9107, 418, 7, 11925, 7, 944, 13, 20471, 62, 4868, 828, 67, 4906, 28, 30388, 8, 628, 220, 220, 220, 220, 220, 220, 220, 299, 77, 62, 4868, 796, 2116, 13, 20471, 62, 4868, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 6632, 62, 18747, 58, 20471, 62, 4868, 58, 312, 87, 11, 1058, 944, 13, 12947, 62, 7857, 11907, 796, 6407, 628, 220, 220, 220, 220, 220, 220, 220, 649, 62, 293, 3080, 796, 6632, 62, 18747, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 318, 62, 33863, 796, 357, 81, 8873, 1875, 2123, 64, 8, 1222, 357, 3605, 62, 293, 3080, 8, 198, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 1459, 62, 18242, 796, 13946, 62, 18242, 58, 312, 87, 60, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 770, 714, 2192, 307, 6596, 11, 475, 379, 1551, 340, 338, 3938, 15879, 1143, 290, 43865, 357, 45, 6404, 45, 287, 640, 290, 399, 287, 4088, 8, 628, 220, 220, 220, 220, 220, 220, 220, 981, 6407, 25, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4296, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5667, 28, 37659, 13, 30073, 7, 3605, 62, 293, 3080, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 88, 62, 47408, 796, 13946, 62, 18242, 58, 293, 3080, 60, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5667, 62, 565, 5819, 796, 357, 293, 3080, 8, 1222, 357, 565, 5819, 62, 18242, 6624, 1459, 62, 18242, 8, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 649, 62, 293, 3080, 28, 37659, 13, 9107, 418, 7, 11925, 7, 944, 13, 20471, 62, 4868, 828, 288, 4906, 28, 30388, 8, 198, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 77, 62, 33201, 796, 45941, 13, 34642, 7, 20471, 62, 4868, 58, 293, 3080, 62, 565, 5819, 7131, 25, 944, 13, 12947, 62, 7857, 4083, 2704, 41769, 28955, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 581, 796, 299, 77, 62, 33201, 58, 271, 62, 33863, 58, 20471, 62, 33201, 60, 855, 25101, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1426, 796, 45941, 13, 3003, 7, 81, 8873, 58, 411, 60, 1875, 2123, 64, 38381, 15, 60, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 18896, 7, 1930, 8, 1875, 657, 25, 4296, 28, 17821, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 33863, 58, 411, 58, 1930, 11907, 796, 6407, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 649, 62, 293, 3080, 58, 411, 58, 1930, 11907, 796, 6407, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 4296, 318, 10352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 45941, 13, 3003, 7, 271, 62, 33863, 38381, 15, 60, 628, 220, 220, 220, 825, 1064, 62, 33863, 62, 21048, 62, 12947, 62, 85, 16, 7, 944, 11, 4686, 87, 11, 2123, 64, 11, 13946, 62, 18242, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 15553, 329, 10342, 329, 16936, 12020, 1626, 198, 220, 220, 220, 220, 220, 220, 220, 617, 12109, 11387, 13, 220, 198, 220, 220, 220, 220, 220, 220, 220, 24451, 815, 307, 281, 6565, 900, 329, 262, 287, 1287, 2163, 869, 13, 628, 220, 220, 220, 220, 220, 220, 220, 5740, 284, 3589, 1058, 6041, 286, 23989, 11, 428, 318, 2495, 640, 2784, 2229, 5145, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 16409, 198, 220, 220, 220, 220, 220, 220, 220, 24200, 6329, 198, 220, 220, 220, 220, 220, 220, 220, 7343, 286, 2173, 287, 262, 6232, 286, 966, 4686, 87, 1058, 352, 35, 7177, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 220, 220, 220, 374, 8873, 796, 2116, 13, 81, 8873, 198, 220, 220, 220, 220, 220, 220, 220, 299, 77, 62, 4868, 796, 2116, 13, 20471, 62, 4868, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 649, 62, 293, 3080, 28, 20471, 62, 4868, 58, 312, 87, 7131, 25, 944, 13, 12947, 62, 7857, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 318, 62, 33863, 796, 45941, 13, 9107, 418, 7, 11925, 7, 944, 13, 20471, 62, 4868, 828, 67, 4906, 28, 37659, 13, 600, 8, 628, 220, 220, 220, 220, 220, 220, 220, 318, 62, 33863, 58, 3605, 62, 293, 3080, 58, 81, 8873, 58, 3605, 62, 293, 3080, 60, 1875, 2123, 64, 11907, 796, 352, 198, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 1459, 62, 18242, 796, 13946, 62, 18242, 58, 312, 87, 60, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 30274, 994, 356, 3075, 400, 261, 1096, 644, 338, 2174, 986, 428, 318, 4047, 287, 891, 11373, 2644, 198, 220, 220, 220, 220, 220, 220, 220, 981, 6407, 25, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4296, 796, 10352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5667, 28, 37659, 13, 71, 25558, 7, 3605, 62, 293, 3080, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 649, 62, 293, 3080, 28, 21737, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 331, 62, 47408, 796, 13946, 62, 18242, 58, 293, 3080, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5667, 62, 565, 5819, 796, 5667, 58, 88, 62, 47408, 6624, 1459, 62, 18242, 60, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 77, 62, 33201, 796, 299, 77, 62, 4868, 58, 293, 3080, 62, 565, 5819, 60, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 2837, 7, 16, 11, 2116, 13, 12947, 62, 7857, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 581, 796, 299, 77, 62, 33201, 58, 271, 62, 33863, 58, 20471, 62, 33201, 58, 45299, 72, 11907, 6624, 657, 11, 1312, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1426, 796, 45941, 13, 3003, 7, 81, 8873, 58, 411, 60, 1875, 2123, 64, 38381, 15, 60, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 18896, 7, 1930, 8, 1875, 657, 25, 4296, 28, 17821, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 318, 62, 33863, 58, 411, 58, 1930, 11907, 796, 352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 649, 62, 293, 3080, 13, 33295, 7, 411, 58, 1930, 12962, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 4296, 318, 10352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 45941, 13, 3003, 7, 271, 62, 33863, 6624, 352, 38381, 15, 60, 628, 220, 220, 220, 37227, 825, 24061, 62, 1073, 17208, 62, 48270, 62, 34960, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 4823, 796, 23884, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 329, 4686, 87, 287, 2116, 13, 312, 87, 62, 1087, 364, 25, 1303, 379, 617, 5046, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 24451, 796, 2116, 13, 19796, 62, 33863, 62, 21048, 62, 12947, 7, 312, 87, 11, 2123, 64, 11, 13946, 62, 18242, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6167, 62, 1087, 364, 62, 20471, 796, 45941, 13, 34642, 26933, 565, 5819, 62, 18242, 58, 8461, 60, 329, 37628, 287, 24451, 12962, 37227, 198, 198, 29113, 14468, 4242, 2, 198, 29113, 14468, 4242, 2, 198, 7804, 4242, 10361, 5499, 2174, 1303, 7804, 4242, 21017, 198, 29113, 14468, 4242, 2, 198, 29113, 14468, 4242, 2, 198, 198, 4299, 2198, 62, 565, 5819, 62, 301, 1799, 7, 944, 11, 1395, 11, 11387, 2599, 220, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 11259, 262, 5174, 13946, 10399, 11, 17706, 257, 517, 7805, 454, 516, 198, 220, 220, 220, 6232, 2989, 357, 3106, 319, 617, 7838, 11387, 8, 329, 2173, 351, 2440, 29509, 871, 13, 198, 220, 220, 220, 770, 318, 29627, 2092, 284, 257, 42640, 6630, 287, 2939, 10618, 341, 290, 6209, 198, 220, 220, 220, 1838, 1654, 356, 4398, 470, 5174, 49062, 13946, 10399, 266, 13, 81, 13, 83, 284, 617, 7838, 11387, 357, 9562, 3967, 737, 628, 220, 220, 220, 770, 468, 2089, 4088, 13357, 11, 2476, 9025, 611, 356, 765, 284, 1057, 319, 399, 29, 940, 61, 20, 1366, 2173, 13, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 12109, 62, 34960, 796, 2116, 13, 43337, 62, 34960, 198, 220, 220, 220, 299, 77, 62, 67, 12514, 796, 2116, 13, 20471, 62, 67, 12514, 198, 220, 220, 220, 25979, 796, 2116, 13, 67, 12514, 198, 220, 220, 220, 374, 8873, 796, 2116, 13, 81, 8873, 198, 220, 220, 220, 299, 77, 62, 4868, 796, 2116, 13, 20471, 62, 4868, 198, 220, 220, 220, 4686, 87, 62, 1087, 364, 796, 2116, 13, 312, 87, 62, 1087, 364, 62, 403, 647, 2004, 220, 198, 220, 220, 220, 13946, 62, 18242, 796, 2116, 13, 565, 5819, 62, 18242, 628, 220, 220, 220, 299, 62, 9562, 62, 1930, 796, 657, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 4686, 87, 62, 7942, 62, 1087, 364, 796, 17635, 628, 220, 220, 220, 329, 4686, 87, 287, 4686, 87, 62, 1087, 364, 25, 198, 220, 220, 220, 220, 220, 220, 220, 374, 8873, 62, 16159, 796, 374, 8873, 58, 312, 87, 60, 198, 220, 220, 220, 220, 220, 220, 220, 25979, 62, 81, 8873, 796, 374, 8873, 62, 16159, 532, 11387, 198, 220, 220, 220, 220, 220, 220, 220, 611, 11387, 1279, 352, 68, 12, 18, 25, 1303, 655, 2198, 299, 77, 62, 4868, 2644, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 24451, 28, 20471, 62, 4868, 58, 312, 87, 7131, 16, 25, 944, 13, 12947, 62, 7857, 60, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 24451, 796, 2116, 13, 19796, 62, 33863, 62, 21048, 62, 12947, 7, 312, 87, 11, 25979, 62, 81, 8873, 11, 13946, 62, 18242, 8, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 4798, 7, 11925, 7, 33863, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 6167, 62, 1087, 364, 62, 20471, 796, 45941, 13, 34642, 7, 944, 13, 565, 5819, 62, 18242, 58, 33863, 12962, 2, 58, 565, 5819, 62, 18242, 58, 8461, 60, 329, 37628, 287, 24451, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 4686, 87, 62, 9806, 796, 4686, 87, 62, 1087, 364, 58, 6167, 62, 1087, 364, 62, 20471, 58, 37659, 13, 853, 9806, 7, 81, 8873, 58, 312, 87, 62, 1087, 364, 58, 18242, 62, 1087, 364, 62, 20471, 11907, 15437, 2361, 198, 220, 220, 220, 220, 220, 220, 220, 374, 8873, 62, 14421, 796, 374, 8873, 58, 312, 87, 60, 628, 220, 220, 220, 220, 220, 220, 220, 611, 357, 374, 8873, 62, 14421, 1279, 374, 8873, 58, 312, 87, 62, 9806, 60, 1267, 1222, 357, 4686, 87, 14512, 4686, 87, 62, 9806, 1267, 1058, 220, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 77, 62, 67, 12514, 58, 312, 87, 60, 796, 4686, 87, 62, 9806, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 25979, 58, 312, 87, 60, 796, 45941, 13, 75, 1292, 70, 13, 27237, 7, 55, 58, 312, 87, 62, 9806, 45297, 55, 58, 312, 87, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 12109, 62, 34960, 58, 312, 87, 62, 9806, 4083, 33295, 7, 312, 87, 8, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 62, 9562, 62, 1930, 47932, 16, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4686, 87, 62, 7942, 62, 1087, 364, 13, 33295, 7, 312, 87, 8, 628, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 1441, 45941, 13, 18747, 7, 312, 87, 62, 7942, 62, 1087, 364, 11, 67, 4906, 28, 37659, 13, 600, 828, 299, 62, 9562, 62, 1930, 198, 198, 4299, 8333, 62, 565, 5819, 7, 312, 87, 62, 1087, 364, 11, 299, 77, 62, 67, 12514, 11, 12109, 62, 34960, 2599, 198, 220, 220, 220, 37227, 220, 198, 220, 220, 220, 11259, 262, 13946, 10399, 290, 262, 1957, 3915, 2334, 357, 20471, 62, 67, 12514, 8, 8333, 284, 790, 198, 220, 220, 220, 966, 257, 13946, 6167, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 198, 220, 220, 220, 299, 62, 16159, 796, 4686, 87, 62, 1087, 364, 13, 43358, 58, 15, 60, 198, 220, 220, 220, 299, 62, 39873, 796, 299, 77, 62, 67, 12514, 13, 43358, 58, 15, 60, 198, 220, 220, 220, 13946, 62, 18242, 796, 532, 16, 9, 37659, 13, 1952, 7, 77, 62, 39873, 11, 67, 4906, 28, 37659, 13, 600, 8, 1303, 6865, 13562, 790, 640, 13, 198, 220, 220, 220, 220, 198, 220, 220, 220, 329, 269, 11, 6167, 287, 19974, 7, 312, 87, 62, 1087, 364, 11, 2837, 7, 77, 62, 16159, 8, 15179, 198, 220, 220, 220, 220, 220, 220, 220, 13946, 62, 18242, 58, 66, 60, 796, 6167, 198, 220, 220, 220, 220, 220, 220, 220, 8333, 62, 565, 5819, 62, 22089, 7, 43337, 62, 34960, 58, 66, 4357, 13946, 62, 18242, 11, 12109, 62, 34960, 11, 6167, 8, 220, 220, 220, 220, 198, 220, 220, 220, 1441, 13946, 62, 18242, 220, 220, 220, 220, 198, 198, 4299, 8333, 62, 565, 5819, 62, 22089, 7, 15763, 11, 565, 5819, 62, 18242, 11, 43337, 62, 34960, 11, 18242, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3311, 30753, 2163, 329, 38875, 14722, 329, 257, 5509, 4823, 13, 198, 220, 220, 220, 22025, 2105, 4006, 318, 1138, 618, 262, 6808, 318, 6565, 357, 72, 13, 68, 13, 257, 12835, 468, 587, 4251, 8, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 220, 198, 220, 220, 220, 611, 407, 6808, 25, 220, 1303, 788, 1276, 307, 257, 12835, 5145, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 198, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 329, 1200, 287, 6808, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 13946, 62, 18242, 58, 9410, 22241, 18242, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 8333, 62, 565, 5819, 62, 22089, 7, 43337, 62, 34960, 58, 9410, 4357, 565, 5819, 62, 18242, 11, 43337, 62, 34960, 11, 18242, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 4299, 6376, 62, 18223, 263, 7, 18747, 11, 3718, 28, 16, 68, 12, 23, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 32039, 25, 198, 220, 220, 220, 220, 220, 220, 220, 15553, 329, 4917, 717, 2378, 287, 281, 7177, 326, 468, 257, 1988, 3744, 621, 262, 717, 5002, 287, 326, 7177, 198, 220, 220, 220, 220, 220, 220, 220, 1002, 645, 5002, 318, 1043, 11, 5860, 6045, 198, 220, 220, 220, 39281, 25, 198, 220, 220, 220, 220, 220, 220, 220, 352, 68, 12, 23, 198, 220, 220, 220, 8229, 25, 198, 220, 220, 220, 220, 220, 220, 220, 493, 393, 6045, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2378, 28, 18747, 58, 15, 60, 198, 220, 220, 220, 329, 4686, 87, 11, 1188, 287, 45941, 13, 358, 268, 6975, 378, 7, 18747, 2599, 1303, 3105, 5145, 1058, 714, 307, 3075, 400, 261, 1143, 198, 220, 220, 220, 220, 220, 220, 220, 611, 1188, 1875, 357, 9186, 1343, 3718, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 4686, 87, 58, 15, 60, 198, 198, 4299, 2512, 18557, 33529, 198, 220, 220, 220, 37227, 45356, 13570, 284, 3159, 37811, 198, 220, 220, 220, 25064, 13, 19282, 448, 796, 1280, 7, 418, 13, 7959, 8423, 11, 705, 86, 11537, 198, 198, 4299, 7139, 18557, 33529, 198, 220, 220, 220, 37227, 4834, 2977, 13570, 284, 3159, 37811, 198, 220, 220, 220, 25064, 13, 19282, 448, 796, 25064, 13, 834, 19282, 448, 834, 198 ]
2.285354
7,934
import argparse import typing import aztk.spark from aztk_cli import config, utils
[ 11748, 1822, 29572, 198, 11748, 19720, 198, 198, 11748, 35560, 30488, 13, 2777, 668, 198, 6738, 35560, 30488, 62, 44506, 1330, 4566, 11, 3384, 4487, 628, 198 ]
3.185185
27
import obspython as obs from random import choices FLAG = True INTERVAL = 100 eg = Example() # class created ,obs part starts
[ 11748, 909, 2777, 7535, 355, 10201, 201, 198, 6738, 4738, 1330, 7747, 201, 198, 201, 198, 38948, 796, 6407, 201, 198, 41358, 23428, 796, 1802, 201, 198, 201, 198, 201, 198, 1533, 796, 17934, 3419, 220, 1303, 1398, 2727, 837, 8158, 636, 4940, 201, 198, 201, 198, 201, 198, 201, 198, 201, 198 ]
2.754717
53
from datetime import datetime
[ 6738, 4818, 8079, 1330, 4818, 8079, 628, 198 ]
4
8
import numpy as np import matplotlib.pyplot as plt import casadi as cas # define functions # Check if Sensor is a NTC and find out the Resistance R_measured = [103e3, 120e3, 70e3, 15.2e3] T_measured_C = [25, 20, 33, 74] R_N = 103e3 T_N = 298.15 U_ges = 3.3 T_range_C = [0, 200] # Kelvin from Temp T_range = [i + 273.15 for i in T_range_C] T_measured = [i + 273.15 for i in T_measured_C] # Fit B B_sym = cas.SX.sym("B") f = 0 for R, T in zip(R_measured, T_measured): f += (R-R_ntc(R_N, B_sym, T, T_N))**2 nlp = {'x': B_sym, 'f': f} S = cas.nlpsol('S', 'ipopt', nlp) res = S() B = res['x'].full()[0] # Search for the Value of R_1 which minimizes the deviation of Measured Voltage at a specific Temperature T_Nenn_C = 65 T_Nenn = T_Nenn_C + 273.15 R_1 = cas.SX.sym("R_1") T_sym = cas.SX.sym("T") U = U_meas(U_ges, R_1, R_ntc(R_N, B, T_sym, T_N)) jac = cas.Function("dudT", [R_1, T_sym], [cas.jacobian(U, T_sym)]) lbx = [0] ubx = [cas.inf] nlp = {'x': R_1, 'f': jac(R_1, T_Nenn)} S = cas.nlpsol('S', 'ipopt', nlp) res = S(lbx=lbx, ubx=ubx) R_1 = res['x'].full()[0] # plot T = np.linspace(T_range[0], T_range[1], num=200) T_C = np.linspace(T_range_C[0], T_range_C[1], num=200) print("R_1: %e" % R_1) print("B: %e" % B) plt.figure() plt.title("Fitted and Measured Resistance of the NTC") plt.plot(T_C, R_ntc(R_N, B, T, T_N), label="R_fitted") plt.plot(T_measured_C, R_measured, "x", label="R_measured") plt.xlabel("Temp [Grad]") plt.ylabel("R [Ohm]") plt.legend() U_range = U_meas(U_ges, R_1, R_ntc(R_N, B, T, T_N)) plt.figure() plt.title("Voltage vs. Temperature with optimal Resistance. Vertical line shows the optimal Temperature.") plt.plot(T_C, U_range, label="R/NTC") plt.vlines(T_Nenn_C, U_range.min(), U_range.max()) plt.xlabel("Temp [Grad]") plt.ylabel("U [V]") plt.legend() # Calibrate Sensor from ADC measurements # measurements adc_voltage_measured = [2.21634, 2.17343, 1.59904, 1.49781, 0.84637, 0.71773, 0.59042, 0.67618, 0.18674, 0.22936,0.18058,0.16265, 0.31080, 0.35350, 0.51420, 0.54871, 0.69035, 0.74026, 0.93252, 0.97848, 1.14037, 1.22280, 1.62269, 1.66503, 2.68944, 2.70243] T_measured = [42, 43, 60, 65, 92, 99, 106, 101, 156, 146, 158, 161, 133, 128, 112, 109, 100, 97, 87, 85, 78, 75, 61, 59, 24, 23] # Fit Model R1 = 24.9e3 B_sym = cas.SX.sym("B") Rn_sym = cas.SX.sym("Rn") Tn_sym = cas.SX.sym("Tn") syms = cas.vertcat(B_sym, Rn_sym, Tn_sym) x0 = [B, 103e3, T_N] f = 0 for T, adc_voltage in zip(T_measured, adc_voltage_measured): f += (T-Temp(adc_voltage, R1, U_ges, B_sym, Rn_sym, Tn_sym))**2 f += (Rn_sym-103e3)**2+(Tn_sym-T_N)**2 nlp = {'x': syms, 'f': f} S = cas.nlpsol('S', 'ipopt', nlp) res = S(x0=x0) B = res['x'].full()[0] Rn = res['x'].full()[1] Tn = res['x'].full()[2] print("B:", B, "R1:", R1, "Rn:", Rn, "Tn:", Tn) plt.figure() plt.title("Fitted Model for measured Voltage vs. Temperature") adc_range = np.linspace(min(adc_voltage_measured), max(adc_voltage_measured)) plt.plot(adc_range, Temp(adc_range, R1, U_ges, B, Rn, Tn), label="Fitted Model") plt.plot(adc_voltage_measured, T_measured, 'x', label="Measured") plt.xlabel("ADC voltage [V]") plt.ylabel("Temp [Grad]") plt.legend() plt.show()
[ 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 6124, 9189, 355, 6124, 198, 198, 2, 8160, 5499, 198, 198, 2, 6822, 611, 35367, 318, 257, 399, 4825, 290, 1064, 503, 262, 17363, 198, 198, 49, 62, 1326, 34006, 796, 685, 15197, 68, 18, 11, 7982, 68, 18, 11, 4317, 68, 18, 11, 1315, 13, 17, 68, 18, 60, 198, 51, 62, 1326, 34006, 62, 34, 796, 685, 1495, 11, 1160, 11, 4747, 11, 8915, 60, 198, 198, 49, 62, 45, 796, 15349, 68, 18, 198, 51, 62, 45, 796, 37576, 13, 1314, 198, 52, 62, 3212, 796, 513, 13, 18, 198, 51, 62, 9521, 62, 34, 796, 685, 15, 11, 939, 60, 628, 198, 198, 2, 46577, 422, 24189, 198, 51, 62, 9521, 796, 685, 72, 1343, 38549, 13, 1314, 329, 1312, 287, 309, 62, 9521, 62, 34, 60, 198, 51, 62, 1326, 34006, 796, 685, 72, 1343, 38549, 13, 1314, 329, 1312, 287, 309, 62, 1326, 34006, 62, 34, 60, 198, 198, 2, 25048, 347, 198, 33, 62, 37047, 796, 6124, 13, 50, 55, 13, 37047, 7203, 33, 4943, 198, 69, 796, 657, 198, 1640, 371, 11, 309, 287, 19974, 7, 49, 62, 1326, 34006, 11, 309, 62, 1326, 34006, 2599, 198, 220, 220, 220, 277, 15853, 357, 49, 12, 49, 62, 429, 66, 7, 49, 62, 45, 11, 347, 62, 37047, 11, 309, 11, 309, 62, 45, 4008, 1174, 17, 628, 198, 21283, 79, 796, 1391, 6, 87, 10354, 347, 62, 37047, 11, 705, 69, 10354, 277, 92, 198, 50, 796, 6124, 13, 21283, 862, 349, 10786, 50, 3256, 705, 541, 8738, 3256, 299, 34431, 8, 198, 411, 796, 311, 3419, 198, 198, 33, 796, 581, 17816, 87, 6, 4083, 12853, 3419, 58, 15, 60, 198, 198, 2, 11140, 329, 262, 11052, 286, 371, 62, 16, 543, 10356, 4340, 262, 28833, 286, 2185, 34006, 45444, 379, 257, 2176, 34467, 198, 51, 62, 45, 1697, 62, 34, 796, 6135, 198, 51, 62, 45, 1697, 796, 309, 62, 45, 1697, 62, 34, 1343, 38549, 13, 1314, 198, 198, 49, 62, 16, 796, 6124, 13, 50, 55, 13, 37047, 7203, 49, 62, 16, 4943, 198, 51, 62, 37047, 796, 6124, 13, 50, 55, 13, 37047, 7203, 51, 4943, 198, 198, 52, 796, 471, 62, 1326, 292, 7, 52, 62, 3212, 11, 371, 62, 16, 11, 371, 62, 429, 66, 7, 49, 62, 45, 11, 347, 11, 309, 62, 37047, 11, 309, 62, 45, 4008, 198, 30482, 796, 6124, 13, 22203, 7203, 67, 463, 51, 1600, 685, 49, 62, 16, 11, 309, 62, 37047, 4357, 685, 34004, 13, 30482, 672, 666, 7, 52, 11, 309, 62, 37047, 8, 12962, 198, 198, 23160, 87, 796, 685, 15, 60, 198, 549, 87, 796, 685, 34004, 13, 10745, 60, 198, 21283, 79, 796, 1391, 6, 87, 10354, 371, 62, 16, 11, 705, 69, 10354, 474, 330, 7, 49, 62, 16, 11, 309, 62, 45, 1697, 38165, 198, 198, 50, 796, 6124, 13, 21283, 862, 349, 10786, 50, 3256, 705, 541, 8738, 3256, 299, 34431, 8, 198, 411, 796, 311, 7, 23160, 87, 28, 23160, 87, 11, 20967, 87, 28, 549, 87, 8, 198, 198, 49, 62, 16, 796, 581, 17816, 87, 6, 4083, 12853, 3419, 58, 15, 60, 198, 198, 2, 7110, 198, 51, 796, 45941, 13, 21602, 10223, 7, 51, 62, 9521, 58, 15, 4357, 309, 62, 9521, 58, 16, 4357, 997, 28, 2167, 8, 198, 51, 62, 34, 796, 45941, 13, 21602, 10223, 7, 51, 62, 9521, 62, 34, 58, 15, 4357, 309, 62, 9521, 62, 34, 58, 16, 4357, 997, 28, 2167, 8, 198, 4798, 7203, 49, 62, 16, 25, 4064, 68, 1, 4064, 371, 62, 16, 8, 198, 4798, 7203, 33, 25, 4064, 68, 1, 4064, 347, 8, 198, 489, 83, 13, 26875, 3419, 198, 489, 83, 13, 7839, 7203, 37, 2175, 290, 2185, 34006, 17363, 286, 262, 399, 4825, 4943, 198, 489, 83, 13, 29487, 7, 51, 62, 34, 11, 371, 62, 429, 66, 7, 49, 62, 45, 11, 347, 11, 309, 11, 309, 62, 45, 828, 6167, 2625, 49, 62, 38631, 4943, 198, 489, 83, 13, 29487, 7, 51, 62, 1326, 34006, 62, 34, 11, 371, 62, 1326, 34006, 11, 366, 87, 1600, 6167, 2625, 49, 62, 1326, 34006, 4943, 198, 489, 83, 13, 87, 18242, 7203, 30782, 685, 42731, 60, 4943, 198, 489, 83, 13, 2645, 9608, 7203, 49, 685, 5812, 76, 60, 4943, 198, 489, 83, 13, 1455, 437, 3419, 198, 198, 52, 62, 9521, 796, 471, 62, 1326, 292, 7, 52, 62, 3212, 11, 371, 62, 16, 11, 371, 62, 429, 66, 7, 49, 62, 45, 11, 347, 11, 309, 11, 309, 62, 45, 4008, 198, 489, 83, 13, 26875, 3419, 198, 489, 83, 13, 7839, 7203, 53, 5978, 496, 3691, 13, 34467, 351, 16586, 17363, 13, 38937, 1627, 2523, 262, 16586, 34467, 19570, 198, 489, 83, 13, 29487, 7, 51, 62, 34, 11, 471, 62, 9521, 11, 6167, 2625, 49, 14, 45, 4825, 4943, 198, 489, 83, 13, 85, 6615, 7, 51, 62, 45, 1697, 62, 34, 11, 471, 62, 9521, 13, 1084, 22784, 471, 62, 9521, 13, 9806, 28955, 198, 489, 83, 13, 87, 18242, 7203, 30782, 685, 42731, 60, 4943, 198, 489, 83, 13, 2645, 9608, 7203, 52, 685, 53, 60, 4943, 198, 489, 83, 13, 1455, 437, 3419, 628, 198, 2, 2199, 2889, 378, 35367, 422, 49169, 13871, 198, 198, 2, 13871, 198, 198, 324, 66, 62, 37764, 496, 62, 1326, 34006, 796, 685, 17, 13, 20666, 2682, 11, 362, 13, 1558, 32118, 11, 352, 13, 43452, 3023, 11, 352, 13, 2920, 49703, 11, 657, 13, 23, 3510, 2718, 11, 657, 13, 22, 1558, 4790, 11, 657, 13, 3270, 3023, 17, 11, 657, 13, 42548, 1507, 11, 657, 13, 1507, 45385, 11, 657, 13, 23539, 2623, 11, 15, 13, 1507, 2713, 23, 11, 15, 13, 1433, 22980, 11, 657, 13, 18, 24045, 11, 657, 13, 2327, 14877, 11, 657, 13, 47396, 1238, 11, 657, 13, 49934, 4869, 11, 657, 13, 35844, 2327, 11, 657, 13, 45598, 2075, 11, 657, 13, 6052, 22800, 11, 657, 13, 32196, 2780, 11, 352, 13, 15187, 2718, 11, 352, 13, 1828, 21033, 11, 352, 13, 21, 1828, 3388, 11, 352, 13, 2791, 31938, 11, 362, 13, 40523, 2598, 11, 362, 13, 2154, 26660, 60, 198, 51, 62, 1326, 34006, 796, 685, 3682, 11, 5946, 11, 3126, 11, 6135, 11, 10190, 11, 7388, 11, 15696, 11, 8949, 11, 23871, 11, 22986, 11, 24063, 11, 27829, 11, 22169, 11, 13108, 11, 13539, 11, 16003, 11, 1802, 11, 10111, 11, 10083, 11, 7600, 11, 8699, 11, 5441, 11, 8454, 11, 7863, 11, 1987, 11, 2242, 60, 198, 198, 2, 25048, 9104, 198, 49, 16, 796, 1987, 13, 24, 68, 18, 198, 33, 62, 37047, 796, 6124, 13, 50, 55, 13, 37047, 7203, 33, 4943, 198, 49, 77, 62, 37047, 796, 6124, 13, 50, 55, 13, 37047, 7203, 49, 77, 4943, 198, 51, 77, 62, 37047, 796, 6124, 13, 50, 55, 13, 37047, 7203, 51, 77, 4943, 198, 1837, 907, 796, 6124, 13, 1851, 9246, 7, 33, 62, 37047, 11, 371, 77, 62, 37047, 11, 309, 77, 62, 37047, 8, 198, 87, 15, 796, 685, 33, 11, 15349, 68, 18, 11, 309, 62, 45, 60, 198, 69, 796, 657, 198, 1640, 309, 11, 512, 66, 62, 37764, 496, 287, 19974, 7, 51, 62, 1326, 34006, 11, 512, 66, 62, 37764, 496, 62, 1326, 34006, 2599, 198, 220, 220, 220, 277, 15853, 357, 51, 12, 30782, 7, 324, 66, 62, 37764, 496, 11, 371, 16, 11, 471, 62, 3212, 11, 347, 62, 37047, 11, 371, 77, 62, 37047, 11, 309, 77, 62, 37047, 4008, 1174, 17, 198, 198, 69, 15853, 357, 49, 77, 62, 37047, 12, 15197, 68, 18, 8, 1174, 17, 33747, 51, 77, 62, 37047, 12, 51, 62, 45, 8, 1174, 17, 198, 21283, 79, 796, 1391, 6, 87, 10354, 827, 907, 11, 705, 69, 10354, 277, 92, 198, 50, 796, 6124, 13, 21283, 862, 349, 10786, 50, 3256, 705, 541, 8738, 3256, 299, 34431, 8, 198, 411, 796, 311, 7, 87, 15, 28, 87, 15, 8, 198, 198, 33, 796, 581, 17816, 87, 6, 4083, 12853, 3419, 58, 15, 60, 198, 49, 77, 796, 581, 17816, 87, 6, 4083, 12853, 3419, 58, 16, 60, 198, 51, 77, 796, 581, 17816, 87, 6, 4083, 12853, 3419, 58, 17, 60, 198, 198, 4798, 7203, 33, 25, 1600, 347, 11, 366, 49, 16, 25, 1600, 371, 16, 11, 366, 49, 77, 25, 1600, 371, 77, 11, 366, 51, 77, 25, 1600, 309, 77, 8, 198, 198, 489, 83, 13, 26875, 3419, 198, 489, 83, 13, 7839, 7203, 37, 2175, 9104, 329, 8630, 45444, 3691, 13, 34467, 4943, 198, 324, 66, 62, 9521, 796, 45941, 13, 21602, 10223, 7, 1084, 7, 324, 66, 62, 37764, 496, 62, 1326, 34006, 828, 3509, 7, 324, 66, 62, 37764, 496, 62, 1326, 34006, 4008, 198, 489, 83, 13, 29487, 7, 324, 66, 62, 9521, 11, 24189, 7, 324, 66, 62, 9521, 11, 371, 16, 11, 471, 62, 3212, 11, 347, 11, 371, 77, 11, 309, 77, 828, 6167, 2625, 37, 2175, 9104, 4943, 198, 489, 83, 13, 29487, 7, 324, 66, 62, 37764, 496, 62, 1326, 34006, 11, 309, 62, 1326, 34006, 11, 705, 87, 3256, 6167, 2625, 5308, 34006, 4943, 198, 489, 83, 13, 87, 18242, 7203, 2885, 34, 15004, 685, 53, 60, 4943, 198, 489, 83, 13, 2645, 9608, 7203, 30782, 685, 42731, 60, 4943, 198, 489, 83, 13, 1455, 437, 3419, 198, 198, 489, 83, 13, 12860, 3419, 198 ]
1.994956
1,586
import os import re if __name__ == "__main__": filters = [SingleChineseFilter()] diff_file = "C:\\Users\\allen.luo\\Desktop\\diff_filter\\test.diff.txt" differ = DiffFilter(diff_file) differ.filter(filters)
[ 11748, 28686, 198, 11748, 302, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 16628, 796, 685, 28008, 23604, 22417, 3419, 60, 198, 220, 220, 220, 814, 62, 7753, 796, 366, 34, 25, 6852, 14490, 6852, 439, 268, 13, 2290, 78, 6852, 36881, 6852, 26069, 62, 24455, 6852, 9288, 13, 26069, 13, 14116, 1, 198, 220, 220, 220, 13238, 796, 10631, 22417, 7, 26069, 62, 7753, 8, 198, 220, 220, 220, 13238, 13, 24455, 7, 10379, 1010, 8, 198 ]
2.590909
88
from onegov.agency.app import AgencyApp from onegov.agency.initial_content import create_new_organisation from onegov.user import User from os import path from pytest import fixture from sqlalchemy.orm.session import close_all_sessions from tests.shared import Client from tests.shared.utils import create_app from transaction import commit from yaml import dump @fixture(scope='function') @fixture(scope='function') @fixture(scope='function') @fixture(scope='function') @fixture(scope='function')
[ 6738, 530, 9567, 13, 40955, 13, 1324, 1330, 7732, 4677, 198, 6738, 530, 9567, 13, 40955, 13, 36733, 62, 11299, 1330, 2251, 62, 3605, 62, 9971, 5612, 198, 6738, 530, 9567, 13, 7220, 1330, 11787, 198, 6738, 28686, 1330, 3108, 198, 6738, 12972, 9288, 1330, 29220, 198, 6738, 44161, 282, 26599, 13, 579, 13, 29891, 1330, 1969, 62, 439, 62, 82, 6202, 198, 6738, 5254, 13, 28710, 1330, 20985, 198, 6738, 5254, 13, 28710, 13, 26791, 1330, 2251, 62, 1324, 198, 6738, 8611, 1330, 4589, 198, 6738, 331, 43695, 1330, 10285, 628, 198, 31, 69, 9602, 7, 29982, 11639, 8818, 11537, 628, 198, 198, 31, 69, 9602, 7, 29982, 11639, 8818, 11537, 628, 198, 31, 69, 9602, 7, 29982, 11639, 8818, 11537, 628, 198, 31, 69, 9602, 7, 29982, 11639, 8818, 11537, 628, 198, 31, 69, 9602, 7, 29982, 11639, 8818, 11537, 198 ]
3.559441
143
from django.apps import AppConfig from django.db.models.signals import post_migrate def migrate_can_clone_instances(sender, **kwargs): ''' Migrate can clone instances user attribute to permission ''' from django.conf import settings from django.contrib.auth.models import User, Permission from accounts.models import UserAttributes plan = kwargs['plan'] for migration, rolled_back in plan: if migration.app_label == 'instances' and migration.name == '0002_permissionset' and not rolled_back: users = User.objects.all() permission = Permission.objects.get(codename='clone_instances') print('\033[92mMigrating can_clone_instaces user attribute to permission\033[0m') for user in users: if user.userattributes: if user.userattributes.can_clone_instances: user.user_permissions.add(permission) break
[ 6738, 42625, 14208, 13, 18211, 1330, 2034, 16934, 198, 6738, 42625, 14208, 13, 9945, 13, 27530, 13, 12683, 874, 1330, 1281, 62, 76, 42175, 628, 198, 4299, 32492, 62, 5171, 62, 21018, 62, 8625, 1817, 7, 82, 2194, 11, 12429, 46265, 22046, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 337, 42175, 460, 17271, 10245, 2836, 11688, 284, 7170, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 422, 42625, 14208, 13, 10414, 1330, 6460, 198, 220, 220, 220, 422, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 27530, 1330, 11787, 11, 2448, 3411, 198, 220, 220, 220, 422, 5504, 13, 27530, 1330, 11787, 29021, 628, 220, 220, 220, 1410, 796, 479, 86, 22046, 17816, 11578, 20520, 198, 220, 220, 220, 329, 13472, 11, 11686, 62, 1891, 287, 1410, 25, 198, 220, 220, 220, 220, 220, 220, 220, 611, 13472, 13, 1324, 62, 18242, 6624, 705, 8625, 1817, 6, 290, 13472, 13, 3672, 6624, 705, 34215, 62, 525, 8481, 316, 6, 290, 407, 11686, 62, 1891, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2985, 796, 11787, 13, 48205, 13, 439, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7170, 796, 2448, 3411, 13, 48205, 13, 1136, 7, 19815, 12453, 11639, 21018, 62, 8625, 1817, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3601, 10786, 59, 44427, 58, 5892, 76, 44, 3692, 803, 460, 62, 21018, 62, 8625, 2114, 2836, 11688, 284, 7170, 59, 44427, 58, 15, 76, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 329, 2836, 287, 2985, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 2836, 13, 7220, 1078, 7657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 2836, 13, 7220, 1078, 7657, 13, 5171, 62, 21018, 62, 8625, 1817, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2836, 13, 7220, 62, 525, 8481, 13, 2860, 7, 525, 3411, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 628 ]
2.513089
382
# encoding: utf-8 """ Unit test suite for the docx.opc.rel module """ from __future__ import ( absolute_import, division, print_function, unicode_literals ) import pytest from docx.opc.oxml import CT_Relationships from docx.opc.packuri import PackURI from docx.opc.part import Part from docx.opc.rel import _Relationship, Relationships from ..unitutil.mock import ( call, class_mock, instance_mock, Mock, patch, PropertyMock )
[ 2, 21004, 25, 3384, 69, 12, 23, 198, 198, 37811, 198, 26453, 1332, 18389, 329, 262, 2205, 87, 13, 404, 66, 13, 2411, 8265, 198, 37811, 198, 198, 6738, 11593, 37443, 834, 1330, 357, 198, 220, 220, 220, 4112, 62, 11748, 11, 7297, 11, 3601, 62, 8818, 11, 28000, 1098, 62, 17201, 874, 198, 8, 198, 198, 11748, 12972, 9288, 198, 198, 6738, 2205, 87, 13, 404, 66, 13, 1140, 4029, 1330, 16356, 62, 47117, 5748, 198, 6738, 2205, 87, 13, 404, 66, 13, 8002, 9900, 1330, 6400, 47269, 198, 6738, 2205, 87, 13, 404, 66, 13, 3911, 1330, 2142, 198, 6738, 2205, 87, 13, 404, 66, 13, 2411, 1330, 4808, 47117, 1056, 11, 13883, 5748, 198, 198, 6738, 11485, 20850, 22602, 13, 76, 735, 1330, 357, 198, 220, 220, 220, 869, 11, 1398, 62, 76, 735, 11, 4554, 62, 76, 735, 11, 44123, 11, 8529, 11, 14161, 44, 735, 198, 8, 628, 198 ]
2.87013
154
#!/usr/local/bin/python3.6 # vim: expandtab shiftwidth=4 # Copyright (C) 2020 National Institute of Informatics # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. import pytest from sinetstream import MessageReader, MessageWriter, InvalidArgumentError from conftest import ( SERVICE, TOPIC, BROKER, WS_BROKER, WSS_BROKER, CACERT_PATH, ) from itertools import product pytestmark = pytest.mark.usefixtures('setup_config') @pytest.mark.parametrize("io,config_params", product( [MessageReader, MessageWriter], [{'protocol': x} for x in ['MQTTv31', 'MQTTv311', 'MQTTv5']], )) @pytest.mark.parametrize("io,config_params", [ (MessageReader, {'protocol': 'xxx'}), (MessageWriter, {'protocol': 'xxx'}), ]) @pytest.mark.parametrize("io,config_params", [ (MessageReader, {'transport': 'tcp'}), (MessageWriter, {'transport': 'tcp'}), ]) @pytest.mark.skipif(WS_BROKER is None, reason='MQTT_WS_BROKER is not set.') @pytest.mark.parametrize("io,config_params,config_brokers", [ (MessageReader, {'transport': 'websockets'}, WS_BROKER), (MessageWriter, {'transport': 'websockets'}, WS_BROKER), ]) wss_params = { 'transport': 'websockets', 'tls': { 'ca_certs': str(CACERT_PATH), }, } @pytest.mark.skipif(WSS_BROKER is None, reason='MQTT_WSS_BROKER is not set.') @pytest.mark.parametrize("io,config_params,config_brokers", [ (MessageReader, wss_params, WSS_BROKER), (MessageWriter, wss_params, WSS_BROKER), ]) @pytest.mark.parametrize("io,config_params", [ (MessageReader, {'transport': 'xxx'}), (MessageWriter, {'transport': 'xxx'}), ]) @pytest.mark.parametrize("io,config_params", product( [MessageReader, MessageWriter], [{'clean_session': x} for x in [True, False]], )) @pytest.mark.parametrize("io,config_params", product( [MessageReader, MessageWriter], [{'max_inflight_messages_set': {'inflight': x}} for x in [20, 40]], )) @pytest.mark.parametrize("io,config_params", product( [MessageReader, MessageWriter], [{'max_queued_messages_set': {'queue_size': x}} for x in [0, 10]], )) @pytest.mark.parametrize("io,config_params", product( [MessageReader, MessageWriter], [{'message_retry_set': {'retry': x}} for x in [5, 10]], )) ws_set_options_params = { 'transport': 'websockets', 'ws_set_options': { 'path': '/mqtt', }, } @pytest.mark.skipif(WS_BROKER is None, reason='MQTT_WS_BROKER is not set.') @pytest.mark.parametrize("io,config_params,config_brokers", [ (MessageReader, ws_set_options_params, WS_BROKER), (MessageWriter, ws_set_options_params, WS_BROKER), ]) will_set_params = { 'will_set': { 'topic': TOPIC, 'payload': 'XXX', 'qos': 1, 'retain': True, } } @pytest.mark.parametrize("io,config_params", [ (MessageReader, will_set_params), (MessageWriter, will_set_params), ]) reconnect_delay_params = { 'reconnect_delay_set': { 'min_delay': 1, 'max_delay': 120, } } @pytest.mark.parametrize("io,config_params", [ (MessageReader, reconnect_delay_params), (MessageWriter, reconnect_delay_params), ])
[ 2, 48443, 14629, 14, 12001, 14, 8800, 14, 29412, 18, 13, 21, 198, 2, 43907, 25, 4292, 8658, 6482, 10394, 28, 19, 198, 198, 2, 15069, 357, 34, 8, 12131, 2351, 5136, 286, 554, 18982, 873, 198, 2, 198, 2, 49962, 284, 262, 24843, 10442, 5693, 357, 1921, 37, 8, 739, 530, 198, 2, 393, 517, 18920, 5964, 11704, 13, 220, 4091, 262, 28536, 2393, 198, 2, 9387, 351, 428, 670, 329, 3224, 1321, 198, 2, 5115, 6634, 9238, 13, 220, 383, 7054, 37, 16625, 428, 2393, 198, 2, 284, 345, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 198, 2, 366, 34156, 15341, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 198, 2, 351, 262, 13789, 13, 220, 921, 743, 7330, 257, 4866, 286, 262, 13789, 379, 198, 2, 198, 2, 220, 220, 2638, 1378, 2503, 13, 43073, 13, 2398, 14, 677, 4541, 14, 43, 2149, 24290, 12, 17, 13, 15, 198, 2, 198, 2, 17486, 2672, 416, 9723, 1099, 393, 4987, 284, 287, 3597, 11, 198, 2, 3788, 9387, 739, 262, 13789, 318, 9387, 319, 281, 198, 2, 366, 1921, 3180, 1, 29809, 1797, 11, 42881, 34764, 11015, 6375, 7102, 49828, 11053, 3963, 15529, 198, 2, 509, 12115, 11, 2035, 4911, 393, 17142, 13, 220, 4091, 262, 13789, 329, 262, 198, 2, 2176, 3303, 15030, 21627, 290, 11247, 198, 2, 739, 262, 13789, 13, 198, 198, 11748, 12972, 9288, 198, 6738, 7813, 316, 5532, 1330, 16000, 33634, 11, 16000, 34379, 11, 17665, 28100, 1713, 12331, 198, 6738, 369, 701, 395, 1330, 357, 198, 220, 220, 220, 47453, 11, 28662, 2149, 11, 11177, 11380, 1137, 11, 25290, 62, 11473, 11380, 1137, 11, 370, 5432, 62, 11473, 11380, 1137, 11, 327, 2246, 17395, 62, 34219, 11, 198, 8, 198, 6738, 340, 861, 10141, 1330, 1720, 198, 198, 9078, 9288, 4102, 796, 12972, 9288, 13, 4102, 13, 1904, 69, 25506, 10786, 40406, 62, 11250, 11537, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 952, 11, 11250, 62, 37266, 1600, 1720, 7, 198, 220, 220, 220, 685, 12837, 33634, 11, 16000, 34379, 4357, 198, 220, 220, 220, 685, 90, 6, 11235, 4668, 10354, 2124, 92, 329, 2124, 287, 37250, 49215, 15751, 85, 3132, 3256, 705, 49215, 15751, 85, 36244, 3256, 705, 49215, 15751, 85, 20, 20520, 4357, 198, 4008, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 952, 11, 11250, 62, 37266, 1600, 685, 198, 220, 220, 220, 357, 12837, 33634, 11, 1391, 6, 11235, 4668, 10354, 705, 31811, 6, 92, 828, 198, 220, 220, 220, 357, 12837, 34379, 11, 1391, 6, 11235, 4668, 10354, 705, 31811, 6, 92, 828, 198, 12962, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 952, 11, 11250, 62, 37266, 1600, 685, 198, 220, 220, 220, 357, 12837, 33634, 11, 1391, 6, 7645, 634, 10354, 705, 83, 13155, 6, 92, 828, 198, 220, 220, 220, 357, 12837, 34379, 11, 1391, 6, 7645, 634, 10354, 705, 83, 13155, 6, 92, 828, 198, 12962, 628, 198, 31, 9078, 9288, 13, 4102, 13, 48267, 361, 7, 19416, 62, 11473, 11380, 1137, 318, 6045, 11, 1738, 11639, 49215, 15751, 62, 19416, 62, 11473, 11380, 1137, 318, 407, 900, 2637, 8, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 952, 11, 11250, 62, 37266, 11, 11250, 62, 7957, 15949, 1600, 685, 198, 220, 220, 220, 357, 12837, 33634, 11, 1391, 6, 7645, 634, 10354, 705, 732, 1443, 11603, 6, 5512, 25290, 62, 11473, 11380, 1137, 828, 198, 220, 220, 220, 357, 12837, 34379, 11, 1391, 6, 7645, 634, 10354, 705, 732, 1443, 11603, 6, 5512, 25290, 62, 11473, 11380, 1137, 828, 198, 12962, 628, 198, 86, 824, 62, 37266, 796, 1391, 198, 220, 220, 220, 705, 7645, 634, 10354, 705, 732, 1443, 11603, 3256, 198, 220, 220, 220, 705, 83, 7278, 10354, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 705, 6888, 62, 22583, 82, 10354, 965, 7, 34, 2246, 17395, 62, 34219, 828, 198, 220, 220, 220, 8964, 198, 92, 628, 198, 31, 9078, 9288, 13, 4102, 13, 48267, 361, 7, 54, 5432, 62, 11473, 11380, 1137, 318, 6045, 11, 1738, 11639, 49215, 15751, 62, 54, 5432, 62, 11473, 11380, 1137, 318, 407, 900, 2637, 8, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 952, 11, 11250, 62, 37266, 11, 11250, 62, 7957, 15949, 1600, 685, 198, 220, 220, 220, 357, 12837, 33634, 11, 266, 824, 62, 37266, 11, 370, 5432, 62, 11473, 11380, 1137, 828, 198, 220, 220, 220, 357, 12837, 34379, 11, 266, 824, 62, 37266, 11, 370, 5432, 62, 11473, 11380, 1137, 828, 198, 12962, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 952, 11, 11250, 62, 37266, 1600, 685, 198, 220, 220, 220, 357, 12837, 33634, 11, 1391, 6, 7645, 634, 10354, 705, 31811, 6, 92, 828, 198, 220, 220, 220, 357, 12837, 34379, 11, 1391, 6, 7645, 634, 10354, 705, 31811, 6, 92, 828, 198, 12962, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 952, 11, 11250, 62, 37266, 1600, 1720, 7, 198, 220, 220, 220, 685, 12837, 33634, 11, 16000, 34379, 4357, 198, 220, 220, 220, 685, 90, 6, 27773, 62, 29891, 10354, 2124, 92, 329, 2124, 287, 685, 17821, 11, 10352, 60, 4357, 198, 4008, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 952, 11, 11250, 62, 37266, 1600, 1720, 7, 198, 220, 220, 220, 685, 12837, 33634, 11, 16000, 34379, 4357, 198, 220, 220, 220, 685, 90, 6, 9806, 62, 259, 22560, 62, 37348, 1095, 62, 2617, 10354, 1391, 6, 259, 22560, 10354, 2124, 11709, 329, 2124, 287, 685, 1238, 11, 2319, 60, 4357, 198, 4008, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 952, 11, 11250, 62, 37266, 1600, 1720, 7, 198, 220, 220, 220, 685, 12837, 33634, 11, 16000, 34379, 4357, 198, 220, 220, 220, 685, 90, 6, 9806, 62, 4188, 1739, 62, 37348, 1095, 62, 2617, 10354, 1391, 6, 36560, 62, 7857, 10354, 2124, 11709, 329, 2124, 287, 685, 15, 11, 838, 60, 4357, 198, 4008, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 952, 11, 11250, 62, 37266, 1600, 1720, 7, 198, 220, 220, 220, 685, 12837, 33634, 11, 16000, 34379, 4357, 198, 220, 220, 220, 685, 90, 6, 20500, 62, 1186, 563, 62, 2617, 10354, 1391, 6, 1186, 563, 10354, 2124, 11709, 329, 2124, 287, 685, 20, 11, 838, 60, 4357, 198, 4008, 628, 198, 18504, 62, 2617, 62, 25811, 62, 37266, 796, 1391, 198, 220, 220, 220, 705, 7645, 634, 10354, 705, 732, 1443, 11603, 3256, 198, 220, 220, 220, 705, 18504, 62, 2617, 62, 25811, 10354, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 705, 6978, 10354, 31051, 76, 80, 926, 3256, 198, 220, 220, 220, 8964, 198, 92, 628, 198, 31, 9078, 9288, 13, 4102, 13, 48267, 361, 7, 19416, 62, 11473, 11380, 1137, 318, 6045, 11, 1738, 11639, 49215, 15751, 62, 19416, 62, 11473, 11380, 1137, 318, 407, 900, 2637, 8, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 952, 11, 11250, 62, 37266, 11, 11250, 62, 7957, 15949, 1600, 685, 198, 220, 220, 220, 357, 12837, 33634, 11, 266, 82, 62, 2617, 62, 25811, 62, 37266, 11, 25290, 62, 11473, 11380, 1137, 828, 198, 220, 220, 220, 357, 12837, 34379, 11, 266, 82, 62, 2617, 62, 25811, 62, 37266, 11, 25290, 62, 11473, 11380, 1137, 828, 198, 12962, 628, 198, 10594, 62, 2617, 62, 37266, 796, 1391, 198, 220, 220, 220, 705, 10594, 62, 2617, 10354, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 705, 26652, 10354, 28662, 2149, 11, 198, 220, 220, 220, 220, 220, 220, 220, 705, 15577, 2220, 10354, 705, 43145, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 705, 80, 418, 10354, 352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 705, 1186, 391, 10354, 6407, 11, 198, 220, 220, 220, 1782, 198, 92, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 952, 11, 11250, 62, 37266, 1600, 685, 198, 220, 220, 220, 357, 12837, 33634, 11, 481, 62, 2617, 62, 37266, 828, 198, 220, 220, 220, 357, 12837, 34379, 11, 481, 62, 2617, 62, 37266, 828, 198, 12962, 628, 198, 260, 8443, 62, 40850, 62, 37266, 796, 1391, 198, 220, 220, 220, 705, 260, 8443, 62, 40850, 62, 2617, 10354, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 705, 1084, 62, 40850, 10354, 352, 11, 198, 220, 220, 220, 220, 220, 220, 220, 705, 9806, 62, 40850, 10354, 7982, 11, 198, 220, 220, 220, 1782, 198, 92, 628, 198, 31, 9078, 9288, 13, 4102, 13, 17143, 316, 380, 2736, 7203, 952, 11, 11250, 62, 37266, 1600, 685, 198, 220, 220, 220, 357, 12837, 33634, 11, 37671, 62, 40850, 62, 37266, 828, 198, 220, 220, 220, 357, 12837, 34379, 11, 37671, 62, 40850, 62, 37266, 828, 198, 12962, 198 ]
2.587842
1,497
# from distutils.core import setup # setup(name='helper', # version='0.1.1', # py_modules=['upload_github'], # data_files=[('config', ['mysql.cfg'])], # ) # from setuptools import setup # # setup( # name='mypackage', # version='0.0.1', # packages=['mypackage'], # install_requires=[ # 'requests', # 'importlib; python_version == "2.6"', # ], # )
[ 2, 422, 1233, 26791, 13, 7295, 1330, 9058, 198, 2, 9058, 7, 3672, 11639, 2978, 525, 3256, 198, 2, 220, 220, 220, 220, 220, 220, 2196, 11639, 15, 13, 16, 13, 16, 3256, 198, 2, 220, 220, 220, 220, 220, 220, 12972, 62, 18170, 28, 17816, 25850, 62, 12567, 6, 4357, 198, 2, 220, 220, 220, 220, 220, 220, 1366, 62, 16624, 41888, 10786, 11250, 3256, 37250, 28744, 13976, 13, 37581, 6, 12962, 4357, 198, 2, 220, 220, 220, 220, 220, 220, 1267, 198, 198, 2, 422, 900, 37623, 10141, 1330, 9058, 198, 2, 220, 198, 2, 9058, 7, 198, 2, 220, 220, 220, 220, 1438, 11639, 1820, 26495, 3256, 198, 2, 220, 220, 220, 220, 2196, 11639, 15, 13, 15, 13, 16, 3256, 198, 2, 220, 220, 220, 220, 10392, 28, 17816, 1820, 26495, 6, 4357, 198, 2, 220, 220, 220, 220, 2721, 62, 47911, 41888, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 705, 8897, 3558, 3256, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 705, 11748, 8019, 26, 21015, 62, 9641, 6624, 366, 17, 13, 21, 1, 3256, 198, 2, 220, 220, 220, 220, 16589, 198, 2, 1267 ]
2.087179
195
__copyright__ = 'Copyright 2021, The RADICAL-Cybertools Team' __license__ = 'MIT' import glob import radical.utils as ru from radical.dreamer.units import Core, Task, CORE_STATE from unittest import TestCase TEST_CASES_PATH = 'tests/unit_tests/test_units/test_cases/core.*.json'
[ 198, 834, 22163, 4766, 834, 796, 705, 15269, 33448, 11, 383, 33540, 20151, 12, 20418, 4835, 10141, 4816, 6, 198, 834, 43085, 834, 220, 220, 796, 705, 36393, 6, 198, 198, 11748, 15095, 198, 198, 11748, 7702, 13, 26791, 355, 7422, 198, 198, 6738, 7702, 13, 25966, 263, 13, 41667, 1330, 7231, 11, 15941, 11, 327, 6965, 62, 44724, 198, 198, 6738, 555, 715, 395, 1330, 6208, 20448, 198, 198, 51, 6465, 62, 34, 1921, 1546, 62, 34219, 796, 705, 41989, 14, 20850, 62, 41989, 14, 9288, 62, 41667, 14, 9288, 62, 33964, 14, 7295, 15885, 13, 17752, 6, 628 ]
2.88
100
import entity, allocate import numpy as nump import datetime from copy import deepcopy ndsa = 58 #######################################################################Event Processes#################################################################################### def Arrival(arrivalinfo, Sim, Stat, OPTN): """ This function simulates the arrival of patients. It computes the MELD score of the patient and adds him to the corresponding DSA waiting list. Input: @arrivalinfo: all the patient's information @Sim: class object that contains variables relevant to the simulation @Stat: class object that containts statistical info of the simulation @OPTN: complete patient data Output: @Sim: updated Sim @Stat: updated Stat @OPTN updated OPTN """ #Create Patient Entity newpatient = entity.Patient(arrivalinfo[1].astype(int),arrivalinfo[3].astype(int),Sim.clock) #Assign Patient Characteristics newpatient.Status1 = arrivalinfo[9].astype(int) newpatient.ABO = arrivalinfo[5].astype(int) newpatient.HCC = arrivalinfo[8].astype(int) newpatient.Na = arrivalinfo[10].astype(int) newpatient.lMELD = arrivalinfo[7].astype(int) newpatient.MELD = arrivalinfo[6].astype(int) newpatient.Inactive = arrivalinfo[11].astype(int) #Assign Allocation MELD based on policy if Sim.sodium ==1: #if sodium policy is selected #bound the sodium score effective_na = newpatient.Na if effective_na <125: effective_na = 125 elif effective_na > 137: effective_na = 137 #compute the allocation MELD score if nump.rint(newpatient.lMELD + 1.32*(137-effective_na)-(0.033*newpatient.lMELD*(137-effective_na))) <6: newpatient.MELD =6 elif nump.rint(newpatient.lMELD + 1.32*(137-effective_na)-(0.033*newpatient.lMELD*(137-effective_na))) > 40: newpatient.MELD =40 else: newpatient.MELD = nump.rint(newpatient.lMELD + 1.32*(137-effective_na)-(0.033*newpatient.lMELD*(137-effective_na))) else: #if sodium policy not selected #bound the sodium score if newpatient.MELD <6: newpatient.MELD =6 elif newpatient.MELD >40: newpatient.MELD = 40 #Apply Status1 and HCC exceptions (if applicable) if newpatient.Status1 ==1: newpatient.MELD =41 elif newpatient.HCC ==1 and Sim.capanddelay ==1: newpatient.MELD = min(newpatient.lMELD,28) #Place Patient in DSA List if newpatient.DSA >= 0: OPTN[newpatient.DSA].append(newpatient) #Update Stats Stat.yarrivals[newpatient.DSA] = Stat.yarrivals[newpatient.DSA] + 1 Stat.numcandidates[newpatient.DSA] = Stat.numcandidates[newpatient.DSA] + 1 #return updated Sim, Stat, and OPTN return Sim, Stat, OPTN #Diagnostic Info #here def Progression(proginfo, Sim, Stat, OPTN, reps): """ This function searches for a particular patient from the OPTN data structure and update the patient's characteristics Input: @proginfo: all of the information of the patient being searched up @Sim: class object containing relevant information of the patient being searched up @Stat: class object containing statistical information of the simulation @OPTN: complete patient data @reps: current replication number Output: @Sim: updated Sim @Stat: updated Stat @OPTN: updated OPTN """ progdsa = proginfo[9].astype(int) #obtain DSA #test =0 #run if we have an actual DSA if progdsa >=0: #search for patient in the OPTN data structure for i, patient in enumerate(OPTN[progdsa]): #check if the id matches if patient.id == proginfo[1].astype(int): #Update Patient if patient.Relist ==1: #Ignore updates for relisted patients break elif proginfo[3].astype(int) == 1: #Patient dies, remove and update stats Stat.ydeaths[progdsa] = Stat.ydeaths[progdsa] + 1 #increment the number of deaths by one Stat.numcandidates[progdsa] = Stat.numcandidates[progdsa] - 1 #decrement the number of candidates waiting by one del OPTN[progdsa][i] #delete the patient object since patient died break elif proginfo[4].astype(int) ==1: #Patient removed, remove and update stats Stat.yremoved[progdsa] = Stat.yremoved[progdsa] + 1 #increment the number of removals by one Stat.numcandidates[progdsa] = Stat.numcandidates[progdsa] - 1 #decrement the number of candidates waiting by one #record as follows (time of removal, repetition, patient id, patient allocation MELD, patient lab MELD) oidreport = [nump.floor(Sim.clock), reps, Sim.clock, patient.id,patient.MELD, patient.lMELD] Sim.record_removals = nump.vstack((Sim.record_removals, oidreport)) #concatenate the row oidreport to the record of removals del OPTN[progdsa][i] #delete patient object since patient is removed break else: #Update candidate patient.lMELD = proginfo[6].astype(int) patient.Na = proginfo[7].astype(int) patient.MELD = proginfo[5].astype(int) patient.Inactive = proginfo[10].astype(int) #set bound on MELD score if patient.MELD <6: patient.MELD =6 elif patient.MELD >40: patient.MELD = 40 #Update Allocation MELD based on policy (if applicable) if Sim.sodium ==1 and patient.Status1 != 1 and patient.HCC != 1: #if sodium score policy is selected, then update the meld score for non-status1, non-HCC patient #set bound on sodium score effective_na = patient.Na if effective_na <125: effective_na = 125 elif effective_na > 137: effective_na = 137 #compute MELD score if nump.rint(patient.lMELD + 1.32*(137-effective_na)-(0.033*patient.lMELD*(137-effective_na))) <6: patient.MELD =6 elif nump.rint(patient.lMELD + 1.32*(137-effective_na)-(0.033*patient.lMELD*(137-effective_na))) > 40: patient.MELD =40 else: patient.MELD = nump.rint(patient.lMELD + 1.32*(137-effective_na)-(0.033*patient.lMELD*(137-effective_na))) elif Sim.capanddelay ==1 and patient.Status1 != 1 and patient.HCC == 1: #if cap and delay policy is selected, update meld score for status1, HCC patient #compute MELD score if Sim.clock - patient.create_time <= .5: patient.MELD = max(28,patient.MELD) elif (Sim.clock - patient.create_time) > .5 and (Sim.clock - patient.create_time <= .75): patient.MELD = max(29,patient.MELD) elif (Sim.clock - patient.create_time) > .75 and (Sim.clock - patient.create_time <= 1): patient.MELD = max(31,patient.MELD) elif (Sim.clock - patient.create_time) > 1 and (Sim.clock - patient.create_time <= 1.25): patient.MELD = max(33,patient.MELD) elif (Sim.clock - patient.create_time) > 1.25 and (Sim.clock - patient.create_time <= 1.5): patient.MELD = max(34,patient.MELD) else: patient.MELD = min(patient.MELD+1,40) break #return updated Sim, Stat, and OPTN return Sim, Stat, OPTN def OrganArrival(organinfo, Sim, Stat, OPTN, Regions, SharingPartners, Patients_Accept, Donor_Accept, DSA_Avg_Times, AcceptanceModelS1, AcceptanceModel, Relist, reps): """ This function simulates the organ arrival. It tries to match the organ to a patient from the corresponding DSA waitlist. Input: @organinfo: information on the organ @Sim: class object containing relevant variables for simulation @Stat: class object containing statistical information of simulation @OPTN: complete patient data @Regions: neighbhorhood map for regions, districts, or neighbhorhoods @SharingPartners: neighborhood map adding sharing partners to existing geographic relationships among OPOs @Patients_Accept: coefficients regarding donor's characteristics for acceptance model @Donor_Accept: coefficients regarding donor's characteristics for acceptance model @DSA_Avg_Times: data on average transport times between DSAs @AcceptanceModelS1: coefficients regarding patient's characteristics for status-1 acceptance model @AccpetanceModel: coefficients regarding patient's characteristics for non-status-1 acceptance model @Relist: values regarding the probability that a transplanted patient will relist @reps: replication number Output: @Sim: updated Sim @Stat: updated Stat @OPTN: updated OPTN """ #Create Organ neworgan = entity.Organ(int(organinfo[2])) neworgan.organid = Sim.oid Sim.oid = Sim.oid + 1 #Assign Organ Attributes neworgan.ABO = organinfo[4].astype(int) #Allocate Organ #disposition is tuple of organ status (accept/reject) , transplanting DSA, and patient id if accepted disposition = allocate.Allocate(neworgan, OPTN, Sim, Regions, SharingPartners, Patients_Accept, Donor_Accept, DSA_Avg_Times, AcceptanceModelS1, AcceptanceModel) if disposition[0] == 1: #organ is transplanted #Remove transplanted patient from waiting list and update statistics for i, patient in enumerate(OPTN[disposition[1]]): #search for the patient in the OPTN data structure if patient.id == disposition[2]: #Determine if patient will relist and assign special attributes if necesary willrelist = 0 if patient.Relist ==0: #if patient has not been relisted #Determine if patient will be relisted if was not already r1 =nump.random.uniform(Relist[0],Relist[1],1) r2 =nump.random.uniform(0,1,1) if r2 < r1: willrelist =1 #Determine when current graft will fail r3 = nump.random.uniform(0,1,1) if r3 < .4: patient.RelistTxTime = Sim.clock + 5 elif r3 >= .4 and r3 < .6: patient.RelistTxTime = Sim.clock + 2 elif r3 >= 6 and r3 < .8: patient.RelistTxTime = Sim.clock + 1 else: patient.RelistTxTime = Sim.clock #Update relist statistics Stat.yrelists[disposition[1]] = Stat.yrelists[disposition[1]] +1 #record the floor of current time, reptitiion, current time, patient id, patient meld score, and relist tx time relistidreport = [nump.floor(Sim.clock), reps, Sim.clock, patient.id,patient.MELD,patient.RelistTxTime] #concatenate the relistidreport to the record of relists Sim.record_relists = nump.vstack((Sim.record_relists, relistidreport)) #Update Stats for Transplants #Number of Transplants and Regrafts Stat.ytransplants[disposition[1]] = Stat.ytransplants[disposition[1]] +1 Sim.record_txDSA[neworgan.DSA,disposition[1]] = Sim.record_txDSA[neworgan.DSA,disposition[1]] +1 if patient.Relist ==1: #if patient is relisted Stat.yregrafts[disposition[1]] = Stat.yregrafts[disposition[1]] +1 #increase number of retransplanted patients by 1 #Compute waiting Time if patient.Relist ==0: #if patient is not relisted Stat.ywait[disposition[1]] = Stat.ywait[disposition[1]] + (Sim.clock - patient.create_time) else: #if patient is relisted Stat.ywait[disposition[1]] = Stat.ywait[disposition[1]] + (Sim.clock - patient.RelistTxTime) #Waiting List Sizes if willrelist ==0: Stat.numcandidates[disposition[1]] = Stat.numcandidates[disposition[1]] -1 #decrease the number of waitling list candidates for the DSA by 1 #1st Transplant MELD if patient.Status1 ==0 and patient.Relist ==0: #Tx-MELD at measure assumed to exclude re-grafts Stat.yMELD[disposition[1]] = Stat.yMELD[disposition[1]] + patient.MELD #increase the MELD score the DSA Stat.ymedMELD[disposition[1]].append(patient.MELD) #record the patient MELD score #Output for Posttransplant processing for those who were not ever relisted or will be if willrelist ==0 and patient.Relist ==0: regtx =0 nattx = 0 if patient.DSA != neworgan.DSA and (Regions[neworgan.DSA,patient.DSA] ==1 or SharingPartners[neworgan.DSA, patient.DSA] == 1): regtx =1 #patient had regional transplant elif patient.DSA != neworgan.DSA: nattx=1 #patient had national transplant #record the floor of the current time, repetition, current time, patient id, indicator for regional transplant, indicator for national #transplant txidreport = [nump.floor(Sim.clock), reps, Sim.clock, patient.id,regtx,nattx] Sim.record_txID = nump.vstack((Sim.record_txID, txidreport)) #add new record to list of transplant records #record as follows (time of removal, repetition, patient id, patient allocation MELD, patient lab MElD) oidreport = [nump.floor(Sim.clock), reps, Sim.clock, patient.id,Sim.oid] #add to list of transplant records Sim.record_doID = nump.vstack((Sim.record_doID, oidreport)) #Out for Posttransplant proceesing for regrafts if patient.Relist ==1: regtx =0 #indicator for regional transplant nattx = 0 #indicator for national transplant if patient.DSA != neworgan.DSA and (Regions[neworgan.DSA,patient.DSA] ==1 or SharingPartners[neworgan.DSA, patient.DSA] == 1): regtx =1 #patient had regional transplant elif patient.DSA != neworgan.DSA: nattx=1 #patient had national transplant #record the floor of the current time, repetition, current time, patient id, indicator for regional transplant, indicator for national transplant txidreport = [nump.floor(Sim.clock), reps, Sim.clock, patient.id,regtx,nattx] #add to list of relisted transplants Sim.record_txIDregraft = nump.vstack((Sim.record_txIDregraft, txidreport)) #record as follows (time of removal, repetition, patient id, patient allocation MELD, patient lab MELD) oidreport = [nump.floor(Sim.clock), reps, Sim.clock, patient.id,Sim.oid] #add to list of retransplant records Sim.record_doIDregraft = nump.vstack((Sim.record_doIDregraft, oidreport)) if willrelist ==1: #if patient will relist, update relist status and MELD score OPTN[disposition[1]][i].Relist =1 OPTN[disposition[1]][i].MELD = 32 OPTN[disposition[1]][i].lMELD = 32 else: #remove transplanted patient if will not be relisted del OPTN[disposition[1]][i] break else: #organ is discarded; update statistics (optional) pass #return updated Sim, Stat, and OPTN return Sim, Stat, OPTN def Year(Sim, Stat, reps): """ This function updates the statistics of the simulation per year Input: @Sim: class object that contains relevant variables for the simulation @Stat: class object that contains statistical information of the simulation @reps: current replication number Output: @Sim: updated Sim @Stat: updated Stat """ #Annual Disparity Statistics mr_1 = nump.zeros(shape=(ndsa,1),dtype=float) tr_1 = nump.zeros(shape=(ndsa,1),dtype=float) wt_1 = nump.zeros(shape=(ndsa,1),dtype=float) meld_l = nump.zeros(shape=(ndsa,1),dtype=float) for i in range(0,ndsa): if Stat.ytransplants[i] > 0: wt_1[i] = Stat.ywait[i] / Stat.ytransplants[i] #compute the total waiting list/total # of transplant per DSA meld_l[i] = Stat.yMELD[i] / Stat.ytransplants[i] #compute the total MELD score/total # of transplant per DSA else: #write nan if no values available wt_1[i] = nump.nan meld_l[i] = nump.nan if (Stat.yarrivals[i] + Stat.ycandidates[i]) == 0: #write nan if no values available mr_1[i] = nump.nan tr_1[i] = nump.nan else: mr_1[i] = Stat.ydeaths[i] / (Stat.yarrivals[i] + Stat.ycandidates[i]) #compute mortality rate (number of deaths/number of waiting candidates) tr_1[i] = Stat.ytransplants[i] / (Stat.yarrivals[i] + Stat.ycandidates[i]) #compute transplant rate (number of transplants/number of waiting candidates) #compute the median MELD score medianmelds = nump.zeros(shape=(ndsa,1),dtype=float) for i in range(0,ndsa): if Stat.ymedMELD[i] != []: medianmelds[i] = nump.nanmedian(Stat.ymedMELD[i]) else: medianmelds[i] = nump.nan #Intermediate Data Outputs #nump.savetxt("Output_check.txt", Stat.numcandidates, fmt='%1.4e', delimiter='\t', newline='\n') #nump.savetxt("Output_check2.txt", Stat.yremoved, fmt='%1.4e', delimiter='\t', newline='\n') #nump.savetxt("Output_check3.txt", Stat.yarrivals, fmt='%1.4e', delimiter='\t', newline='\n') #nump.savetxt("Output_check4.txt", Stat.ydeaths, fmt='%1.4e', delimiter='\t', newline='\n') #nump.savetxt("Output_check5.txt", Stat.ytransplants, fmt='%1.4e', delimiter='\t', newline='\n') #nump.savetxt("Output_check6.txt", mr_1, fmt='%1.4e', delimiter='\t', newline='\n') mr_numdeaths = [nump.sum(Stat.ydeaths),nump.floor(Sim.clock),reps] #record the total number of deaths along with its current time and current repetition #mr_disparity = [nump.linalg.norm(mr_1,ord=1),nump.floor(Sim.clock),reps] #tx_disparity = [nump.linalg.norm(tr_1,ord=1),nump.floor(Sim.clock),reps] #wt_disparity = [nump.linalg.norm(wt_1,ord=1),nump.floor(Sim.clock),reps] mr_disparity_mean = [nump.nanmean(mr_1),nump.floor(Sim.clock),reps] #record the mean mortality rate along with its current time and current repetition mr_disparity_std = [nump.nanstd(mr_1),nump.floor(Sim.clock),reps] #record the standard deviation of mortality rate along withs current time and current repetition meld_disparity_mean = [nump.nanmean(meld_l),nump.floor(Sim.clock),reps] #record the mean MELD score along with current time and current repetition meld_disparity_std = [nump.nanstd(meld_l),nump.floor(Sim.clock),reps] #record the standard deviation of the MELD score along with current time and current repetition medmeld_mean = [nump.nanmean(medianmelds),nump.floor(Sim.clock),reps] #record the mean median MELD score along with current time and current repetition medmeld_std = [nump.nanstd(medianmelds),nump.floor(Sim.clock),reps] #record the standard deviation of the median MELD score along with current time and current repetition #print(tx_disparity) #add the records to the list of yearly statistics Sim.record_deaths = nump.vstack((Sim.record_deaths, mr_numdeaths)) Sim.record_mr_disparity_mean = nump.vstack((Sim.record_mr_disparity_mean, mr_disparity_mean)) Sim.record_mr_disparity_std = nump.vstack((Sim.record_mr_disparity_std, mr_disparity_std)) Sim.record_meld_disparity_mean = nump.vstack((Sim.record_meld_disparity_mean, meld_disparity_mean)) Sim.record_meld_disparity_std = nump.vstack((Sim.record_meld_disparity_std, meld_disparity_std)) Sim.record_medMELDmean = nump.vstack((Sim.record_medMELDmean, medmeld_mean)) Sim.record_medMELDstd = nump.vstack((Sim.record_medMELDstd, medmeld_std)) Sim.record_txDSAoutput = nump.vstack((Sim.record_txDSAoutput, Sim.record_txDSA)) #create array that records the current time and repetition recindex =nump.ndarray(shape=(1,3)) recindex[0,0] = nump.floor(Sim.clock) recindex[0,1] = reps #add DSA vector regarding deaths, transplants, etc. to the list of records Sim.record_ydeaths =nump.concatenate((Sim.record_ydeaths,nump.concatenate((recindex,nump.transpose(Stat.ydeaths)),axis=1)),axis=0) Sim.record_ytransplants = nump.concatenate((Sim.record_ytransplants,nump.concatenate((recindex,nump.transpose(Stat.ytransplants)),axis=1)),axis=0) Sim.record_yarrivals = nump.concatenate((Sim.record_yarrivals,nump.concatenate((recindex,nump.transpose(Stat.yarrivals)),axis=1)),axis=0) Sim.record_ycandidates = nump.concatenate((Sim.record_ycandidates,nump.concatenate((recindex,nump.transpose(Stat.ycandidates)),axis=1)),axis=0) Sim.record_yremoved =nump.concatenate((Sim.record_yremoved,nump.concatenate((recindex,nump.transpose(Stat.yremoved)),axis=1)),axis=0) Sim.record_ywait = nump.concatenate((Sim.record_ywait,nump.concatenate((recindex,nump.transpose(Stat.ywait)),axis=1)),axis=0) Sim.record_yMELD = nump.concatenate((Sim.record_yMELD,nump.concatenate((recindex,nump.transpose(Stat.yMELD)),axis=1)),axis=0) Sim.record_yrelists =nump.concatenate((Sim.record_yrelists,nump.concatenate((recindex,nump.transpose(Stat.yrelists)),axis=1)),axis=0) Sim.record_yregrafts =nump.concatenate((Sim.record_yregrafts,nump.concatenate((recindex,nump.transpose(Stat.yregrafts)),axis=1)),axis=0) #Reset Statistics for Following Year Stat.yarrivals = nump.zeros(shape=(ndsa,1),dtype=int) Stat.ydeaths = nump.zeros(shape=(ndsa,1),dtype=int) Stat.yremoved = nump.zeros(shape=(ndsa,1),dtype=int) Stat.ytransplants = nump.zeros(shape=(ndsa,1),dtype=int) Stat.ycandidates = deepcopy(Stat.numcandidates) Stat.ywait = nump.zeros(shape=(ndsa,1),dtype=float) Stat.yMELD = nump.zeros(shape=(ndsa,1),dtype=int) Stat.ymedMELD = [[] for i in range(0,ndsa)] Stat.yrelists = nump.zeros(shape=(ndsa,1),dtype=int) Stat.yregrafts = nump.zeros(shape=(ndsa,1),dtype=int) #return updated Sim, Stat return Sim, Stat def EndRep(): """ Prints a message saying that a replication ended. """ print("Ending replication, time is: ", datetime.datetime.now().time()) #print(Sim.clock) #####################################################################################################################################################################################################################
[ 11748, 9312, 11, 31935, 198, 11748, 299, 32152, 355, 299, 931, 198, 11748, 4818, 8079, 198, 6738, 4866, 1330, 2769, 30073, 198, 358, 11400, 796, 7618, 198, 198, 29113, 29113, 4242, 21017, 9237, 10854, 274, 29113, 29113, 14468, 4242, 198, 4299, 27350, 2100, 7, 283, 43171, 10951, 11, 3184, 11, 5133, 11, 39852, 45, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 770, 2163, 985, 15968, 262, 10325, 286, 3871, 13, 632, 552, 1769, 262, 337, 24639, 4776, 286, 262, 5827, 290, 6673, 683, 284, 262, 11188, 360, 4090, 4953, 1351, 13, 198, 220, 220, 220, 23412, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 283, 43171, 10951, 25, 477, 262, 5827, 338, 1321, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 8890, 25, 1398, 2134, 326, 4909, 9633, 5981, 284, 262, 18640, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 17126, 25, 1398, 2134, 326, 3994, 912, 13905, 7508, 286, 262, 18640, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 3185, 46559, 25, 1844, 5827, 1366, 198, 220, 220, 220, 25235, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 8890, 25, 6153, 3184, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 17126, 25, 6153, 5133, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 3185, 46559, 6153, 39852, 45, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 16447, 35550, 20885, 198, 220, 220, 220, 649, 26029, 796, 9312, 13, 12130, 1153, 7, 283, 43171, 10951, 58, 16, 4083, 459, 2981, 7, 600, 828, 283, 43171, 10951, 58, 18, 4083, 459, 2981, 7, 600, 828, 8890, 13, 15750, 8, 628, 220, 220, 220, 1303, 8021, 570, 35550, 15684, 3969, 198, 220, 220, 220, 649, 26029, 13, 19580, 16, 796, 10325, 10951, 58, 24, 4083, 459, 2981, 7, 600, 8, 198, 220, 220, 220, 649, 26029, 13, 6242, 46, 796, 10325, 10951, 58, 20, 4083, 459, 2981, 7, 600, 8, 198, 220, 220, 220, 649, 26029, 13, 39, 4093, 796, 10325, 10951, 58, 23, 4083, 459, 2981, 7, 600, 8, 198, 220, 220, 220, 649, 26029, 13, 26705, 796, 10325, 10951, 58, 940, 4083, 459, 2981, 7, 600, 8, 198, 220, 220, 220, 649, 26029, 13, 75, 44, 24639, 796, 10325, 10951, 58, 22, 4083, 459, 2981, 7, 600, 8, 198, 220, 220, 220, 649, 26029, 13, 44, 24639, 796, 10325, 10951, 58, 21, 4083, 459, 2981, 7, 600, 8, 198, 220, 220, 220, 649, 26029, 13, 818, 5275, 796, 10325, 10951, 58, 1157, 4083, 459, 2981, 7, 600, 8, 198, 220, 220, 220, 220, 198, 220, 220, 220, 1303, 8021, 570, 1439, 5040, 337, 24639, 1912, 319, 2450, 198, 220, 220, 220, 611, 3184, 13, 82, 12664, 6624, 16, 25, 1303, 361, 21072, 2450, 318, 6163, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 7784, 262, 21072, 4776, 198, 220, 220, 220, 220, 220, 220, 220, 4050, 62, 2616, 796, 649, 26029, 13, 26705, 198, 220, 220, 220, 220, 220, 220, 220, 611, 4050, 62, 2616, 1279, 11623, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4050, 62, 2616, 796, 13151, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 4050, 62, 2616, 1875, 21643, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4050, 62, 2616, 796, 21643, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 5589, 1133, 262, 20157, 337, 24639, 4776, 198, 220, 220, 220, 220, 220, 220, 220, 611, 299, 931, 13, 22272, 7, 3605, 26029, 13, 75, 44, 24639, 1343, 352, 13, 2624, 9, 7, 19708, 12, 16803, 62, 2616, 13219, 7, 15, 13, 44427, 9, 3605, 26029, 13, 75, 44, 24639, 9, 7, 19708, 12, 16803, 62, 2616, 22305, 1279, 21, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 649, 26029, 13, 44, 24639, 796, 21, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 299, 931, 13, 22272, 7, 3605, 26029, 13, 75, 44, 24639, 1343, 352, 13, 2624, 9, 7, 19708, 12, 16803, 62, 2616, 13219, 7, 15, 13, 44427, 9, 3605, 26029, 13, 75, 44, 24639, 9, 7, 19708, 12, 16803, 62, 2616, 22305, 1875, 2319, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 649, 26029, 13, 44, 24639, 796, 1821, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 649, 26029, 13, 44, 24639, 796, 299, 931, 13, 22272, 7, 3605, 26029, 13, 75, 44, 24639, 1343, 352, 13, 2624, 9, 7, 19708, 12, 16803, 62, 2616, 13219, 7, 15, 13, 44427, 9, 3605, 26029, 13, 75, 44, 24639, 9, 7, 19708, 12, 16803, 62, 2616, 22305, 198, 220, 220, 220, 220, 198, 220, 220, 220, 2073, 25, 1303, 361, 21072, 2450, 407, 6163, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 7784, 262, 21072, 4776, 198, 220, 220, 220, 220, 220, 220, 220, 611, 649, 26029, 13, 44, 24639, 1279, 21, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 649, 26029, 13, 44, 24639, 796, 21, 198, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 649, 26029, 13, 44, 24639, 1875, 1821, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 649, 26029, 13, 44, 24639, 796, 2319, 628, 198, 220, 220, 220, 1303, 44836, 12678, 16, 290, 367, 4093, 13269, 357, 361, 9723, 8, 198, 220, 220, 220, 611, 649, 26029, 13, 19580, 16, 6624, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 649, 26029, 13, 44, 24639, 796, 3901, 198, 220, 220, 220, 1288, 361, 649, 26029, 13, 39, 4093, 6624, 16, 290, 3184, 13, 11128, 392, 40850, 6624, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 649, 26029, 13, 44, 24639, 796, 949, 7, 3605, 26029, 13, 75, 44, 24639, 11, 2078, 8, 628, 220, 220, 220, 1303, 27271, 35550, 287, 360, 4090, 7343, 198, 220, 220, 220, 611, 649, 26029, 13, 35, 4090, 18189, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 39852, 45, 58, 3605, 26029, 13, 35, 4090, 4083, 33295, 7, 3605, 26029, 8, 628, 198, 220, 220, 220, 1303, 10260, 20595, 198, 220, 220, 220, 5133, 13, 88, 283, 380, 12786, 58, 3605, 26029, 13, 35, 4090, 60, 796, 5133, 13, 88, 283, 380, 12786, 58, 3605, 26029, 13, 35, 4090, 60, 1343, 352, 198, 220, 220, 220, 5133, 13, 22510, 46188, 37051, 58, 3605, 26029, 13, 35, 4090, 60, 796, 5133, 13, 22510, 46188, 37051, 58, 3605, 26029, 13, 35, 4090, 60, 1343, 352, 628, 220, 220, 220, 1303, 7783, 6153, 3184, 11, 5133, 11, 290, 39852, 45, 198, 220, 220, 220, 1441, 3184, 11, 5133, 11, 39852, 45, 628, 198, 220, 220, 220, 1303, 18683, 4660, 15132, 14151, 198, 220, 220, 220, 1303, 1456, 198, 198, 4299, 1041, 32383, 7, 1676, 1655, 6513, 11, 3184, 11, 5133, 11, 39852, 45, 11, 20982, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 770, 2163, 15455, 329, 257, 1948, 5827, 422, 262, 39852, 45, 1366, 4645, 290, 4296, 262, 5827, 338, 9695, 198, 220, 220, 220, 23412, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 1676, 1655, 6513, 25, 477, 286, 262, 1321, 286, 262, 5827, 852, 16499, 510, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 8890, 25, 1398, 2134, 7268, 5981, 1321, 286, 262, 5827, 852, 16499, 510, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 17126, 25, 1398, 2134, 7268, 13905, 1321, 286, 262, 18640, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 3185, 46559, 25, 1844, 5827, 1366, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 260, 862, 25, 1459, 30330, 1271, 198, 220, 220, 220, 25235, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 8890, 25, 6153, 3184, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 17126, 25, 6153, 5133, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 3185, 46559, 25, 6153, 39852, 45, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1172, 9310, 64, 796, 1172, 10951, 58, 24, 4083, 459, 2981, 7, 600, 8, 1303, 672, 3153, 360, 4090, 198, 220, 220, 220, 1303, 9288, 796, 15, 628, 220, 220, 220, 1303, 5143, 611, 356, 423, 281, 4036, 360, 4090, 198, 220, 220, 220, 611, 1172, 9310, 64, 18189, 15, 25, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 12947, 329, 5827, 287, 262, 39852, 45, 1366, 4645, 198, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 11, 5827, 287, 27056, 378, 7, 3185, 46559, 58, 1676, 70, 9310, 64, 60, 2599, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 9122, 611, 262, 4686, 7466, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5827, 13, 312, 6624, 1172, 10951, 58, 16, 4083, 459, 2981, 7, 600, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 10260, 35550, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5827, 13, 6892, 396, 6624, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 32916, 382, 5992, 329, 823, 6347, 3871, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 1172, 10951, 58, 18, 4083, 459, 2981, 7, 600, 8, 6624, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 12130, 1153, 10564, 11, 4781, 290, 4296, 9756, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5133, 13, 88, 22595, 82, 58, 1676, 70, 9310, 64, 60, 796, 5133, 13, 88, 22595, 82, 58, 1676, 70, 9310, 64, 60, 1343, 352, 1303, 24988, 434, 262, 1271, 286, 7040, 416, 530, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5133, 13, 22510, 46188, 37051, 58, 1676, 70, 9310, 64, 60, 796, 5133, 13, 22510, 46188, 37051, 58, 1676, 70, 9310, 64, 60, 532, 352, 1303, 12501, 260, 434, 262, 1271, 286, 5871, 4953, 416, 530, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1619, 39852, 45, 58, 1676, 70, 9310, 64, 7131, 72, 60, 1303, 33678, 262, 5827, 2134, 1201, 5827, 3724, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 1172, 10951, 58, 19, 4083, 459, 2981, 7, 600, 8, 6624, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 12130, 1153, 4615, 11, 4781, 290, 4296, 9756, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5133, 13, 88, 2787, 2668, 58, 1676, 70, 9310, 64, 60, 796, 5133, 13, 88, 2787, 2668, 58, 1676, 70, 9310, 64, 60, 1343, 352, 1303, 24988, 434, 262, 1271, 286, 816, 709, 874, 416, 530, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5133, 13, 22510, 46188, 37051, 58, 1676, 70, 9310, 64, 60, 796, 5133, 13, 22510, 46188, 37051, 58, 1676, 70, 9310, 64, 60, 532, 352, 1303, 12501, 260, 434, 262, 1271, 286, 5871, 4953, 416, 530, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 22105, 355, 5679, 357, 2435, 286, 9934, 11, 29693, 11, 5827, 4686, 11, 5827, 20157, 337, 24639, 11, 5827, 2248, 337, 24639, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 267, 312, 13116, 796, 685, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 20982, 11, 3184, 13, 15750, 11, 5827, 13, 312, 11, 26029, 13, 44, 24639, 11, 5827, 13, 75, 44, 24639, 60, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3184, 13, 22105, 62, 2787, 709, 874, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 2787, 709, 874, 11, 220, 267, 312, 13116, 4008, 1303, 1102, 9246, 268, 378, 262, 5752, 267, 312, 13116, 284, 262, 1700, 286, 816, 709, 874, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1619, 39852, 45, 58, 1676, 70, 9310, 64, 7131, 72, 60, 1303, 33678, 5827, 2134, 1201, 5827, 318, 4615, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 10260, 4540, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 75, 44, 24639, 796, 1172, 10951, 58, 21, 4083, 459, 2981, 7, 600, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 26705, 796, 1172, 10951, 58, 22, 4083, 459, 2981, 7, 600, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 44, 24639, 796, 1172, 10951, 58, 20, 4083, 459, 2981, 7, 600, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 818, 5275, 796, 1172, 10951, 58, 940, 4083, 459, 2981, 7, 600, 8, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2617, 5421, 319, 337, 24639, 4776, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5827, 13, 44, 24639, 1279, 21, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 44, 24639, 796, 21, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 5827, 13, 44, 24639, 1875, 1821, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 44, 24639, 796, 2319, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 10260, 1439, 5040, 337, 24639, 1912, 319, 2450, 357, 361, 9723, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 3184, 13, 82, 12664, 6624, 16, 290, 5827, 13, 19580, 16, 14512, 352, 290, 5827, 13, 39, 4093, 14512, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 361, 21072, 4776, 2450, 318, 6163, 11, 788, 4296, 262, 502, 335, 4776, 329, 1729, 12, 13376, 16, 11, 1729, 12, 39, 4093, 5827, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2617, 5421, 319, 21072, 4776, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4050, 62, 2616, 796, 5827, 13, 26705, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 4050, 62, 2616, 1279, 11623, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4050, 62, 2616, 796, 13151, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 4050, 62, 2616, 1875, 21643, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4050, 62, 2616, 796, 21643, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 5589, 1133, 337, 24639, 4776, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 299, 931, 13, 22272, 7, 26029, 13, 75, 44, 24639, 1343, 352, 13, 2624, 9, 7, 19708, 12, 16803, 62, 2616, 13219, 7, 15, 13, 44427, 9, 26029, 13, 75, 44, 24639, 9, 7, 19708, 12, 16803, 62, 2616, 22305, 1279, 21, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 44, 24639, 796, 21, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 299, 931, 13, 22272, 7, 26029, 13, 75, 44, 24639, 1343, 352, 13, 2624, 9, 7, 19708, 12, 16803, 62, 2616, 13219, 7, 15, 13, 44427, 9, 26029, 13, 75, 44, 24639, 9, 7, 19708, 12, 16803, 62, 2616, 22305, 1875, 2319, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 44, 24639, 796, 1821, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 44, 24639, 796, 299, 931, 13, 22272, 7, 26029, 13, 75, 44, 24639, 1343, 352, 13, 2624, 9, 7, 19708, 12, 16803, 62, 2616, 13219, 7, 15, 13, 44427, 9, 26029, 13, 75, 44, 24639, 9, 7, 19708, 12, 16803, 62, 2616, 22305, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 3184, 13, 11128, 392, 40850, 6624, 16, 290, 5827, 13, 19580, 16, 14512, 352, 290, 5827, 13, 39, 4093, 6624, 352, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 361, 1451, 290, 5711, 2450, 318, 6163, 11, 4296, 502, 335, 4776, 329, 3722, 16, 11, 367, 4093, 5827, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 5589, 1133, 337, 24639, 4776, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 3184, 13, 15750, 532, 5827, 13, 17953, 62, 2435, 19841, 764, 20, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 44, 24639, 796, 3509, 7, 2078, 11, 26029, 13, 44, 24639, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 357, 8890, 13, 15750, 532, 5827, 13, 17953, 62, 2435, 8, 1875, 764, 20, 290, 357, 8890, 13, 15750, 532, 5827, 13, 17953, 62, 2435, 19841, 764, 2425, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 44, 24639, 796, 3509, 7, 1959, 11, 26029, 13, 44, 24639, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 357, 8890, 13, 15750, 532, 5827, 13, 17953, 62, 2435, 8, 1875, 764, 2425, 290, 357, 8890, 13, 15750, 532, 5827, 13, 17953, 62, 2435, 19841, 352, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 44, 24639, 796, 3509, 7, 3132, 11, 26029, 13, 44, 24639, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 357, 8890, 13, 15750, 532, 5827, 13, 17953, 62, 2435, 8, 1875, 352, 290, 357, 8890, 13, 15750, 532, 5827, 13, 17953, 62, 2435, 19841, 352, 13, 1495, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 44, 24639, 796, 3509, 7, 2091, 11, 26029, 13, 44, 24639, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 357, 8890, 13, 15750, 532, 5827, 13, 17953, 62, 2435, 8, 1875, 352, 13, 1495, 290, 357, 8890, 13, 15750, 532, 5827, 13, 17953, 62, 2435, 19841, 352, 13, 20, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 44, 24639, 796, 3509, 7, 2682, 11, 26029, 13, 44, 24639, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 44, 24639, 796, 949, 7, 26029, 13, 44, 24639, 10, 16, 11, 1821, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 198, 220, 220, 220, 1303, 7783, 6153, 3184, 11, 5133, 11, 290, 39852, 45, 198, 220, 220, 220, 1441, 3184, 11, 5133, 11, 39852, 45, 628, 628, 198, 4299, 7221, 3163, 43171, 7, 9971, 10951, 11, 3184, 11, 5133, 11, 39852, 45, 11, 47089, 11, 36644, 7841, 2741, 11, 28021, 62, 38855, 11, 2094, 273, 62, 38855, 11, 360, 4090, 62, 48997, 62, 28595, 11, 21699, 590, 17633, 50, 16, 11, 21699, 590, 17633, 11, 4718, 396, 11, 20982, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 770, 2163, 985, 15968, 262, 1618, 10325, 13, 632, 8404, 284, 2872, 262, 1618, 284, 257, 5827, 422, 262, 11188, 360, 4090, 4043, 4868, 13, 198, 220, 220, 220, 23412, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 9971, 10951, 25, 1321, 319, 262, 1618, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 8890, 25, 1398, 2134, 7268, 5981, 9633, 329, 18640, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 17126, 25, 1398, 2134, 7268, 13905, 1321, 286, 18640, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 3185, 46559, 25, 1844, 5827, 1366, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 8081, 507, 25, 9882, 17899, 2894, 3975, 329, 7652, 11, 12815, 11, 393, 9882, 17899, 2894, 82, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 2484, 1723, 7841, 2741, 25, 6232, 3975, 4375, 7373, 4887, 284, 4683, 22987, 6958, 1871, 13349, 16748, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 12130, 2334, 62, 38855, 25, 44036, 5115, 17052, 338, 9695, 329, 13427, 2746, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 3987, 273, 62, 38855, 25, 44036, 5115, 17052, 338, 9695, 329, 13427, 2746, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 35, 4090, 62, 48997, 62, 28595, 25, 1366, 319, 2811, 4839, 1661, 1022, 17400, 1722, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 38855, 590, 17633, 50, 16, 25, 44036, 5115, 5827, 338, 9695, 329, 3722, 12, 16, 13427, 2746, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 17320, 6449, 590, 17633, 25, 44036, 5115, 5827, 338, 9695, 329, 1729, 12, 13376, 12, 16, 13427, 2746, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 6892, 396, 25, 3815, 5115, 262, 12867, 326, 257, 37100, 4126, 5827, 481, 823, 396, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 260, 862, 25, 30330, 1271, 198, 220, 220, 220, 25235, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 8890, 25, 6153, 3184, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 17126, 25, 6153, 5133, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 3185, 46559, 25, 6153, 39852, 45, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 1303, 16447, 7221, 198, 220, 220, 220, 649, 9971, 796, 9312, 13, 26121, 7, 600, 7, 9971, 10951, 58, 17, 60, 4008, 198, 220, 220, 220, 649, 9971, 13, 9971, 312, 796, 3184, 13, 1868, 198, 220, 220, 220, 3184, 13, 1868, 796, 3184, 13, 1868, 1343, 352, 628, 220, 220, 220, 1303, 8021, 570, 7221, 49213, 198, 220, 220, 220, 649, 9971, 13, 6242, 46, 796, 1618, 10951, 58, 19, 4083, 459, 2981, 7, 600, 8, 628, 198, 220, 220, 220, 1303, 3237, 13369, 7221, 198, 220, 220, 220, 1303, 6381, 9150, 318, 46545, 286, 1618, 3722, 357, 13635, 14, 260, 752, 8, 837, 23319, 278, 360, 4090, 11, 290, 5827, 4686, 611, 6292, 198, 220, 220, 220, 24665, 796, 31935, 13, 3237, 13369, 7, 3605, 9971, 11, 39852, 45, 11, 3184, 11, 47089, 11, 36644, 7841, 2741, 11, 28021, 62, 38855, 11, 2094, 273, 62, 38855, 11, 360, 4090, 62, 48997, 62, 28595, 11, 21699, 590, 17633, 50, 16, 11, 21699, 590, 17633, 8, 628, 220, 220, 220, 611, 24665, 58, 15, 60, 6624, 352, 25, 1303, 9971, 318, 37100, 4126, 628, 220, 220, 220, 220, 220, 220, 220, 1303, 27914, 37100, 4126, 5827, 422, 4953, 1351, 290, 4296, 7869, 198, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 11, 5827, 287, 27056, 378, 7, 3185, 46559, 58, 6381, 9150, 58, 16, 11907, 2599, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 12947, 329, 262, 5827, 287, 262, 39852, 45, 1366, 4645, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5827, 13, 312, 6624, 24665, 58, 17, 5974, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 35, 2357, 3810, 611, 5827, 481, 823, 396, 290, 8333, 2041, 12608, 611, 497, 728, 560, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 481, 2411, 396, 796, 657, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5827, 13, 6892, 396, 6624, 15, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 361, 5827, 468, 407, 587, 823, 6347, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 35, 2357, 3810, 611, 5827, 481, 307, 823, 6347, 611, 373, 407, 1541, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 16, 796, 77, 931, 13, 25120, 13, 403, 6933, 7, 6892, 396, 58, 15, 4357, 6892, 396, 58, 16, 4357, 16, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 17, 796, 77, 931, 13, 25120, 13, 403, 6933, 7, 15, 11, 16, 11, 16, 8, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 374, 17, 1279, 374, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 481, 2411, 396, 796, 16, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 35, 2357, 3810, 618, 1459, 38455, 481, 2038, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 374, 18, 796, 299, 931, 13, 25120, 13, 403, 6933, 7, 15, 11, 16, 11, 16, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 374, 18, 1279, 764, 19, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 6892, 396, 46047, 7575, 796, 3184, 13, 15750, 1343, 642, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 374, 18, 18189, 764, 19, 290, 374, 18, 1279, 764, 21, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 6892, 396, 46047, 7575, 796, 3184, 13, 15750, 1343, 362, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 374, 18, 18189, 718, 290, 374, 18, 1279, 764, 23, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 6892, 396, 46047, 7575, 796, 3184, 13, 15750, 1343, 352, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5827, 13, 6892, 396, 46047, 7575, 796, 3184, 13, 15750, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 10260, 823, 396, 7869, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5133, 13, 88, 2411, 1023, 58, 6381, 9150, 58, 16, 11907, 796, 5133, 13, 88, 2411, 1023, 58, 6381, 9150, 58, 16, 11907, 1343, 16, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 22105, 262, 4314, 286, 1459, 640, 11, 28761, 8846, 295, 11, 1459, 640, 11, 5827, 4686, 11, 5827, 502, 335, 4776, 11, 290, 823, 396, 27765, 640, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 823, 396, 312, 13116, 796, 685, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 20982, 11, 3184, 13, 15750, 11, 5827, 13, 312, 11, 26029, 13, 44, 24639, 11, 26029, 13, 6892, 396, 46047, 7575, 60, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 1102, 9246, 268, 378, 262, 823, 396, 312, 13116, 284, 262, 1700, 286, 823, 1023, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3184, 13, 22105, 62, 2411, 1023, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 2411, 1023, 11, 220, 823, 396, 312, 13116, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 10260, 20595, 329, 3602, 489, 1187, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 15057, 286, 3602, 489, 1187, 290, 3310, 1617, 82, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5133, 13, 88, 7645, 489, 1187, 58, 6381, 9150, 58, 16, 11907, 796, 5133, 13, 88, 7645, 489, 1187, 58, 6381, 9150, 58, 16, 11907, 1343, 16, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3184, 13, 22105, 62, 17602, 35, 4090, 58, 3605, 9971, 13, 35, 4090, 11, 6381, 9150, 58, 16, 11907, 796, 3184, 13, 22105, 62, 17602, 35, 4090, 58, 3605, 9971, 13, 35, 4090, 11, 6381, 9150, 58, 16, 11907, 1343, 16, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5827, 13, 6892, 396, 6624, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 361, 5827, 318, 823, 6347, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5133, 13, 88, 2301, 1617, 82, 58, 6381, 9150, 58, 16, 11907, 796, 5133, 13, 88, 2301, 1617, 82, 58, 6381, 9150, 58, 16, 11907, 1343, 16, 1303, 24988, 589, 1271, 286, 1005, 26084, 489, 4126, 3871, 416, 352, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 7293, 1133, 4953, 3862, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5827, 13, 6892, 396, 6624, 15, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 361, 5827, 318, 407, 823, 6347, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5133, 13, 88, 17077, 58, 6381, 9150, 58, 16, 11907, 796, 5133, 13, 88, 17077, 58, 6381, 9150, 58, 16, 11907, 1343, 357, 8890, 13, 15750, 532, 5827, 13, 17953, 62, 2435, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 361, 5827, 318, 823, 6347, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5133, 13, 88, 17077, 58, 6381, 9150, 58, 16, 11907, 796, 5133, 13, 88, 17077, 58, 6381, 9150, 58, 16, 11907, 1343, 357, 8890, 13, 15750, 532, 5827, 13, 6892, 396, 46047, 7575, 8, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 33484, 1780, 7343, 311, 4340, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 481, 2411, 396, 6624, 15, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5133, 13, 22510, 46188, 37051, 58, 6381, 9150, 58, 16, 11907, 796, 5133, 13, 22510, 46188, 37051, 58, 6381, 9150, 58, 16, 11907, 532, 16, 1303, 12501, 260, 589, 262, 1271, 286, 4043, 1359, 1351, 5871, 329, 262, 360, 4090, 416, 352, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 16, 301, 3602, 15060, 337, 24639, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5827, 13, 19580, 16, 6624, 15, 290, 5827, 13, 6892, 396, 6624, 15, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 46047, 12, 44, 24639, 379, 3953, 9672, 284, 19607, 302, 12, 70, 1617, 82, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5133, 13, 88, 44, 24639, 58, 6381, 9150, 58, 16, 11907, 796, 5133, 13, 88, 44, 24639, 58, 6381, 9150, 58, 16, 11907, 1343, 5827, 13, 44, 24639, 1303, 24988, 589, 262, 337, 24639, 4776, 262, 360, 4090, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5133, 13, 88, 1150, 44, 24639, 58, 6381, 9150, 58, 16, 60, 4083, 33295, 7, 26029, 13, 44, 24639, 8, 1303, 22105, 262, 5827, 337, 24639, 4776, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 26410, 329, 2947, 7645, 15060, 7587, 329, 883, 508, 547, 407, 1683, 823, 6347, 393, 481, 307, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 481, 2411, 396, 6624, 15, 290, 5827, 13, 6892, 396, 6624, 15, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 842, 17602, 796, 15, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 1078, 87, 796, 657, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5827, 13, 35, 4090, 14512, 649, 9971, 13, 35, 4090, 290, 357, 8081, 507, 58, 3605, 9971, 13, 35, 4090, 11, 26029, 13, 35, 4090, 60, 6624, 16, 393, 36644, 7841, 2741, 58, 3605, 9971, 13, 35, 4090, 11, 5827, 13, 35, 4090, 60, 6624, 352, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 842, 17602, 796, 16, 1303, 26029, 550, 7915, 23319, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 5827, 13, 35, 4090, 14512, 649, 9971, 13, 35, 4090, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 1078, 87, 28, 16, 1303, 26029, 550, 2260, 23319, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 22105, 262, 4314, 286, 262, 1459, 640, 11, 29693, 11, 1459, 640, 11, 5827, 4686, 11, 16916, 329, 7915, 23319, 11, 16916, 329, 2260, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 7645, 15060, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 27765, 312, 13116, 796, 685, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 20982, 11, 3184, 13, 15750, 11, 5827, 13, 312, 11, 2301, 17602, 11, 77, 1078, 87, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3184, 13, 22105, 62, 17602, 2389, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 17602, 2389, 11, 220, 27765, 312, 13116, 4008, 1303, 2860, 649, 1700, 284, 1351, 286, 23319, 4406, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 22105, 355, 5679, 357, 2435, 286, 9934, 11, 29693, 11, 5827, 4686, 11, 5827, 20157, 337, 24639, 11, 5827, 2248, 337, 9527, 35, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 267, 312, 13116, 796, 685, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 20982, 11, 3184, 13, 15750, 11, 5827, 13, 312, 11, 8890, 13, 1868, 60, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2860, 284, 1351, 286, 23319, 4406, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3184, 13, 22105, 62, 4598, 2389, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 4598, 2389, 11, 220, 267, 312, 13116, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 7975, 329, 2947, 7645, 15060, 386, 344, 274, 278, 329, 842, 1617, 82, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5827, 13, 6892, 396, 6624, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 842, 17602, 796, 15, 1303, 521, 26407, 329, 7915, 23319, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 1078, 87, 796, 657, 1303, 521, 26407, 329, 2260, 23319, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 5827, 13, 35, 4090, 14512, 649, 9971, 13, 35, 4090, 290, 357, 8081, 507, 58, 3605, 9971, 13, 35, 4090, 11, 26029, 13, 35, 4090, 60, 6624, 16, 393, 36644, 7841, 2741, 58, 3605, 9971, 13, 35, 4090, 11, 5827, 13, 35, 4090, 60, 6624, 352, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 842, 17602, 796, 16, 1303, 26029, 550, 7915, 23319, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1288, 361, 5827, 13, 35, 4090, 14512, 649, 9971, 13, 35, 4090, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 299, 1078, 87, 28, 16, 1303, 26029, 550, 2260, 23319, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 22105, 262, 4314, 286, 262, 1459, 640, 11, 29693, 11, 1459, 640, 11, 5827, 4686, 11, 16916, 329, 7915, 23319, 11, 16916, 329, 2260, 23319, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 27765, 312, 13116, 796, 685, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 20982, 11, 3184, 13, 15750, 11, 5827, 13, 312, 11, 2301, 17602, 11, 77, 1078, 87, 60, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2860, 284, 1351, 286, 823, 6347, 37100, 1187, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3184, 13, 22105, 62, 17602, 2389, 2301, 1617, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 17602, 2389, 2301, 1617, 11, 220, 27765, 312, 13116, 4008, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 22105, 355, 5679, 357, 2435, 286, 9934, 11, 29693, 11, 5827, 4686, 11, 5827, 20157, 337, 24639, 11, 5827, 2248, 337, 24639, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 267, 312, 13116, 796, 685, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 20982, 11, 3184, 13, 15750, 11, 5827, 13, 312, 11, 8890, 13, 1868, 60, 628, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 2860, 284, 1351, 286, 1005, 26084, 15060, 4406, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3184, 13, 22105, 62, 4598, 2389, 2301, 1617, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 4598, 2389, 2301, 1617, 11, 220, 267, 312, 13116, 4008, 628, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 611, 481, 2411, 396, 6624, 16, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 361, 5827, 481, 823, 396, 11, 4296, 823, 396, 3722, 290, 337, 24639, 4776, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 39852, 45, 58, 6381, 9150, 58, 16, 60, 7131, 72, 4083, 6892, 396, 796, 16, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 39852, 45, 58, 6381, 9150, 58, 16, 60, 7131, 72, 4083, 44, 24639, 796, 3933, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 39852, 45, 58, 6381, 9150, 58, 16, 60, 7131, 72, 4083, 75, 44, 24639, 796, 3933, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 28956, 37100, 4126, 5827, 611, 481, 407, 307, 823, 6347, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1619, 39852, 45, 58, 6381, 9150, 58, 16, 60, 7131, 72, 60, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2270, 628, 220, 220, 220, 2073, 25, 1303, 9971, 318, 25148, 26, 4296, 7869, 357, 25968, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1208, 628, 220, 220, 220, 1303, 7783, 6153, 3184, 11, 5133, 11, 290, 39852, 45, 198, 220, 220, 220, 1441, 3184, 11, 5133, 11, 39852, 45, 198, 198, 4299, 6280, 7, 8890, 11, 5133, 11, 20982, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 770, 2163, 5992, 262, 7869, 286, 262, 18640, 583, 614, 198, 220, 220, 220, 23412, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 8890, 25, 1398, 2134, 326, 4909, 5981, 9633, 329, 262, 18640, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 17126, 25, 1398, 2134, 326, 4909, 13905, 1321, 286, 262, 18640, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 260, 862, 25, 1459, 30330, 1271, 198, 220, 220, 220, 25235, 25, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 8890, 25, 6153, 3184, 198, 220, 220, 220, 220, 220, 220, 220, 2488, 17126, 25, 6153, 5133, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 1303, 18858, 723, 3167, 1845, 414, 14370, 198, 220, 220, 220, 285, 81, 62, 16, 796, 299, 931, 13, 9107, 418, 7, 43358, 16193, 358, 11400, 11, 16, 828, 67, 4906, 28, 22468, 8, 198, 220, 220, 220, 491, 62, 16, 796, 299, 931, 13, 9107, 418, 7, 43358, 16193, 358, 11400, 11, 16, 828, 67, 4906, 28, 22468, 8, 198, 220, 220, 220, 266, 83, 62, 16, 796, 299, 931, 13, 9107, 418, 7, 43358, 16193, 358, 11400, 11, 16, 828, 67, 4906, 28, 22468, 8, 198, 220, 220, 220, 502, 335, 62, 75, 796, 299, 931, 13, 9107, 418, 7, 43358, 16193, 358, 11400, 11, 16, 828, 67, 4906, 28, 22468, 8, 628, 220, 220, 220, 329, 1312, 287, 2837, 7, 15, 11, 358, 11400, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 611, 5133, 13, 88, 7645, 489, 1187, 58, 72, 60, 1875, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 266, 83, 62, 16, 58, 72, 60, 796, 5133, 13, 88, 17077, 58, 72, 60, 1220, 5133, 13, 88, 7645, 489, 1187, 58, 72, 60, 1303, 5589, 1133, 262, 2472, 4953, 1351, 14, 23350, 1303, 286, 23319, 583, 360, 4090, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 502, 335, 62, 75, 58, 72, 60, 796, 5133, 13, 88, 44, 24639, 58, 72, 60, 1220, 5133, 13, 88, 7645, 489, 1187, 58, 72, 60, 1303, 5589, 1133, 262, 2472, 337, 24639, 4776, 14, 23350, 1303, 286, 23319, 583, 360, 4090, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 13564, 15709, 611, 645, 3815, 1695, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 266, 83, 62, 16, 58, 72, 60, 796, 299, 931, 13, 12647, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 502, 335, 62, 75, 58, 72, 60, 796, 299, 931, 13, 12647, 628, 198, 220, 220, 220, 220, 220, 220, 220, 611, 357, 17126, 13, 88, 283, 380, 12786, 58, 72, 60, 1343, 5133, 13, 88, 46188, 37051, 58, 72, 12962, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1303, 13564, 15709, 611, 645, 3815, 1695, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 285, 81, 62, 16, 58, 72, 60, 796, 299, 931, 13, 12647, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 491, 62, 16, 58, 72, 60, 796, 299, 931, 13, 12647, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 285, 81, 62, 16, 58, 72, 60, 796, 5133, 13, 88, 22595, 82, 58, 72, 60, 1220, 357, 17126, 13, 88, 283, 380, 12786, 58, 72, 60, 1343, 5133, 13, 88, 46188, 37051, 58, 72, 12962, 1303, 5589, 1133, 12430, 2494, 357, 17618, 286, 7040, 14, 17618, 286, 4953, 5871, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 491, 62, 16, 58, 72, 60, 796, 5133, 13, 88, 7645, 489, 1187, 58, 72, 60, 1220, 357, 17126, 13, 88, 283, 380, 12786, 58, 72, 60, 1343, 5133, 13, 88, 46188, 37051, 58, 72, 12962, 1303, 5589, 1133, 23319, 2494, 357, 17618, 286, 37100, 1187, 14, 17618, 286, 4953, 5871, 8, 628, 220, 220, 220, 1303, 5589, 1133, 262, 14288, 337, 24639, 4776, 198, 220, 220, 220, 14288, 1326, 335, 82, 796, 299, 931, 13, 9107, 418, 7, 43358, 16193, 358, 11400, 11, 16, 828, 67, 4906, 28, 22468, 8, 198, 220, 220, 220, 329, 1312, 287, 2837, 7, 15, 11, 358, 11400, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 611, 5133, 13, 88, 1150, 44, 24639, 58, 72, 60, 14512, 685, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 14288, 1326, 335, 82, 58, 72, 60, 796, 299, 931, 13, 12647, 1150, 666, 7, 17126, 13, 88, 1150, 44, 24639, 58, 72, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 2073, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 14288, 1326, 335, 82, 58, 72, 60, 796, 299, 931, 13, 12647, 628, 198, 220, 220, 220, 1303, 9492, 13857, 6060, 25235, 82, 198, 220, 220, 220, 1303, 77, 931, 13, 21928, 14116, 7203, 26410, 62, 9122, 13, 14116, 1600, 5133, 13, 22510, 46188, 37051, 11, 46996, 11639, 4, 16, 13, 19, 68, 3256, 46728, 2676, 11639, 59, 83, 3256, 649, 1370, 11639, 59, 77, 11537, 198, 220, 220, 220, 1303, 77, 931, 13, 21928, 14116, 7203, 26410, 62, 9122, 17, 13, 14116, 1600, 5133, 13, 88, 2787, 2668, 11, 46996, 11639, 4, 16, 13, 19, 68, 3256, 46728, 2676, 11639, 59, 83, 3256, 649, 1370, 11639, 59, 77, 11537, 198, 220, 220, 220, 1303, 77, 931, 13, 21928, 14116, 7203, 26410, 62, 9122, 18, 13, 14116, 1600, 5133, 13, 88, 283, 380, 12786, 11, 46996, 11639, 4, 16, 13, 19, 68, 3256, 46728, 2676, 11639, 59, 83, 3256, 649, 1370, 11639, 59, 77, 11537, 198, 220, 220, 220, 1303, 77, 931, 13, 21928, 14116, 7203, 26410, 62, 9122, 19, 13, 14116, 1600, 5133, 13, 88, 22595, 82, 11, 46996, 11639, 4, 16, 13, 19, 68, 3256, 46728, 2676, 11639, 59, 83, 3256, 649, 1370, 11639, 59, 77, 11537, 198, 220, 220, 220, 1303, 77, 931, 13, 21928, 14116, 7203, 26410, 62, 9122, 20, 13, 14116, 1600, 5133, 13, 88, 7645, 489, 1187, 11, 46996, 11639, 4, 16, 13, 19, 68, 3256, 46728, 2676, 11639, 59, 83, 3256, 649, 1370, 11639, 59, 77, 11537, 198, 220, 220, 220, 1303, 77, 931, 13, 21928, 14116, 7203, 26410, 62, 9122, 21, 13, 14116, 1600, 285, 81, 62, 16, 11, 46996, 11639, 4, 16, 13, 19, 68, 3256, 46728, 2676, 11639, 59, 83, 3256, 649, 1370, 11639, 59, 77, 11537, 628, 628, 220, 220, 220, 285, 81, 62, 22510, 22595, 82, 796, 685, 77, 931, 13, 16345, 7, 17126, 13, 88, 22595, 82, 828, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 260, 862, 60, 1303, 22105, 262, 2472, 1271, 286, 7040, 1863, 351, 663, 1459, 640, 290, 1459, 29693, 198, 220, 220, 220, 1303, 43395, 62, 6381, 1845, 414, 796, 685, 77, 931, 13, 75, 1292, 70, 13, 27237, 7, 43395, 62, 16, 11, 585, 28, 16, 828, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 260, 862, 60, 220, 198, 220, 220, 220, 1303, 17602, 62, 6381, 1845, 414, 796, 685, 77, 931, 13, 75, 1292, 70, 13, 27237, 7, 2213, 62, 16, 11, 585, 28, 16, 828, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 260, 862, 60, 198, 220, 220, 220, 1303, 46569, 62, 6381, 1845, 414, 796, 685, 77, 931, 13, 75, 1292, 70, 13, 27237, 7, 46569, 62, 16, 11, 585, 28, 16, 828, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 260, 862, 60, 198, 220, 220, 220, 285, 81, 62, 6381, 1845, 414, 62, 32604, 796, 685, 77, 931, 13, 12647, 32604, 7, 43395, 62, 16, 828, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 260, 862, 60, 1303, 22105, 262, 1612, 12430, 2494, 1863, 351, 663, 1459, 640, 290, 1459, 29693, 198, 220, 220, 220, 285, 81, 62, 6381, 1845, 414, 62, 19282, 796, 685, 77, 931, 13, 12647, 19282, 7, 43395, 62, 16, 828, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 260, 862, 60, 1303, 22105, 262, 3210, 28833, 286, 12430, 2494, 1863, 351, 82, 1459, 640, 290, 1459, 29693, 198, 220, 220, 220, 502, 335, 62, 6381, 1845, 414, 62, 32604, 796, 685, 77, 931, 13, 12647, 32604, 7, 1326, 335, 62, 75, 828, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 260, 862, 60, 1303, 22105, 262, 1612, 337, 24639, 4776, 1863, 351, 1459, 640, 290, 1459, 29693, 198, 220, 220, 220, 502, 335, 62, 6381, 1845, 414, 62, 19282, 796, 685, 77, 931, 13, 12647, 19282, 7, 1326, 335, 62, 75, 828, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 260, 862, 60, 1303, 22105, 262, 3210, 28833, 286, 262, 337, 24639, 4776, 1863, 351, 1459, 640, 290, 1459, 29693, 198, 220, 220, 220, 1117, 1326, 335, 62, 32604, 796, 685, 77, 931, 13, 12647, 32604, 7, 1150, 666, 1326, 335, 82, 828, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 260, 862, 60, 1303, 22105, 262, 1612, 14288, 337, 24639, 4776, 1863, 351, 1459, 640, 290, 1459, 29693, 198, 220, 220, 220, 1117, 1326, 335, 62, 19282, 796, 685, 77, 931, 13, 12647, 19282, 7, 1150, 666, 1326, 335, 82, 828, 77, 931, 13, 28300, 7, 8890, 13, 15750, 828, 260, 862, 60, 1303, 22105, 262, 3210, 28833, 286, 262, 14288, 337, 24639, 4776, 1863, 351, 1459, 640, 290, 1459, 29693, 628, 220, 220, 220, 1303, 4798, 7, 17602, 62, 6381, 1845, 414, 8, 628, 220, 220, 220, 1303, 2860, 262, 4406, 284, 262, 1351, 286, 24169, 7869, 198, 220, 220, 220, 3184, 13, 22105, 62, 22595, 82, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 22595, 82, 11, 220, 285, 81, 62, 22510, 22595, 82, 4008, 198, 220, 220, 220, 3184, 13, 22105, 62, 43395, 62, 6381, 1845, 414, 62, 32604, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 43395, 62, 6381, 1845, 414, 62, 32604, 11, 285, 81, 62, 6381, 1845, 414, 62, 32604, 4008, 198, 220, 220, 220, 3184, 13, 22105, 62, 43395, 62, 6381, 1845, 414, 62, 19282, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 43395, 62, 6381, 1845, 414, 62, 19282, 11, 285, 81, 62, 6381, 1845, 414, 62, 19282, 4008, 198, 220, 220, 220, 3184, 13, 22105, 62, 1326, 335, 62, 6381, 1845, 414, 62, 32604, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 1326, 335, 62, 6381, 1845, 414, 62, 32604, 11, 502, 335, 62, 6381, 1845, 414, 62, 32604, 4008, 198, 220, 220, 220, 3184, 13, 22105, 62, 1326, 335, 62, 6381, 1845, 414, 62, 19282, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 1326, 335, 62, 6381, 1845, 414, 62, 19282, 11, 502, 335, 62, 6381, 1845, 414, 62, 19282, 4008, 198, 220, 220, 220, 3184, 13, 22105, 62, 1150, 44, 24639, 32604, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 1150, 44, 24639, 32604, 11, 1117, 1326, 335, 62, 32604, 4008, 198, 220, 220, 220, 3184, 13, 22105, 62, 1150, 44, 24639, 19282, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 1150, 44, 24639, 19282, 11, 1117, 1326, 335, 62, 19282, 4008, 198, 220, 220, 220, 3184, 13, 22105, 62, 17602, 35, 4090, 22915, 796, 299, 931, 13, 85, 25558, 19510, 8890, 13, 22105, 62, 17602, 35, 4090, 22915, 11, 3184, 13, 22105, 62, 17602, 35, 4090, 4008, 628, 220, 220, 220, 1303, 17953, 7177, 326, 4406, 262, 1459, 640, 290, 29693, 198, 220, 220, 220, 664, 9630, 796, 77, 931, 13, 358, 18747, 7, 43358, 16193, 16, 11, 18, 4008, 198, 220, 220, 220, 664, 9630, 58, 15, 11, 15, 60, 796, 299, 931, 13, 28300, 7, 8890, 13, 15750, 8, 198, 220, 220, 220, 664, 9630, 58, 15, 11, 16, 60, 796, 20982, 628, 220, 220, 220, 1303, 2860, 360, 4090, 15879, 5115, 7040, 11, 37100, 1187, 11, 3503, 13, 284, 262, 1351, 286, 4406, 198, 220, 220, 220, 3184, 13, 22105, 62, 88, 22595, 82, 796, 77, 931, 13, 1102, 9246, 268, 378, 19510, 8890, 13, 22105, 62, 88, 22595, 82, 11, 77, 931, 13, 1102, 9246, 268, 378, 19510, 8344, 9630, 11, 77, 931, 13, 7645, 3455, 7, 17126, 13, 88, 22595, 82, 36911, 22704, 28, 16, 36911, 22704, 28, 15, 8, 198, 220, 220, 220, 3184, 13, 22105, 62, 88, 7645, 489, 1187, 796, 299, 931, 13, 1102, 9246, 268, 378, 19510, 8890, 13, 22105, 62, 88, 7645, 489, 1187, 11, 77, 931, 13, 1102, 9246, 268, 378, 19510, 8344, 9630, 11, 77, 931, 13, 7645, 3455, 7, 17126, 13, 88, 7645, 489, 1187, 36911, 22704, 28, 16, 36911, 22704, 28, 15, 8, 198, 220, 220, 220, 3184, 13, 22105, 62, 88, 283, 380, 12786, 796, 299, 931, 13, 1102, 9246, 268, 378, 19510, 8890, 13, 22105, 62, 88, 283, 380, 12786, 11, 77, 931, 13, 1102, 9246, 268, 378, 19510, 8344, 9630, 11, 77, 931, 13, 7645, 3455, 7, 17126, 13, 88, 283, 380, 12786, 36911, 22704, 28, 16, 36911, 22704, 28, 15, 8, 198, 220, 220, 220, 3184, 13, 22105, 62, 88, 46188, 37051, 796, 299, 931, 13, 1102, 9246, 268, 378, 19510, 8890, 13, 22105, 62, 88, 46188, 37051, 11, 77, 931, 13, 1102, 9246, 268, 378, 19510, 8344, 9630, 11, 77, 931, 13, 7645, 3455, 7, 17126, 13, 88, 46188, 37051, 36911, 22704, 28, 16, 36911, 22704, 28, 15, 8, 198, 220, 220, 220, 3184, 13, 22105, 62, 88, 2787, 2668, 796, 77, 931, 13, 1102, 9246, 268, 378, 19510, 8890, 13, 22105, 62, 88, 2787, 2668, 11, 77, 931, 13, 1102, 9246, 268, 378, 19510, 8344, 9630, 11, 77, 931, 13, 7645, 3455, 7, 17126, 13, 88, 2787, 2668, 36911, 22704, 28, 16, 36911, 22704, 28, 15, 8, 198, 220, 220, 220, 3184, 13, 22105, 62, 88, 17077, 796, 299, 931, 13, 1102, 9246, 268, 378, 19510, 8890, 13, 22105, 62, 88, 17077, 11, 77, 931, 13, 1102, 9246, 268, 378, 19510, 8344, 9630, 11, 77, 931, 13, 7645, 3455, 7, 17126, 13, 88, 17077, 36911, 22704, 28, 16, 36911, 22704, 28, 15, 8, 198, 220, 220, 220, 3184, 13, 22105, 62, 88, 44, 24639, 796, 299, 931, 13, 1102, 9246, 268, 378, 19510, 8890, 13, 22105, 62, 88, 44, 24639, 11, 77, 931, 13, 1102, 9246, 268, 378, 19510, 8344, 9630, 11, 77, 931, 13, 7645, 3455, 7, 17126, 13, 88, 44, 24639, 36911, 22704, 28, 16, 36911, 22704, 28, 15, 8, 198, 220, 220, 220, 3184, 13, 22105, 62, 88, 2411, 1023, 796, 77, 931, 13, 1102, 9246, 268, 378, 19510, 8890, 13, 22105, 62, 88, 2411, 1023, 11, 77, 931, 13, 1102, 9246, 268, 378, 19510, 8344, 9630, 11, 77, 931, 13, 7645, 3455, 7, 17126, 13, 88, 2411, 1023, 36911, 22704, 28, 16, 36911, 22704, 28, 15, 8, 198, 220, 220, 220, 3184, 13, 22105, 62, 88, 2301, 1617, 82, 796, 77, 931, 13, 1102, 9246, 268, 378, 19510, 8890, 13, 22105, 62, 88, 2301, 1617, 82, 11, 77, 931, 13, 1102, 9246, 268, 378, 19510, 8344, 9630, 11, 77, 931, 13, 7645, 3455, 7, 17126, 13, 88, 2301, 1617, 82, 36911, 22704, 28, 16, 36911, 22704, 28, 15, 8, 628, 220, 220, 220, 1303, 4965, 316, 14370, 329, 14207, 6280, 198, 220, 220, 220, 5133, 13, 88, 283, 380, 12786, 796, 220, 220, 220, 299, 931, 13, 9107, 418, 7, 43358, 16193, 358, 11400, 11, 16, 828, 67, 4906, 28, 600, 8, 198, 220, 220, 220, 5133, 13, 88, 22595, 82, 796, 220, 220, 220, 220, 220, 299, 931, 13, 9107, 418, 7, 43358, 16193, 358, 11400, 11, 16, 828, 67, 4906, 28, 600, 8, 198, 220, 220, 220, 5133, 13, 88, 2787, 2668, 796, 220, 220, 220, 220, 299, 931, 13, 9107, 418, 7, 43358, 16193, 358, 11400, 11, 16, 828, 67, 4906, 28, 600, 8, 198, 220, 220, 220, 5133, 13, 88, 7645, 489, 1187, 796, 299, 931, 13, 9107, 418, 7, 43358, 16193, 358, 11400, 11, 16, 828, 67, 4906, 28, 600, 8, 198, 220, 220, 220, 5133, 13, 88, 46188, 37051, 796, 2769, 30073, 7, 17126, 13, 22510, 46188, 37051, 8, 198, 220, 220, 220, 5133, 13, 88, 17077, 796, 220, 220, 220, 220, 220, 220, 220, 299, 931, 13, 9107, 418, 7, 43358, 16193, 358, 11400, 11, 16, 828, 67, 4906, 28, 22468, 8, 198, 220, 220, 220, 5133, 13, 88, 44, 24639, 796, 220, 220, 220, 220, 220, 220, 220, 299, 931, 13, 9107, 418, 7, 43358, 16193, 358, 11400, 11, 16, 828, 67, 4906, 28, 600, 8, 198, 220, 220, 220, 5133, 13, 88, 1150, 44, 24639, 796, 220, 220, 220, 220, 16410, 60, 329, 1312, 287, 2837, 7, 15, 11, 358, 11400, 15437, 198, 220, 220, 220, 5133, 13, 88, 2411, 1023, 796, 220, 220, 220, 220, 299, 931, 13, 9107, 418, 7, 43358, 16193, 358, 11400, 11, 16, 828, 67, 4906, 28, 600, 8, 198, 220, 220, 220, 5133, 13, 88, 2301, 1617, 82, 796, 220, 220, 220, 299, 931, 13, 9107, 418, 7, 43358, 16193, 358, 11400, 11, 16, 828, 67, 4906, 28, 600, 8, 628, 220, 220, 220, 1303, 7783, 6153, 3184, 11, 5133, 198, 220, 220, 220, 1441, 3184, 11, 5133, 628, 198, 198, 4299, 5268, 6207, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 12578, 82, 257, 3275, 2282, 326, 257, 30330, 4444, 13, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3601, 7203, 12915, 278, 30330, 11, 220, 640, 318, 25, 33172, 4818, 8079, 13, 19608, 8079, 13, 2197, 22446, 2435, 28955, 628, 628, 220, 220, 220, 1303, 4798, 7, 8890, 13, 15750, 8, 198, 198, 29113, 29113, 29113, 29113, 29113, 29113, 14468, 4242, 2 ]
2.203729
11,049
def countSort(array): """ Counting Sort algorithm implementation on Python. :param array: array that need to be sorted :return: resulting sorted array """ output = [0 for i in range(256)] count = [0 for i in range(256)] result = ["" for element in array] for i in array: result[ord(i)] += 1 for i in range(256): result[i] += result[i - 1] for i in range(len(array)): output[result[ord(array[i])] - 1] = array[i] count[ord(array[i])] -= 1 for i in range(len(array)): result[i] = output[i] return result
[ 4299, 954, 42758, 7, 18747, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2764, 278, 33947, 11862, 7822, 319, 11361, 13, 198, 220, 220, 220, 1058, 17143, 7177, 25, 7177, 326, 761, 284, 307, 23243, 198, 220, 220, 220, 1058, 7783, 25, 7186, 23243, 7177, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5072, 796, 685, 15, 329, 1312, 287, 2837, 7, 11645, 15437, 198, 220, 220, 220, 954, 796, 685, 15, 329, 1312, 287, 2837, 7, 11645, 15437, 198, 220, 220, 220, 1255, 796, 14631, 1, 329, 5002, 287, 7177, 60, 198, 220, 220, 220, 329, 1312, 287, 7177, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1255, 58, 585, 7, 72, 15437, 15853, 352, 198, 220, 220, 220, 329, 1312, 287, 2837, 7, 11645, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 1255, 58, 72, 60, 15853, 1255, 58, 72, 532, 352, 60, 198, 220, 220, 220, 329, 1312, 287, 2837, 7, 11925, 7, 18747, 8, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 5072, 58, 20274, 58, 585, 7, 18747, 58, 72, 12962, 60, 532, 352, 60, 796, 7177, 58, 72, 60, 198, 220, 220, 220, 220, 220, 220, 220, 954, 58, 585, 7, 18747, 58, 72, 12962, 60, 48185, 352, 198, 220, 220, 220, 329, 1312, 287, 2837, 7, 11925, 7, 18747, 8, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 1255, 58, 72, 60, 796, 5072, 58, 72, 60, 198, 220, 220, 220, 1441, 1255, 198 ]
2.395161
248
# flake8: noqa from samtranslator.model.function_policies import FunctionPolicies, PolicyTypes
[ 2, 781, 539, 23, 25, 645, 20402, 198, 198, 6738, 6072, 7645, 41880, 13, 19849, 13, 8818, 62, 79, 4160, 444, 1330, 15553, 47, 4160, 444, 11, 7820, 31431, 198 ]
3.2
30
""" Capstone Project. Code to run on a LAPTOP (NOT the robot). Constructs and returns Frame objects for the basics: -- teleoperation -- arm movement -- stopping the robot program This code is SHARED by all team members. It contains both: -- High-level, general-purpose methods for a Snatch3r EV3 robot. -- Lower-level code to interact with the EV3 robot library. Author: Your professors (for the framework and lower-level code) and Nicholas Snow, Katana College, and Zach Kelly. Winter term, 2018-2019. """ import tkinter from tkinter import ttk import time def get_teleoperation_frame(window, mqtt_sender): """ Constructs and returns a frame on the given window, where the frame has Entry and Button objects that control the EV3 robot's motion by passing messages using the given MQTT Sender. :type window: ttk.Frame | ttk.Toplevel :type mqtt_sender: com.MqttClient """ # Construct the frame to return: frame = ttk.Frame(window, padding=10, borderwidth=5, relief="ridge") frame.grid() # Construct the widgets on the frame: frame_label = ttk.Label(frame, text="Teleoperation") left_speed_label = ttk.Label(frame, text="Left wheel speed (0 to 100)") right_speed_label = ttk.Label(frame, text="Right wheel speed (0 to 100)") left_speed_entry = ttk.Entry(frame, width=8) left_speed_entry.insert(0, "100") right_speed_entry = ttk.Entry(frame, width=8, justify=tkinter.RIGHT) right_speed_entry.insert(0, "100") forward_button = ttk.Button(frame, text="Forward") backward_button = ttk.Button(frame, text="Backward") left_button = ttk.Button(frame, text="Left") right_button = ttk.Button(frame, text="Right") stop_button = ttk.Button(frame, text="Stop") # Grid the widgets: frame_label.grid(row=0, column=1) left_speed_label.grid(row=1, column=0) right_speed_label.grid(row=1, column=2) left_speed_entry.grid(row=2, column=0) right_speed_entry.grid(row=2, column=2) forward_button.grid(row=3, column=1) left_button.grid(row=4, column=0) stop_button.grid(row=4, column=1) right_button.grid(row=4, column=2) backward_button.grid(row=5, column=1) # Set the button callbacks: forward_button["command"] = lambda: handle_forward( left_speed_entry, right_speed_entry, mqtt_sender) backward_button["command"] = lambda: handle_backward( left_speed_entry, right_speed_entry, mqtt_sender) left_button["command"] = lambda: handle_left( left_speed_entry, right_speed_entry, mqtt_sender) right_button["command"] = lambda: handle_right( left_speed_entry, right_speed_entry, mqtt_sender) stop_button["command"] = lambda: handle_stop(mqtt_sender) return frame def get_arm_frame(window, mqtt_sender): """ Constructs and returns a frame on the given window, where the frame has Entry and Button objects that control the EV3 robot's Arm by passing messages using the given MQTT Sender. :type window: ttk.Frame | ttk.Toplevel :type mqtt_sender: com.MqttClient """ # Construct the frame to return: frame = ttk.Frame(window, padding=10, borderwidth=5, relief="ridge") frame.grid() # Construct the widgets on the frame: frame_label = ttk.Label(frame, text="Arm and Claw") position_label = ttk.Label(frame, text="Desired arm position:") position_entry = ttk.Entry(frame, width=8) raise_arm_button = ttk.Button(frame, text="Raise arm") lower_arm_button = ttk.Button(frame, text="Lower arm") calibrate_arm_button = ttk.Button(frame, text="Calibrate arm") move_arm_button = ttk.Button(frame, text="Move arm to position (0 to 5112)") blank_label = ttk.Label(frame, text="") # Grid the widgets: frame_label.grid(row=0, column=1) position_label.grid(row=1, column=0) position_entry.grid(row=1, column=1) position_entry.insert(0, "0") move_arm_button.grid(row=1, column=2) blank_label.grid(row=2, column=1) raise_arm_button.grid(row=3, column=0) lower_arm_button.grid(row=3, column=1) calibrate_arm_button.grid(row=3, column=2) # Set the Button callbacks: raise_arm_button["command"] = lambda: handle_raise_arm(mqtt_sender) lower_arm_button["command"] = lambda: handle_lower_arm(mqtt_sender) calibrate_arm_button["command"] = lambda: handle_calibrate_arm(mqtt_sender) move_arm_button["command"] = lambda: handle_move_arm_to_position(position_entry.get(), mqtt_sender) return frame def get_control_frame(window, mqtt_sender): """ Constructs and returns a frame on the given window, where the frame has Button objects to exit this program and/or the robot's program (via MQTT). :type window: ttk.Frame | ttk.Toplevel :type mqtt_sender: com.MqttClient """ # Construct the frame to return: frame = ttk.Frame(window, padding=10, borderwidth=5, relief="ridge") frame.grid() # Construct the widgets on the frame: frame_label = ttk.Label(frame, text="Control") quit_robot_button = ttk.Button(frame, text="Stop the robot's program") exit_button = ttk.Button(frame, text="Stop this and the robot's program") # Grid the widgets: frame_label.grid(row=0, column=1) quit_robot_button.grid(row=1, column=0) exit_button.grid(row=1, column=2) # Set the Button callbacks: quit_robot_button["command"] = lambda: handle_quit(mqtt_sender) exit_button["command"] = lambda: handle_exit(mqtt_sender) return frame ############################################################################### ############################################################################### # The following specifies, for each Button, # what should happen when the Button is pressed. ############################################################################### ############################################################################### ############################################################################### # Handlers for Buttons in the Teleoperation frame. ############################################################################### def handle_forward(left_entry_box, right_entry_box, mqtt_sender): """ Tells the robot to move using the speeds in the given entry boxes, with the speeds used as given. :type left_entry_box: ttk.Entry :type right_entry_box: ttk.Entry :type mqtt_sender: com.MqttClient """ print('forward', left_entry_box.get(), right_entry_box.get()) mqtt_sender.send_message('movement', [left_entry_box.get(), right_entry_box.get()]) def handle_backward(left_entry_box, right_entry_box, mqtt_sender): """ Tells the robot to move using the speeds in the given entry boxes, but using the negatives of the speeds in the entry boxes. :type left_entry_box: ttk.Entry :type right_entry_box: ttk.Entry :type mqtt_sender: com.MqttClient """ print('backward', left_entry_box.get(), right_entry_box.get()) left = -int(left_entry_box.get()) right = -int(right_entry_box.get()) mqtt_sender.send_message('movement', [str(left), str(right)]) def handle_left(left_entry_box, right_entry_box, mqtt_sender): """ Tells the robot to move using the speeds in the given entry boxes, but using the negative of the speed in the left entry box. :type left_entry_box: ttk.Entry :type right_entry_box: ttk.Entry :type mqtt_sender: com.MqttClient """ print('left', left_entry_box.get(), right_entry_box.get()) left = -int(left_entry_box.get()) right = int(right_entry_box.get()) mqtt_sender.send_message('movement', [str(left), str(right)]) def handle_right(left_entry_box, right_entry_box, mqtt_sender): """ Tells the robot to move using the speeds in the given entry boxes, but using the negative of the speed in the right entry box. :type left_entry_box: ttk.Entry :type right_entry_box: ttk.Entry :type mqtt_sender: com.MqttClient """ print('right', left_entry_box.get(), right_entry_box.get()) left = int(left_entry_box.get()) right = -int(right_entry_box.get()) mqtt_sender.send_message('movement', [str(left), str(right)]) def handle_stop(mqtt_sender): """ Tells the robot to stop. :type mqtt_sender: com.MqttClient """ mqtt_sender.send_message('stop') print("Stop") ############################################################################### # Handlers for Buttons in the ArmAndClaw frame. ############################################################################### def handle_raise_arm(mqtt_sender): """ Tells the robot to raise its Arm until its touch sensor is pressed. :type mqtt_sender: com.MqttClient """ mqtt_sender.send_message('up') print("Move Arm Up") def handle_lower_arm(mqtt_sender): """ Tells the robot to lower its Arm until it is all the way down. :type mqtt_sender: com.MqttClient """ mqtt_sender.send_message('down') print("Move Arm Down") def handle_calibrate_arm(mqtt_sender): """ Tells the robot to calibrate its Arm, that is, first to raise its Arm until its touch sensor is pressed, then to lower its Arm until it is all the way down, and then to mark taht position as position 0. :type mqtt_sender: com.MqttClient """ mqtt_sender.send_message('calibrate') print("Calibrate") def handle_move_arm_to_position(position_entry, mqtt_sender): """ Tells the robot to move its Arm to the position in the given Entry box. The robot must have previously calibrated its Arm. :type arm_position_entry ttk.Entry :type mqtt_sender: com.MqttClient """ mqtt_sender.send_message('move_to_pos', [str(position_entry)]) print("Move to Position:",position_entry) ############################################################################### # Handlers for Buttons in the Control frame. ############################################################################### def handle_quit(mqtt_sender): """ Tell the robot's program to stop its loop (and hence quit). :type mqtt_sender: com.MqttClient """ mqtt_sender.send_message('command', ['quit']) print('########') print('# Quit #') print('########') def handle_exit(mqtt_sender): """ Tell the robot's program to stop its loop (and hence quit). Then exit this program. :type mqtt_sender: com.MqttClient """ mqtt_sender.send_message('command', ['exit']) print('########') print('# Exit #') print('########') def get_Sprint_1_Drive_System_frame(window, mqtt_sender): """ Constructs and returns a frame on the given window, where the frame has Special objects that control the EV3 robot's motion by passing messages using the given MQTT Sender. :type window: ttk.Frame | ttk.Toplevel :type mqtt_sender: com.MqttClient """ # Construct the frame to return: frame = ttk.Frame(window, padding=10, borderwidth=5, relief="ridge") frame.grid() # Construct the widgets on the frame: frame_label = ttk.Label(frame, text="Secondary Drive System") wheel_speed_label = ttk.Label(frame, text="Wheel Speed (0 to 100)") time_label = ttk.Label(frame, text="Movement Time (0 to INF)") inches_label = ttk.Label(frame, text="Movement Distance (0 to INF)") wheel_speed_entry = ttk.Entry(frame, width=8) wheel_speed_entry.insert(0, "100") time_entry = ttk.Entry(frame, width=8, justify=tkinter.RIGHT) time_entry.insert(0, "10") inches_entry = ttk.Entry(frame, width=8, justify=tkinter.RIGHT) inches_entry.insert(0, "10") forward_time_button = ttk.Button(frame, text="Forward for Seconds") forward_time_inches_button = ttk.Button(frame, text="Forward for Inches(time)") forward_inches_button = ttk.Button(frame, text="Forward for Inches(Encoder)") # Grid the widgets: frame_label.grid(row=0, column=1) wheel_speed_label.grid(row=1, column=0) time_label.grid(row=1, column=1) inches_label.grid(row=1, column=2) wheel_speed_entry.grid(row=2, column=0) time_entry.grid(row=2, column=1) inches_entry.grid(row=2, column=2) forward_time_button.grid(row=3, column=0) forward_time_inches_button.grid(row=3, column=1) forward_inches_button.grid(row=3, column=2) # Set the button callbacks: forward_time_button["command"] = lambda: handle_forward_time_button(wheel_speed_entry.get(), time_entry.get(), mqtt_sender) forward_time_inches_button["command"] = lambda: handle_forward_time_inches_button(wheel_speed_entry.get(), inches_entry.get(), mqtt_sender) forward_inches_button["command"] = lambda: handle_forward_inches_button(wheel_speed_entry.get(), inches_entry.get(), mqtt_sender) return frame def get_Sprint_1_Beeper_System_frame(window, mqtt_sender): """ Constructs and returns a frame on the given window, where the frame has Beeper objects that control the EV3 robot's motion by passing messages using the given MQTT Sender. :type window: ttk.Frame | ttk.Toplevel :type mqtt_sender: com.MqttClient """ # Construct the frame to return: frame = ttk.Frame(window, padding=10, borderwidth=5, relief="ridge") frame.grid() # Construct the widgets on the frame: frame_label = ttk.Label(frame, text="Sound System") number_of_beeps_label = ttk.Label(frame, text="Number of Beeps") tone_duration_label = ttk.Label(frame, text="Duration of Tone") tone_frequency_label = ttk.Label(frame, text="Tone Frequency") speak_text_label = ttk.Label(frame, text="Text to Speech") number_of_beeps= ttk.Entry(frame, width=8) number_of_beeps.insert(0, "10") tone_duration = ttk.Entry(frame, width=8, justify=tkinter.RIGHT) tone_duration.insert(0, "10") tone_frequency = ttk.Entry(frame, width=8, justify=tkinter.RIGHT) tone_frequency.insert(0, "10") speak_text = ttk.Entry(frame, width=8, justify=tkinter.RIGHT) speak_text.insert(0, "Type Here") beep_button = ttk.Button(frame, text="Play Beeps") tone_button = ttk.Button(frame, text="Play Tone") speak_button = ttk.Button(frame, text="Read Text") # Grid the widgets: frame_label.grid(row=0, column=1) number_of_beeps_label.grid(row=1, column=0) tone_duration_label.grid(row=1, column=1) tone_frequency_label.grid(row=1, column=2) speak_text_label.grid(row=1, column=3) number_of_beeps.grid(row=2, column=0) tone_duration.grid(row=2, column=1) tone_frequency.grid(row=2, column=2) speak_text.grid(row=2, column=3) beep_button.grid(row=3, column=0) tone_button.grid(row=3, column=1) speak_button.grid(row=3, column=3) # Set the button callbacks: beep_button["command"] = lambda: handle_beep_button(number_of_beeps.get(), mqtt_sender) tone_button["command"] = lambda: handle_tone_button(tone_duration.get(), tone_frequency.get(), mqtt_sender) speak_button["command"] = lambda: handle_speak_button(speak_text.get(), mqtt_sender) return frame def get_Katana_frame(window, mqtt_sender): """ Constructs and returns a frame on the given window, where the frame has Beeper objects that control the EV3 robot's motion by passing messages using the given MQTT Sender. :type window: ttk.Frame | ttk.Toplevel :type mqtt_sender: com.MqttClient """ # Construct the frame to return: frame = ttk.Frame(window, padding=10, borderwidth=5, relief="ridge") frame.grid() # Construct the widgets on the frame: frame_label = ttk.Label(frame, text="Katana's System") obtain_with_sensor_label = ttk.Label(frame, text="Get Object with Proximity") obtain_with_sensor_button = ttk.Button(frame, text="Get") wheel_speed_label = ttk.Label(frame, text="Move Speed") rate_of_frequency_label = ttk.Label(frame, text="Frequency Rate (Increasing)") rate_of_frequency = ttk.Entry(frame, width=8, justify=tkinter.LEFT) rate_of_frequency.insert(0, "10") initial_frequency_label = ttk.Label(frame, text="Initial Frequency") initial_frequency = ttk.Entry(frame, width=8, justify=tkinter.LEFT) initial_frequency.insert(0, "5") obtain_with_camera_label = ttk.Label(frame, text="Get Object with Camera") obtain_with_camera_button = ttk.Button(frame, text="Get") wheel_speed_entry = ttk.Entry(frame, width=8) wheel_speed_entry.insert(0, "100") spin_speed_label = ttk.Label(frame, text="Spinning Speed") spin_speed = ttk.Entry(frame, width=8, justify=tkinter.LEFT) spin_speed.insert(0, "10") spin_direction_label = ttk.Label(frame, text="Spinning Direction") spin_direction = ttk.Entry(frame, width=8, justify=tkinter.LEFT) spin_direction.insert(0, "Counter Clockwise") # Grid the widgets: frame_label.grid(row=0, column=2) obtain_with_sensor_label.grid(row=1, column=1) obtain_with_sensor_button.grid(row=2, column=1) rate_of_frequency_label.grid(row=1,column=2) rate_of_frequency.grid(row=2, column=2) initial_frequency_label.grid(row=1, column=3) initial_frequency.grid(row=2, column=3) wheel_speed_label.grid(row=3, column=2) wheel_speed_entry.grid(row=4, column=2) obtain_with_camera_label.grid(row=5, column=1) obtain_with_camera_button.grid(row=6, column=1) spin_speed_label.grid(row=5, column=2) spin_speed.grid(row=6, column=2) spin_direction_label.grid(row=5, column=3) spin_direction.grid(row=6, column=3) # Set the button callbacks: obtain_with_sensor_button["command"] = lambda: handle_obtain_with_sensor_button(wheel_speed_entry.get(),rate_of_frequency.get(), initial_frequency.get(), mqtt_sender) obtain_with_camera_button["command"] = lambda: handle_obtain_with_camera_button(wheel_speed_entry.get(), spin_speed.get(), spin_direction.get(), rate_of_frequency.get(), initial_frequency.get(),mqtt_sender) return frame def get_Nick_frame(window, mqtt_sender): """ Constructs and returns a frame on the given window, where the frame has Beeper objects that control the EV3 robot's motion by passing messages using the given MQTT Sender. :type window: ttk.Frame | ttk.Toplevel :type mqtt_sender: com.MqttClient """ # Construct the frame to return: frame = ttk.Frame(window, padding=10, borderwidth=5, relief="ridge") frame.grid() # Construct the widgets on the frame: frame_label = ttk.Label(frame, text="Nick's Sprint 2 System") proximity_label = ttk.Label(frame, text="Go to and Pick up Object (Proximity)") proximity_button = ttk.Button(frame, text="Run Proximity Grab") camera_label = ttk.Label(frame, text="Go to and Pick up Object (Camera)") camera_button = ttk.Button(frame, text="Run Camera Grab") line_follower_label = ttk.Label(frame, text="Line Follower (Bang Bang Method)") line_button = ttk.Button(frame, text="Follow Line") rate_of_beeps_label = ttk.Label(frame, text="Beep Rate Increase") rate_of_beeps= ttk.Entry(frame, width=8, justify=tkinter.LEFT) rate_of_beeps.insert(0, "10") initial_beeps_label = ttk.Label(frame, text="Initial Beep Rate") initial_beeps = ttk.Entry(frame, width=8, justify=tkinter.LEFT) initial_beeps.insert(0, "5") speed_label = ttk.Label(frame, text="Turning Speed") speed = ttk.Entry(frame, width=8, justify=tkinter.LEFT) speed.insert(0, "100") direction_label = ttk.Label(frame, text="Turning Direction, Clockwise or Counter-Clockwise") direction = ttk.Entry(frame, width=8, justify=tkinter.LEFT) direction.insert(0, "Clockwise") starting_side_label = ttk.Label(frame, text="Turning Direction, Right or Left") starting_side = ttk.Entry(frame, width=8, justify=tkinter.LEFT) starting_side.insert(0, "Right") # Grid the widgets: frame_label.grid(row=0, column=1) proximity_label.grid(row=1, column=0) proximity_button.grid(row=1, column=1) rate_of_beeps_label.grid(row=2, column=0) rate_of_beeps.grid(row=2, column=1) initial_beeps_label.grid(row=3, column=0) initial_beeps.grid(row=3, column=1) camera_label.grid(row=4, column=0) camera_button.grid(row=4, column=1) speed_label.grid(row=5, column=0) speed.grid(row=5, column=1) direction_label.grid(row=6, column=0) direction.grid(row=6, column=1) line_follower_label.grid(row=7, column=0) line_button.grid(row=7, column=1) starting_side_label.grid(row=8, column=0) starting_side.grid(row=8, column=1) # Set the button callbacks: proximity_button["command"] = lambda: handle_proximity_button(rate_of_beeps.get(), initial_beeps.get(), mqtt_sender) camera_button["command"] = lambda: handle_camera_button(speed.get(),direction.get(),rate_of_beeps.get(), initial_beeps.get(), mqtt_sender) line_button["command"] = lambda: handle_line_button(starting_side.get(), mqtt_sender) return frame ##COLOR FRAMING def get_Sprint_2_Color_frame(window, mqtt_sender): """ Constructs and returns a frame on the given window, where the frame has Beeper objects that control the EV3 robot's motion by passing messages using the given MQTT Sender. :type window: ttk.Frame | ttk.Toplevel :type mqtt_sender: com.MqttClient """ # Construct the frame to return: frame = ttk.Frame(window, padding=10, borderwidth=5, relief="ridge") frame.grid() # Construct the widgets on the frame: frame_label = ttk.Label(frame, text="Color Sensor") intensity_less_label = ttk.Label(frame, text="Go Until Intensity is Less Than") intensity_less_button = ttk.Button(frame, text="Run Less than Intensity") intensity_greater_label = ttk.Label(frame, text="Go Until Intensity is Greater Than") intensity_greater_button = ttk.Button(frame, text="Run Greater than Intensity") until_color_label = ttk.Label(frame, text="Go Until Color") until_color_button = ttk.Button(frame, text="Run Go Until Color") until_not_color_label = ttk.Label(frame, text="Go Until Not Color") until_not_color_button = ttk.Button(frame, text="Run Go Until Not Color") color_label = ttk.Label(frame, text="Color") color= ttk.Entry(frame, width=8, justify=tkinter.LEFT) color.insert(0, "Red") speed_label = ttk.Label(frame, text="Speed") speed = ttk.Entry(frame, width=8, justify=tkinter.LEFT) speed.insert(0, "50") intensity_label = ttk.Label(frame, text="Light Intensity") intensity = ttk.Entry(frame, width=8, justify=tkinter.LEFT) intensity.insert(0, "50") # Grid the widgets: frame_label.grid(row=0, column=1) color_label.grid(row=1, column=0) color.grid(row=2, column=0) speed_label.grid(row=1, column=1) speed.grid(row=2, column=1) intensity_label.grid(row=1, column=2) intensity.grid(row=2, column=2) intensity_less_label.grid(row=3, column=0) intensity_less_button.grid(row=4, column=0) intensity_greater_label.grid(row=5, column=0) intensity_greater_button.grid(row=6, column=0) until_color_label.grid(row=3, column=2) until_color_button.grid(row=4, column=2) until_not_color_label.grid(row=5, column=2) until_not_color_button.grid(row=6, column=2) # Set the button callbacks: intensity_less_button["command"] = lambda: handle_intensity_less_button(speed.get(), intensity.get(), mqtt_sender) intensity_greater_button["command"] = lambda: handle_intensity_greater_button(speed.get(),intensity.get(), mqtt_sender) until_color_button["command"] = lambda: handle_until_color_button(speed.get(),color.get(), mqtt_sender) until_not_color_button["command"] = lambda: handle_until_not_color_button(speed.get(),color.get(), mqtt_sender) return frame ##PROXIMITY SENSOR def get_Sprint_2_Proximity_frame(window, mqtt_sender): """ Constructs and returns a frame on the given window, where the frame has Beeper objects that control the EV3 robot's motion by passing messages using the given MQTT Sender. :type window: ttk.Frame | ttk.Toplevel :type mqtt_sender: com.MqttClient """ # Construct the frame to return: frame = ttk.Frame(window, padding=10, borderwidth=5, relief="ridge") frame.grid() # Construct the widgets on the frame: frame_label = ttk.Label(frame, text="Proximity Sensor") distance_less_label = ttk.Label(frame, text="Go Until Distance is Less Than") distance_less_button = ttk.Button(frame, text="Run Less than Distance") distance_greater_label = ttk.Label(frame, text="Go Until Distance is Greater Than") distance_greater_button = ttk.Button(frame, text="Run Greater than Distance") until_distance_label = ttk.Label(frame, text="Go Until Distance Within") until_distance_button = ttk.Button(frame, text="Run Go Until Distance Within") inches_label = ttk.Label(frame, text="Inches") inches = ttk.Entry(frame, width=8, justify=tkinter.LEFT) inches.insert(0, "10") speed_label = ttk.Label(frame, text="Speed") speed = ttk.Entry(frame, width=8, justify=tkinter.LEFT) speed.insert(0, "100") delta_label = ttk.Label(frame, text="Delta Distance") delta = ttk.Entry(frame, width=8, justify=tkinter.LEFT) delta.insert(0, "50") # Grid the widgets: frame_label.grid(row=0, column=1) distance_less_label.grid(row=3, column=0) distance_less_button.grid(row=4, column=0) distance_greater_label.grid(row=3, column=1) distance_greater_button.grid(row=4, column=1) until_distance_label.grid(row=3, column=2) until_distance_button.grid(row=4, column=2) delta_label.grid(row=1, column=0) delta.grid(row=2, column=0) speed_label.grid(row=1, column=1) speed.grid(row=2, column=1) inches_label.grid(row=1, column=2) inches.grid(row=2, column=2) # Set the button callbacks: distance_greater_button["command"] = lambda: handle_distance_greater_button(speed.get(), inches.get(), mqtt_sender) distance_less_button["command"] = lambda: handle_distance_less_button(speed.get(), inches.get(),mqtt_sender) until_distance_button["command"] = lambda: handle_until_distance_button(speed.get(), inches.get(), delta.get(), mqtt_sender) return frame ##Camera SENSOR def get_Sprint_2_Camera_frame(window, mqtt_sender): """ Constructs and returns a frame on the given window, where the frame has Beeper objects that control the EV3 robot's motion by passing messages using the given MQTT Sender. :type window: ttk.Frame | ttk.Toplevel :type mqtt_sender: com.MqttClient """ # Construct the frame to return: frame = ttk.Frame(window, padding=10, borderwidth=5, relief="ridge") frame.grid() # Construct the widgets on the frame: frame_label = ttk.Label(frame, text="Camera Sensor") counter_clockwise_label = ttk.Label(frame, text="Search Counterclockwise") counter_clockwise_button = ttk.Button(frame, text="Run CCW Search") clockwise_label = ttk.Label(frame, text="Search Counterclockwise") clockwise_button = ttk.Button(frame, text="Run CW Search") speed_label = ttk.Label(frame, text="Speed") speed = ttk.Entry(frame, width=8, justify=tkinter.LEFT) speed.insert(0, "100") area_label = ttk.Label(frame, text="Area Size") area = ttk.Entry(frame, width=8, justify=tkinter.LEFT) area.insert(0, "10") # Grid the widgets: frame_label.grid(row=0, column=1) counter_clockwise_label.grid(row=1, column=0) counter_clockwise_button.grid(row=2, column=0) clockwise_label.grid(row=1, column=2) clockwise_button.grid(row=2, column=2) area_label.grid(row=1, column=1) area.grid(row=2, column=1) speed_label.grid(row=3, column=1) speed.grid(row=4, column=1) # Set the button callbacks: counter_clockwise_button["command"] = lambda: handle_counter_clockwise_button(speed.get(), area.get(), mqtt_sender) clockwise_button["command"] = lambda: handle_clockwise_button(speed.get(), area.get(), mqtt_sender) return frame
[ 37811, 198, 220, 4476, 6440, 4935, 13, 220, 6127, 284, 1057, 319, 257, 406, 2969, 35222, 357, 11929, 262, 9379, 737, 198, 220, 28407, 82, 290, 5860, 25184, 5563, 329, 262, 19165, 25, 198, 220, 1377, 5735, 27184, 198, 220, 1377, 3211, 3356, 198, 220, 1377, 12225, 262, 9379, 1430, 628, 220, 770, 2438, 318, 39225, 1961, 416, 477, 1074, 1866, 13, 220, 632, 4909, 1111, 25, 198, 220, 220, 220, 1377, 3334, 12, 5715, 11, 2276, 12, 29983, 5050, 329, 257, 5489, 963, 18, 81, 8696, 18, 9379, 13, 198, 220, 220, 220, 1377, 16048, 12, 5715, 2438, 284, 9427, 351, 262, 8696, 18, 9379, 5888, 13, 628, 220, 6434, 25, 220, 3406, 20339, 357, 1640, 262, 9355, 290, 2793, 12, 5715, 2438, 8, 198, 220, 220, 220, 290, 20320, 7967, 11, 8595, 2271, 5535, 11, 290, 18825, 9077, 13, 198, 220, 10633, 3381, 11, 2864, 12, 23344, 13, 198, 37811, 198, 198, 11748, 256, 74, 3849, 198, 6738, 256, 74, 3849, 1330, 256, 30488, 198, 11748, 640, 628, 198, 4299, 651, 62, 46813, 27184, 62, 14535, 7, 17497, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 28407, 82, 290, 5860, 257, 5739, 319, 262, 1813, 4324, 11, 810, 262, 5739, 198, 220, 220, 220, 468, 21617, 290, 20969, 5563, 326, 1630, 262, 8696, 18, 9379, 338, 6268, 198, 220, 220, 220, 416, 6427, 6218, 1262, 262, 1813, 337, 48, 15751, 311, 2194, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 4324, 25, 220, 220, 220, 220, 220, 220, 256, 30488, 13, 19778, 930, 256, 30488, 13, 51, 643, 626, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 28407, 262, 5739, 284, 1441, 25, 198, 220, 220, 220, 5739, 796, 256, 30488, 13, 19778, 7, 17497, 11, 24511, 28, 940, 11, 4865, 10394, 28, 20, 11, 8259, 2625, 12818, 4943, 198, 220, 220, 220, 5739, 13, 25928, 3419, 628, 220, 220, 220, 1303, 28407, 262, 40803, 319, 262, 5739, 25, 198, 220, 220, 220, 5739, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 31709, 27184, 4943, 198, 220, 220, 220, 1364, 62, 12287, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 18819, 7825, 2866, 357, 15, 284, 1802, 8, 4943, 198, 220, 220, 220, 826, 62, 12287, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 11028, 7825, 2866, 357, 15, 284, 1802, 8, 4943, 628, 220, 220, 220, 1364, 62, 12287, 62, 13000, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 8, 198, 220, 220, 220, 1364, 62, 12287, 62, 13000, 13, 28463, 7, 15, 11, 366, 3064, 4943, 198, 220, 220, 220, 826, 62, 12287, 62, 13000, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 49, 9947, 8, 198, 220, 220, 220, 826, 62, 12287, 62, 13000, 13, 28463, 7, 15, 11, 366, 3064, 4943, 628, 220, 220, 220, 2651, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 39746, 4943, 198, 220, 220, 220, 19528, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 7282, 904, 4943, 198, 220, 220, 220, 1364, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 18819, 4943, 198, 220, 220, 220, 826, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 11028, 4943, 198, 220, 220, 220, 2245, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 19485, 4943, 628, 220, 220, 220, 1303, 24846, 262, 40803, 25, 198, 220, 220, 220, 5739, 62, 18242, 13, 25928, 7, 808, 28, 15, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 1364, 62, 12287, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 826, 62, 12287, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 1364, 62, 12287, 62, 13000, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 826, 62, 12287, 62, 13000, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 17, 8, 628, 220, 220, 220, 2651, 62, 16539, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 1364, 62, 16539, 13, 25928, 7, 808, 28, 19, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 2245, 62, 16539, 13, 25928, 7, 808, 28, 19, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 826, 62, 16539, 13, 25928, 7, 808, 28, 19, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 19528, 62, 16539, 13, 25928, 7, 808, 28, 20, 11, 5721, 28, 16, 8, 628, 220, 220, 220, 1303, 5345, 262, 4936, 869, 10146, 25, 198, 220, 220, 220, 2651, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 11813, 7, 198, 220, 220, 220, 220, 220, 220, 220, 1364, 62, 12287, 62, 13000, 11, 826, 62, 12287, 62, 13000, 11, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 19528, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 1891, 904, 7, 198, 220, 220, 220, 220, 220, 220, 220, 1364, 62, 12287, 62, 13000, 11, 826, 62, 12287, 62, 13000, 11, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 1364, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 9464, 7, 198, 220, 220, 220, 220, 220, 220, 220, 1364, 62, 12287, 62, 13000, 11, 826, 62, 12287, 62, 13000, 11, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 826, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 3506, 7, 198, 220, 220, 220, 220, 220, 220, 220, 1364, 62, 12287, 62, 13000, 11, 826, 62, 12287, 62, 13000, 11, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 2245, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 11338, 7, 76, 80, 926, 62, 82, 2194, 8, 628, 220, 220, 220, 1441, 5739, 628, 198, 4299, 651, 62, 1670, 62, 14535, 7, 17497, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 28407, 82, 290, 5860, 257, 5739, 319, 262, 1813, 4324, 11, 810, 262, 5739, 198, 220, 220, 220, 468, 21617, 290, 20969, 5563, 326, 1630, 262, 8696, 18, 9379, 338, 7057, 198, 220, 220, 220, 416, 6427, 6218, 1262, 262, 1813, 337, 48, 15751, 311, 2194, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 4324, 25, 220, 220, 220, 220, 220, 220, 256, 30488, 13, 19778, 930, 256, 30488, 13, 51, 643, 626, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 28407, 262, 5739, 284, 1441, 25, 198, 220, 220, 220, 5739, 796, 256, 30488, 13, 19778, 7, 17497, 11, 24511, 28, 940, 11, 4865, 10394, 28, 20, 11, 8259, 2625, 12818, 4943, 198, 220, 220, 220, 5739, 13, 25928, 3419, 628, 220, 220, 220, 1303, 28407, 262, 40803, 319, 262, 5739, 25, 198, 220, 220, 220, 5739, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 26560, 290, 30358, 4943, 198, 220, 220, 220, 2292, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 5960, 1202, 3211, 2292, 25, 4943, 198, 220, 220, 220, 2292, 62, 13000, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 8, 628, 220, 220, 220, 5298, 62, 1670, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 21762, 786, 3211, 4943, 198, 220, 220, 220, 2793, 62, 1670, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 31426, 3211, 4943, 198, 220, 220, 220, 33801, 378, 62, 1670, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 9771, 2889, 378, 3211, 4943, 198, 220, 220, 220, 1445, 62, 1670, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2420, 2625, 21774, 3211, 284, 2292, 357, 15, 284, 6885, 1065, 8, 4943, 198, 220, 220, 220, 9178, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 4943, 628, 220, 220, 220, 1303, 24846, 262, 40803, 25, 198, 220, 220, 220, 5739, 62, 18242, 13, 25928, 7, 808, 28, 15, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 2292, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 2292, 62, 13000, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 2292, 62, 13000, 13, 28463, 7, 15, 11, 366, 15, 4943, 198, 220, 220, 220, 1445, 62, 1670, 62, 16539, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 17, 8, 628, 220, 220, 220, 9178, 62, 18242, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 5298, 62, 1670, 62, 16539, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 2793, 62, 1670, 62, 16539, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 33801, 378, 62, 1670, 62, 16539, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 17, 8, 628, 220, 220, 220, 1303, 5345, 262, 20969, 869, 10146, 25, 198, 220, 220, 220, 5298, 62, 1670, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 40225, 62, 1670, 7, 76, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 2793, 62, 1670, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 21037, 62, 1670, 7, 76, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 33801, 378, 62, 1670, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 9948, 2889, 378, 62, 1670, 7, 76, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 1445, 62, 1670, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 21084, 62, 1670, 62, 1462, 62, 9150, 7, 9150, 62, 13000, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 628, 220, 220, 220, 1441, 5739, 628, 198, 4299, 651, 62, 13716, 62, 14535, 7, 17497, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 28407, 82, 290, 5860, 257, 5739, 319, 262, 1813, 4324, 11, 810, 262, 5739, 468, 198, 220, 220, 220, 20969, 5563, 284, 8420, 428, 1430, 290, 14, 273, 262, 9379, 338, 1430, 357, 8869, 337, 48, 15751, 737, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 4324, 25, 220, 220, 220, 220, 220, 220, 256, 30488, 13, 19778, 930, 256, 30488, 13, 51, 643, 626, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 28407, 262, 5739, 284, 1441, 25, 198, 220, 220, 220, 5739, 796, 256, 30488, 13, 19778, 7, 17497, 11, 24511, 28, 940, 11, 4865, 10394, 28, 20, 11, 8259, 2625, 12818, 4943, 198, 220, 220, 220, 5739, 13, 25928, 3419, 628, 220, 220, 220, 1303, 28407, 262, 40803, 319, 262, 5739, 25, 198, 220, 220, 220, 5739, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 15988, 4943, 198, 220, 220, 220, 11238, 62, 305, 13645, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 19485, 262, 9379, 338, 1430, 4943, 198, 220, 220, 220, 8420, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 19485, 428, 290, 262, 9379, 338, 1430, 4943, 628, 220, 220, 220, 1303, 24846, 262, 40803, 25, 198, 220, 220, 220, 5739, 62, 18242, 13, 25928, 7, 808, 28, 15, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 11238, 62, 305, 13645, 62, 16539, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 8420, 62, 16539, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 17, 8, 628, 220, 220, 220, 1303, 5345, 262, 20969, 869, 10146, 25, 198, 220, 220, 220, 11238, 62, 305, 13645, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 47391, 7, 76, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 8420, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 37023, 7, 76, 80, 926, 62, 82, 2194, 8, 628, 220, 220, 220, 1441, 5739, 198, 198, 29113, 29113, 7804, 4242, 21017, 198, 29113, 29113, 7804, 4242, 21017, 198, 2, 383, 1708, 26052, 11, 329, 1123, 20969, 11, 198, 2, 644, 815, 1645, 618, 262, 20969, 318, 12070, 13, 198, 29113, 29113, 7804, 4242, 21017, 198, 29113, 29113, 7804, 4242, 21017, 198, 198, 29113, 29113, 7804, 4242, 21017, 198, 2, 7157, 8116, 329, 887, 27288, 287, 262, 14318, 27184, 5739, 13, 198, 29113, 29113, 7804, 4242, 21017, 198, 4299, 5412, 62, 11813, 7, 9464, 62, 13000, 62, 3524, 11, 826, 62, 13000, 62, 3524, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 14026, 82, 262, 9379, 284, 1445, 1262, 262, 12055, 287, 262, 1813, 5726, 10559, 11, 198, 220, 220, 220, 351, 262, 12055, 973, 355, 1813, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 1364, 62, 13000, 62, 3524, 25, 220, 220, 256, 30488, 13, 30150, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 826, 62, 13000, 62, 3524, 25, 220, 256, 30488, 13, 30150, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 220, 220, 220, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3601, 10786, 11813, 3256, 1364, 62, 13000, 62, 3524, 13, 1136, 22784, 826, 62, 13000, 62, 3524, 13, 1136, 28955, 198, 220, 220, 220, 285, 80, 926, 62, 82, 2194, 13, 21280, 62, 20500, 10786, 21084, 434, 3256, 685, 9464, 62, 13000, 62, 3524, 13, 1136, 22784, 826, 62, 13000, 62, 3524, 13, 1136, 3419, 12962, 628, 198, 4299, 5412, 62, 1891, 904, 7, 9464, 62, 13000, 62, 3524, 11, 826, 62, 13000, 62, 3524, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 14026, 82, 262, 9379, 284, 1445, 1262, 262, 12055, 287, 262, 1813, 5726, 10559, 11, 198, 220, 220, 220, 475, 1262, 262, 42510, 286, 262, 12055, 287, 262, 5726, 10559, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 1364, 62, 13000, 62, 3524, 25, 220, 220, 256, 30488, 13, 30150, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 826, 62, 13000, 62, 3524, 25, 220, 256, 30488, 13, 30150, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 220, 220, 220, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3601, 10786, 1891, 904, 3256, 1364, 62, 13000, 62, 3524, 13, 1136, 22784, 826, 62, 13000, 62, 3524, 13, 1136, 28955, 198, 220, 220, 220, 1364, 796, 532, 600, 7, 9464, 62, 13000, 62, 3524, 13, 1136, 28955, 198, 220, 220, 220, 826, 796, 532, 600, 7, 3506, 62, 13000, 62, 3524, 13, 1136, 28955, 198, 220, 220, 220, 285, 80, 926, 62, 82, 2194, 13, 21280, 62, 20500, 10786, 21084, 434, 3256, 685, 2536, 7, 9464, 828, 965, 7, 3506, 8, 12962, 628, 198, 4299, 5412, 62, 9464, 7, 9464, 62, 13000, 62, 3524, 11, 826, 62, 13000, 62, 3524, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 14026, 82, 262, 9379, 284, 1445, 1262, 262, 12055, 287, 262, 1813, 5726, 10559, 11, 198, 220, 220, 220, 475, 1262, 262, 4633, 286, 262, 2866, 287, 262, 1364, 5726, 3091, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 1364, 62, 13000, 62, 3524, 25, 220, 220, 256, 30488, 13, 30150, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 826, 62, 13000, 62, 3524, 25, 220, 256, 30488, 13, 30150, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 220, 220, 220, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3601, 10786, 9464, 3256, 1364, 62, 13000, 62, 3524, 13, 1136, 22784, 826, 62, 13000, 62, 3524, 13, 1136, 28955, 198, 220, 220, 220, 1364, 796, 532, 600, 7, 9464, 62, 13000, 62, 3524, 13, 1136, 28955, 198, 220, 220, 220, 826, 796, 493, 7, 3506, 62, 13000, 62, 3524, 13, 1136, 28955, 198, 220, 220, 220, 285, 80, 926, 62, 82, 2194, 13, 21280, 62, 20500, 10786, 21084, 434, 3256, 685, 2536, 7, 9464, 828, 965, 7, 3506, 8, 12962, 198, 198, 4299, 5412, 62, 3506, 7, 9464, 62, 13000, 62, 3524, 11, 826, 62, 13000, 62, 3524, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 14026, 82, 262, 9379, 284, 1445, 1262, 262, 12055, 287, 262, 1813, 5726, 10559, 11, 198, 220, 220, 220, 475, 1262, 262, 4633, 286, 262, 2866, 287, 262, 826, 5726, 3091, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 1364, 62, 13000, 62, 3524, 25, 220, 220, 256, 30488, 13, 30150, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 826, 62, 13000, 62, 3524, 25, 220, 256, 30488, 13, 30150, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 220, 220, 220, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3601, 10786, 3506, 3256, 1364, 62, 13000, 62, 3524, 13, 1136, 22784, 826, 62, 13000, 62, 3524, 13, 1136, 28955, 198, 220, 220, 220, 1364, 796, 493, 7, 9464, 62, 13000, 62, 3524, 13, 1136, 28955, 198, 220, 220, 220, 826, 796, 532, 600, 7, 3506, 62, 13000, 62, 3524, 13, 1136, 28955, 198, 220, 220, 220, 285, 80, 926, 62, 82, 2194, 13, 21280, 62, 20500, 10786, 21084, 434, 3256, 685, 2536, 7, 9464, 828, 965, 7, 3506, 8, 12962, 198, 198, 4299, 5412, 62, 11338, 7, 76, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 14026, 82, 262, 9379, 284, 2245, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 285, 80, 926, 62, 82, 2194, 13, 21280, 62, 20500, 10786, 11338, 11537, 198, 220, 220, 220, 3601, 7203, 19485, 4943, 198, 198, 29113, 29113, 7804, 4242, 21017, 198, 2, 7157, 8116, 329, 887, 27288, 287, 262, 7057, 1870, 2601, 707, 5739, 13, 198, 29113, 29113, 7804, 4242, 21017, 198, 4299, 5412, 62, 40225, 62, 1670, 7, 76, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 14026, 82, 262, 9379, 284, 5298, 663, 7057, 1566, 663, 3638, 12694, 318, 12070, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 285, 80, 926, 62, 82, 2194, 13, 21280, 62, 20500, 10786, 929, 11537, 198, 220, 220, 220, 3601, 7203, 21774, 7057, 3205, 4943, 198, 198, 4299, 5412, 62, 21037, 62, 1670, 7, 76, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 14026, 82, 262, 9379, 284, 2793, 663, 7057, 1566, 340, 318, 477, 262, 835, 866, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 285, 80, 926, 62, 82, 2194, 13, 21280, 62, 20500, 10786, 2902, 11537, 198, 220, 220, 220, 3601, 7203, 21774, 7057, 5588, 4943, 198, 198, 4299, 5412, 62, 9948, 2889, 378, 62, 1670, 7, 76, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 14026, 82, 262, 9379, 284, 33801, 378, 663, 7057, 11, 326, 318, 11, 717, 284, 5298, 663, 7057, 198, 220, 220, 220, 1566, 663, 3638, 12694, 318, 12070, 11, 788, 284, 2793, 663, 7057, 1566, 340, 318, 198, 220, 220, 220, 477, 262, 835, 866, 11, 290, 788, 284, 1317, 256, 993, 83, 2292, 355, 2292, 657, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 285, 80, 926, 62, 82, 2194, 13, 21280, 62, 20500, 10786, 9948, 2889, 378, 11537, 198, 220, 220, 220, 3601, 7203, 9771, 2889, 378, 4943, 198, 198, 4299, 5412, 62, 21084, 62, 1670, 62, 1462, 62, 9150, 7, 9150, 62, 13000, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 14026, 82, 262, 9379, 284, 1445, 663, 7057, 284, 262, 2292, 287, 262, 1813, 21617, 3091, 13, 198, 220, 220, 220, 383, 9379, 1276, 423, 4271, 48050, 663, 7057, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 3211, 62, 9150, 62, 13000, 220, 256, 30488, 13, 30150, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 220, 220, 220, 220, 220, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 285, 80, 926, 62, 82, 2194, 13, 21280, 62, 20500, 10786, 21084, 62, 1462, 62, 1930, 3256, 685, 2536, 7, 9150, 62, 13000, 8, 12962, 198, 220, 220, 220, 3601, 7203, 21774, 284, 23158, 25, 1600, 9150, 62, 13000, 8, 198, 198, 29113, 29113, 7804, 4242, 21017, 198, 2, 7157, 8116, 329, 887, 27288, 287, 262, 6779, 5739, 13, 198, 29113, 29113, 7804, 4242, 21017, 198, 4299, 5412, 62, 47391, 7, 76, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 14026, 262, 9379, 338, 1430, 284, 2245, 663, 9052, 357, 392, 12891, 11238, 737, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 285, 80, 926, 62, 82, 2194, 13, 21280, 62, 20500, 10786, 21812, 3256, 37250, 47391, 6, 12962, 198, 220, 220, 220, 3601, 10786, 7804, 11537, 198, 220, 220, 220, 3601, 10786, 2, 48887, 1303, 11537, 198, 220, 220, 220, 3601, 10786, 7804, 11537, 198, 198, 4299, 5412, 62, 37023, 7, 76, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 14026, 262, 9379, 338, 1430, 284, 2245, 663, 9052, 357, 392, 12891, 11238, 737, 198, 220, 220, 220, 3244, 8420, 428, 1430, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 285, 80, 926, 62, 82, 2194, 25, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 285, 80, 926, 62, 82, 2194, 13, 21280, 62, 20500, 10786, 21812, 3256, 37250, 37023, 6, 12962, 198, 220, 220, 220, 3601, 10786, 7804, 11537, 198, 220, 220, 220, 3601, 10786, 2, 29739, 1303, 11537, 198, 220, 220, 220, 3601, 10786, 7804, 11537, 628, 628, 198, 4299, 651, 62, 50, 4798, 62, 16, 62, 24825, 62, 11964, 62, 14535, 7, 17497, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 28407, 82, 290, 5860, 257, 5739, 319, 262, 1813, 4324, 11, 810, 262, 5739, 198, 220, 220, 220, 468, 6093, 5563, 326, 1630, 262, 8696, 18, 9379, 338, 6268, 198, 220, 220, 220, 416, 6427, 6218, 1262, 262, 1813, 337, 48, 15751, 311, 2194, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 4324, 25, 220, 220, 220, 220, 220, 220, 256, 30488, 13, 19778, 930, 256, 30488, 13, 51, 643, 626, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 28407, 262, 5739, 284, 1441, 25, 198, 220, 220, 220, 5739, 796, 256, 30488, 13, 19778, 7, 17497, 11, 24511, 28, 940, 11, 4865, 10394, 28, 20, 11, 8259, 2625, 12818, 4943, 198, 220, 220, 220, 5739, 13, 25928, 3419, 628, 220, 220, 220, 1303, 28407, 262, 40803, 319, 262, 5739, 25, 198, 220, 220, 220, 5739, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 12211, 560, 9974, 4482, 4943, 198, 220, 220, 220, 7825, 62, 12287, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 45307, 8729, 357, 15, 284, 1802, 8, 4943, 198, 220, 220, 220, 640, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 21774, 434, 3862, 357, 15, 284, 45594, 8, 4943, 198, 220, 220, 220, 8331, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 21774, 434, 34600, 357, 15, 284, 45594, 8, 4943, 628, 220, 220, 220, 7825, 62, 12287, 62, 13000, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 8, 198, 220, 220, 220, 7825, 62, 12287, 62, 13000, 13, 28463, 7, 15, 11, 366, 3064, 4943, 198, 220, 220, 220, 640, 62, 13000, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 49, 9947, 8, 198, 220, 220, 220, 640, 62, 13000, 13, 28463, 7, 15, 11, 366, 940, 4943, 198, 220, 220, 220, 8331, 62, 13000, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 49, 9947, 8, 198, 220, 220, 220, 8331, 62, 13000, 13, 28463, 7, 15, 11, 366, 940, 4943, 628, 198, 220, 220, 220, 2651, 62, 2435, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 39746, 329, 40876, 4943, 198, 220, 220, 220, 2651, 62, 2435, 62, 45457, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 39746, 329, 554, 2052, 7, 2435, 8, 4943, 198, 220, 220, 220, 2651, 62, 45457, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 39746, 329, 554, 2052, 7, 27195, 12342, 8, 4943, 628, 198, 220, 220, 220, 1303, 24846, 262, 40803, 25, 198, 220, 220, 220, 5739, 62, 18242, 13, 25928, 7, 808, 28, 15, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 7825, 62, 12287, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 640, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 8331, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 7825, 62, 12287, 62, 13000, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 640, 62, 13000, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 8331, 62, 13000, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 17, 8, 628, 220, 220, 220, 2651, 62, 2435, 62, 16539, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 2651, 62, 2435, 62, 45457, 62, 16539, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 2651, 62, 45457, 62, 16539, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 17, 8, 628, 220, 220, 220, 1303, 5345, 262, 4936, 869, 10146, 25, 198, 220, 220, 220, 2651, 62, 2435, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 11813, 62, 2435, 62, 16539, 7, 22001, 62, 12287, 62, 13000, 13, 1136, 22784, 640, 62, 13000, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 2651, 62, 2435, 62, 45457, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 11813, 62, 2435, 62, 45457, 62, 16539, 7, 22001, 62, 12287, 62, 13000, 13, 1136, 22784, 8331, 62, 13000, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 2651, 62, 45457, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 11813, 62, 45457, 62, 16539, 7, 22001, 62, 12287, 62, 13000, 13, 1136, 22784, 8331, 62, 13000, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 1441, 5739, 628, 628, 198, 4299, 651, 62, 50, 4798, 62, 16, 62, 33, 41278, 62, 11964, 62, 14535, 7, 17497, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 28407, 82, 290, 5860, 257, 5739, 319, 262, 1813, 4324, 11, 810, 262, 5739, 198, 220, 220, 220, 468, 1355, 5723, 5563, 326, 1630, 262, 8696, 18, 9379, 338, 6268, 198, 220, 220, 220, 416, 6427, 6218, 1262, 262, 1813, 337, 48, 15751, 311, 2194, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 4324, 25, 220, 220, 220, 220, 220, 220, 256, 30488, 13, 19778, 930, 256, 30488, 13, 51, 643, 626, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 28407, 262, 5739, 284, 1441, 25, 198, 220, 220, 220, 5739, 796, 256, 30488, 13, 19778, 7, 17497, 11, 24511, 28, 940, 11, 4865, 10394, 28, 20, 11, 8259, 2625, 12818, 4943, 198, 220, 220, 220, 5739, 13, 25928, 3419, 628, 220, 220, 220, 1303, 28407, 262, 40803, 319, 262, 5739, 25, 198, 220, 220, 220, 5739, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 21369, 4482, 4943, 198, 220, 220, 220, 1271, 62, 1659, 62, 1350, 25386, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 15057, 286, 1355, 25386, 4943, 198, 220, 220, 220, 8216, 62, 32257, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 26054, 286, 45362, 4943, 198, 220, 220, 220, 8216, 62, 35324, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 51, 505, 31902, 4943, 198, 220, 220, 220, 2740, 62, 5239, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 8206, 284, 24709, 4943, 628, 220, 220, 220, 1271, 62, 1659, 62, 1350, 25386, 28, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 8, 198, 220, 220, 220, 1271, 62, 1659, 62, 1350, 25386, 13, 28463, 7, 15, 11, 366, 940, 4943, 198, 220, 220, 220, 8216, 62, 32257, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 49, 9947, 8, 198, 220, 220, 220, 8216, 62, 32257, 13, 28463, 7, 15, 11, 366, 940, 4943, 198, 220, 220, 220, 8216, 62, 35324, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 49, 9947, 8, 198, 220, 220, 220, 8216, 62, 35324, 13, 28463, 7, 15, 11, 366, 940, 4943, 198, 220, 220, 220, 2740, 62, 5239, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 49, 9947, 8, 198, 220, 220, 220, 2740, 62, 5239, 13, 28463, 7, 15, 11, 366, 6030, 3423, 4943, 628, 198, 220, 220, 220, 307, 538, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 11002, 1355, 25386, 4943, 198, 220, 220, 220, 8216, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 11002, 45362, 4943, 198, 220, 220, 220, 2740, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 5569, 8255, 4943, 628, 198, 220, 220, 220, 1303, 24846, 262, 40803, 25, 198, 220, 220, 220, 5739, 62, 18242, 13, 25928, 7, 808, 28, 15, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 1271, 62, 1659, 62, 1350, 25386, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 8216, 62, 32257, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 8216, 62, 35324, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 2740, 62, 5239, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 18, 8, 628, 220, 220, 220, 1271, 62, 1659, 62, 1350, 25386, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 8216, 62, 32257, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 8216, 62, 35324, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 2740, 62, 5239, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 18, 8, 628, 220, 220, 220, 307, 538, 62, 16539, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 8216, 62, 16539, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 2740, 62, 16539, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 18, 8, 628, 220, 220, 220, 1303, 5345, 262, 4936, 869, 10146, 25, 198, 220, 220, 220, 307, 538, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 1350, 538, 62, 16539, 7, 17618, 62, 1659, 62, 1350, 25386, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 8216, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 41527, 62, 16539, 7, 41527, 62, 32257, 13, 1136, 22784, 8216, 62, 35324, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 2740, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 47350, 62, 16539, 7, 47350, 62, 5239, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 1441, 5739, 628, 198, 198, 4299, 651, 62, 25881, 2271, 62, 14535, 7, 17497, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 28407, 82, 290, 5860, 257, 5739, 319, 262, 1813, 4324, 11, 810, 262, 5739, 198, 220, 220, 220, 468, 1355, 5723, 5563, 326, 1630, 262, 8696, 18, 9379, 338, 6268, 198, 220, 220, 220, 416, 6427, 6218, 1262, 262, 1813, 337, 48, 15751, 311, 2194, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 4324, 25, 220, 220, 220, 220, 220, 220, 256, 30488, 13, 19778, 930, 256, 30488, 13, 51, 643, 626, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 28407, 262, 5739, 284, 1441, 25, 198, 220, 220, 220, 5739, 796, 256, 30488, 13, 19778, 7, 17497, 11, 24511, 28, 940, 11, 4865, 10394, 28, 20, 11, 8259, 2625, 12818, 4943, 198, 220, 220, 220, 5739, 13, 25928, 3419, 628, 220, 220, 220, 1303, 28407, 262, 40803, 319, 262, 5739, 25, 198, 220, 220, 220, 5739, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 25881, 2271, 338, 4482, 4943, 198, 220, 220, 220, 7330, 62, 4480, 62, 82, 22854, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 3855, 9515, 351, 1041, 87, 18853, 4943, 198, 220, 220, 220, 7330, 62, 4480, 62, 82, 22854, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 3855, 4943, 628, 220, 220, 220, 7825, 62, 12287, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 21774, 8729, 4943, 198, 220, 220, 220, 2494, 62, 1659, 62, 35324, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 37, 28707, 14806, 357, 15562, 2313, 8, 4943, 198, 220, 220, 220, 2494, 62, 1659, 62, 35324, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 2494, 62, 1659, 62, 35324, 13, 28463, 7, 15, 11, 366, 940, 4943, 198, 220, 220, 220, 4238, 62, 35324, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 24243, 31902, 4943, 198, 220, 220, 220, 4238, 62, 35324, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 4238, 62, 35324, 13, 28463, 7, 15, 11, 366, 20, 4943, 628, 220, 220, 220, 7330, 62, 4480, 62, 25695, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 3855, 9515, 351, 20432, 4943, 198, 220, 220, 220, 7330, 62, 4480, 62, 25695, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 3855, 4943, 628, 220, 220, 220, 7825, 62, 12287, 62, 13000, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 8, 198, 220, 220, 220, 7825, 62, 12287, 62, 13000, 13, 28463, 7, 15, 11, 366, 3064, 4943, 198, 220, 220, 220, 7906, 62, 12287, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 4561, 23062, 8729, 4943, 198, 220, 220, 220, 7906, 62, 12287, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 7906, 62, 12287, 13, 28463, 7, 15, 11, 366, 940, 4943, 198, 220, 220, 220, 7906, 62, 37295, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 4561, 23062, 41837, 4943, 198, 220, 220, 220, 7906, 62, 37295, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 7906, 62, 37295, 13, 28463, 7, 15, 11, 366, 31694, 21328, 3083, 4943, 628, 220, 220, 220, 1303, 24846, 262, 40803, 25, 198, 220, 220, 220, 5739, 62, 18242, 13, 25928, 7, 808, 28, 15, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 7330, 62, 4480, 62, 82, 22854, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 7330, 62, 4480, 62, 82, 22854, 62, 16539, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 2494, 62, 1659, 62, 35324, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 28665, 28, 17, 8, 198, 220, 220, 220, 2494, 62, 1659, 62, 35324, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 4238, 62, 35324, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 18, 8, 198, 220, 220, 220, 4238, 62, 35324, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 18, 8, 628, 220, 220, 220, 7825, 62, 12287, 62, 18242, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 7825, 62, 12287, 62, 13000, 13, 25928, 7, 808, 28, 19, 11, 5721, 28, 17, 8, 628, 220, 220, 220, 7330, 62, 4480, 62, 25695, 62, 18242, 13, 25928, 7, 808, 28, 20, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 7330, 62, 4480, 62, 25695, 62, 16539, 13, 25928, 7, 808, 28, 21, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 7906, 62, 12287, 62, 18242, 13, 25928, 7, 808, 28, 20, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 7906, 62, 12287, 13, 25928, 7, 808, 28, 21, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 7906, 62, 37295, 62, 18242, 13, 25928, 7, 808, 28, 20, 11, 5721, 28, 18, 8, 198, 220, 220, 220, 7906, 62, 37295, 13, 25928, 7, 808, 28, 21, 11, 5721, 28, 18, 8, 628, 220, 220, 220, 1303, 5345, 262, 4936, 869, 10146, 25, 198, 220, 220, 220, 7330, 62, 4480, 62, 82, 22854, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 672, 3153, 62, 4480, 62, 82, 22854, 62, 16539, 7, 22001, 62, 12287, 62, 13000, 13, 1136, 22784, 4873, 62, 1659, 62, 35324, 13, 1136, 22784, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4238, 62, 35324, 13, 1136, 22784, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 285, 80, 926, 62, 82, 2194, 8, 628, 220, 220, 220, 7330, 62, 4480, 62, 25695, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 672, 3153, 62, 4480, 62, 25695, 62, 16539, 7, 22001, 62, 12287, 62, 13000, 13, 1136, 22784, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7906, 62, 12287, 13, 1136, 22784, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 7906, 62, 37295, 13, 1136, 22784, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2494, 62, 1659, 62, 35324, 13, 1136, 22784, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4238, 62, 35324, 13, 1136, 22784, 76, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 1441, 5739, 198, 198, 4299, 651, 62, 23609, 62, 14535, 7, 17497, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 28407, 82, 290, 5860, 257, 5739, 319, 262, 1813, 4324, 11, 810, 262, 5739, 198, 220, 220, 220, 468, 1355, 5723, 5563, 326, 1630, 262, 8696, 18, 9379, 338, 6268, 198, 220, 220, 220, 416, 6427, 6218, 1262, 262, 1813, 337, 48, 15751, 311, 2194, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 4324, 25, 220, 220, 220, 220, 220, 220, 256, 30488, 13, 19778, 930, 256, 30488, 13, 51, 643, 626, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 28407, 262, 5739, 284, 1441, 25, 198, 220, 220, 220, 5739, 796, 256, 30488, 13, 19778, 7, 17497, 11, 24511, 28, 940, 11, 4865, 10394, 28, 20, 11, 8259, 2625, 12818, 4943, 198, 220, 220, 220, 5739, 13, 25928, 3419, 628, 220, 220, 220, 1303, 28407, 262, 40803, 319, 262, 5739, 25, 198, 220, 220, 220, 5739, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 23609, 338, 23178, 362, 4482, 4943, 198, 220, 220, 220, 20387, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 5247, 284, 290, 12346, 510, 9515, 357, 2964, 87, 18853, 8, 4943, 198, 220, 220, 220, 20387, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 10987, 1041, 87, 18853, 25339, 4943, 628, 220, 220, 220, 4676, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 5247, 284, 290, 12346, 510, 9515, 357, 35632, 8, 4943, 198, 220, 220, 220, 4676, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 10987, 20432, 25339, 4943, 628, 220, 220, 220, 1627, 62, 69, 47030, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 13949, 376, 47030, 357, 43984, 9801, 11789, 8, 4943, 198, 220, 220, 220, 1627, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 7155, 6910, 4943, 628, 220, 220, 220, 2494, 62, 1659, 62, 1350, 25386, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 3856, 538, 14806, 25285, 4943, 198, 220, 220, 220, 2494, 62, 1659, 62, 1350, 25386, 28, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 2494, 62, 1659, 62, 1350, 25386, 13, 28463, 7, 15, 11, 366, 940, 4943, 198, 220, 220, 220, 4238, 62, 1350, 25386, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 24243, 1355, 538, 14806, 4943, 198, 220, 220, 220, 4238, 62, 1350, 25386, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 4238, 62, 1350, 25386, 13, 28463, 7, 15, 11, 366, 20, 4943, 628, 220, 220, 220, 2866, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 17278, 278, 8729, 4943, 198, 220, 220, 220, 2866, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 2866, 13, 28463, 7, 15, 11, 366, 3064, 4943, 198, 220, 220, 220, 4571, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 17278, 278, 41837, 11, 21328, 3083, 393, 15034, 12, 44758, 3083, 4943, 198, 220, 220, 220, 4571, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 4571, 13, 28463, 7, 15, 11, 366, 44758, 3083, 4943, 628, 220, 220, 220, 3599, 62, 1589, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 17278, 278, 41837, 11, 6498, 393, 9578, 4943, 198, 220, 220, 220, 3599, 62, 1589, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 3599, 62, 1589, 13, 28463, 7, 15, 11, 366, 11028, 4943, 628, 220, 220, 220, 1303, 24846, 262, 40803, 25, 198, 220, 220, 220, 5739, 62, 18242, 13, 25928, 7, 808, 28, 15, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 20387, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 20387, 62, 16539, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 2494, 62, 1659, 62, 1350, 25386, 62, 18242, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 2494, 62, 1659, 62, 1350, 25386, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 4238, 62, 1350, 25386, 62, 18242, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 4238, 62, 1350, 25386, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 16, 8, 628, 220, 220, 220, 4676, 62, 18242, 13, 25928, 7, 808, 28, 19, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 4676, 62, 16539, 13, 25928, 7, 808, 28, 19, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 2866, 62, 18242, 13, 25928, 7, 808, 28, 20, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 2866, 13, 25928, 7, 808, 28, 20, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 4571, 62, 18242, 13, 25928, 7, 808, 28, 21, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 4571, 13, 25928, 7, 808, 28, 21, 11, 5721, 28, 16, 8, 628, 220, 220, 220, 1627, 62, 69, 47030, 62, 18242, 13, 25928, 7, 808, 28, 22, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 1627, 62, 16539, 13, 25928, 7, 808, 28, 22, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 3599, 62, 1589, 62, 18242, 13, 25928, 7, 808, 28, 23, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 3599, 62, 1589, 13, 25928, 7, 808, 28, 23, 11, 5721, 28, 16, 8, 628, 220, 220, 220, 1303, 5345, 262, 4936, 869, 10146, 25, 198, 220, 220, 220, 20387, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 1676, 87, 18853, 62, 16539, 7, 4873, 62, 1659, 62, 1350, 25386, 13, 1136, 22784, 4238, 62, 1350, 25386, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 4676, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 25695, 62, 16539, 7, 12287, 13, 1136, 22784, 37295, 13, 1136, 22784, 4873, 62, 1659, 62, 1350, 25386, 13, 1136, 22784, 4238, 62, 1350, 25386, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 1627, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 1370, 62, 16539, 7, 38690, 62, 1589, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 1441, 5739, 198, 198, 2235, 46786, 8782, 2390, 2751, 198, 4299, 651, 62, 50, 4798, 62, 17, 62, 10258, 62, 14535, 7, 17497, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 28407, 82, 290, 5860, 257, 5739, 319, 262, 1813, 4324, 11, 810, 262, 5739, 198, 220, 220, 220, 468, 1355, 5723, 5563, 326, 1630, 262, 8696, 18, 9379, 338, 6268, 198, 220, 220, 220, 416, 6427, 6218, 1262, 262, 1813, 337, 48, 15751, 311, 2194, 13, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 4324, 25, 220, 220, 220, 220, 220, 220, 256, 30488, 13, 19778, 930, 256, 30488, 13, 51, 643, 626, 198, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 28407, 262, 5739, 284, 1441, 25, 198, 220, 220, 220, 5739, 796, 256, 30488, 13, 19778, 7, 17497, 11, 24511, 28, 940, 11, 4865, 10394, 28, 20, 11, 8259, 2625, 12818, 4943, 198, 220, 220, 220, 5739, 13, 25928, 3419, 628, 220, 220, 220, 1303, 28407, 262, 40803, 319, 262, 5739, 25, 198, 220, 220, 220, 5739, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 10258, 35367, 4943, 198, 220, 220, 220, 12245, 62, 1203, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 5247, 14303, 2558, 6377, 318, 12892, 17924, 4943, 198, 220, 220, 220, 12245, 62, 1203, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 10987, 12892, 621, 2558, 6377, 4943, 628, 220, 220, 220, 12245, 62, 18223, 263, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 5247, 14303, 2558, 6377, 318, 18169, 17924, 4943, 198, 220, 220, 220, 12245, 62, 18223, 263, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 10987, 18169, 621, 2558, 6377, 4943, 628, 220, 220, 220, 1566, 62, 8043, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 5247, 14303, 5315, 4943, 198, 220, 220, 220, 1566, 62, 8043, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 10987, 1514, 14303, 5315, 4943, 628, 220, 220, 220, 1566, 62, 1662, 62, 8043, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 5247, 14303, 1892, 5315, 4943, 198, 220, 220, 220, 1566, 62, 1662, 62, 8043, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 10987, 1514, 14303, 1892, 5315, 4943, 628, 220, 220, 220, 3124, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 10258, 4943, 198, 220, 220, 220, 3124, 28, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 3124, 13, 28463, 7, 15, 11, 366, 7738, 4943, 198, 220, 220, 220, 2866, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 22785, 4943, 198, 220, 220, 220, 2866, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 2866, 13, 28463, 7, 15, 11, 366, 1120, 4943, 628, 220, 220, 220, 12245, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 15047, 2558, 6377, 4943, 198, 220, 220, 220, 12245, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 12245, 13, 28463, 7, 15, 11, 366, 1120, 4943, 628, 628, 220, 220, 220, 1303, 24846, 262, 40803, 25, 198, 220, 220, 220, 5739, 62, 18242, 13, 25928, 7, 808, 28, 15, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 3124, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 3124, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 2866, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 2866, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 12245, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 12245, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 17, 8, 628, 220, 220, 220, 12245, 62, 1203, 62, 18242, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 12245, 62, 1203, 62, 16539, 13, 25928, 7, 808, 28, 19, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 12245, 62, 18223, 263, 62, 18242, 13, 25928, 7, 808, 28, 20, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 12245, 62, 18223, 263, 62, 16539, 13, 25928, 7, 808, 28, 21, 11, 5721, 28, 15, 8, 628, 220, 220, 220, 1566, 62, 8043, 62, 18242, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 1566, 62, 8043, 62, 16539, 13, 25928, 7, 808, 28, 19, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 1566, 62, 1662, 62, 8043, 62, 18242, 13, 25928, 7, 808, 28, 20, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 1566, 62, 1662, 62, 8043, 62, 16539, 13, 25928, 7, 808, 28, 21, 11, 5721, 28, 17, 8, 628, 198, 220, 220, 220, 1303, 5345, 262, 4936, 869, 10146, 25, 198, 220, 220, 220, 12245, 62, 1203, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 47799, 62, 1203, 62, 16539, 7, 12287, 13, 1136, 22784, 12245, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 12245, 62, 18223, 263, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 47799, 62, 18223, 263, 62, 16539, 7, 12287, 13, 1136, 22784, 47799, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 1566, 62, 8043, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 28446, 62, 8043, 62, 16539, 7, 12287, 13, 1136, 22784, 8043, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 1566, 62, 1662, 62, 8043, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 28446, 62, 1662, 62, 8043, 62, 16539, 7, 12287, 13, 1136, 22784, 8043, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 1441, 5739, 628, 198, 198, 2235, 31190, 55, 3955, 9050, 311, 16938, 1581, 198, 4299, 651, 62, 50, 4798, 62, 17, 62, 2964, 87, 18853, 62, 14535, 7, 17497, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 28407, 82, 290, 5860, 257, 5739, 319, 262, 1813, 4324, 11, 810, 262, 5739, 198, 220, 220, 220, 468, 1355, 5723, 5563, 326, 1630, 262, 8696, 18, 9379, 338, 6268, 198, 220, 220, 220, 416, 6427, 6218, 1262, 262, 1813, 337, 48, 15751, 311, 2194, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 220, 4324, 25, 220, 220, 220, 220, 220, 220, 256, 30488, 13, 19778, 930, 256, 30488, 13, 51, 643, 626, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 28407, 262, 5739, 284, 1441, 25, 198, 220, 220, 220, 5739, 796, 256, 30488, 13, 19778, 7, 17497, 11, 24511, 28, 940, 11, 4865, 10394, 28, 20, 11, 8259, 2625, 12818, 4943, 198, 220, 220, 220, 5739, 13, 25928, 3419, 198, 220, 220, 220, 1303, 28407, 262, 40803, 319, 262, 5739, 25, 198, 220, 220, 220, 5739, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 2964, 87, 18853, 35367, 4943, 628, 220, 220, 220, 5253, 62, 1203, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 5247, 14303, 34600, 318, 12892, 17924, 4943, 198, 220, 220, 220, 5253, 62, 1203, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 10987, 12892, 621, 34600, 4943, 628, 220, 220, 220, 5253, 62, 18223, 263, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 5247, 14303, 34600, 318, 18169, 17924, 4943, 198, 220, 220, 220, 5253, 62, 18223, 263, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 10987, 18169, 621, 34600, 4943, 628, 220, 220, 220, 1566, 62, 30246, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 5247, 14303, 34600, 12511, 4943, 198, 220, 220, 220, 1566, 62, 30246, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 10987, 1514, 14303, 34600, 12511, 4943, 628, 628, 220, 220, 220, 8331, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 818, 2052, 4943, 198, 220, 220, 220, 8331, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 8331, 13, 28463, 7, 15, 11, 366, 940, 4943, 628, 220, 220, 220, 2866, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 22785, 4943, 198, 220, 220, 220, 2866, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 2866, 13, 28463, 7, 15, 11, 366, 3064, 4943, 628, 220, 220, 220, 25979, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 42430, 34600, 4943, 198, 220, 220, 220, 25979, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 25979, 13, 28463, 7, 15, 11, 366, 1120, 4943, 628, 220, 220, 220, 1303, 24846, 262, 40803, 25, 198, 220, 220, 220, 5739, 62, 18242, 13, 25928, 7, 808, 28, 15, 11, 5721, 28, 16, 8, 628, 220, 220, 220, 5253, 62, 1203, 62, 18242, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 5253, 62, 1203, 62, 16539, 13, 25928, 7, 808, 28, 19, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 5253, 62, 18223, 263, 62, 18242, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 5253, 62, 18223, 263, 62, 16539, 13, 25928, 7, 808, 28, 19, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 1566, 62, 30246, 62, 18242, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 1566, 62, 30246, 62, 16539, 13, 25928, 7, 808, 28, 19, 11, 5721, 28, 17, 8, 628, 220, 220, 220, 25979, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 25979, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 15, 8, 628, 220, 220, 220, 2866, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 2866, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 16, 8, 628, 220, 220, 220, 8331, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 8331, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 17, 8, 628, 220, 220, 220, 1303, 5345, 262, 4936, 869, 10146, 25, 198, 220, 220, 220, 5253, 62, 18223, 263, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 30246, 62, 18223, 263, 62, 16539, 7, 12287, 13, 1136, 22784, 8331, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 5253, 62, 1203, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 30246, 62, 1203, 62, 16539, 7, 12287, 13, 1136, 22784, 8331, 13, 1136, 22784, 76, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 1566, 62, 30246, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 28446, 62, 30246, 62, 16539, 7, 12287, 13, 1136, 22784, 8331, 13, 1136, 22784, 25979, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 1441, 5739, 628, 628, 198, 198, 2235, 35632, 311, 16938, 1581, 198, 4299, 651, 62, 50, 4798, 62, 17, 62, 35632, 62, 14535, 7, 17497, 11, 285, 80, 926, 62, 82, 2194, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 28407, 82, 290, 5860, 257, 5739, 319, 262, 1813, 4324, 11, 810, 262, 5739, 198, 220, 220, 220, 468, 1355, 5723, 5563, 326, 1630, 262, 8696, 18, 9379, 338, 6268, 198, 220, 220, 220, 416, 6427, 6218, 1262, 262, 1813, 337, 48, 15751, 311, 2194, 13, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 220, 4324, 25, 220, 220, 220, 220, 220, 220, 256, 30488, 13, 19778, 930, 256, 30488, 13, 51, 643, 626, 198, 220, 220, 220, 220, 220, 220, 220, 1058, 4906, 220, 285, 80, 926, 62, 82, 2194, 25, 220, 401, 13, 44, 80, 926, 11792, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1303, 28407, 262, 5739, 284, 1441, 25, 198, 220, 220, 220, 5739, 796, 256, 30488, 13, 19778, 7, 17497, 11, 24511, 28, 940, 11, 4865, 10394, 28, 20, 11, 8259, 2625, 12818, 4943, 198, 220, 220, 220, 5739, 13, 25928, 3419, 198, 220, 220, 220, 1303, 28407, 262, 40803, 319, 262, 5739, 25, 198, 220, 220, 220, 5739, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 35632, 35367, 4943, 628, 220, 220, 220, 3753, 62, 15750, 3083, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 18243, 15034, 15750, 3083, 4943, 198, 220, 220, 220, 3753, 62, 15750, 3083, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 10987, 12624, 54, 11140, 4943, 628, 220, 220, 220, 8801, 3083, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 18243, 15034, 15750, 3083, 4943, 198, 220, 220, 220, 8801, 3083, 62, 16539, 796, 256, 30488, 13, 21864, 7, 14535, 11, 2420, 2625, 10987, 24006, 11140, 4943, 628, 220, 220, 220, 2866, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 22785, 4943, 198, 220, 220, 220, 2866, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 2866, 13, 28463, 7, 15, 11, 366, 3064, 4943, 628, 220, 220, 220, 1989, 62, 18242, 796, 256, 30488, 13, 33986, 7, 14535, 11, 2420, 2625, 30547, 12849, 4943, 198, 220, 220, 220, 1989, 796, 256, 30488, 13, 30150, 7, 14535, 11, 9647, 28, 23, 11, 12051, 28, 30488, 3849, 13, 2538, 9792, 8, 198, 220, 220, 220, 1989, 13, 28463, 7, 15, 11, 366, 940, 4943, 628, 220, 220, 220, 1303, 24846, 262, 40803, 25, 198, 220, 220, 220, 5739, 62, 18242, 13, 25928, 7, 808, 28, 15, 11, 5721, 28, 16, 8, 628, 220, 220, 220, 3753, 62, 15750, 3083, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 3753, 62, 15750, 3083, 62, 16539, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 15, 8, 198, 220, 220, 220, 8801, 3083, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 17, 8, 198, 220, 220, 220, 8801, 3083, 62, 16539, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 17, 8, 628, 198, 220, 220, 220, 1989, 62, 18242, 13, 25928, 7, 808, 28, 16, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 1989, 13, 25928, 7, 808, 28, 17, 11, 5721, 28, 16, 8, 628, 220, 220, 220, 2866, 62, 18242, 13, 25928, 7, 808, 28, 18, 11, 5721, 28, 16, 8, 198, 220, 220, 220, 2866, 13, 25928, 7, 808, 28, 19, 11, 5721, 28, 16, 8, 628, 220, 220, 220, 1303, 5345, 262, 4936, 869, 10146, 25, 198, 220, 220, 220, 3753, 62, 15750, 3083, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 24588, 62, 15750, 3083, 62, 16539, 7, 12287, 13, 1136, 22784, 1989, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 198, 220, 220, 220, 8801, 3083, 62, 16539, 14692, 21812, 8973, 796, 37456, 25, 5412, 62, 15750, 3083, 62, 16539, 7, 12287, 13, 1136, 22784, 1989, 13, 1136, 22784, 285, 80, 926, 62, 82, 2194, 8, 628, 220, 220, 220, 1441, 5739, 198 ]
2.576913
11,175
import functools import torch.utils.model_zoo as model_zoo from ._preprocessing import preprocess_input from .densenet import densenet_encoders from .dpn import dpn_encoders from .efficientnet import efficientnet_encoders from .inceptionresnetv2 import inception_encoders from .resnet import resnet_encoders from .senet import senet_encoders from .vgg import vgg_encoders from .xception import xception_encoders encoders = {} encoders.update(resnet_encoders) encoders.update(dpn_encoders) encoders.update(vgg_encoders) encoders.update(senet_encoders) encoders.update(densenet_encoders) encoders.update(inception_encoders) encoders.update(xception_encoders) encoders.update(efficientnet_encoders)
[ 11748, 1257, 310, 10141, 198, 198, 11748, 28034, 13, 26791, 13, 19849, 62, 89, 2238, 355, 2746, 62, 89, 2238, 198, 198, 6738, 47540, 3866, 36948, 1330, 662, 14681, 62, 15414, 198, 6738, 764, 67, 18756, 316, 1330, 288, 18756, 316, 62, 12685, 375, 364, 198, 6738, 764, 67, 21999, 1330, 288, 21999, 62, 12685, 375, 364, 198, 6738, 764, 16814, 3262, 1330, 6942, 3262, 62, 12685, 375, 364, 198, 6738, 764, 924, 1159, 411, 3262, 85, 17, 1330, 30839, 62, 12685, 375, 364, 198, 6738, 764, 411, 3262, 1330, 581, 3262, 62, 12685, 375, 364, 198, 6738, 764, 6248, 316, 1330, 3308, 316, 62, 12685, 375, 364, 198, 6738, 764, 85, 1130, 1330, 410, 1130, 62, 12685, 375, 364, 198, 6738, 764, 87, 4516, 1330, 2124, 4516, 62, 12685, 375, 364, 198, 198, 12685, 375, 364, 796, 23884, 198, 12685, 375, 364, 13, 19119, 7, 411, 3262, 62, 12685, 375, 364, 8, 198, 12685, 375, 364, 13, 19119, 7, 67, 21999, 62, 12685, 375, 364, 8, 198, 12685, 375, 364, 13, 19119, 7, 85, 1130, 62, 12685, 375, 364, 8, 198, 12685, 375, 364, 13, 19119, 7, 6248, 316, 62, 12685, 375, 364, 8, 198, 12685, 375, 364, 13, 19119, 7, 67, 18756, 316, 62, 12685, 375, 364, 8, 198, 12685, 375, 364, 13, 19119, 7, 924, 1159, 62, 12685, 375, 364, 8, 198, 12685, 375, 364, 13, 19119, 7, 87, 4516, 62, 12685, 375, 364, 8, 198, 12685, 375, 364, 13, 19119, 7, 16814, 3262, 62, 12685, 375, 364, 8, 628, 628 ]
2.76378
254
N = int(input()) gabarito_prova = input().split() gabarito_aluno = input().split() list_aluno = [] list_prova = [] count = 0 for i in range(gabarito_aluno): for j in range(gabarito_prova): if gabarito_aluno[i] == gabarito_prova[j]: count += 1 print(count)
[ 45, 796, 493, 7, 15414, 28955, 198, 70, 397, 283, 10094, 62, 1676, 6862, 796, 5128, 22446, 35312, 3419, 198, 70, 397, 283, 10094, 62, 282, 36909, 796, 5128, 22446, 35312, 3419, 198, 198, 4868, 62, 282, 36909, 796, 17635, 198, 4868, 62, 1676, 6862, 796, 17635, 198, 198, 9127, 796, 657, 198, 198, 1640, 1312, 287, 2837, 7, 70, 397, 283, 10094, 62, 282, 36909, 2599, 198, 220, 220, 220, 329, 474, 287, 2837, 7, 70, 397, 283, 10094, 62, 1676, 6862, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 611, 308, 397, 283, 10094, 62, 282, 36909, 58, 72, 60, 6624, 308, 397, 283, 10094, 62, 1676, 6862, 58, 73, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 954, 15853, 352, 198, 198, 4798, 7, 9127, 8, 198 ]
2.088235
136
from django.conf.urls import url from apps.contact import views urlpatterns = [ url(r"^$", views.index, name="contact_index"), url(r"^submit/", views.contact_submit, name="submit"), ]
[ 6738, 42625, 14208, 13, 10414, 13, 6371, 82, 1330, 19016, 198, 198, 6738, 6725, 13, 32057, 1330, 5009, 198, 198, 6371, 33279, 82, 796, 685, 198, 220, 220, 220, 19016, 7, 81, 1, 61, 3, 1600, 5009, 13, 9630, 11, 1438, 2625, 32057, 62, 9630, 12340, 198, 220, 220, 220, 19016, 7, 81, 1, 61, 46002, 14, 1600, 5009, 13, 32057, 62, 46002, 11, 1438, 2625, 46002, 12340, 198, 60, 198 ]
2.732394
71
# -*- coding: utf-8 -*- import asyncio from typing import List, Tuple import io from urllib.parse import urljoin from lxml.html import fromstring import aiohttp from nonebot.adapters.cqhttp import MessageSegment from .formdata import FormData headers = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'zh-CN,zh;q=0.9', 'Cache-Control': 'max-age=0', 'Connection': 'keep-alive', 'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundaryuwjSiBcpPag4k159', 'Cookie': 'Hm_lvt_765ecde8c11b85f1ac5f168fa6e6821f=1602471368; Hm_lpvt_765ecde8c11b85f1ac5f168fa6e6821f=1602472300', 'Host': 'iqdb.org', 'Origin': 'http://iqdb.org', 'Referer': 'http://iqdb.org/', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36'} async def get_pic_from_url(url: str): """ 返回信息元祖 :param url: :return: """ async with aiohttp.ClientSession() as session: async with session.get(url) as resp: content = io.BytesIO(await resp.read()) data = FormData(boundary="----WebKitFormBoundaryuwjSiBcpPag4k159") data.add_field(name="MAX_FILE_SIZE", value="") for i in range(1, 7): data.add_field(name="service[]", value=str(i)) data.add_field(name="service[]", value="11") data.add_field(name="service[]", value="13") data.add_field(name="file", value=content, content_type="application/octet-stream", filename="0.jpg") data.add_field(name="url", value="") async with session.post("http://iqdb.org/", data=data, headers=headers) as res: html = await res.text() return [i for i in parse_html(html)] pass async def get_des(url: str): """ 返回详细简介 cq码转义 :param url: :return: """ image_data: List[Tuple] = await get_pic_from_url(url) if not image_data: msg: str = "找不到高相似度的" yield msg return for pic in image_data: msg = MessageSegment.image(file=pic[0]) + f"\n{pic[1]}\n" for i in pic[2]: msg = msg + f"{i}\n" yield msg
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 11748, 30351, 952, 198, 6738, 19720, 1330, 7343, 11, 309, 29291, 198, 11748, 33245, 198, 198, 6738, 2956, 297, 571, 13, 29572, 1330, 19016, 22179, 198, 6738, 300, 19875, 13, 6494, 1330, 422, 8841, 198, 11748, 257, 952, 4023, 198, 6738, 4844, 13645, 13, 324, 12126, 13, 66, 80, 4023, 1330, 16000, 41030, 434, 198, 198, 6738, 764, 687, 7890, 1330, 5178, 6601, 198, 198, 50145, 796, 1391, 198, 220, 220, 220, 705, 38855, 10354, 705, 5239, 14, 6494, 11, 31438, 14, 87, 6494, 10, 19875, 11, 31438, 14, 19875, 26, 80, 28, 15, 13, 24, 11, 9060, 14, 12384, 79, 11, 9060, 14, 499, 782, 11, 9, 15211, 26, 80, 28, 15, 13, 23, 11, 31438, 14, 32696, 12, 1069, 3803, 26, 85, 28, 65, 18, 26, 80, 28, 15, 13, 24, 3256, 198, 220, 220, 220, 705, 38855, 12, 27195, 7656, 10354, 705, 70, 13344, 11, 825, 17660, 3256, 705, 38855, 12, 32065, 10354, 705, 23548, 12, 44175, 11, 23548, 26, 80, 28, 15, 13, 24, 3256, 705, 30562, 12, 15988, 10354, 705, 9806, 12, 496, 28, 15, 3256, 198, 220, 220, 220, 705, 32048, 10354, 705, 14894, 12, 282, 425, 3256, 198, 220, 220, 220, 705, 19746, 12, 6030, 10354, 705, 16680, 541, 433, 14, 687, 12, 7890, 26, 18645, 28, 650, 13908, 20827, 8479, 49646, 560, 84, 86, 73, 42801, 33, 13155, 47, 363, 19, 74, 19707, 3256, 198, 220, 220, 220, 705, 34, 18055, 10354, 705, 39, 76, 62, 6780, 83, 62, 29143, 721, 2934, 23, 66, 1157, 65, 5332, 69, 16, 330, 20, 69, 14656, 13331, 21, 68, 3104, 2481, 69, 28, 14198, 23753, 1485, 3104, 26, 367, 76, 62, 34431, 36540, 62, 29143, 721, 2934, 23, 66, 1157, 65, 5332, 69, 16, 330, 20, 69, 14656, 13331, 21, 68, 3104, 2481, 69, 28, 14198, 23753, 1954, 405, 3256, 198, 220, 220, 220, 705, 17932, 10354, 705, 25011, 9945, 13, 2398, 3256, 705, 39688, 10354, 705, 4023, 1378, 25011, 9945, 13, 2398, 3256, 705, 8134, 11882, 10354, 705, 4023, 1378, 25011, 9945, 13, 2398, 14, 3256, 705, 44948, 12, 818, 22390, 12, 16844, 3558, 10354, 705, 16, 3256, 198, 220, 220, 220, 705, 12982, 12, 36772, 10354, 705, 44, 8590, 5049, 14, 20, 13, 15, 357, 11209, 24563, 838, 13, 15, 26, 7178, 2414, 26, 2124, 2414, 8, 4196, 13908, 20827, 14, 46096, 13, 2623, 357, 42, 28656, 11, 588, 2269, 37549, 8, 13282, 14, 5705, 13, 15, 13, 19, 20198, 13, 13348, 23298, 14, 46096, 13, 2623, 6, 92, 628, 198, 198, 292, 13361, 825, 651, 62, 16564, 62, 6738, 62, 6371, 7, 6371, 25, 965, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5525, 123, 242, 32368, 252, 46479, 94, 162, 223, 107, 17739, 225, 163, 98, 244, 198, 220, 220, 220, 1058, 17143, 19016, 25, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 30351, 351, 257, 952, 4023, 13, 11792, 36044, 3419, 355, 6246, 25, 198, 220, 220, 220, 220, 220, 220, 220, 30351, 351, 6246, 13, 1136, 7, 6371, 8, 355, 1217, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2695, 796, 33245, 13, 45992, 9399, 7, 707, 4548, 1217, 13, 961, 28955, 198, 220, 220, 220, 220, 220, 220, 220, 1366, 796, 5178, 6601, 7, 7784, 560, 2625, 650, 13908, 20827, 8479, 49646, 560, 84, 86, 73, 42801, 33, 13155, 47, 363, 19, 74, 19707, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 1366, 13, 2860, 62, 3245, 7, 3672, 2625, 22921, 62, 25664, 62, 33489, 1600, 1988, 2625, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 2837, 7, 16, 11, 767, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1366, 13, 2860, 62, 3245, 7, 3672, 2625, 15271, 21737, 1600, 1988, 28, 2536, 7, 72, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 1366, 13, 2860, 62, 3245, 7, 3672, 2625, 15271, 21737, 1600, 1988, 2625, 1157, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 1366, 13, 2860, 62, 3245, 7, 3672, 2625, 15271, 21737, 1600, 1988, 2625, 1485, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 1366, 13, 2860, 62, 3245, 7, 3672, 2625, 7753, 1600, 1988, 28, 11299, 11, 2695, 62, 4906, 2625, 31438, 14, 38441, 316, 12, 5532, 1600, 29472, 2625, 15, 13, 9479, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 1366, 13, 2860, 62, 3245, 7, 3672, 2625, 6371, 1600, 1988, 2625, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 30351, 351, 6246, 13, 7353, 7203, 4023, 1378, 25011, 9945, 13, 2398, 14, 1600, 1366, 28, 7890, 11, 24697, 28, 50145, 8, 355, 581, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 27711, 796, 25507, 581, 13, 5239, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 685, 72, 329, 1312, 287, 21136, 62, 6494, 7, 6494, 15437, 198, 220, 220, 220, 1208, 628, 198, 292, 13361, 825, 651, 62, 8906, 7, 6371, 25, 965, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5525, 123, 242, 32368, 252, 46237, 99, 163, 119, 228, 163, 106, 222, 20015, 233, 220, 269, 80, 163, 254, 223, 164, 121, 105, 20046, 231, 198, 220, 220, 220, 1058, 17143, 19016, 25, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2939, 62, 7890, 25, 7343, 58, 51, 29291, 60, 796, 25507, 651, 62, 16564, 62, 6738, 62, 6371, 7, 6371, 8, 198, 220, 220, 220, 611, 407, 2939, 62, 7890, 25, 198, 220, 220, 220, 220, 220, 220, 220, 31456, 25, 965, 796, 366, 33699, 122, 38834, 26344, 108, 165, 45865, 33566, 116, 27670, 120, 41753, 99, 21410, 1, 198, 220, 220, 220, 220, 220, 220, 220, 7800, 31456, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 198, 220, 220, 220, 329, 8301, 287, 2939, 62, 7890, 25, 198, 220, 220, 220, 220, 220, 220, 220, 31456, 796, 16000, 41030, 434, 13, 9060, 7, 7753, 28, 16564, 58, 15, 12962, 1343, 277, 1, 59, 77, 90, 16564, 58, 16, 60, 32239, 77, 1, 198, 220, 220, 220, 220, 220, 220, 220, 329, 1312, 287, 8301, 58, 17, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 31456, 796, 31456, 1343, 277, 1, 90, 72, 32239, 77, 1, 198, 220, 220, 220, 220, 220, 220, 220, 7800, 31456, 628 ]
2.136406
1,085
import datetime from flask import request from explorer.services.message import MessageService from explorer.services.miner import MinerService from explorer.services.wallets import WalletsService from explorer.services.blocks import BlocksService from base.utils.fil import datetime_to_height from base.response import response_json def get_message_list_by_height(): """ 获取Send消息列表根据高度 :return: """ height = request.form.get('height') result = MessageService.get_message_list_by_height(height) return response_json(result) def get_miner_info_by_miner_no(): """ 获取指定信息列表miner_no :return: """ miner_no = request.form.get('miner_no') date_str = request.form.get('date_str') result = MinerService.get_miner_info_by_miner_no(miner_no, date_str) return response_json(result) def get_wallet_address_change(): """ 获取钱包指点数据大小的变化量 :return: """ wallet_address = request.form.get('wallet_address') balance_value = request.form.get('balance_value') height = int(request.form.get('height')) result = WalletsService.get_wallet_address_change(wallet_address, balance_value, height) return response_json(result) def get_is_all_wallet(): """ 查询是否是钱包 :return: """ address = request.form.get("address") if not address: return response_json(False) result = WalletsService.get_is_all_wallet(address) if result: return response_json(result["value"]) return response_json(False) def get_miner_day_list(): """ 存储提供者每天的miner数据 :return: """ miner_no = request.form.get("miner_no") date = request.form.get("date") data = MinerService.get_miner_day_list(miner_no, date) return response_json(data) def get_init_value(): """ 存储提供者每天的miner数据 :return: """ miner_no = request.form.get("miner_no") fields = request.form.get("fields") end_time = request.form.get("end_time") data = MinerService.get_init_value(miner_no, fields, end_time) return response_json(data) def get_block_count(): """ 查询指定时间后是否还有新的区块 :return: """ date = request.form.get('date') height = datetime_to_height(date) count = BlocksService.get_tipset_block_count(start_height=height) return response_json({"count": count}) def get_miner_increment(): """ 查询指定时间后是否还有新的区块 :return: """ miner_no = request.form.get('miner_no') date = request.form.get('date') key = request.form.get('key') if not date: date = str(datetime.date.today() - datetime.timedelta(days=1)) result = MinerService.get_miner_increment(miner_no, date, key) return response_json(result)
[ 11748, 4818, 8079, 198, 6738, 42903, 1330, 2581, 198, 6738, 39349, 13, 30416, 13, 20500, 1330, 16000, 16177, 198, 6738, 39349, 13, 30416, 13, 1084, 263, 1330, 29295, 16177, 198, 6738, 39349, 13, 30416, 13, 16783, 5289, 1330, 6445, 5289, 16177, 198, 6738, 39349, 13, 30416, 13, 27372, 1330, 35111, 16177, 198, 6738, 2779, 13, 26791, 13, 10379, 1330, 4818, 8079, 62, 1462, 62, 17015, 198, 6738, 2779, 13, 26209, 1330, 2882, 62, 17752, 628, 198, 4299, 651, 62, 20500, 62, 4868, 62, 1525, 62, 17015, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5525, 236, 115, 20998, 244, 25206, 162, 114, 230, 162, 223, 107, 26344, 245, 26193, 101, 43718, 117, 162, 235, 106, 165, 45865, 41753, 99, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 6001, 796, 2581, 13, 687, 13, 1136, 10786, 17015, 11537, 198, 220, 220, 220, 1255, 796, 16000, 16177, 13, 1136, 62, 20500, 62, 4868, 62, 1525, 62, 17015, 7, 17015, 8, 198, 220, 220, 220, 1441, 2882, 62, 17752, 7, 20274, 8, 628, 198, 4299, 651, 62, 1084, 263, 62, 10951, 62, 1525, 62, 1084, 263, 62, 3919, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5525, 236, 115, 20998, 244, 162, 234, 229, 22522, 248, 46479, 94, 162, 223, 107, 26344, 245, 26193, 101, 1084, 263, 62, 3919, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 16285, 62, 3919, 796, 2581, 13, 687, 13, 1136, 10786, 1084, 263, 62, 3919, 11537, 198, 220, 220, 220, 3128, 62, 2536, 796, 2581, 13, 687, 13, 1136, 10786, 4475, 62, 2536, 11537, 198, 220, 220, 220, 1255, 796, 29295, 16177, 13, 1136, 62, 1084, 263, 62, 10951, 62, 1525, 62, 1084, 263, 62, 3919, 7, 1084, 263, 62, 3919, 11, 3128, 62, 2536, 8, 198, 220, 220, 220, 1441, 2882, 62, 17752, 7, 20274, 8, 628, 198, 4299, 651, 62, 44623, 62, 21975, 62, 3803, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5525, 236, 115, 20998, 244, 165, 240, 109, 44293, 227, 162, 234, 229, 163, 224, 117, 46763, 108, 162, 235, 106, 32014, 22887, 237, 21410, 20998, 246, 44293, 244, 34932, 237, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 13008, 62, 21975, 796, 2581, 13, 687, 13, 1136, 10786, 44623, 62, 21975, 11537, 198, 220, 220, 220, 5236, 62, 8367, 796, 2581, 13, 687, 13, 1136, 10786, 20427, 62, 8367, 11537, 198, 220, 220, 220, 6001, 796, 493, 7, 25927, 13, 687, 13, 1136, 10786, 17015, 6, 4008, 198, 220, 220, 220, 1255, 796, 6445, 5289, 16177, 13, 1136, 62, 44623, 62, 21975, 62, 3803, 7, 44623, 62, 21975, 11, 5236, 62, 8367, 11, 6001, 8, 198, 220, 220, 220, 1441, 2882, 62, 17752, 7, 20274, 8, 628, 198, 4299, 651, 62, 271, 62, 439, 62, 44623, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 10545, 253, 98, 46237, 95, 42468, 28938, 99, 42468, 165, 240, 109, 44293, 227, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 2209, 796, 2581, 13, 687, 13, 1136, 7203, 21975, 4943, 198, 220, 220, 220, 611, 407, 2209, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2882, 62, 17752, 7, 25101, 8, 198, 220, 220, 220, 1255, 796, 6445, 5289, 16177, 13, 1136, 62, 271, 62, 439, 62, 44623, 7, 21975, 8, 198, 220, 220, 220, 611, 1255, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1441, 2882, 62, 17752, 7, 20274, 14692, 8367, 8973, 8, 198, 220, 220, 220, 1441, 2882, 62, 17752, 7, 25101, 8, 628, 198, 4299, 651, 62, 1084, 263, 62, 820, 62, 4868, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 10263, 255, 246, 43636, 101, 162, 237, 238, 160, 122, 249, 38519, 162, 107, 237, 25465, 21410, 1084, 263, 46763, 108, 162, 235, 106, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 16285, 62, 3919, 796, 2581, 13, 687, 13, 1136, 7203, 1084, 263, 62, 3919, 4943, 198, 220, 220, 220, 3128, 796, 2581, 13, 687, 13, 1136, 7203, 4475, 4943, 198, 220, 220, 220, 1366, 796, 29295, 16177, 13, 1136, 62, 1084, 263, 62, 820, 62, 4868, 7, 1084, 263, 62, 3919, 11, 3128, 8, 198, 220, 220, 220, 1441, 2882, 62, 17752, 7, 7890, 8, 628, 198, 4299, 651, 62, 15003, 62, 8367, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 10263, 255, 246, 43636, 101, 162, 237, 238, 160, 122, 249, 38519, 162, 107, 237, 25465, 21410, 1084, 263, 46763, 108, 162, 235, 106, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 16285, 62, 3919, 796, 2581, 13, 687, 13, 1136, 7203, 1084, 263, 62, 3919, 4943, 198, 220, 220, 220, 7032, 796, 2581, 13, 687, 13, 1136, 7203, 25747, 4943, 198, 220, 220, 220, 886, 62, 2435, 796, 2581, 13, 687, 13, 1136, 7203, 437, 62, 2435, 4943, 198, 220, 220, 220, 1366, 796, 29295, 16177, 13, 1136, 62, 15003, 62, 8367, 7, 1084, 263, 62, 3919, 11, 7032, 11, 886, 62, 2435, 8, 198, 220, 220, 220, 1441, 2882, 62, 17752, 7, 7890, 8, 628, 198, 4299, 651, 62, 9967, 62, 9127, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 10545, 253, 98, 46237, 95, 162, 234, 229, 22522, 248, 33768, 114, 29785, 112, 28938, 236, 42468, 28938, 99, 32573, 246, 17312, 231, 23877, 108, 21410, 44293, 118, 161, 251, 245, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 3128, 796, 2581, 13, 687, 13, 1136, 10786, 4475, 11537, 198, 220, 220, 220, 6001, 796, 4818, 8079, 62, 1462, 62, 17015, 7, 4475, 8, 198, 220, 220, 220, 954, 796, 35111, 16177, 13, 1136, 62, 41315, 316, 62, 9967, 62, 9127, 7, 9688, 62, 17015, 28, 17015, 8, 198, 220, 220, 220, 1441, 2882, 62, 17752, 7, 4895, 9127, 1298, 954, 30072, 628, 198, 4299, 651, 62, 1084, 263, 62, 24988, 434, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 10545, 253, 98, 46237, 95, 162, 234, 229, 22522, 248, 33768, 114, 29785, 112, 28938, 236, 42468, 28938, 99, 32573, 246, 17312, 231, 23877, 108, 21410, 44293, 118, 161, 251, 245, 198, 220, 220, 220, 1058, 7783, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 16285, 62, 3919, 796, 2581, 13, 687, 13, 1136, 10786, 1084, 263, 62, 3919, 11537, 198, 220, 220, 220, 3128, 796, 2581, 13, 687, 13, 1136, 10786, 4475, 11537, 198, 220, 220, 220, 1994, 796, 2581, 13, 687, 13, 1136, 10786, 2539, 11537, 198, 220, 220, 220, 611, 407, 3128, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3128, 796, 965, 7, 19608, 8079, 13, 4475, 13, 40838, 3419, 532, 4818, 8079, 13, 16514, 276, 12514, 7, 12545, 28, 16, 4008, 198, 220, 220, 220, 1255, 796, 29295, 16177, 13, 1136, 62, 1084, 263, 62, 24988, 434, 7, 1084, 263, 62, 3919, 11, 3128, 11, 1994, 8, 198, 220, 220, 220, 1441, 2882, 62, 17752, 7, 20274, 8, 628 ]
2.258145
1,197
import pandas as pd import numpy as np import os import tensorflow as tf from functools import partial ####### STUDENTS FILL THIS OUT ###### #Question 3 def reduce_dimension_ndc(df, ndc_code_df): ''' df: pandas dataframe, input dataset ndc_df: pandas dataframe, drug code dataset used for mapping in generic names return: df: pandas dataframe, output dataframe with joined generic drug name ''' mapping = dict(ndc_code_df[['NDC_Code', 'Non-proprietary Name']].values) mapping['nan'] = np.nan df['generic_drug_name'] = df['ndc_code'].astype(str).apply(lambda x : mapping[x]) return df #Question 4 def select_first_encounter(df): ''' df: pandas dataframe, dataframe with all encounters return: - first_encounter_df: pandas dataframe, dataframe with only the first encounter for a given patient ''' df.sort_values(by = 'encounter_id') first_encounters = df.groupby('patient_nbr')['encounter_id'].first().values first_encounter_df = df[df['encounter_id'].isin(first_encounters)] return first_encounter_df #Question 6 #Question 7 def create_tf_categorical_feature_cols(categorical_col_list, vocab_dir='./diabetes_vocab/'): ''' categorical_col_list: list, categorical field list that will be transformed with TF feature column vocab_dir: string, the path where the vocabulary text files are located return: output_tf_list: list of TF feature columns ''' output_tf_list = [] for c in categorical_col_list: vocab_file_path = os.path.join(vocab_dir, c + "_vocab.txt") vocab = tf.feature_column.categorical_column_with_vocabulary_file(key=c, vocabulary_file = vocab_file_path, num_oov_buckets=1) tf_categorical_feature_column = tf.feature_column.indicator_column(vocab) output_tf_list.append(tf_categorical_feature_column) return output_tf_list #Question 8 def normalize_numeric_with_zscore(col, mean, std): ''' This function can be used in conjunction with the tf feature column for normalization ''' return (col - mean)/std def create_tf_numeric_feature(col, MEAN, STD, default_value=0): ''' col: string, input numerical column name MEAN: the mean for the column in the training data STD: the standard deviation for the column in the training data default_value: the value that will be used for imputing the field return: tf_numeric_feature: tf feature column representation of the input field ''' normalizer_fn = lambda col, m, s : (col - m) / s normalizer = partial(normalizer_fn, m = MEAN, s = STD) tf_numeric_feature = tf.feature_column.numeric_column(col, normalizer_fn = normalizer, dtype = tf.float64, default_value = default_value) return tf_numeric_feature #Question 9 def get_mean_std_from_preds(diabetes_yhat): ''' diabetes_yhat: TF Probability prediction object ''' m = diabetes_yhat.mean() s = diabetes_yhat.stddev() return m, s # Question 10 def get_student_binary_prediction(df, col): ''' df: pandas dataframe prediction output dataframe col: str, probability mean prediction field return: student_binary_prediction: pandas dataframe converting input to flattened numpy array and binary labels ''' student_binary_prediction = df[col].apply(lambda x : 1 if x >= 5 else 0) return student_binary_prediction
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28686, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 6738, 1257, 310, 10141, 1330, 13027, 198, 198, 4242, 21017, 49348, 15365, 376, 8267, 12680, 16289, 46424, 2, 198, 2, 24361, 513, 198, 4299, 4646, 62, 46156, 62, 358, 66, 7, 7568, 11, 299, 17896, 62, 8189, 62, 7568, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 47764, 25, 19798, 292, 1366, 14535, 11, 5128, 27039, 198, 220, 220, 220, 299, 17896, 62, 7568, 25, 19798, 292, 1366, 14535, 11, 2563, 2438, 27039, 973, 329, 16855, 287, 14276, 3891, 198, 220, 220, 220, 1441, 25, 198, 220, 220, 220, 220, 220, 220, 220, 47764, 25, 19798, 292, 1366, 14535, 11, 5072, 1366, 14535, 351, 5399, 14276, 2563, 1438, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 16855, 796, 8633, 7, 358, 66, 62, 8189, 62, 7568, 58, 17816, 8575, 34, 62, 10669, 3256, 705, 15419, 12, 1676, 3448, 8527, 6530, 20520, 4083, 27160, 8, 198, 220, 220, 220, 16855, 17816, 12647, 20520, 796, 45941, 13, 12647, 198, 220, 220, 220, 47764, 17816, 41357, 62, 30349, 62, 3672, 20520, 796, 47764, 17816, 358, 66, 62, 8189, 6, 4083, 459, 2981, 7, 2536, 737, 39014, 7, 50033, 2124, 1058, 16855, 58, 87, 12962, 198, 220, 220, 220, 220, 198, 220, 220, 220, 1441, 47764, 198, 198, 2, 24361, 604, 198, 4299, 2922, 62, 11085, 62, 12685, 6828, 7, 7568, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 47764, 25, 19798, 292, 1366, 14535, 11, 1366, 14535, 351, 477, 16925, 198, 220, 220, 220, 1441, 25, 198, 220, 220, 220, 220, 198, 220, 220, 220, 220, 220, 220, 220, 532, 717, 62, 12685, 6828, 62, 7568, 25, 19798, 292, 1366, 14535, 11, 1366, 14535, 351, 691, 262, 717, 8791, 329, 257, 1813, 5827, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 47764, 13, 30619, 62, 27160, 7, 1525, 796, 705, 12685, 6828, 62, 312, 11537, 198, 220, 220, 220, 717, 62, 12685, 15044, 796, 47764, 13, 8094, 1525, 10786, 26029, 62, 77, 1671, 11537, 17816, 12685, 6828, 62, 312, 6, 4083, 11085, 22446, 27160, 198, 220, 220, 220, 717, 62, 12685, 6828, 62, 7568, 796, 47764, 58, 7568, 17816, 12685, 6828, 62, 312, 6, 4083, 45763, 7, 11085, 62, 12685, 15044, 15437, 198, 220, 220, 220, 1441, 717, 62, 12685, 6828, 62, 7568, 198, 198, 2, 24361, 718, 198, 198, 2, 24361, 767, 198, 198, 4299, 2251, 62, 27110, 62, 66, 2397, 12409, 62, 30053, 62, 4033, 82, 7, 66, 2397, 12409, 62, 4033, 62, 4868, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 12776, 397, 62, 15908, 28, 4458, 14, 10989, 11064, 62, 18893, 397, 14, 6, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 4253, 12409, 62, 4033, 62, 4868, 25, 1351, 11, 4253, 12409, 2214, 1351, 326, 481, 307, 14434, 351, 24958, 3895, 5721, 198, 220, 220, 220, 12776, 397, 62, 15908, 25, 4731, 11, 262, 3108, 810, 262, 25818, 2420, 3696, 389, 5140, 198, 220, 220, 220, 1441, 25, 198, 220, 220, 220, 220, 220, 220, 220, 5072, 62, 27110, 62, 4868, 25, 1351, 286, 24958, 3895, 15180, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 5072, 62, 27110, 62, 4868, 796, 17635, 198, 220, 220, 220, 329, 269, 287, 4253, 12409, 62, 4033, 62, 4868, 25, 198, 220, 220, 220, 220, 220, 220, 220, 12776, 397, 62, 7753, 62, 6978, 796, 28686, 13, 6978, 13, 22179, 7, 18893, 397, 62, 15908, 11, 220, 269, 1343, 45434, 18893, 397, 13, 14116, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 12776, 397, 796, 48700, 13, 30053, 62, 28665, 13, 66, 2397, 12409, 62, 28665, 62, 4480, 62, 18893, 22528, 62, 7753, 7, 2539, 28, 66, 11, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 25818, 62, 7753, 796, 12776, 397, 62, 7753, 62, 6978, 11, 220, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 997, 62, 78, 709, 62, 27041, 1039, 28, 16, 8, 198, 220, 220, 220, 220, 220, 220, 220, 48700, 62, 66, 2397, 12409, 62, 30053, 62, 28665, 796, 48700, 13, 30053, 62, 28665, 13, 521, 26407, 62, 28665, 7, 18893, 397, 8, 198, 220, 220, 220, 220, 220, 220, 220, 5072, 62, 27110, 62, 4868, 13, 33295, 7, 27110, 62, 66, 2397, 12409, 62, 30053, 62, 28665, 8, 198, 220, 220, 220, 1441, 5072, 62, 27110, 62, 4868, 198, 198, 2, 24361, 807, 198, 4299, 3487, 1096, 62, 77, 39223, 62, 4480, 62, 89, 26675, 7, 4033, 11, 1612, 11, 14367, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 770, 2163, 460, 307, 973, 287, 17856, 351, 262, 48700, 3895, 5721, 329, 3487, 1634, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 1441, 357, 4033, 532, 1612, 20679, 19282, 628, 198, 198, 4299, 2251, 62, 27110, 62, 77, 39223, 62, 30053, 7, 4033, 11, 11948, 1565, 11, 48571, 11, 4277, 62, 8367, 28, 15, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 951, 25, 4731, 11, 5128, 29052, 5721, 1438, 198, 220, 220, 220, 11948, 1565, 25, 262, 1612, 329, 262, 5721, 287, 262, 3047, 1366, 198, 220, 220, 220, 48571, 25, 262, 3210, 28833, 329, 262, 5721, 287, 262, 3047, 1366, 198, 220, 220, 220, 4277, 62, 8367, 25, 262, 1988, 326, 481, 307, 973, 329, 848, 15129, 262, 2214, 628, 220, 220, 220, 1441, 25, 198, 220, 220, 220, 220, 220, 220, 220, 48700, 62, 77, 39223, 62, 30053, 25, 48700, 3895, 5721, 10552, 286, 262, 5128, 2214, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 3487, 7509, 62, 22184, 796, 37456, 951, 11, 285, 11, 264, 1058, 357, 4033, 532, 285, 8, 1220, 264, 198, 220, 220, 220, 3487, 7509, 796, 13027, 7, 11265, 7509, 62, 22184, 11, 285, 796, 11948, 1565, 11, 264, 796, 48571, 8, 198, 220, 220, 220, 48700, 62, 77, 39223, 62, 30053, 796, 48700, 13, 30053, 62, 28665, 13, 77, 39223, 62, 28665, 7, 4033, 11, 3487, 7509, 62, 22184, 796, 3487, 7509, 11, 288, 4906, 796, 48700, 13, 22468, 2414, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 4277, 62, 8367, 796, 4277, 62, 8367, 8, 198, 220, 220, 220, 1441, 48700, 62, 77, 39223, 62, 30053, 198, 198, 2, 24361, 860, 198, 4299, 651, 62, 32604, 62, 19282, 62, 6738, 62, 28764, 82, 7, 10989, 11064, 62, 88, 5183, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 12593, 62, 88, 5183, 25, 24958, 30873, 1799, 17724, 2134, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 285, 796, 12593, 62, 88, 5183, 13, 32604, 3419, 198, 220, 220, 220, 264, 796, 12593, 62, 88, 5183, 13, 301, 1860, 1990, 3419, 198, 220, 220, 220, 1441, 285, 11, 264, 198, 198, 2, 18233, 838, 198, 4299, 651, 62, 50139, 62, 39491, 62, 28764, 2867, 7, 7568, 11, 951, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 47764, 25, 19798, 292, 1366, 14535, 17724, 5072, 1366, 14535, 198, 220, 220, 220, 951, 25, 965, 11, 220, 12867, 1612, 17724, 2214, 198, 220, 220, 220, 1441, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3710, 62, 39491, 62, 28764, 2867, 25, 19798, 292, 1366, 14535, 23202, 5128, 284, 45096, 299, 32152, 7177, 290, 13934, 14722, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 3710, 62, 39491, 62, 28764, 2867, 796, 47764, 58, 4033, 4083, 39014, 7, 50033, 2124, 1058, 352, 611, 2124, 18189, 642, 2073, 657, 8, 198, 220, 220, 220, 1441, 3710, 62, 39491, 62, 28764, 2867, 198 ]
2.478644
1,475
from turtle import Screen import time from food import Food from snake_shape import Snake from snake_scoreboard import Scoreboard screen = Screen() screen.setup(width=600, height=600) screen.bgcolor('black') screen.title('My snake game for desktop.') screen.tracer(0) snake = Snake() food = Food() scoreboard = Scoreboard() screen.listen() screen.onkey(snake.up, "Up") screen.onkey(snake.down, "Down") screen.onkey(snake.left, "Left") screen.onkey(snake.right, "Right") game_is_on = True while game_is_on: screen.update() time.sleep(0.1) snake.move() if snake.segment[0].distance(food) < 15: food.refresh() snake.extend() scoreboard.increase_score() if snake.segment[0].xcor() > 280 or snake.segment[0].xcor() < -280 or snake.segment[0].ycor() > 255 or snake.segment[0].ycor() < -280: scoreboard.game_over() game_is_on = False for segment in snake.segment[1:]: if snake.segment[0].distance(segment) < 10: game_is_on = False scoreboard.game_over() screen.exitonclick()
[ 6738, 28699, 1330, 15216, 201, 198, 11748, 640, 201, 198, 6738, 2057, 1330, 7318, 201, 198, 6738, 17522, 62, 43358, 1330, 16705, 201, 198, 6738, 17522, 62, 26675, 3526, 1330, 15178, 3526, 201, 198, 201, 198, 9612, 796, 15216, 3419, 201, 198, 9612, 13, 40406, 7, 10394, 28, 8054, 11, 6001, 28, 8054, 8, 201, 198, 9612, 13, 35904, 8043, 10786, 13424, 11537, 201, 198, 9612, 13, 7839, 10786, 3666, 17522, 983, 329, 11364, 2637, 8, 201, 198, 9612, 13, 2213, 11736, 7, 15, 8, 201, 198, 201, 198, 16184, 539, 796, 16705, 3419, 201, 198, 19425, 796, 7318, 3419, 201, 198, 26675, 3526, 796, 15178, 3526, 3419, 201, 198, 201, 198, 9612, 13, 4868, 268, 3419, 201, 198, 9612, 13, 261, 2539, 7, 16184, 539, 13, 929, 11, 366, 4933, 4943, 201, 198, 9612, 13, 261, 2539, 7, 16184, 539, 13, 2902, 11, 366, 8048, 4943, 201, 198, 9612, 13, 261, 2539, 7, 16184, 539, 13, 9464, 11, 366, 18819, 4943, 201, 198, 9612, 13, 261, 2539, 7, 16184, 539, 13, 3506, 11, 366, 11028, 4943, 201, 198, 201, 198, 6057, 62, 271, 62, 261, 796, 6407, 201, 198, 201, 198, 4514, 983, 62, 271, 62, 261, 25, 201, 198, 220, 220, 220, 3159, 13, 19119, 3419, 201, 198, 220, 220, 220, 640, 13, 42832, 7, 15, 13, 16, 8, 201, 198, 220, 220, 220, 17522, 13, 21084, 3419, 201, 198, 201, 198, 220, 220, 220, 611, 17522, 13, 325, 5154, 58, 15, 4083, 30246, 7, 19425, 8, 1279, 1315, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 2057, 13, 5420, 3447, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 17522, 13, 2302, 437, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 50198, 13, 24988, 589, 62, 26675, 3419, 201, 198, 201, 198, 220, 220, 220, 611, 17522, 13, 325, 5154, 58, 15, 4083, 87, 10215, 3419, 1875, 21355, 393, 17522, 13, 325, 5154, 58, 15, 4083, 87, 10215, 3419, 1279, 532, 21033, 393, 17522, 13, 325, 5154, 58, 15, 4083, 88, 10215, 3419, 1875, 14280, 393, 17522, 13, 325, 5154, 58, 15, 4083, 88, 10215, 3419, 1279, 532, 21033, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 50198, 13, 6057, 62, 2502, 3419, 201, 198, 220, 220, 220, 220, 220, 220, 220, 983, 62, 271, 62, 261, 796, 10352, 201, 198, 201, 198, 220, 220, 220, 329, 10618, 287, 17522, 13, 325, 5154, 58, 16, 25, 5974, 201, 198, 220, 220, 220, 220, 220, 220, 220, 611, 17522, 13, 325, 5154, 58, 15, 4083, 30246, 7, 325, 5154, 8, 1279, 838, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 983, 62, 271, 62, 261, 796, 10352, 201, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 50198, 13, 6057, 62, 2502, 3419, 201, 198, 201, 198, 9612, 13, 37023, 261, 12976, 3419 ]
2.318087
481
from .sample.aplugin import APlugin from .sample.apluginimpl import * from .sample.bplugin import BPlugin from .sample.bpluginimpl import *
[ 6738, 764, 39873, 13, 64, 33803, 1330, 3486, 75, 1018, 259, 198, 6738, 764, 39873, 13, 64, 33803, 23928, 1330, 1635, 198, 6738, 764, 39873, 13, 65, 33803, 1330, 347, 37233, 198, 6738, 764, 39873, 13, 65, 33803, 23928, 1330, 1635, 198 ]
3.333333
42
# -*- coding: utf-8 -*- import unittest import os import json from dataclasses import asdict import numpy as np import click from click.testing import CliRunner from nelson_siegel_svensson import cli, NelsonSiegelCurve, \ NelsonSiegelSvenssonCurve class TestNelson_siegel_svensson(unittest.TestCase): '''Tests for `nelson_siegel_svensson` CLI.''' def test_command_line_interface(self): '''Test the CLI.''' result = self.runner.invoke(cli.cli_main) self.assertEqual(0, result.exit_code) help_result = self.runner.invoke(cli.cli_main, ['--help']) self.assertEqual(0, help_result.exit_code) self.assertIn('--help Show this message and exit.', help_result.output) def test_cli_evaluate(self): '''Test evaluate CLI.''' param = ['evaluate', '-c', '{"beta0": 0.017, "beta1": -0.023, "beta2": 0.24, "tau": 2}', '-t', '[1,2,3]'] result = self.runner.invoke(cli.cli_main, param) self.assertEqual(0, result.exit_code) self.assertIn('0.0758359', result.output) def test_cli_calibrate(self): '''Test calibrate CLI.''' param = ['calibrate', '-t', json.dumps(self.t), '-y', json.dumps(self.y)] result = self.runner.invoke(cli.cli_main, param) self.assertEqual(0, result.exit_code) self.assertIn('0.0451', result.output) first_output = result.output result = self.runner.invoke(cli.cli_main, param + ['--nelson-siegel-svensson']) self.assertEqual(0, result.exit_code) self.assertEqual(first_output, result.output) result = self.runner.invoke(cli.cli_main, param + ['--nelson-siegel']) self.assertEqual(0, result.exit_code) self.assertIn('0.0425', result.output) result = self.runner.invoke(cli.cli_main, param + ['--nelson-siegel', '--initial-tau1', '1.234']) self.assertEqual(0, result.exit_code) self.assertIn('0.04179', result.output) def test_cli_plot(self): '''Test plot CLI.''' fname = 'output.png' param = ['plot', '-o', fname, '-c', '{"beta0": 0.017, "beta1": -0.023, "beta2": 0.24, "tau": 2}'] with self.runner.isolated_filesystem(): result = self.runner.invoke(cli.cli_main, param) self.assertEqual(0, result.exit_code) self.assertTrue(os.path.exists(fname), fname + ' missing') result = self.runner.invoke(cli.cli_main, param + ['-f', '10', '-t', '20']) self.assertEqual(0, result.exit_code) self.assertTrue(os.path.exists(fname), fname + ' missing') def test_curve_parameters(self): '''Test curve parameter.''' param = cli.Curve() self.assertRaises(click.BadParameter, param.convert, value='', param=None, ctx=None) self.assertRaises(click.BadParameter, param.convert, value='{}', param=None, ctx=None) missing_tau = '{"beta0": 0.017, "beta1": -0.023, "beta2": 0.24}' self.assertRaises(click.BadParameter, param.convert, value=missing_tau, param=None, ctx=None) self.assertEqual(self.y1, param.convert(json.dumps(asdict(self.y1)), None, None)) self.assertEqual(self.y2, param.convert(json.dumps(asdict(self.y2)), None, None)) def test_float_array_parameters(self): '''Test float array parameter.''' param = cli.FloatArray() self.assertRaises(click.BadParameter, param.convert, value='', param=None, ctx=None) self.assertRaises(click.BadParameter, param.convert, value='{"a": 1}', param=None, ctx=None) self.assertRaises(click.BadParameter, param.convert, value='["a"]', param=None, ctx=None) self.assertEqual(np.array([1.0]), param.convert('[1.0]', None, None)) self.assertEqual(np.array([1.0]), param.convert('[1]', None, None)) self.assertEqual([], param.convert('[]', None, None).tolist()) self.assertTrue((np.array([1.0, 2.0, 3.0]) == param.convert('[1, 2,3.0]', None, None)).all())
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 555, 715, 395, 198, 11748, 28686, 198, 11748, 33918, 198, 6738, 4818, 330, 28958, 1330, 355, 11600, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 3904, 198, 6738, 3904, 13, 33407, 1330, 1012, 72, 49493, 198, 198, 6738, 299, 10151, 62, 82, 28210, 62, 82, 574, 16528, 1330, 537, 72, 11, 12996, 50, 28210, 26628, 303, 11, 3467, 198, 220, 220, 220, 12996, 50, 28210, 50, 574, 16528, 26628, 303, 628, 198, 4871, 6208, 45, 10151, 62, 82, 28210, 62, 82, 574, 16528, 7, 403, 715, 395, 13, 14402, 20448, 2599, 198, 220, 220, 220, 705, 7061, 51, 3558, 329, 4600, 77, 10151, 62, 82, 28210, 62, 82, 574, 16528, 63, 43749, 2637, 7061, 628, 220, 220, 220, 825, 1332, 62, 21812, 62, 1370, 62, 39994, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 14402, 262, 43749, 2637, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 1255, 796, 2116, 13, 16737, 13, 37669, 7, 44506, 13, 44506, 62, 12417, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 15, 11, 1255, 13, 37023, 62, 8189, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1037, 62, 20274, 796, 2116, 13, 16737, 13, 37669, 7, 44506, 13, 44506, 62, 12417, 11, 37250, 438, 16794, 6, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 15, 11, 1037, 62, 20274, 13, 37023, 62, 8189, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 818, 10786, 438, 16794, 220, 5438, 428, 3275, 290, 8420, 2637, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1037, 62, 20274, 13, 22915, 8, 628, 220, 220, 220, 825, 1332, 62, 44506, 62, 49786, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 14402, 13446, 43749, 2637, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 5772, 796, 37250, 49786, 3256, 705, 12, 66, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 4895, 31361, 15, 1298, 657, 13, 29326, 11, 366, 31361, 16, 1298, 532, 15, 13, 45310, 11, 366, 31361, 17, 1298, 657, 13, 1731, 11, 366, 83, 559, 1298, 362, 92, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 12, 83, 3256, 44438, 16, 11, 17, 11, 18, 60, 20520, 198, 220, 220, 220, 220, 220, 220, 220, 1255, 796, 2116, 13, 16737, 13, 37669, 7, 44506, 13, 44506, 62, 12417, 11, 5772, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 15, 11, 1255, 13, 37023, 62, 8189, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 818, 10786, 15, 13, 15, 38569, 30743, 3256, 1255, 13, 22915, 8, 628, 220, 220, 220, 825, 1332, 62, 44506, 62, 9948, 2889, 378, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 14402, 33801, 378, 43749, 2637, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 5772, 796, 37250, 9948, 2889, 378, 3256, 705, 12, 83, 3256, 33918, 13, 67, 8142, 7, 944, 13, 83, 828, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 12, 88, 3256, 33918, 13, 67, 8142, 7, 944, 13, 88, 15437, 198, 220, 220, 220, 220, 220, 220, 220, 1255, 796, 2116, 13, 16737, 13, 37669, 7, 44506, 13, 44506, 62, 12417, 11, 5772, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 15, 11, 1255, 13, 37023, 62, 8189, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 818, 10786, 15, 13, 15, 36330, 3256, 1255, 13, 22915, 8, 198, 220, 220, 220, 220, 220, 220, 220, 717, 62, 22915, 796, 1255, 13, 22915, 198, 220, 220, 220, 220, 220, 220, 220, 1255, 796, 2116, 13, 16737, 13, 37669, 7, 44506, 13, 44506, 62, 12417, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5772, 1343, 37250, 438, 77, 10151, 12, 82, 28210, 12, 82, 574, 16528, 6, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 15, 11, 1255, 13, 37023, 62, 8189, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 11085, 62, 22915, 11, 1255, 13, 22915, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1255, 796, 2116, 13, 16737, 13, 37669, 7, 44506, 13, 44506, 62, 12417, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5772, 1343, 37250, 438, 77, 10151, 12, 82, 28210, 6, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 15, 11, 1255, 13, 37023, 62, 8189, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 818, 10786, 15, 13, 3023, 1495, 3256, 1255, 13, 22915, 8, 198, 220, 220, 220, 220, 220, 220, 220, 1255, 796, 2116, 13, 16737, 13, 37669, 7, 44506, 13, 44506, 62, 12417, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5772, 1343, 37250, 438, 77, 10151, 12, 82, 28210, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 438, 36733, 12, 83, 559, 16, 3256, 705, 16, 13, 24409, 6, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 15, 11, 1255, 13, 37023, 62, 8189, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 818, 10786, 15, 13, 3023, 21738, 3256, 1255, 13, 22915, 8, 628, 220, 220, 220, 825, 1332, 62, 44506, 62, 29487, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 14402, 7110, 43749, 2637, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 277, 3672, 796, 705, 22915, 13, 11134, 6, 198, 220, 220, 220, 220, 220, 220, 220, 5772, 796, 37250, 29487, 3256, 705, 12, 78, 3256, 277, 3672, 11, 705, 12, 66, 3256, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 4895, 31361, 15, 1298, 657, 13, 29326, 11, 366, 31361, 16, 1298, 532, 15, 13, 45310, 11, 366, 31361, 17, 1298, 657, 13, 1731, 11, 366, 83, 559, 1298, 362, 92, 20520, 198, 220, 220, 220, 220, 220, 220, 220, 351, 2116, 13, 16737, 13, 30152, 515, 62, 16624, 6781, 33529, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1255, 796, 2116, 13, 16737, 13, 37669, 7, 44506, 13, 44506, 62, 12417, 11, 5772, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 15, 11, 1255, 13, 37023, 62, 8189, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 17821, 7, 418, 13, 6978, 13, 1069, 1023, 7, 69, 3672, 828, 277, 3672, 1343, 705, 4814, 11537, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1255, 796, 2116, 13, 16737, 13, 37669, 7, 44506, 13, 44506, 62, 12417, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5772, 1343, 685, 29001, 69, 3256, 705, 940, 3256, 705, 12, 83, 3256, 705, 1238, 6, 12962, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 15, 11, 1255, 13, 37023, 62, 8189, 8, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 17821, 7, 418, 13, 6978, 13, 1069, 1023, 7, 69, 3672, 828, 277, 3672, 1343, 705, 4814, 11537, 628, 220, 220, 220, 825, 1332, 62, 22019, 303, 62, 17143, 7307, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 14402, 12133, 11507, 2637, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 5772, 796, 537, 72, 13, 26628, 303, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 21762, 2696, 7, 12976, 13, 22069, 36301, 11, 5772, 13, 1102, 1851, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1988, 11639, 3256, 5772, 28, 14202, 11, 269, 17602, 28, 14202, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 21762, 2696, 7, 12976, 13, 22069, 36301, 11, 5772, 13, 1102, 1851, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1988, 11639, 90, 92, 3256, 5772, 28, 14202, 11, 269, 17602, 28, 14202, 8, 198, 220, 220, 220, 220, 220, 220, 220, 4814, 62, 83, 559, 796, 705, 4895, 31361, 15, 1298, 657, 13, 29326, 11, 366, 31361, 16, 1298, 532, 15, 13, 45310, 11, 366, 31361, 17, 1298, 657, 13, 1731, 92, 6, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 21762, 2696, 7, 12976, 13, 22069, 36301, 11, 5772, 13, 1102, 1851, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1988, 28, 45688, 62, 83, 559, 11, 5772, 28, 14202, 11, 269, 17602, 28, 14202, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 944, 13, 88, 16, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5772, 13, 1102, 1851, 7, 17752, 13, 67, 8142, 7, 292, 11600, 7, 944, 13, 88, 16, 36911, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6045, 11, 6045, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 944, 13, 88, 17, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5772, 13, 1102, 1851, 7, 17752, 13, 67, 8142, 7, 292, 11600, 7, 944, 13, 88, 17, 36911, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 6045, 11, 6045, 4008, 628, 220, 220, 220, 825, 1332, 62, 22468, 62, 18747, 62, 17143, 7307, 7, 944, 2599, 198, 220, 220, 220, 220, 220, 220, 220, 705, 7061, 14402, 12178, 7177, 11507, 2637, 7061, 198, 220, 220, 220, 220, 220, 220, 220, 5772, 796, 537, 72, 13, 43879, 19182, 3419, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 21762, 2696, 7, 12976, 13, 22069, 36301, 11, 5772, 13, 1102, 1851, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1988, 11639, 3256, 5772, 28, 14202, 11, 269, 17602, 28, 14202, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 21762, 2696, 7, 12976, 13, 22069, 36301, 11, 5772, 13, 1102, 1851, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1988, 11639, 4895, 64, 1298, 352, 92, 3256, 5772, 28, 14202, 11, 269, 17602, 28, 14202, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 21762, 2696, 7, 12976, 13, 22069, 36301, 11, 5772, 13, 1102, 1851, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1988, 11639, 14692, 64, 8973, 3256, 5772, 28, 14202, 11, 269, 17602, 28, 14202, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 37659, 13, 18747, 26933, 16, 13, 15, 46570, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5772, 13, 1102, 1851, 10786, 58, 16, 13, 15, 60, 3256, 6045, 11, 6045, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 7, 37659, 13, 18747, 26933, 16, 13, 15, 46570, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5772, 13, 1102, 1851, 10786, 58, 16, 60, 3256, 6045, 11, 6045, 4008, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 36, 13255, 26933, 4357, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5772, 13, 1102, 1851, 10786, 21737, 3256, 6045, 11, 6045, 737, 83, 349, 396, 28955, 198, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 30493, 17821, 19510, 37659, 13, 18747, 26933, 16, 13, 15, 11, 362, 13, 15, 11, 513, 13, 15, 12962, 6624, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 5772, 13, 1102, 1851, 10786, 58, 16, 11, 220, 220, 362, 11, 18, 13, 15, 60, 3256, 6045, 11, 6045, 29720, 439, 28955, 198 ]
1.913473
2,427
#!/usr/bin/env python ''' Project: Geothon (https://github.com/MBoustani/Geothon) File: Vector/reproject_shp.py Description: This code reprojects Shapefile. Author: Maziyar Boustani (github.com/MBoustani) ''' import os try: import ogr except ImportError: from osgeo import ogr try: import osr except ImportError: from osgeo import osr #an example input shapefile file. in_shp_file = '../static_files/shapefile/rivers_lake_centerlines/ne_50m_rivers_lake_centerlines.shp' #set the driver to ESRI Shapefile driver = ogr.GetDriverByName('ESRI Shapefile') #open input shapefile in_shp_datasource = driver.Open(in_shp_file) #get input shapefile layer in_layer = in_shp_datasource.GetLayerByIndex(0) #get input shapefile geometry in_geom_type = in_layer.GetGeomType() #get input shapefile spatial reference source = in_layer.GetSpatialRef() #create spatial reference for output shapefile target = osr.SpatialReference() #in this case NAD83(HARN) / California zone 4 target.ImportFromEPSG(2873) #create a trasnform from source to target transform = osr.CoordinateTransformation(source, target) #output shapefile name out_shp = 'reprojected.shp' #output shapefile layer name out_layer_name = 'shp_layer' #create output shapefile data_source(file) if os.path.exists(out_shp): driver.DeleteDataSource(out_shp) data_source = driver.CreateDataSource(out_shp) #define output shapefile layer out_layer = data_source.CreateLayer(out_layer_name, target, in_geom_type) #get input shapefile layer definition in_layer_defn = in_layer.GetLayerDefn() num_field_col = in_layer_defn.GetFieldCount() for each in range(num_field_col): field = in_layer_defn.GetFieldDefn(each) out_layer.CreateField(field) #get input shapefile number of features in_num_feature = in_layer.GetFeatureCount() for feature in range(in_num_feature): in_feature = in_layer.GetFeature(feature) in_geom = in_feature.GetGeometryRef() in_geom.Transform(transform) feature = ogr.Feature(out_layer.GetLayerDefn()) feature.SetGeometry(in_geom) out_layer.CreateFeature(feature)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 7061, 6, 198, 16775, 25, 220, 220, 220, 220, 220, 220, 2269, 849, 261, 357, 5450, 1378, 12567, 13, 785, 14, 10744, 23968, 3216, 14, 10082, 849, 261, 8, 198, 8979, 25, 220, 220, 220, 220, 220, 220, 220, 220, 220, 20650, 14, 260, 16302, 62, 1477, 79, 13, 9078, 198, 11828, 25, 220, 220, 770, 2438, 43969, 752, 82, 25959, 7753, 13, 198, 13838, 25, 220, 220, 220, 220, 220, 220, 220, 21625, 7745, 283, 14551, 301, 3216, 357, 12567, 13, 785, 14, 10744, 23968, 3216, 8, 198, 7061, 6, 198, 11748, 28686, 198, 198, 28311, 25, 198, 220, 220, 220, 1330, 267, 2164, 198, 16341, 17267, 12331, 25, 198, 220, 220, 220, 422, 28686, 469, 78, 1330, 267, 2164, 198, 198, 28311, 25, 198, 220, 220, 220, 1330, 267, 27891, 198, 16341, 17267, 12331, 25, 198, 220, 220, 220, 422, 28686, 469, 78, 1330, 267, 27891, 198, 198, 2, 272, 1672, 5128, 5485, 7753, 2393, 13, 198, 259, 62, 1477, 79, 62, 7753, 796, 705, 40720, 12708, 62, 16624, 14, 43358, 7753, 14, 380, 690, 62, 27180, 62, 16159, 6615, 14, 710, 62, 1120, 76, 62, 380, 690, 62, 27180, 62, 16159, 6615, 13, 1477, 79, 6, 198, 198, 2, 2617, 262, 4639, 284, 13380, 7112, 25959, 7753, 198, 26230, 796, 267, 2164, 13, 3855, 32103, 3886, 5376, 10786, 1546, 7112, 25959, 7753, 11537, 198, 198, 2, 9654, 5128, 5485, 7753, 198, 259, 62, 1477, 79, 62, 19608, 292, 1668, 796, 4639, 13, 11505, 7, 259, 62, 1477, 79, 62, 7753, 8, 198, 198, 2, 1136, 5128, 5485, 7753, 7679, 198, 259, 62, 29289, 796, 287, 62, 1477, 79, 62, 19608, 292, 1668, 13, 3855, 49925, 3886, 15732, 7, 15, 8, 198, 198, 2, 1136, 5128, 5485, 7753, 22939, 198, 259, 62, 469, 296, 62, 4906, 796, 287, 62, 29289, 13, 3855, 10082, 296, 6030, 3419, 198, 198, 2, 1136, 5128, 5485, 7753, 21739, 4941, 198, 10459, 796, 287, 62, 29289, 13, 3855, 4561, 34961, 8134, 3419, 198, 198, 2, 17953, 21739, 4941, 329, 5072, 5485, 7753, 198, 16793, 796, 267, 27891, 13, 4561, 34961, 26687, 3419, 198, 2, 259, 428, 1339, 49204, 5999, 7, 39, 1503, 45, 8, 1220, 3442, 6516, 604, 198, 16793, 13, 20939, 4863, 36, 3705, 38, 7, 2078, 4790, 8, 198, 198, 2, 17953, 257, 491, 292, 77, 687, 422, 2723, 284, 2496, 198, 35636, 796, 267, 27891, 13, 7222, 45480, 8291, 1161, 7, 10459, 11, 2496, 8, 198, 198, 2, 22915, 5485, 7753, 1438, 198, 448, 62, 1477, 79, 796, 705, 260, 16302, 276, 13, 1477, 79, 6, 198, 2, 22915, 5485, 7753, 7679, 1438, 198, 448, 62, 29289, 62, 3672, 796, 705, 1477, 79, 62, 29289, 6, 198, 198, 2, 17953, 5072, 5485, 7753, 1366, 62, 10459, 7, 7753, 8, 198, 361, 28686, 13, 6978, 13, 1069, 1023, 7, 448, 62, 1477, 79, 2599, 198, 220, 220, 220, 4639, 13, 38727, 6601, 7416, 7, 448, 62, 1477, 79, 8, 198, 7890, 62, 10459, 796, 4639, 13, 16447, 6601, 7416, 7, 448, 62, 1477, 79, 8, 198, 198, 2, 13086, 5072, 5485, 7753, 7679, 198, 448, 62, 29289, 796, 1366, 62, 10459, 13, 16447, 49925, 7, 448, 62, 29289, 62, 3672, 11, 2496, 11, 287, 62, 469, 296, 62, 4906, 8, 198, 198, 2, 1136, 5128, 5485, 7753, 7679, 6770, 198, 259, 62, 29289, 62, 4299, 77, 796, 287, 62, 29289, 13, 3855, 49925, 7469, 77, 3419, 198, 22510, 62, 3245, 62, 4033, 796, 287, 62, 29289, 62, 4299, 77, 13, 3855, 15878, 12332, 3419, 198, 198, 1640, 1123, 287, 2837, 7, 22510, 62, 3245, 62, 4033, 2599, 198, 220, 220, 220, 2214, 796, 287, 62, 29289, 62, 4299, 77, 13, 3855, 15878, 7469, 77, 7, 27379, 8, 198, 220, 220, 220, 503, 62, 29289, 13, 16447, 15878, 7, 3245, 8, 198, 198, 2, 1136, 5128, 5485, 7753, 1271, 286, 3033, 198, 259, 62, 22510, 62, 30053, 796, 287, 62, 29289, 13, 3855, 38816, 12332, 3419, 198, 198, 1640, 3895, 287, 2837, 7, 259, 62, 22510, 62, 30053, 2599, 198, 220, 220, 220, 287, 62, 30053, 796, 287, 62, 29289, 13, 3855, 38816, 7, 30053, 8, 198, 220, 220, 220, 287, 62, 469, 296, 796, 287, 62, 30053, 13, 3855, 10082, 15748, 8134, 3419, 198, 220, 220, 220, 287, 62, 469, 296, 13, 41762, 7, 35636, 8, 198, 220, 220, 220, 3895, 796, 267, 2164, 13, 38816, 7, 448, 62, 29289, 13, 3855, 49925, 7469, 77, 28955, 198, 220, 220, 220, 3895, 13, 7248, 10082, 15748, 7, 259, 62, 469, 296, 8, 198, 220, 220, 220, 503, 62, 29289, 13, 16447, 38816, 7, 30053, 8, 198 ]
2.731266
774
import numpy as np import librosa from scipy import interpolate import pywt from matplotlib.image import imsave from scipy.signal import butter, lfilter, freqz from matplotlib import pyplot as plt from imageProcessingUtil import ImageProcessing import SimpleITK as sitk
[ 11748, 299, 32152, 355, 45941, 201, 198, 11748, 9195, 4951, 64, 201, 198, 6738, 629, 541, 88, 1330, 39555, 378, 201, 198, 11748, 12972, 46569, 201, 198, 6738, 2603, 29487, 8019, 13, 9060, 1330, 545, 21928, 201, 198, 6738, 629, 541, 88, 13, 12683, 282, 1330, 9215, 11, 300, 24455, 11, 2030, 80, 89, 201, 198, 6738, 2603, 29487, 8019, 1330, 12972, 29487, 355, 458, 83, 201, 198, 6738, 2939, 18709, 278, 18274, 346, 1330, 7412, 18709, 278, 201, 198, 11748, 17427, 2043, 42, 355, 1650, 74, 201, 198, 201, 198, 201, 198 ]
3.043011
93
# Name: # Date: result = 0 loop_control = True while loop_control == True: b = int(raw_input('Enter a number to add, or 0 to indicate you are finished:')) if b == 0: loop_control = False result = result + b print 'your result is:' print result
[ 2, 6530, 25, 198, 2, 7536, 25, 628, 220, 220, 220, 1255, 796, 657, 198, 220, 220, 220, 9052, 62, 13716, 796, 6407, 198, 4514, 9052, 62, 13716, 6624, 6407, 25, 198, 220, 220, 220, 275, 796, 493, 7, 1831, 62, 15414, 10786, 17469, 257, 1271, 284, 751, 11, 393, 657, 284, 7603, 345, 389, 5201, 32105, 4008, 198, 220, 220, 220, 611, 275, 6624, 657, 25, 198, 220, 220, 220, 220, 220, 220, 220, 9052, 62, 13716, 796, 10352, 198, 220, 220, 220, 1255, 796, 1255, 1343, 275, 198, 4798, 705, 14108, 1255, 318, 32105, 198, 4798, 1255, 628, 198 ]
2.722772
101
import os import json import unittest from troposphere import ec2, Template from generate_qumulo_cloudformation_template import * if __name__ == '__main__': unittest.main()
[ 11748, 28686, 198, 11748, 33918, 198, 11748, 555, 715, 395, 198, 198, 6738, 14673, 22829, 1330, 9940, 17, 11, 37350, 198, 198, 6738, 7716, 62, 80, 388, 43348, 62, 17721, 1161, 62, 28243, 1330, 1635, 628, 198, 220, 220, 220, 220, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419, 198 ]
2.921875
64
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . import outputs from ._enums import * from ._inputs import * __all__ = ['NotificationHubArgs', 'NotificationHub'] @pulumi.input_type
[ 2, 19617, 28, 40477, 12, 23, 198, 2, 17202, 39410, 25, 428, 2393, 373, 7560, 416, 262, 21624, 12994, 26144, 35986, 13, 17202, 198, 2, 17202, 2141, 407, 4370, 416, 1021, 4556, 345, 821, 1728, 345, 760, 644, 345, 389, 1804, 0, 17202, 198, 198, 11748, 14601, 198, 11748, 17472, 12994, 198, 11748, 17472, 12994, 13, 43282, 198, 6738, 19720, 1330, 4377, 11, 337, 5912, 11, 32233, 11, 45835, 11, 4479, 11, 31754, 198, 6738, 2644, 1330, 4808, 315, 2410, 198, 6738, 764, 1330, 23862, 198, 6738, 47540, 268, 5700, 1330, 1635, 198, 6738, 47540, 15414, 82, 1330, 1635, 198, 198, 834, 439, 834, 796, 37250, 3673, 2649, 16066, 42035, 3256, 705, 3673, 2649, 16066, 20520, 198, 198, 31, 79, 377, 12994, 13, 15414, 62, 4906, 628, 198 ]
3.59375
128
import os import re import sys from datetime import datetime from typing import Optional, Mapping from urllib.parse import urlparse, urlunparse import boto3 # type: ignore[import] import click # type: ignore[import] import requests from requests_ntlm import HttpNtlmAuth # type: ignore[import] from bs4 import BeautifulSoup # type: ignore[import] from botocore.exceptions import ProfileNotFound, ClientError # type: ignore[import] from sts_auth import utils from sts_auth.okta import Okta from sts_auth.config import Config from sts_auth.utils import logger class STSAuth(object): """Initializes an STS Authenticator. :param username: Username to authenticate with (required). :param password: Password to authenticate with (required). :param credentialsfile: A path to an AWS Credentials file (required). See https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html for more details. :param idpentryurl: URL to the IDP Entrypoint. :param profile: Name of an AWS Profile to automatically fetch credentials for. :param okta_org: Name of the Okta organization, ex: `my-company`. :param domain: Domain which your username resides if required. :param region: Region for AWS to authenticate in. :param output: Output format, one of: `json`, `text`, `table`. """ def fetch_aws_account_names(self, response: requests.Response) -> Optional[requests.Response]: """Posts ADFS form to get account list response""" hiddenform = response.soup.find("form", {"name": "hiddenform"}) # type: ignore[attr-defined] headers = { "Referer": response.url, "Content-Type": "application/x-www-form-urlencoded", } selectors = ",".join("{}[name]".format(i) for i in ("input", "button", "textarea", "select")) data = [(tag.get("name"), tag.get("value")) for tag in hiddenform.select(selectors)] url = hiddenform.attrs.get("action") try: adfs_response = self.session.post(url, data=data, headers=headers, timeout=5) except requests.exceptions.ConnectionError as e: msg_fmt = "Could not fetch account aliases from {} due to an exception. Using cached values!\n {}" click.secho(msg_fmt.format(url, str(e)), fg="red") return None adfs_response.soup = BeautifulSoup(adfs_response.text, "lxml") # type: ignore[attr-defined] return adfs_response def fetch_aws_sts_token( role_arn: str, principal_arn: str, assertion: str, duration_seconds: Optional[int] = 3600, aws_profile: Optional[str] = None, ) -> Mapping[str, str]: """Use the assertion to get an AWS STS token using `assume_role_with_saml`""" sts = sts_client(aws_profile) token = sts.assume_role_with_saml( RoleArn=role_arn, PrincipalArn=principal_arn, SAMLAssertion=assertion, DurationSeconds=duration_seconds, ) return token def fetch_aws_sts_token_assume_role( role_arn: str, role_session_name: str, aws_profile: str, duration_seconds: Optional[int] = 3600, ) -> Mapping[str, str]: """Use the assertion to get an AWS STS token using `assume_role_with_saml`""" sts = sts_client(aws_profile) try: token = sts.assume_role( RoleArn=role_arn, RoleSessionName=role_session_name, DurationSeconds=duration_seconds, ) except ClientError as e: click.secho(str(e), fg="red") sys.exit(1) return token def sts_client(aws_profile: Optional[str]) -> boto3.Session.client: """Generate a boto3 sts client.""" try: session = boto3.Session(profile_name=aws_profile) sts = session.client("sts") except ProfileNotFound as e: click.secho(str(e), fg="red") sys.exit(1) except Exception as e: # TODO: Proper exception and message raise e return sts
[ 11748, 28686, 198, 11748, 302, 198, 11748, 25064, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 19720, 1330, 32233, 11, 337, 5912, 198, 6738, 2956, 297, 571, 13, 29572, 1330, 19016, 29572, 11, 19016, 403, 29572, 198, 198, 11748, 275, 2069, 18, 220, 1303, 2099, 25, 8856, 58, 11748, 60, 198, 11748, 3904, 220, 1303, 2099, 25, 8856, 58, 11748, 60, 198, 11748, 7007, 198, 6738, 7007, 62, 429, 75, 76, 1330, 367, 29281, 45, 28781, 76, 30515, 220, 1303, 2099, 25, 8856, 58, 11748, 60, 198, 6738, 275, 82, 19, 1330, 23762, 50, 10486, 220, 1303, 2099, 25, 8856, 58, 11748, 60, 198, 6738, 10214, 420, 382, 13, 1069, 11755, 1330, 13118, 3673, 21077, 11, 20985, 12331, 220, 1303, 2099, 25, 8856, 58, 11748, 60, 198, 198, 6738, 39747, 62, 18439, 1330, 3384, 4487, 198, 6738, 39747, 62, 18439, 13, 482, 8326, 1330, 6762, 8326, 198, 6738, 39747, 62, 18439, 13, 11250, 1330, 17056, 198, 6738, 39747, 62, 18439, 13, 26791, 1330, 49706, 628, 198, 4871, 3563, 4090, 1071, 7, 15252, 2599, 198, 220, 220, 220, 37227, 24243, 4340, 281, 3563, 50, 31885, 26407, 13, 628, 220, 220, 220, 1058, 17143, 20579, 25, 50069, 284, 8323, 5344, 351, 357, 35827, 737, 198, 220, 220, 220, 1058, 17143, 9206, 25, 30275, 284, 8323, 5344, 351, 357, 35827, 737, 198, 220, 220, 220, 1058, 17143, 18031, 7753, 25, 317, 3108, 284, 281, 30865, 327, 445, 14817, 2393, 357, 35827, 737, 198, 220, 220, 220, 220, 220, 220, 220, 4091, 3740, 1378, 31628, 13, 8356, 13, 33103, 13, 785, 14, 21282, 74, 12, 1640, 12, 12355, 14, 85, 16, 14, 16244, 263, 12, 41311, 14, 40406, 12, 66, 445, 14817, 13, 6494, 198, 220, 220, 220, 220, 220, 220, 220, 329, 517, 3307, 13, 198, 220, 220, 220, 1058, 17143, 4686, 79, 13000, 6371, 25, 10289, 284, 262, 4522, 47, 21617, 4122, 13, 198, 220, 220, 220, 1058, 17143, 7034, 25, 6530, 286, 281, 30865, 13118, 284, 6338, 21207, 18031, 329, 13, 198, 220, 220, 220, 1058, 17143, 12876, 8326, 62, 2398, 25, 6530, 286, 262, 6762, 8326, 4009, 11, 409, 25, 4600, 1820, 12, 39722, 44646, 198, 220, 220, 220, 1058, 17143, 7386, 25, 20021, 543, 534, 20579, 29076, 611, 2672, 13, 198, 220, 220, 220, 1058, 17143, 3814, 25, 17718, 329, 30865, 284, 8323, 5344, 287, 13, 198, 220, 220, 220, 1058, 17143, 5072, 25, 25235, 5794, 11, 530, 286, 25, 4600, 17752, 47671, 4600, 5239, 47671, 4600, 11487, 44646, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 825, 21207, 62, 8356, 62, 23317, 62, 14933, 7, 944, 11, 2882, 25, 7007, 13, 31077, 8, 4613, 32233, 58, 8897, 3558, 13, 31077, 5974, 198, 220, 220, 220, 220, 220, 220, 220, 37227, 21496, 5984, 10652, 1296, 284, 651, 1848, 1351, 2882, 37811, 198, 220, 220, 220, 220, 220, 220, 220, 7104, 687, 796, 2882, 13, 82, 10486, 13, 19796, 7203, 687, 1600, 19779, 3672, 1298, 366, 30342, 687, 20662, 8, 220, 1303, 2099, 25, 8856, 58, 35226, 12, 23211, 60, 198, 220, 220, 220, 220, 220, 220, 220, 24697, 796, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 8134, 11882, 1298, 2882, 13, 6371, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 19746, 12, 6030, 1298, 366, 31438, 14, 87, 12, 2503, 12, 687, 12, 6371, 12685, 9043, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 1782, 198, 220, 220, 220, 220, 220, 220, 220, 2922, 669, 796, 366, 553, 13, 22179, 7203, 90, 92, 58, 3672, 60, 1911, 18982, 7, 72, 8, 329, 1312, 287, 5855, 15414, 1600, 366, 16539, 1600, 366, 5239, 20337, 1600, 366, 19738, 48774, 198, 220, 220, 220, 220, 220, 220, 220, 1366, 796, 47527, 12985, 13, 1136, 7203, 3672, 12340, 7621, 13, 1136, 7203, 8367, 48774, 329, 7621, 287, 7104, 687, 13, 19738, 7, 19738, 669, 15437, 198, 220, 220, 220, 220, 220, 220, 220, 19016, 796, 7104, 687, 13, 1078, 3808, 13, 1136, 7203, 2673, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 512, 9501, 62, 26209, 796, 2116, 13, 29891, 13, 7353, 7, 6371, 11, 1366, 28, 7890, 11, 24697, 28, 50145, 11, 26827, 28, 20, 8, 198, 220, 220, 220, 220, 220, 220, 220, 2845, 7007, 13, 1069, 11755, 13, 32048, 12331, 355, 304, 25, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 31456, 62, 69, 16762, 796, 366, 23722, 407, 21207, 1848, 47217, 422, 23884, 2233, 284, 281, 6631, 13, 8554, 39986, 3815, 0, 59, 77, 23884, 1, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 3904, 13, 325, 6679, 7, 19662, 62, 69, 16762, 13, 18982, 7, 6371, 11, 965, 7, 68, 36911, 277, 70, 2625, 445, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 1441, 6045, 198, 220, 220, 220, 220, 220, 220, 220, 512, 9501, 62, 26209, 13, 82, 10486, 796, 23762, 50, 10486, 7, 324, 9501, 62, 26209, 13, 5239, 11, 366, 75, 19875, 4943, 220, 1303, 2099, 25, 8856, 58, 35226, 12, 23211, 60, 628, 220, 220, 220, 220, 220, 220, 220, 1441, 512, 9501, 62, 26209, 628, 198, 4299, 21207, 62, 8356, 62, 6448, 62, 30001, 7, 198, 220, 220, 220, 2597, 62, 1501, 25, 965, 11, 198, 220, 220, 220, 10033, 62, 1501, 25, 965, 11, 198, 220, 220, 220, 19190, 25, 965, 11, 198, 220, 220, 220, 9478, 62, 43012, 25, 32233, 58, 600, 60, 796, 4570, 405, 11, 198, 220, 220, 220, 3253, 82, 62, 13317, 25, 32233, 58, 2536, 60, 796, 6045, 11, 198, 8, 4613, 337, 5912, 58, 2536, 11, 965, 5974, 198, 220, 220, 220, 37227, 11041, 262, 19190, 284, 651, 281, 30865, 3563, 50, 11241, 1262, 4600, 562, 2454, 62, 18090, 62, 4480, 62, 37687, 75, 63, 37811, 628, 220, 220, 220, 39747, 796, 39747, 62, 16366, 7, 8356, 62, 13317, 8, 198, 220, 220, 220, 11241, 796, 39747, 13, 562, 2454, 62, 18090, 62, 4480, 62, 37687, 75, 7, 198, 220, 220, 220, 220, 220, 220, 220, 20934, 3163, 77, 28, 18090, 62, 1501, 11, 198, 220, 220, 220, 220, 220, 220, 220, 32641, 3163, 77, 28, 1050, 1939, 8521, 62, 1501, 11, 198, 220, 220, 220, 220, 220, 220, 220, 28844, 43, 8021, 861, 295, 28, 30493, 295, 11, 198, 220, 220, 220, 220, 220, 220, 220, 22920, 12211, 82, 28, 32257, 62, 43012, 11, 198, 220, 220, 220, 1267, 198, 220, 220, 220, 1441, 11241, 628, 198, 4299, 21207, 62, 8356, 62, 6448, 62, 30001, 62, 562, 2454, 62, 18090, 7, 198, 220, 220, 220, 2597, 62, 1501, 25, 965, 11, 198, 220, 220, 220, 2597, 62, 29891, 62, 3672, 25, 965, 11, 198, 220, 220, 220, 3253, 82, 62, 13317, 25, 965, 11, 198, 220, 220, 220, 9478, 62, 43012, 25, 32233, 58, 600, 60, 796, 4570, 405, 11, 198, 8, 4613, 337, 5912, 58, 2536, 11, 965, 5974, 198, 220, 220, 220, 37227, 11041, 262, 19190, 284, 651, 281, 30865, 3563, 50, 11241, 1262, 4600, 562, 2454, 62, 18090, 62, 4480, 62, 37687, 75, 63, 37811, 628, 220, 220, 220, 39747, 796, 39747, 62, 16366, 7, 8356, 62, 13317, 8, 198, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 11241, 796, 39747, 13, 562, 2454, 62, 18090, 7, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 20934, 3163, 77, 28, 18090, 62, 1501, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 20934, 36044, 5376, 28, 18090, 62, 29891, 62, 3672, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 22920, 12211, 82, 28, 32257, 62, 43012, 11, 198, 220, 220, 220, 220, 220, 220, 220, 1267, 198, 220, 220, 220, 2845, 20985, 12331, 355, 304, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3904, 13, 325, 6679, 7, 2536, 7, 68, 828, 277, 70, 2625, 445, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 25064, 13, 37023, 7, 16, 8, 198, 220, 220, 220, 1441, 11241, 628, 198, 4299, 39747, 62, 16366, 7, 8356, 62, 13317, 25, 32233, 58, 2536, 12962, 4613, 275, 2069, 18, 13, 36044, 13, 16366, 25, 198, 220, 220, 220, 37227, 8645, 378, 257, 275, 2069, 18, 39747, 5456, 526, 15931, 628, 220, 220, 220, 1949, 25, 198, 220, 220, 220, 220, 220, 220, 220, 6246, 796, 275, 2069, 18, 13, 36044, 7, 13317, 62, 3672, 28, 8356, 62, 13317, 8, 198, 220, 220, 220, 220, 220, 220, 220, 39747, 796, 6246, 13, 16366, 7203, 6448, 4943, 198, 220, 220, 220, 2845, 13118, 3673, 21077, 355, 304, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3904, 13, 325, 6679, 7, 2536, 7, 68, 828, 277, 70, 2625, 445, 4943, 198, 220, 220, 220, 220, 220, 220, 220, 25064, 13, 37023, 7, 16, 8, 198, 220, 220, 220, 2845, 35528, 355, 304, 25, 198, 220, 220, 220, 220, 220, 220, 220, 1303, 16926, 46, 25, 45989, 6631, 290, 3275, 198, 220, 220, 220, 220, 220, 220, 220, 5298, 304, 198, 220, 220, 220, 1441, 39747, 198 ]
2.591117
1,531
from __future__ import print_function, absolute_import, division import unittest2 as unittest from mock import patch from rds_log_dog.rds_utils import get_size
[ 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 11, 4112, 62, 11748, 11, 7297, 198, 198, 11748, 555, 715, 395, 17, 355, 555, 715, 395, 198, 6738, 15290, 1330, 8529, 198, 198, 6738, 374, 9310, 62, 6404, 62, 9703, 13, 4372, 82, 62, 26791, 1330, 651, 62, 7857, 628 ]
3.326531
49
from cytopy.data.project import Project from cytopy.data.errors import * from cytopy.tests import assets import pytest import os @pytest.fixture()
[ 6738, 3075, 4852, 88, 13, 7890, 13, 16302, 1330, 4935, 198, 6738, 3075, 4852, 88, 13, 7890, 13, 48277, 1330, 1635, 198, 6738, 3075, 4852, 88, 13, 41989, 1330, 6798, 198, 11748, 12972, 9288, 198, 11748, 28686, 628, 198, 31, 9078, 9288, 13, 69, 9602, 3419, 628, 628, 628, 628, 198 ]
3.078431
51