code
stringlengths 2
1.05M
| repo_name
stringlengths 5
104
| path
stringlengths 4
251
| language
stringclasses 1
value | license
stringclasses 15
values | size
int32 2
1.05M
|
|---|---|---|---|---|---|
class config_eval_osm_id(config_base):
mutable = 1
def eval_osm_id(param):
return current['object']['id']
# TESTS
# IN []
# OUT 'n123'
|
plepe/pgmapcss
|
pgmapcss/eval/eval_osm_id.py
|
Python
|
agpl-3.0
| 145
|
# Copyright 2013 by Michiel de Hoon. All rights reserved.
# Copyright 2016 modified by Kevin Ha
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
from Bio.motifs import matrix
from Bio.Alphabet import NucleotideAlphabet
import platform
class ExtendedPositionSpecificScoringMatrix(
matrix.PositionSpecificScoringMatrix):
"""This new class inherits Bio.motifs.matrix.PositionSpecificScoringMatrix.
It has been modified to support any kind of Alphabet. This allows us to
perform motif scans on RNA sequence as well as RNA secondary structure.
The main change is the fact that the 'ACGT' hard-coding has been replaced
with whatever letters are in the Alphabet of the matrix. This seems to be
sufficient enough for our purposes.
"""
def _py_calculate(self, sequence, m, n):
"""Handles the default calcuate() method in Python.
Moved from _calculate in the except clause below.
"""
# The C code handles mixed case so Python version must too:
sequence = sequence.upper()
scores = []
for i in range(n - m + 1):
score = 0.0
for position in range(m):
letter = sequence[i + position]
try:
score += self[letter][position]
except KeyError:
score = float("nan")
break
scores.append(score)
return scores
# Make sure that we use C-accelerated PWM calculations if running under CPython.
# Fall back to the slower Python implementation if Jython or IronPython.
try:
from . import _pwm
def _calculate(self, sequence, m, n):
# Only RNA and DNA is supported right now. If sequence is
# secondary structure, then use Python implementation.
if not isinstance(self.alphabet, NucleotideAlphabet):
return self._py_calculate(sequence, m, n)
letters = ''.join(sorted(self.alphabet.letters))
logodds = [[self[letter][i] for letter in letters]
for i in range(m)]
return self._pwm.calculate(sequence, logodds)
except ImportError:
if platform.python_implementation() == 'CPython':
raise
else:
def _calculate(self, sequence, m, n):
return self._py_calculate(sequence, m, n)
def calculate(self, sequence):
# TODO - Force uppercase here and optimise switch statement in C
# by assuming upper case?
sequence = str(sequence)
m = self.length
n = len(sequence)
scores = self._calculate(sequence, m, n)
if len(scores) == 1:
return scores[0]
else:
return scores
|
morrislab/rnascan
|
rnascan/BioAddons/motifs/matrix.py
|
Python
|
agpl-3.0
| 2,895
|
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
default_app_config = "taiga.timeline.apps.TimelineAppConfig"
|
dayatz/taiga-back
|
taiga/timeline/__init__.py
|
Python
|
agpl-3.0
| 997
|
# -*- coding: utf-8 -*-
"""
Tests for video outline API
"""
# pylint: disable=no-member
import ddt
import itertools
from uuid import uuid4
from collections import namedtuple
from edxval import api
from mobile_api.models import MobileApiConfig
from xmodule.modulestore.tests.factories import ItemFactory
from xmodule.video_module import transcripts_utils
from xmodule.modulestore.django import modulestore
from xmodule.partitions.partitions import Group, UserPartition
from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory
from openedx.core.djangoapps.course_groups.models import CourseUserGroupPartitionGroup
from ..testutils import MobileAPITestCase, MobileAuthTestMixin, MobileEnrolledCourseAccessTestMixin
class TestVideoAPITestCase(MobileAPITestCase):
"""
Base test class for video related mobile APIs
"""
def setUp(self):
super(TestVideoAPITestCase, self).setUp()
self.section = ItemFactory.create(
parent=self.course,
category="chapter",
display_name=u"test factory section omega \u03a9",
)
self.sub_section = ItemFactory.create(
parent=self.section,
category="sequential",
display_name=u"test subsection omega \u03a9",
)
self.unit = ItemFactory.create(
parent=self.sub_section,
category="vertical",
metadata={'graded': True, 'format': 'Homework'},
display_name=u"test unit omega \u03a9",
)
self.other_unit = ItemFactory.create(
parent=self.sub_section,
category="vertical",
metadata={'graded': True, 'format': 'Homework'},
display_name=u"test unit omega 2 \u03a9",
)
self.nameless_unit = ItemFactory.create(
parent=self.sub_section,
category="vertical",
metadata={'graded': True, 'format': 'Homework'},
display_name=None,
)
self.edx_video_id = 'testing-123'
self.video_url = 'http://val.edx.org/val/video.mp4'
self.video_url_high = 'http://val.edx.org/val/video_high.mp4'
self.youtube_url = 'http://val.edx.org/val/youtube.mp4'
self.html5_video_url = 'http://video.edx.org/html5/video.mp4'
api.create_profile({
'profile_name': 'youtube',
'extension': 'mp4',
'width': 1280,
'height': 720
})
api.create_profile({
'profile_name': 'mobile_high',
'extension': 'mp4',
'width': 750,
'height': 590
})
api.create_profile({
'profile_name': 'mobile_low',
'extension': 'mp4',
'width': 640,
'height': 480
})
# create the video in VAL
api.create_video({
'edx_video_id': self.edx_video_id,
'status': 'test',
'client_video_id': u"test video omega \u03a9",
'duration': 12,
'courses': [unicode(self.course.id)],
'encoded_videos': [
{
'profile': 'youtube',
'url': 'xyz123',
'file_size': 0,
'bitrate': 1500
},
{
'profile': 'mobile_low',
'url': self.video_url,
'file_size': 12345,
'bitrate': 250
},
{
'profile': 'mobile_high',
'url': self.video_url_high,
'file_size': 99999,
'bitrate': 250
},
]})
# Set requested profiles
MobileApiConfig(video_profiles="mobile_low,mobile_high,youtube").save()
class TestVideoAPIMixin(object):
"""
Mixin class that provides helpers for testing video related mobile APIs
"""
def _create_video_with_subs(self, custom_subid=None):
"""
Creates and returns a video with stored subtitles.
"""
subid = custom_subid or uuid4().hex
transcripts_utils.save_subs_to_store(
{
'start': [100, 200, 240, 390, 1000],
'end': [200, 240, 380, 1000, 1500],
'text': [
'subs #1',
'subs #2',
'subs #3',
'subs #4',
'subs #5'
]
},
subid,
self.course)
return ItemFactory.create(
parent=self.unit,
category="video",
edx_video_id=self.edx_video_id,
display_name=u"test video omega \u03a9",
sub=subid
)
def _verify_paths(self, course_outline, path_list, outline_index=0):
"""
Takes a path_list and compares it against the course_outline
Attributes:
course_outline (list): A list of dictionaries that includes a 'path'
and 'named_path' field which we will be comparing path_list to
path_list (list): A list of the expected strings
outline_index (int): Index into the course_outline list for which the
path is being tested.
"""
path = course_outline[outline_index]['path']
self.assertEqual(len(path), len(path_list))
for i in range(0, len(path_list)):
self.assertEqual(path_list[i], path[i]['name'])
#named_path will be deprecated eventually
named_path = course_outline[outline_index]['named_path']
self.assertEqual(len(named_path), len(path_list))
for i in range(0, len(path_list)):
self.assertEqual(path_list[i], named_path[i])
def _setup_course_partitions(self, scheme_id='random', is_cohorted=False):
"""Helper method to configure the user partitions in the course."""
self.partition_id = 0 # pylint: disable=attribute-defined-outside-init
self.course.user_partitions = [
UserPartition(
self.partition_id, 'first_partition', 'First Partition',
[Group(0, 'alpha'), Group(1, 'beta')],
scheme=None, scheme_id=scheme_id
),
]
self.course.cohort_config = {'cohorted': is_cohorted}
self.store.update_item(self.course, self.user.id)
def _setup_group_access(self, xblock, partition_id, group_ids):
"""Helper method to configure the partition and group mapping for the given xblock."""
xblock.group_access = {partition_id: group_ids}
self.store.update_item(xblock, self.user.id)
def _setup_split_module(self, sub_block_category):
"""Helper method to configure a split_test unit with children of type sub_block_category."""
self._setup_course_partitions()
self.split_test = ItemFactory.create( # pylint: disable=attribute-defined-outside-init
parent=self.unit,
category="split_test",
display_name=u"split test unit",
user_partition_id=0,
)
sub_block_a = ItemFactory.create(
parent=self.split_test,
category=sub_block_category,
display_name=u"split test block a",
)
sub_block_b = ItemFactory.create(
parent=self.split_test,
category=sub_block_category,
display_name=u"split test block b",
)
self.split_test.group_id_to_child = {
str(index): url for index, url in enumerate([sub_block_a.location, sub_block_b.location])
}
self.store.update_item(self.split_test, self.user.id)
return sub_block_a, sub_block_b
class TestNonStandardCourseStructure(MobileAPITestCase, TestVideoAPIMixin):
"""
Tests /api/mobile/v0.5/video_outlines/courses/{course_id} with no course set
"""
REVERSE_INFO = {'name': 'video-summary-list', 'params': ['course_id']}
def setUp(self):
super(TestNonStandardCourseStructure, self).setUp()
self.chapter_under_course = ItemFactory.create(
parent=self.course,
category="chapter",
display_name=u"test factory chapter under course omega \u03a9",
)
self.section_under_course = ItemFactory.create(
parent=self.course,
category="sequential",
display_name=u"test factory section under course omega \u03a9",
)
self.section_under_chapter = ItemFactory.create(
parent=self.chapter_under_course,
category="sequential",
display_name=u"test factory section under chapter omega \u03a9",
)
self.vertical_under_course = ItemFactory.create(
parent=self.course,
category="vertical",
display_name=u"test factory vertical under course omega \u03a9",
)
self.vertical_under_section = ItemFactory.create(
parent=self.section_under_chapter,
category="vertical",
display_name=u"test factory vertical under section omega \u03a9",
)
def test_structure_course_video(self):
"""
Tests when there is a video without a vertical directly under course
"""
self.login_and_enroll()
ItemFactory.create(
parent=self.course,
category="video",
display_name=u"test factory video omega \u03a9",
)
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 1)
section_url = course_outline[0]["section_url"]
unit_url = course_outline[0]["unit_url"]
self.assertRegexpMatches(section_url, r'courseware$')
self.assertEqual(section_url, unit_url)
self._verify_paths(course_outline, [])
def test_structure_course_vert_video(self):
"""
Tests when there is a video under vertical directly under course
"""
self.login_and_enroll()
ItemFactory.create(
parent=self.vertical_under_course,
category="video",
display_name=u"test factory video omega \u03a9",
)
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 1)
section_url = course_outline[0]["section_url"]
unit_url = course_outline[0]["unit_url"]
self.assertRegexpMatches(
section_url,
r'courseware/test_factory_vertical_under_course_omega_%CE%A9/$'
)
self.assertEqual(section_url, unit_url)
self._verify_paths(
course_outline,
[
u'test factory vertical under course omega \u03a9'
]
)
def test_structure_course_chap_video(self):
"""
Tests when there is a video directly under chapter
"""
self.login_and_enroll()
ItemFactory.create(
parent=self.chapter_under_course,
category="video",
display_name=u"test factory video omega \u03a9",
)
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 1)
section_url = course_outline[0]["section_url"]
unit_url = course_outline[0]["unit_url"]
self.assertRegexpMatches(
section_url,
r'courseware/test_factory_chapter_under_course_omega_%CE%A9/$'
)
self.assertEqual(section_url, unit_url)
self._verify_paths(
course_outline,
[
u'test factory chapter under course omega \u03a9',
]
)
def test_structure_course_section_video(self):
"""
Tests when chapter is none, and video under section under course
"""
self.login_and_enroll()
ItemFactory.create(
parent=self.section_under_course,
category="video",
display_name=u"test factory video omega \u03a9",
)
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 1)
section_url = course_outline[0]["section_url"]
unit_url = course_outline[0]["unit_url"]
self.assertRegexpMatches(
section_url,
r'courseware/test_factory_section_under_course_omega_%CE%A9/$'
)
self.assertEqual(section_url, unit_url)
self._verify_paths(
course_outline,
[
u'test factory section under course omega \u03a9',
]
)
def test_structure_course_chap_section_video(self):
"""
Tests when chapter and sequential exists, with a video with no vertical.
"""
self.login_and_enroll()
ItemFactory.create(
parent=self.section_under_chapter,
category="video",
display_name=u"meow factory video omega \u03a9",
)
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 1)
section_url = course_outline[0]["section_url"]
unit_url = course_outline[0]["unit_url"]
self.assertRegexpMatches(
section_url,
(
r'courseware/test_factory_chapter_under_course_omega_%CE%A9/' +
'test_factory_section_under_chapter_omega_%CE%A9/$'
)
)
self.assertEqual(section_url, unit_url)
self._verify_paths(
course_outline,
[
u'test factory chapter under course omega \u03a9',
u'test factory section under chapter omega \u03a9',
]
)
def test_structure_course_section_vert_video(self):
"""
Tests chapter->section->vertical->unit
"""
self.login_and_enroll()
ItemFactory.create(
parent=self.vertical_under_section,
category="video",
display_name=u"test factory video omega \u03a9",
)
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 1)
section_url = course_outline[0]["section_url"]
unit_url = course_outline[0]["unit_url"]
self.assertRegexpMatches(
section_url,
(
r'courseware/test_factory_chapter_under_course_omega_%CE%A9/' +
'test_factory_section_under_chapter_omega_%CE%A9/$'
)
)
self.assertRegexpMatches(
unit_url,
(
r'courseware/test_factory_chapter_under_course_omega_%CE%A9/' +
'test_factory_section_under_chapter_omega_%CE%A9/1$'
)
)
self._verify_paths(
course_outline,
[
u'test factory chapter under course omega \u03a9',
u'test factory section under chapter omega \u03a9',
u'test factory vertical under section omega \u03a9'
]
)
@ddt.ddt
class TestVideoSummaryList(
TestVideoAPITestCase, MobileAuthTestMixin, MobileEnrolledCourseAccessTestMixin, TestVideoAPIMixin # pylint: disable=bad-continuation
):
"""
Tests for /api/mobile/v0.5/video_outlines/courses/{course_id}..
"""
REVERSE_INFO = {'name': 'video-summary-list', 'params': ['course_id']}
def test_only_on_web(self):
self.login_and_enroll()
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 0)
subid = uuid4().hex
transcripts_utils.save_subs_to_store(
{
'start': [100],
'end': [200],
'text': [
'subs #1',
]
},
subid,
self.course)
ItemFactory.create(
parent=self.unit,
category="video",
display_name=u"test video",
only_on_web=True,
subid=subid
)
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 1)
self.assertIsNone(course_outline[0]["summary"]["video_url"])
self.assertIsNone(course_outline[0]["summary"]["video_thumbnail_url"])
self.assertEqual(course_outline[0]["summary"]["duration"], 0)
self.assertEqual(course_outline[0]["summary"]["size"], 0)
self.assertEqual(course_outline[0]["summary"]["name"], "test video")
self.assertEqual(course_outline[0]["summary"]["transcripts"], {})
self.assertIsNone(course_outline[0]["summary"]["language"])
self.assertEqual(course_outline[0]["summary"]["category"], "video")
self.assertTrue(course_outline[0]["summary"]["only_on_web"])
def test_mobile_api_config(self):
"""
Tests VideoSummaryList with different MobileApiConfig video_profiles
"""
self.login_and_enroll()
edx_video_id = "testing_mobile_high"
api.create_video({
'edx_video_id': edx_video_id,
'status': 'test',
'client_video_id': u"test video omega \u03a9",
'duration': 12,
'courses': [unicode(self.course.id)],
'encoded_videos': [
{
'profile': 'youtube',
'url': self.youtube_url,
'file_size': 2222,
'bitrate': 4444
},
{
'profile': 'mobile_high',
'url': self.video_url_high,
'file_size': 111,
'bitrate': 333
},
]})
ItemFactory.create(
parent=self.other_unit,
category="video",
display_name=u"testing mobile high video",
edx_video_id=edx_video_id,
)
expected_output = {
'category': u'video',
'video_thumbnail_url': None,
'language': u'en',
'name': u'testing mobile high video',
'video_url': self.video_url_high,
'duration': 12.0,
'transcripts': {
'en': 'http://testserver/api/mobile/v0.5/video_outlines/transcripts/{}/testing_mobile_high_video/en'.format(self.course.id) # pylint: disable=line-too-long
},
'only_on_web': False,
'encoded_videos': {
u'mobile_high': {
'url': self.video_url_high,
'file_size': 111
},
u'youtube': {
'url': self.youtube_url,
'file_size': 2222
}
},
'size': 111
}
# Testing when video_profiles='mobile_low,mobile_high,youtube'
course_outline = self.api_response().data
course_outline[0]['summary'].pop("id")
self.assertEqual(course_outline[0]['summary'], expected_output)
# Testing when there is no mobile_low, and that mobile_high doesn't show
MobileApiConfig(video_profiles="mobile_low,youtube").save()
course_outline = self.api_response().data
expected_output['encoded_videos'].pop('mobile_high')
expected_output['video_url'] = self.youtube_url
expected_output['size'] = 2222
course_outline[0]['summary'].pop("id")
self.assertEqual(course_outline[0]['summary'], expected_output)
# Testing where youtube is the default video over mobile_high
MobileApiConfig(video_profiles="youtube,mobile_high").save()
course_outline = self.api_response().data
expected_output['encoded_videos']['mobile_high'] = {
'url': self.video_url_high,
'file_size': 111
}
course_outline[0]['summary'].pop("id")
self.assertEqual(course_outline[0]['summary'], expected_output)
def test_video_not_in_val(self):
self.login_and_enroll()
self._create_video_with_subs()
ItemFactory.create(
parent=self.other_unit,
category="video",
edx_video_id="some_non_existent_id_in_val",
display_name=u"some non existent video in val",
html5_sources=[self.html5_video_url]
)
summary = self.api_response().data[1]['summary']
self.assertEqual(summary['name'], "some non existent video in val")
self.assertIsNone(summary['encoded_videos'])
self.assertIsNone(summary['duration'])
self.assertEqual(summary['size'], 0)
self.assertEqual(summary['video_url'], self.html5_video_url)
def test_course_list(self):
self.login_and_enroll()
self._create_video_with_subs()
ItemFactory.create(
parent=self.other_unit,
category="video",
display_name=u"test video omega 2 \u03a9",
html5_sources=[self.html5_video_url]
)
ItemFactory.create(
parent=self.other_unit,
category="video",
display_name=u"test video omega 3 \u03a9",
source=self.html5_video_url
)
ItemFactory.create(
parent=self.unit,
category="video",
edx_video_id=self.edx_video_id,
display_name=u"test draft video omega \u03a9",
visible_to_staff_only=True,
)
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 3)
vid = course_outline[0]
self.assertTrue('test_subsection_omega_%CE%A9' in vid['section_url'])
self.assertTrue('test_subsection_omega_%CE%A9/1' in vid['unit_url'])
self.assertTrue(u'test_video_omega_\u03a9' in vid['summary']['id'])
self.assertEqual(vid['summary']['video_url'], self.video_url)
self.assertEqual(vid['summary']['size'], 12345)
self.assertTrue('en' in vid['summary']['transcripts'])
self.assertFalse(vid['summary']['only_on_web'])
self.assertEqual(course_outline[1]['summary']['video_url'], self.html5_video_url)
self.assertEqual(course_outline[1]['summary']['size'], 0)
self.assertFalse(course_outline[1]['summary']['only_on_web'])
self.assertEqual(course_outline[1]['path'][2]['name'], self.other_unit.display_name)
self.assertEqual(course_outline[1]['path'][2]['id'], unicode(self.other_unit.location))
self.assertEqual(course_outline[2]['summary']['video_url'], self.html5_video_url)
self.assertEqual(course_outline[2]['summary']['size'], 0)
self.assertFalse(course_outline[2]['summary']['only_on_web'])
def test_with_nameless_unit(self):
self.login_and_enroll()
ItemFactory.create(
parent=self.nameless_unit,
category="video",
edx_video_id=self.edx_video_id,
display_name=u"test draft video omega 2 \u03a9"
)
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 1)
self.assertEqual(course_outline[0]['path'][2]['name'], self.nameless_unit.location.block_id)
def test_with_video_in_sub_section(self):
"""
Tests a non standard xml format where a video is underneath a sequential
We are expecting to return the same unit and section url since there is
no unit vertical.
"""
self.login_and_enroll()
ItemFactory.create(
parent=self.sub_section,
category="video",
edx_video_id=self.edx_video_id,
display_name=u"video in the sub section"
)
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 1)
self.assertEqual(len(course_outline[0]['path']), 2)
section_url = course_outline[0]["section_url"]
unit_url = course_outline[0]["unit_url"]
self.assertIn(
u'courseware/test_factory_section_omega_%CE%A9/test_subsection_omega_%CE%A9',
section_url
)
self.assertTrue(section_url)
self.assertTrue(unit_url)
self.assertEqual(section_url, unit_url)
@ddt.data(
*itertools.product([True, False], ["video", "problem"])
)
@ddt.unpack
def test_with_split_block(self, is_user_staff, sub_block_category):
"""Test with split_module->sub_block_category and for both staff and non-staff users."""
self.login_and_enroll()
self.user.is_staff = is_user_staff
self.user.save()
self._setup_split_module(sub_block_category)
video_outline = self.api_response().data
num_video_blocks = 1 if sub_block_category == "video" else 0
self.assertEqual(len(video_outline), num_video_blocks)
for block_index in range(num_video_blocks):
self._verify_paths(
video_outline,
[
self.section.display_name,
self.sub_section.display_name,
self.unit.display_name,
self.split_test.display_name
],
block_index
)
self.assertIn(u"split test block", video_outline[block_index]["summary"]["name"])
def test_with_split_vertical(self):
"""Test with split_module->vertical->video structure."""
self.login_and_enroll()
split_vertical_a, split_vertical_b = self._setup_split_module("vertical")
ItemFactory.create(
parent=split_vertical_a,
category="video",
display_name=u"video in vertical a",
)
ItemFactory.create(
parent=split_vertical_b,
category="video",
display_name=u"video in vertical b",
)
video_outline = self.api_response().data
# user should see only one of the videos (a or b).
self.assertEqual(len(video_outline), 1)
self.assertIn(u"video in vertical", video_outline[0]["summary"]["name"])
a_or_b = video_outline[0]["summary"]["name"][-1:]
self._verify_paths(
video_outline,
[
self.section.display_name,
self.sub_section.display_name,
self.unit.display_name,
self.split_test.display_name,
u"split test block " + a_or_b
],
)
def _create_cohorted_video(self, group_id):
"""Creates a cohorted video block, giving access to only the given group_id."""
video_block = ItemFactory.create(
parent=self.unit,
category="video",
display_name=u"video for group " + unicode(group_id),
)
self._setup_group_access(video_block, self.partition_id, [group_id])
def _create_cohorted_vertical_with_video(self, group_id):
"""Creates a cohorted vertical with a child video block, giving access to only the given group_id."""
vertical_block = ItemFactory.create(
parent=self.sub_section,
category="vertical",
display_name=u"vertical for group " + unicode(group_id),
)
self._setup_group_access(vertical_block, self.partition_id, [group_id])
ItemFactory.create(
parent=vertical_block,
category="video",
display_name=u"video for group " + unicode(group_id),
)
@ddt.data("_create_cohorted_video", "_create_cohorted_vertical_with_video")
def test_with_cohorted_content(self, content_creator_method_name):
self.login_and_enroll()
self._setup_course_partitions(scheme_id='cohort', is_cohorted=True)
cohorts = []
for group_id in [0, 1]:
getattr(self, content_creator_method_name)(group_id)
cohorts.append(CohortFactory(course_id=self.course.id, name=u"Cohort " + unicode(group_id)))
link = CourseUserGroupPartitionGroup(
course_user_group=cohorts[group_id],
partition_id=self.partition_id,
group_id=group_id,
)
link.save()
for cohort_index in range(len(cohorts)):
# add user to this cohort
cohorts[cohort_index].users.add(self.user)
# should only see video for this cohort
video_outline = self.api_response().data
self.assertEqual(len(video_outline), 1)
self.assertEquals(
u"video for group " + unicode(cohort_index),
video_outline[0]["summary"]["name"]
)
# remove user from this cohort
cohorts[cohort_index].users.remove(self.user)
# un-cohorted user should see no videos
video_outline = self.api_response().data
self.assertEqual(len(video_outline), 0)
# staff user sees all videos
self.user.is_staff = True
self.user.save()
video_outline = self.api_response().data
self.assertEqual(len(video_outline), 2)
def test_with_hidden_blocks(self):
self.login_and_enroll()
hidden_subsection = ItemFactory.create(
parent=self.section,
category="sequential",
hide_from_toc=True,
)
unit_within_hidden_subsection = ItemFactory.create(
parent=hidden_subsection,
category="vertical",
)
hidden_unit = ItemFactory.create(
parent=self.sub_section,
category="vertical",
hide_from_toc=True,
)
ItemFactory.create(
parent=unit_within_hidden_subsection,
category="video",
edx_video_id=self.edx_video_id,
)
ItemFactory.create(
parent=hidden_unit,
category="video",
edx_video_id=self.edx_video_id,
)
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 0)
def test_language(self):
self.login_and_enroll()
video = ItemFactory.create(
parent=self.nameless_unit,
category="video",
edx_video_id=self.edx_video_id,
display_name=u"test draft video omega 2 \u03a9"
)
language_case = namedtuple('language_case', ['transcripts', 'expected_language'])
language_cases = [
# defaults to english
language_case({}, "en"),
# supports english
language_case({"en": 1}, "en"),
# supports another language
language_case({"lang1": 1}, "lang1"),
# returns first alphabetically-sorted language
language_case({"lang1": 1, "en": 2}, "en"),
language_case({"lang1": 1, "lang2": 2}, "lang1"),
]
for case in language_cases:
video.transcripts = case.transcripts
modulestore().update_item(video, self.user.id)
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 1)
self.assertEqual(course_outline[0]['summary']['language'], case.expected_language)
def test_transcripts(self):
self.login_and_enroll()
video = ItemFactory.create(
parent=self.nameless_unit,
category="video",
edx_video_id=self.edx_video_id,
display_name=u"test draft video omega 2 \u03a9"
)
transcript_case = namedtuple('transcript_case', ['transcripts', 'english_subtitle', 'expected_transcripts'])
transcript_cases = [
# defaults to english
transcript_case({}, "", ["en"]),
transcript_case({}, "en-sub", ["en"]),
# supports english
transcript_case({"en": 1}, "", ["en"]),
transcript_case({"en": 1}, "en-sub", ["en"]),
# keeps both english and other languages
transcript_case({"lang1": 1, "en": 2}, "", ["lang1", "en"]),
transcript_case({"lang1": 1, "en": 2}, "en-sub", ["lang1", "en"]),
# adds english to list of languages only if english_subtitle is specified
transcript_case({"lang1": 1, "lang2": 2}, "", ["lang1", "lang2"]),
transcript_case({"lang1": 1, "lang2": 2}, "en-sub", ["lang1", "lang2", "en"]),
]
for case in transcript_cases:
video.transcripts = case.transcripts
video.sub = case.english_subtitle
modulestore().update_item(video, self.user.id)
course_outline = self.api_response().data
self.assertEqual(len(course_outline), 1)
self.assertSetEqual(
set(course_outline[0]['summary']['transcripts'].keys()),
set(case.expected_transcripts)
)
class TestTranscriptsDetail(
TestVideoAPITestCase, MobileAuthTestMixin, MobileEnrolledCourseAccessTestMixin, TestVideoAPIMixin # pylint: disable=bad-continuation
):
"""
Tests for /api/mobile/v0.5/video_outlines/transcripts/{course_id}..
"""
REVERSE_INFO = {'name': 'video-transcripts-detail', 'params': ['course_id']}
def setUp(self):
super(TestTranscriptsDetail, self).setUp()
self.video = self._create_video_with_subs()
def reverse_url(self, reverse_args=None, **kwargs):
reverse_args = reverse_args or {}
reverse_args.update({
'block_id': self.video.location.block_id,
'lang': kwargs.get('lang', 'en'),
})
return super(TestTranscriptsDetail, self).reverse_url(reverse_args, **kwargs)
def test_incorrect_language(self):
self.login_and_enroll()
self.api_response(expected_response_code=404, lang='pl')
def test_transcript_with_unicode_file_name(self):
self.video = self._create_video_with_subs(custom_subid=u'你好')
self.login_and_enroll()
self.api_response(expected_response_code=200, lang='en')
|
eestay/edx-platform
|
lms/djangoapps/mobile_api/video_outlines/tests.py
|
Python
|
agpl-3.0
| 33,840
|
# -*- coding: utf-8 -*-
from flask import Flask
from flask.ext.restful import Api
from blatt.api.resources import (ArticleResource, JournalistResource,
MediaResource, PublicationResource)
app = Flask(__name__)
app.config.from_object('blatt.api.config')
api = Api(app)
api.add_resource(PublicationResource, '/publications/',
'/publications/<int:obj_id>/', endpoint='publications')
api.add_resource(ArticleResource, '/articles/', '/articles/<int:obj_id>',
endpoint='articles')
api.add_resource(JournalistResource, '/journalists/',
'/journalists/<int:obj_id>', endpoint='journalists')
api.add_resource(MediaResource, '/media/', '/media/<int:obj_id>',
endpoint='media')
if __name__ == '__main__':
app.run(debug=True, port=5001)
|
tooxie/blatt
|
blatt/api/app.py
|
Python
|
agpl-3.0
| 833
|
# Copyright (c) 2015-2021 Anish Athalye (me@anishathalye.com)
#
# This software is released under AGPLv3. See the included LICENSE.txt for
# details.
from flask import Flask
app = Flask(__name__)
import gavel.settings as settings
app.config['SQLALCHEMY_DATABASE_URI'] = settings.DB_URI
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SECRET_KEY'] = settings.SECRET_KEY
app.config['SERVER_NAME'] = settings.SERVER_NAME
if settings.PROXY:
from werkzeug.middleware.proxy_fix import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)
from flask_assets import Environment, Bundle
assets = Environment(app)
assets.config['pyscss_style'] = 'expanded'
scss = Bundle(
'css/style.scss',
depends='**/*.scss',
filters=('pyscss',),
output='all.css'
)
assets.register('scss_all', scss)
from celery import Celery
app.config['CELERY_BROKER_URL'] = settings.BROKER_URI
celery = Celery(app.name, broker=app.config['CELERY_BROKER_URL'])
celery.conf.update(app.config)
from gavel.models import db
db.app = app
db.init_app(app)
import gavel.template_filters # registers template filters
import gavel.controllers # registers controllers
|
anishathalye/gavel
|
gavel/__init__.py
|
Python
|
agpl-3.0
| 1,160
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015. Tšili Lauri Johannes
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from datpy.record.fields import DatabaseField
class PublicationField(DatabaseField):
def __init__(self, *args, **kwargs):
self["name"] = "publication"
super(PublicationField, self).__init__(*args, **kwargs)
|
tsili/datpy
|
datpy/record/fields/publication.py
|
Python
|
agpl-3.0
| 979
|
"""
Tests for wiki permissions
"""
from django.contrib.auth.models import Group
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from django.test.utils import override_settings
from courseware.tests.factories import InstructorFactory, StaffFactory
from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE
from wiki.models import URLPath
from course_wiki.views import get_or_create_root
from course_wiki.utils import user_is_article_course_staff, course_wiki_slug
from course_wiki import settings
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE)
class TestWikiAccessBase(ModuleStoreTestCase):
"""Base class for testing wiki access."""
def setUp(self):
self.wiki = get_or_create_root()
self.course_math101 = CourseFactory.create(org='org', number='math101', display_name='Course', metadata={'use_unique_wiki_id': 'false'})
self.course_math101_staff = self.create_staff_for_course(self.course_math101)
wiki_math101 = self.create_urlpath(self.wiki, course_wiki_slug(self.course_math101))
wiki_math101_page = self.create_urlpath(wiki_math101, 'Child')
wiki_math101_page_page = self.create_urlpath(wiki_math101_page, 'Grandchild')
self.wiki_math101_pages = [wiki_math101, wiki_math101_page, wiki_math101_page_page]
self.course_math101b = CourseFactory.create(org='org', number='math101b', display_name='Course', metadata={'use_unique_wiki_id': 'true'})
self.course_math101b_staff = self.create_staff_for_course(self.course_math101b)
wiki_math101b = self.create_urlpath(self.wiki, course_wiki_slug(self.course_math101b))
wiki_math101b_page = self.create_urlpath(wiki_math101b, 'Child')
wiki_math101b_page_page = self.create_urlpath(wiki_math101b_page, 'Grandchild')
self.wiki_math101b_pages = [wiki_math101b, wiki_math101b_page, wiki_math101b_page_page]
def create_urlpath(self, parent, slug):
"""Creates an article at /parent/slug and returns its URLPath"""
return URLPath.create_article(parent, slug, title=slug)
def create_staff_for_course(self, course):
"""Creates and returns users with instructor and staff access to course."""
return [
InstructorFactory(course=course.id), # Creates instructor_org/number/run role name
StaffFactory(course=course.id), # Creates staff_org/number/run role name
]
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE)
class TestWikiAccess(TestWikiAccessBase):
"""Test wiki access for course staff."""
def setUp(self):
super(TestWikiAccess, self).setUp()
self.course_310b = CourseFactory.create(org='org', number='310b', display_name='Course')
self.course_310b_staff = self.create_staff_for_course(self.course_310b)
self.course_310b2 = CourseFactory.create(org='org', number='310b_', display_name='Course')
self.course_310b2_staff = self.create_staff_for_course(self.course_310b2)
self.wiki_310b = self.create_urlpath(self.wiki, course_wiki_slug(self.course_310b))
self.wiki_310b2 = self.create_urlpath(self.wiki, course_wiki_slug(self.course_310b2))
def test_no_one_is_root_wiki_staff(self):
all_course_staff = self.course_math101_staff + self.course_310b_staff + self.course_310b2_staff
for course_staff in all_course_staff:
self.assertFalse(user_is_article_course_staff(course_staff, self.wiki.article))
def test_course_staff_is_course_wiki_staff(self):
for page in self.wiki_math101_pages:
for course_staff in self.course_math101_staff:
self.assertTrue(user_is_article_course_staff(course_staff, page.article))
for page in self.wiki_math101b_pages:
for course_staff in self.course_math101b_staff:
self.assertTrue(user_is_article_course_staff(course_staff, page.article))
def test_settings(self):
for page in self.wiki_math101_pages:
for course_staff in self.course_math101_staff:
self.assertTrue(settings.CAN_DELETE(page.article, course_staff))
self.assertTrue(settings.CAN_MODERATE(page.article, course_staff))
self.assertTrue(settings.CAN_CHANGE_PERMISSIONS(page.article, course_staff))
self.assertTrue(settings.CAN_ASSIGN(page.article, course_staff))
self.assertTrue(settings.CAN_ASSIGN_OWNER(page.article, course_staff))
for page in self.wiki_math101b_pages:
for course_staff in self.course_math101b_staff:
self.assertTrue(settings.CAN_DELETE(page.article, course_staff))
self.assertTrue(settings.CAN_MODERATE(page.article, course_staff))
self.assertTrue(settings.CAN_CHANGE_PERMISSIONS(page.article, course_staff))
self.assertTrue(settings.CAN_ASSIGN(page.article, course_staff))
self.assertTrue(settings.CAN_ASSIGN_OWNER(page.article, course_staff))
def test_other_course_staff_is_not_course_wiki_staff(self):
for page in self.wiki_math101_pages:
for course_staff in self.course_math101b_staff:
self.assertFalse(user_is_article_course_staff(course_staff, page.article))
for page in self.wiki_math101_pages:
for course_staff in self.course_310b_staff:
self.assertFalse(user_is_article_course_staff(course_staff, page.article))
for course_staff in self.course_310b_staff:
self.assertFalse(user_is_article_course_staff(course_staff, self.wiki_310b2.article))
for course_staff in self.course_310b2_staff:
self.assertFalse(user_is_article_course_staff(course_staff, self.wiki_310b.article))
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE)
class TestWikiAccessForStudent(TestWikiAccessBase):
"""Test access for students."""
def setUp(self):
super(TestWikiAccessForStudent, self).setUp()
self.student = UserFactory.create()
def test_student_is_not_root_wiki_staff(self):
self.assertFalse(user_is_article_course_staff(self.student, self.wiki.article))
def test_student_is_not_course_wiki_staff(self):
for page in self.wiki_math101_pages:
self.assertFalse(user_is_article_course_staff(self.student, page.article))
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE)
class TestWikiAccessForNumericalCourseNumber(TestWikiAccessBase):
"""Test staff has access if course number is numerical and wiki slug has an underscore appended."""
def setUp(self):
super(TestWikiAccessForNumericalCourseNumber, self).setUp()
self.course_200 = CourseFactory.create(org='org', number='200', display_name='Course')
self.course_200_staff = self.create_staff_for_course(self.course_200)
wiki_200 = self.create_urlpath(self.wiki, course_wiki_slug(self.course_200))
wiki_200_page = self.create_urlpath(wiki_200, 'Child')
wiki_200_page_page = self.create_urlpath(wiki_200_page, 'Grandchild')
self.wiki_200_pages = [wiki_200, wiki_200_page, wiki_200_page_page]
def test_course_staff_is_course_wiki_staff_for_numerical_course_number(self): # pylint: disable=C0103
for page in self.wiki_200_pages:
for course_staff in self.course_200_staff:
self.assertTrue(user_is_article_course_staff(course_staff, page.article))
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE)
class TestWikiAccessForOldFormatCourseStaffGroups(TestWikiAccessBase):
"""Test staff has access if course group has old format."""
def setUp(self):
super(TestWikiAccessForOldFormatCourseStaffGroups, self).setUp()
self.course_math101c = CourseFactory.create(org='org', number='math101c', display_name='Course')
Group.objects.get_or_create(name='instructor_math101c')
self.course_math101c_staff = self.create_staff_for_course(self.course_math101c)
wiki_math101c = self.create_urlpath(self.wiki, course_wiki_slug(self.course_math101c))
wiki_math101c_page = self.create_urlpath(wiki_math101c, 'Child')
wiki_math101c_page_page = self.create_urlpath(wiki_math101c_page, 'Grandchild')
self.wiki_math101c_pages = [wiki_math101c, wiki_math101c_page, wiki_math101c_page_page]
def test_course_staff_is_course_wiki_staff(self):
for page in self.wiki_math101c_pages:
for course_staff in self.course_math101c_staff:
self.assertTrue(user_is_article_course_staff(course_staff, page.article))
|
morenopc/edx-platform
|
lms/djangoapps/course_wiki/tests/test_access.py
|
Python
|
agpl-3.0
| 8,738
|
# Generated by Django 1.11.4 on 2017-08-14 13:52
from __future__ import unicode_literals
from django.db import migrations
import localflavor.generic.models
class Migration(migrations.Migration):
dependencies = [
('user', '0028_add_user_can_resend_creds_to_power_user'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='iban',
field=localflavor.generic.models.IBANField(blank=True, include_countries=('AT', 'BE', 'BG', 'CH', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GI', 'GR', 'HR', 'HU', 'IE', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MC', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK', 'SM'), max_length=34, use_nordea_extensions=False),
),
]
|
defivelo/db
|
apps/user/migrations/0029_auto_20170814_1552.py
|
Python
|
agpl-3.0
| 765
|
#------------------------------------------------------------------------------
# Copyright (C) 2009 Richard Lincoln
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation; version 2 dated June, 1991.
#
# This software is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANDABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#------------------------------------------------------------------------------
# <<< imports
# @generated
from dynamics.element import Element
from dynamics.domain import Resistance
from dynamics.domain import Reactance
from google.appengine.ext import db
# >>> imports
class VoltageCompensator(Element):
""" A voltage compensator adjusts the terminal voltage feedback to the excitation system by adding a quantity that is proportional to the terminal current of the generator. It is linked to a specific generator by the Bus number and Unit ID
"""
# <<< voltage_compensator.attributes
# @generated
# Compensating (compounding) resistance
rcomp = Resistance
# Compensating (compounding) reactance
xcomp = Reactance
# >>> voltage_compensator.attributes
# <<< voltage_compensator.references
# @generated
# >>> voltage_compensator.references
# <<< voltage_compensator.operations
# @generated
# >>> voltage_compensator.operations
# EOF -------------------------------------------------------------------------
|
rwl/openpowersystem
|
dynamics/dynamics/voltage_compensator/voltage_compensator.py
|
Python
|
agpl-3.0
| 1,867
|
# -*- coding: utf-8 -*-
'''
This file is part of Habitam.
Habitam is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
Habitam is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public
License along with Habitam. If not, see
<http://www.gnu.org/licenses/>.
Created on Jul 18, 2013
@author: Stefan Guna
'''
from datetime import date
from dateutil.relativedelta import relativedelta
from habitam.downloads.common import MARGIN, habitam_brand
from reportlab.lib import colors
from reportlab.lib.enums import TA_CENTER, TA_RIGHT
from reportlab.lib.pagesizes import A4, cm
from reportlab.lib.styles import ParagraphStyle
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph
from reportlab.platypus.flowables import Spacer
import logging
import tempfile
__HEIGHT__ = A4[1]
__WIDTH__ = A4[0]
__FONT_SIZE__ = 9
logger = logging.getLogger(__name__)
def __balance(building, d, money_type):
funds = building.accountlink_set.filter(account__money_type=money_type)
s = reduce(lambda s, l: s + l.account.balance(d), funds, 0)
collecting_funds = building.collecting_funds().filter(account__money_type=money_type)
s = reduce(lambda s, cf: s + cf.account.balance(d), collecting_funds, s)
return s
def __document_number(op_doc):
if op_doc.receipt:
return op_doc.receipt.no
if op_doc.invoice:
return op_doc.invoice.series + '/' + op_doc.invoice.no
return ''
def __download_register(building, day, money_type, title):
d = date(day.year, day.month, 1)
day_before = d - relativedelta(days=1)
initial_balance = __balance(building, day_before, money_type)
d_elem = {'day': day}
while d <= day:
d_elem[d], initial_balance = __register(building, d, initial_balance,
money_type)
d = d + relativedelta(days=1)
logger.debug('Register is %s' % d_elem)
temp = tempfile.NamedTemporaryFile()
__to_pdf(temp, to_data(building, d_elem, day), building, title)
return temp
def __operations(entity, d, money_type, source_only, dest_only):
next_day = d + relativedelta(days=1)
ops = entity.account.operation_list(d, next_day, source_only, dest_only,
money_type)
for op in ops:
op.total_amount = op.total_amount * -1
p = op.penalties()
op.total_amount = op.total_amount + p if p != None else op.total_amount
return ops
def __register(building, d, initial_balance, money_type):
ml = map(lambda ap: __operations(ap, d, money_type, True, False), building.apartments()) + \
map(lambda svc: __operations(svc, d, money_type, False, True), building.services())
ops = []
for ol in ml:
if ol:
ops.extend(ol)
end_balance = reduce(lambda c, op: c + op.total_amount, ops, initial_balance)
return {'initial_balance': initial_balance,
'operations': ops,
'end_balance':end_balance}, end_balance
def __register_format(canvas, doc):
canvas.saveState()
building_style = ParagraphStyle(name='building_title')
t = doc.habitam_building.name
p = Paragraph(t, building_style)
p.wrapOn(canvas, 5 * cm, 2 * cm)
p.drawOn(canvas, .5 * cm, __HEIGHT__ - 1 * cm)
habitam_brand(canvas, __WIDTH__, __HEIGHT__)
canvas.restoreState()
def to_data(building, d_list, day):
d = date(day.year, day.month, 1)
data = []
header = []
header.append('Nr. Crt.')
header.append(u'Nr. Act')
header.append(u'Nr.\nAnexa')
header.append(u'Explicatii')
header.append(u'Incasari')
header.append(u'Plati')
header.append('Simbol\ncont')
data.append(header)
details_style = ParagraphStyle(name='details',
fontSize=__FONT_SIZE__)
day_item_style = ParagraphStyle(name='day_item',
fontSize=__FONT_SIZE__,
alignment=TA_RIGHT)
while d <= day:
if d_list[d]['operations'] is not None and len(d_list[d]['operations']) > 0:
initial_balance = d_list[d]['initial_balance'];
end_balance = d_list[d]['end_balance'];
first_row = []
first_row.append('')
first_row.append('')
first_row.append('')
first_row.append(Paragraph(u'Sold inițial la %s' % d, day_item_style))
first_row.append(initial_balance)
first_row.append('')
first_row.append('')
data.append(first_row)
increment = 1
inbound = 0
outbound = 0
for op_doc in d_list[d]['operations']:
amount = op_doc.total_amount
row = []
row.append(increment)
row.append(__document_number(op_doc))
row.append('')
row.append(Paragraph(op_doc.description, details_style))
if amount >= 0:
row.append(amount)
row.append('')
inbound += amount
else:
row.append('')
row.append(amount * -1)
outbound += amount * -1
increment += 1
data.append(row)
sum_row = []
sum_row.append('')
sum_row.append('')
sum_row.append('')
sum_row.append(Paragraph('RULAJ ZI', day_item_style))
sum_row.append(inbound)
sum_row.append(outbound)
sum_row.append('')
data.append(sum_row)
last_row = []
last_row.append('')
last_row.append('')
last_row.append('')
last_row.append(Paragraph('SOLD FINAL', day_item_style))
last_row.append(end_balance)
last_row.append('')
last_row.append('')
data.append(last_row)
d = d + relativedelta(days=1)
return data
def __to_pdf(tempFile, data, building, title):
doc = SimpleDocTemplate(tempFile, pagesize=A4, leftMargin=MARGIN,
rightMargin=MARGIN, topMargin=MARGIN,
bottomMargin=MARGIN,
title=title,
author='www.habitam.ro')
register_title_style = ParagraphStyle(name='register_title', alignment=TA_CENTER)
register_title = Paragraph(title, register_title_style)
table = Table(data, colWidths=[1.3 * cm, 3 * cm, 1.2 * cm, 7.5 * cm, 2 * cm, 2 * cm, 1.7 * cm])
table.setStyle(TableStyle([
('FONT', (0, 0), (-1, 0), 'Helvetica-Bold'),
('FONTSIZE', (0, 0), (-1, -1), __FONT_SIZE__),
('ALIGN', (0, 0), (-1, 0), 'CENTER'),
('ALIGN', (0, 0), (0, -1), 'CENTER'),
('VALIGN', (0, 0), (-1, -1), 'MIDDLE'),
('INNERGRID', (0, 0), (-1, -1), 0.25, colors.black),
('BOX', (0, 0), (-1, -1), 0.25, colors.black)
]))
flowables = [Spacer(1, 1.5 * cm), register_title, Spacer(1, cm), table]
doc.habitam_building = building
doc.build(flowables, onFirstPage=__register_format, onLaterPages=__register_format)
def download_bank_register(building, day):
return __download_register(building, day, 'bank', u'Registru de bancă')
def download_cash_register(building, day):
return __download_register(building, day, 'cash', u'Registru de casă')
|
habitam/habitam-core
|
habitam/downloads/register.py
|
Python
|
agpl-3.0
| 8,200
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import filemanager.models
def deleteDeadFiles(apps, schema_editor):
fileObject = apps.get_model("filemanager", "fileObject")
files = fileObject.objects.all()
for fileInstance in files:
if not fileInstance.filename:
fileInstance.delete()
class Migration(migrations.Migration):
dependencies = [
('filemanager', '0003_auto_20150226_1838'),
]
operations = [
migrations.RunPython(deleteDeadFiles),
migrations.AlterField(
model_name='thumbobject',
name='filename',
field=models.FileField(upload_to=filemanager.models.thumbuploadpath),
preserve_default=True,
),
]
|
Rhombik/rhombik-object-repository
|
filemanager/migrations/0004_auto_20150327_2335.py
|
Python
|
agpl-3.0
| 796
|
# -*- coding: utf-8 -*-
##############################################################################
#
# Infrastructure
# Copyright (C) 2014 Ingenieria ADHOC
# No email
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import re
from openerp import netsvc
from openerp.osv import osv, fields
class instance(osv.osv):
""""""
_name = 'infrastructure.instance'
_description = 'instance'
_columns = {
'name': fields.char(string='Name', required=True),
'instance_type': fields.selection([(u'secure', u'Secure'), (u'none_secure', u'None Secure')], string='Instance Type', required=True),
'xml_rpc_port': fields.integer(string='xml rpc Port', required=True),
'xml_rpcs_port': fields.integer(string='xml rpcs Port'),
'longpolling_port': fields.integer(string='Longpolling Port'),
'db_filter': fields.many2one('infrastructure.db_filter', string='Db filter', required=True),
'user': fields.char(string='User', readonly=True),
'environment_id': fields.many2one('infrastructure.environment', string='Environment', ondelete='cascade', required=True),
'database_ids': fields.one2many('infrastructure.database', 'instance_id', string='Databases', context={'from_instance':True}),
}
_defaults = {
}
_constraints = [
]
def get_user(self, cr, uid, ids, context=None):
""""""
raise NotImplementedError
instance()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
3dfxmadscientist/odoo-infrastructure
|
addons/infrastructure/instance.py
|
Python
|
agpl-3.0
| 2,237
|
# This file is part of Irianas (Client).
# Copyright (C) 2013 Irisel Gonzalez.
# Authors: Irisel Gonzalez <irisel.gonzalez@gmail.com>
#
from irianas_client.services.commons import CommonService
"""
Config basic for the config file my.cnf
"""
config_basic = {
"mysqld":
{
"datadir": "/var/lib/mysql",
"socket": "/var/lib/mysql/mysql.sock",
"user": "mysql",
"symbolic-links": 0,
"bind-address": "0.0.0.0"},
"mysqld_safe":
{
"log-error": "/var/log/mysqld.log",
"pid-file": "/var/run/mysqld/mysqld.pid"
}
}
params_valid = ["bind-address", "binlog_cache_size", "bulk_insert_buffer_size",
"connect_timeout", "completion_type", "concurrent_insert",
"innodb_additional_mem_pool_size",
"innodb_autoextend_increment",
"innodb_buffer_pool_awe_mem_mb", "innodb_buffer_pool_size",
"innodb_checksums", "innodb_commit_concurrency",
"innodb_concurrency_tickets", "innodb_data_file_path",
"innodb_fast_shutdown", "innodb_file_io_threads",
"innodb_file_per_table", "innodb_flush_log_at_trx_commit",
"innodb_force_recovery", "innodb_lock_wait_timeout",
"innodb_locks_unsafe_for_binlog", "join_buffer_size",
"interactive_timeout", "keep_files_on_create",
"key_buffer_size", "key_cache_age_threshold",
"key_cache_block_size", "key_cache_division_limit",
"max_allowed_packet", "max_connections",
"max_delayed_threads", "max_join_size",
"max_sort_length", "max_sp_recursion_depth",
"query_cache_limit", "query_cache_min_res_unit",
"query_cache_size", "query_cache_type", "socket",
"sort_buffer_size", "wait_timeout"]
params_default = {
"mysqld":
{
"binlog_cache_size": 32768,
"bulk_insert_buffer_size": 8388608,
"connect_timeout": 10,
"completion_type": 0,
"concurrent_insert": "ON",
"innodb_additional_mem_pool_size": 1048576,
"innodb_autoextend_increment": 8,
"innodb_buffer_pool_awe_mem_mb": 0,
"innodb_buffer_pool_size": 8388608,
"innodb_checksums": "ON",
"innodb_commit_concurrency": 0,
"innodb_concurrency_tickets": 500,
"innodb_data_file_path": "ibdata1:10M:autoextend",
"innodb_fast_shutdown": 1,
"innodb_file_io_threads": 4,
"innodb_file_per_table": "OFF",
"innodb_flush_log_at_trx_commit": 1,
"innodb_force_recovery": 0,
"innodb_lock_wait_timeout": 50,
"innodb_locks_unsafe_for_binlog": "OFF",
"join_buffer_size": 131072,
"interactive_timeout": 28800,
"keep_files_on_create": "OFF",
"key_buffer_size": 8388608,
"key_cache_age_threshold": 300,
"key_cache_block_size": 1024,
"key_cache_division_limit": 100,
"max_allowed_packet": 1048576,
"max_connections": 100,
"max_delayed_threads": 20,
"max_join_size": 4294967295,
"max_sort_length": 1024,
"max_sp_recursion_depth": 0,
"query_cache_limit": 1048576,
"query_cache_min_res_unit": 4096,
"query_cache_size": 0,
"query_cache_type": 1,
"socket": "/tmp/mysql.sock",
"sort_buffer_size": 2097144,
"wait_timeout": 28800
}
}
class MySQLConfigFile(object):
"""MySQLConfigFile"""
config = dict()
config_string = ""
def __init__(self):
super(MySQLConfigFile, self).__init__()
def concat_params_mysqld(self):
self.config["mysqld"] = dict(config_basic["mysqld"].items() +
params_default["mysqld"].items())
def add_params_mysqld_safe(self):
self.config["mysqld_safe"] = config_basic["mysqld_safe"]
def create_config_string(self):
for key_mysql, value_mysql in self.config.iteritems():
self.config_string += "[{0}]\n".format(key_mysql)
for key, value in value_mysql.iteritems():
self.config_string += "{0} = {1}\n".format(key, value)
self.config_string += "\n\n"
def save_file(self, path):
config_file = open(path, 'w')
config_file.write(self.config_string)
config_file.close()
def execute_config(self, path):
self.concat_params_mysqld()
self.add_params_mysqld_safe()
self.create_config_string()
self.save_file(path)
class MySQLService(CommonService):
"""MySQLService"""
def __init__(self):
super(MySQLService, self).__init__(None, 'mysql')
def __getattr__(self, attr):
if attr in params_valid:
return params_default["mysqld"][attr]
else:
return super.__getattr__(attr)
def __setattr__(self, attr, value):
if attr in params_valid:
params_default["mysqld"][attr] = value
else:
super.__setattr__(self, attr, value)
def get(self, attr):
return self.__getattr__(attr)
def set(self, attr, value):
self.__setattr__(attr, value)
def save_attr(self, path):
obj_mysql_config_file = MySQLConfigFile()
obj_mysql_config_file.execute_config(path)
def get_dict_params(self):
return params_default["mysqld"]
|
Irigonzalez/irianas-client
|
irianas_client/services/database/mysql.py
|
Python
|
agpl-3.0
| 5,418
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-05-04 15:35
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("services", "0056_unit_accessibility_viewpoint_nullable"),
]
operations = [
migrations.RemoveField(
model_name="service",
name="unit_count",
),
]
|
City-of-Helsinki/smbackend
|
services/migrations/0057_remove_service_unit_count.py
|
Python
|
agpl-3.0
| 419
|
from django.contrib.auth.decorators import login_required, user_passes_test
from django.conf.urls import patterns, include, url
from django.core.urlresolvers import reverse_lazy
from django.views.generic.edit import DeleteView
from warehouse.models import *
from warehouse.views import *
from django.contrib import admin
admin.autodiscover()
def staff_required(view):
return user_passes_test(lambda a: a.is_staff)(view)
urlpatterns = patterns('',
url(r'^itemtype$', staff_required(ItemTypeView.as_view()), name='itemtype'),
url(r'^itemtype/(?P<pk>\d+)/delete/$', staff_required(DeleteViewCustom.as_view(model=ItemType, success_url=reverse_lazy("wh:itemtype"))), name='itemtype-delete'),
url(r'^item$', staff_required(ItemView.as_view()), name='item'),
url(r'^item/(?P<pk>\d+)/delete/$', staff_required(DeleteViewCustom.as_view(model=Item, success_url=reverse_lazy("wh:item"))), name='item-delete'),
url(r'^item/(?P<pk>\d+)/edit/$', staff_required(ItemUpdateView.as_view()), name='item-edit'),
url(r'^item/(?P<pk>\d+)/view$', staff_required(ItemViewDetail.as_view()), name='item-detail'),
url(r'^item/(?P<items>.*)/printlabel$', staff_required(print_label), name='item-printlabel'),
url(r'^mystuff$', login_required(MyStuff.as_view()), name='mystuff'),
url(r'^$', login_required(MyStuff.as_view()), name='mystuff'),
url(r'^qr_api/(?P<size>\d{1,2})/(?P<string>.*)$', login_required(generate_qr), name='qr'),
)
|
wlanslovenija/nodewatcher-warehouse
|
nodewatcherwarehouse/warehouse/urls.py
|
Python
|
agpl-3.0
| 1,471
|
from vertex.filters import IdListFilterSet
from ..models import Ticket
class TicketFilterSet(IdListFilterSet):
class Meta:
model = Ticket
|
zapcoop/vertex
|
vertex_api/service/filters/ticket.py
|
Python
|
agpl-3.0
| 153
|
"""
Tests for methods defined in mongo_utils.py
"""
import ddt
import os
from unittest import TestCase
from uuid import uuid4
from pymongo import ReadPreference
from xmodule.mongo_utils import connect_to_mongodb
@ddt.ddt
class MongoUtilsTests(TestCase):
"""
Tests for methods exposed in mongo_utils
"""
@ddt.data(
('PRIMARY', 'primary', ReadPreference.PRIMARY),
('SECONDARY_PREFERRED', 'secondaryPreferred', ReadPreference.SECONDARY_PREFERRED),
('NEAREST', 'nearest', ReadPreference.NEAREST),
)
@ddt.unpack
def test_connect_to_mongo_read_preference(self, enum_name, mongos_name, expected_read_preference):
"""
Test that read_preference parameter gets converted to a valid pymongo read preference.
"""
host = 'edx.devstack.mongo' if 'BOK_CHOY_HOSTNAME' in os.environ else 'localhost'
db = 'test_read_preference_%s' % uuid4().hex
# Support for read_preference given in constant name form (ie. PRIMARY, SECONDARY_PREFERRED)
connection = connect_to_mongodb(db, host, read_preference=enum_name)
self.assertEqual(connection.client.read_preference, expected_read_preference)
# Support for read_preference given as mongos name.
connection = connect_to_mongodb(db, host, read_preference=mongos_name)
self.assertEqual(connection.client.read_preference, expected_read_preference)
|
jolyonb/edx-platform
|
common/lib/xmodule/xmodule/tests/test_mongo_utils.py
|
Python
|
agpl-3.0
| 1,414
|
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
#############################################################################
#
# Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import fields,osv
import openerp.addons.decimal_precision as dp
from openerp.addons.at_base import util
from openerp.addons.at_base import helper
from dateutil.relativedelta import relativedelta
class hr_timesheet(osv.osv):
def add_totals_day(self, cr, uid, oid, days, context=None):
res = {}
cr.execute('SELECT day.name, day.total_attendance, day.total_timesheet, day.total_difference\
FROM hr_timesheet_sheet_sheet AS sheet \
LEFT JOIN hr_timesheet_sheet_sheet_day AS day \
ON (sheet.id = day.sheet_id \
AND day.name IN %s) \
WHERE sheet.id = %s',(tuple(days),oid) )
for record in cr.fetchall():
res[record[0]] = {}
res[record[0]]['total_attendance_day'] = record[1]
res[record[0]]['total_timesheet_day'] = record[2]
res[record[0]]['total_difference_day'] = record[3]
return res
def get_leaves(self,cr,uid,oid,context=None):
return {}
def _get_date_from(self,cr, uid, str_date, context=None):
d_date = util.strToDate(str_date)
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
r = user.company_id and user.company_id.timesheet_range or 'month'
if r=='month':
return d_date.strftime('%Y-%m-01')
elif r=='week':
return (d_date + relativedelta(weekday=0, weeks=-1)).strftime('%Y-%m-%d')
elif r=='year':
return d_date.strftime('%Y-01-01')
return d_date.strftime('%Y-%m-%d')
def _get_date_to(self,cr, uid, str_date, context=None):
d_date = util.strToDate(str_date)
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
r = user.company_id and user.company_id.timesheet_range or 'month'
if r=='month':
return (d_date + relativedelta(months=+1,day=1,days=-1)).strftime('%Y-%m-%d')
elif r=='week':
return (d_date + relativedelta(weekday=6)).strftime('%Y-%m-%d')
elif r=='year':
return d_date.strftime('%Y-12-31')
return d_date.strftime('%Y-%m-%d')
def get_timesheet_day(self,cr,uid,str_date,context=None):
"""
return ts_day_obj
"""
if context is None:
context = {}
employee_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context)
if employee_ids:
employee_id = employee_ids[0]
timesheet_ids = self.search(cr, uid, [('employee_id','=',employee_id),('state','in',['draft','new']),('date_from','<=',str_date), ('date_to','>=',str_date)], context=context)
if timesheet_ids:
ts_day_obj = self.pool.get("hr_timesheet_sheet.sheet.day")
ts_day_ids = ts_day_obj.search(cr,uid,[("name","=",str_date),("sheet_id","=",timesheet_ids[0])])
if ts_day_ids:
return ts_day_obj.browse(cr,uid,ts_day_ids[0],context)
return None
def get_timesheet(self,cr,uid,str_date,context=None):
if context is None:
context = {}
employee_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context)
if employee_ids:
employee_id = employee_ids[0]
timesheet_ids = self.search(cr, uid, [('employee_id','=',employee_id),('date_from','<=',str_date), ('date_to','>=',str_date)], context=context)
if timesheet_ids:
return timesheet_ids[0]
return None
def get_timesheet_lazy(self,cr,uid,str_date,context=None):
if context is None:
context = {}
employee_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context)
if not len(employee_ids):
raise osv.except_osv(_('Error !'), _('No employee defined for your user !'))
elif len(employee_ids) > 1:
raise osv.except_osv(_('Error !'), _('More than one employee defined for your user !'))
employee_id = employee_ids[0]
timesheet_ids = self.search(cr, uid, [('employee_id','=',employee_id),('state','in',['draft','new']),('date_from','<=',str_date), ('date_to','>=',str_date)], context=context)
if len(timesheet_ids) > 1:
raise osv.except_osv(_('Error !'), _('More than one timesheet for the same user and the same time range !'))
elif len(timesheet_ids) == 1:
return timesheet_ids[0]
else:
date_from = self._get_date_from(cr,uid,str_date,context)
vals = {
"name" : helper.getMonthYear(cr, uid, str_date, context),
"date_from" : date_from,
"date_to" : self._get_date_to(cr,uid,str_date,context),
"date_current" : date_from,
"state" : "new",
"employee_id" : employee_id,
"company_id" : self.pool.get('res.company')._company_default_get(cr, uid, 'hr_timesheet_sheet.sheet', context=context)
}
return self.create(cr, uid, vals, context=context)
def get_timesheet_data(self, cr, uid, oid, context=None):
#inner function for get lines
def _get_attendances(in_days, in_day):
data = in_days.get(in_day,None)
if data == None:
data = {}
in_days[in_day] = data
attendance = data.get("attendances",None)
if attendance == None:
attendance = []
in_days[in_day]["attendances"]=attendance
return attendance
timesheet = self.browse(cr, uid, oid, context)
attendance_obj = self.pool.get("hr.attendance")
attendance_ids = attendance_obj.search(cr,uid,[("sheet_id","=",timesheet.id)],order="name asc")
next_range = {
"day" : None,
"from" : None,
"to" : None
}
days = {}
for att in attendance_obj.browse(cr,uid,attendance_ids,context):
cur_day = util.timeToDateStr(att.name)
if att.action == "sign_in":
next_range = {
"day" : cur_day,
"from" : helper.strToLocalTimeStr(cr,uid,att.name,context),
"to" : None
}
_get_attendances(days,cur_day).append(next_range)
elif att.action=="sign_out":
if next_range["day"] != cur_day:
next_range = {
"day" : cur_day,
"from" : None,
"to" : helper.strToLocalTimeStr(cr,uid,att.name,context)
}
_get_attendances(days,cur_day).append(next_range)
else:
next_range["to"] = helper.strToLocalTimeStr(cr,uid,att.name,context)
leaves = self.get_leaves(cr, uid, oid, context)
date_from = util.strToDate(timesheet.date_from)
date_to = util.strToDate(timesheet.date_to)
date_cur = date_from
delta_day = relativedelta(days=1)
range_open = False
while date_cur <= date_to:
date_cur_str = util.dateToStr(date_cur)
attendances = _get_attendances(days,date_cur_str)
days[date_cur_str]['total_attendance_day']=0.0
days[date_cur_str]['total_timesheet_day']=0.0
days[date_cur_str]['total_difference_day']=0.0
leaves_for_day = leaves.get(date_cur_str)
if leaves_for_day:
days[date_cur_str]["leaves"]=leaves_for_day
if not attendances and range_open:
attendances.append( {
"day" : date_cur_str,
"from" : date_cur_str + " 00:00:00",
"to" : date_cur_str + " 24:00:00"
})
elif attendances:
if range_open:
attendances[0]["from"] = date_cur_str + " 00:00:00"
range_open = False
last_range = attendances[-1]
if not last_range.get("to"):
range_open = True
last_range["to"]= util.timeToStr(date_cur+delta_day)
date_cur += delta_day
#get total days
cr.execute('SELECT day.name, day.total_attendance, day.total_timesheet, day.total_difference\
FROM hr_timesheet_sheet_sheet AS sheet \
LEFT JOIN hr_timesheet_sheet_sheet_day AS day \
ON (sheet.id = day.sheet_id \
AND day.name IN %s) \
WHERE sheet.id = %s',(tuple(days.keys()),oid) )
for total_day in cr.fetchall():
if total_day[0]:
days[total_day[0]]['total_attendance_day'] = total_day[1]
days[total_day[0]]['total_timesheet_day'] = total_day[2]
days[total_day[0]]['total_difference_day'] = total_day[3]
#get analytic lines
line_obj = self.pool.get("hr.analytic.timesheet")
for key,value in days.items():
value["lines"] = line_obj.search(cr, uid, [("date","=",key),("sheet_id","=",timesheet.id)], order="id asc")
return days
_inherit = "hr_timesheet_sheet.sheet"
class hr_timesheet_line(osv.osv):
def _amount_brutto(self, cr, uid, ids, field_name, arg, context=None):
tax_obj= self.pool.get("account.tax")
res = {}
for line in self.browse(cr, uid, ids, context=context):
amount = 0.0
product = line.product_id
if product:
amount_all = tax_obj.compute_all(cr,uid,product.supplier_taxes_id,product.standard_price,1,product=product.id)
amount = amount_all["total_included"]
res[line.id]=amount
return res
_inherit = "hr.analytic.timesheet"
_columns = {
"amount_brutto" : fields.function(_amount_brutto,string="Amount (Brutto)",type="float", digits_compute=dp.get_precision("Account")),
}
|
funkring/fdoo
|
addons-funkring/at_hr/hr_timesheet.py
|
Python
|
agpl-3.0
| 11,031
|
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emmanuel Mathier <emmanuel.mathier@gmail.com>
#
# The licence is in the file __manifest__.py
#
##############################################################################
from . import partner_compassion
from . import correspondence_metadata
from . import correspondence
from . import correspondence_page
from . import correspondence_template
from . import import_config
from . import import_letters_history
from . import import_letter_line
from . import contracts
from . import correspondence_b2s_layout
from . import correspondence_translation_box
from . import project_compassion
from . import correspondence_s2b_generator
from . import queue_job
|
maxime-beck/compassion-modules
|
sbc_compassion/models/__init__.py
|
Python
|
agpl-3.0
| 892
|
import logging
import markdown2
import textwrap
from xblock.core import XBlock
from xblock.fields import Scope, String, List
from xblock.fragment import Fragment
from xblockutils.resources import ResourceLoader
from xblockutils.studio_editable import StudioEditableXBlockMixin
log = logging.getLogger(__name__)
loader = ResourceLoader(__name__)
class MarkdownXBlock(StudioEditableXBlockMixin, XBlock):
"""
Displays markdown content as HTML
"""
display_name = String(
help="This name appears in the horizontal navigation at the top of the page.",
default="Markdown",
scope=Scope.settings)
filename = String(
help="Relative path to a markdown file uploaded to the static store. For example, \"markdown_file.md\".",
default="",
scope=Scope.content)
content = String(
help="Markdown content to display for this module.",
default=u"",
multiline_editor=True,
scope=Scope.content)
extras = List(
help="Markdown2 module extras to turn on for the instance.",
list_style="set",
list_values_provider=lambda _: [
# Taken from https://github.com/trentm/python-markdown2/wiki/Extras
{"display_name": "Code Friendly", "value": "code-friendly"},
{"display_name": "Fenced Code Blocks", "value": "fenced-code-blocks"},
{"display_name": "Footnotes", "value": "footnotes"},
{"display_name": "GFM Tables", "value": "tables"},
{"display_name": "File Variables", "value": "use-file-vars"},
{"display_name": "Cuddled lists", "value": "cuddled-lists"},
{"display_name": "Google Code Wiki Tables", "value": "wiki-tables"},
{"display_name": "Header IDs", "value": "header-ids"},
{"display_name": "HTML classes", "value": "html-classes"},
{"display_name": "Link patterns", "value": "link-patterns"},
{"display_name": "Markdown in HTML", "value": "markdown-in-html"},
{"display_name": "Metadata", "value": "metadata"},
{"display_name": "No Follow", "value": "nofollow"},
{"display_name": "Pyshell", "value": "pyshell"},
{"display_name": "SmartyPants", "value": "smarty-pants"},
{"display_name": "Spoiler Block", "value": "spoiler"},
{"display_name": "Table of Contents", "value": "toc"},
{"display_name": "Twitter Tag Friendly", "value": "tag-friendly"},
{"display_name": "XML", "value": "xml"},
],
default=[
"code-friendly",
"fenced-code-blocks",
"footnotes",
"tables",
"use-file-vars",
],
scope=Scope.content)
editable_fields = (
'display_name',
'filename',
'content',
'extras')
@classmethod
def parse_xml(cls, node, runtime, keys, id_generator):
"""
Parses the source XML in a way that preserves indenting, needed for markdown.
"""
block = runtime.construct_xblock_from_class(cls, keys)
# Load the data
for name, value in node.items():
if name in block.fields:
value = (block.fields[name]).from_string(value)
setattr(block, name, value)
# Load content
text = node.text
if text:
# Fix up whitespace.
if text[0] == "\n":
text = text[1:]
text.rstrip()
text = textwrap.dedent(text)
if text:
block.content = text
return block
def student_view(self, context=None):
"""
The student view of the MarkdownXBlock.
"""
if self.filename:
# These can only be imported when the XBlock is running on the LMS
# or CMS. Do it at runtime so that the workbench is usable for
# regular XML content.
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore
from xmodule.exceptions import NotFoundError
from opaque_keys import InvalidKeyError
try:
course_id = self.xmodule_runtime.course_id
loc = StaticContent.compute_location(course_id, self.filename)
asset = contentstore().find(loc)
content = asset.data
except (NotFoundError, InvalidKeyError):
pass
else:
content = self.content
html_content = ""
if content:
html_content = markdown2.markdown(content, extras=self.extras)
# Render the HTML template
context = {'content': html_content}
html = loader.render_template('templates/main.html', context)
frag = Fragment(html)
if "fenced-code-blocks" in self.extras:
frag.add_css_url(self.runtime.local_resource_url(self, 'public/css/pygments.css'))
return frag
@staticmethod
def workbench_scenarios():
"""A canned scenario for display in the workbench."""
return [
("MarkdownXBlock",
"""<vertical_demo>
<mdown>
# This is an h1
## This is an h2
This is a regular paragraph.
This is a code block.
```
#!/bin/bash
echo "This is a fenced code block.
```
```python
from xblock.core import XBlock
class MarkdownXBlock(XBlock):
"This is a colored fence block."
```
> This is a blockquote.
* This is
* an unordered
* list
1. This is
1. an ordered
1. list
[Link to cat](http://i.imgur.com/3xVUnyA.jpg)

</mdown>
</vertical_demo>
"""),
]
|
hastexo/markdown-xblock
|
mdown/mdown.py
|
Python
|
agpl-3.0
| 6,219
|
"""
Instructor (2) dashboard page.
"""
from bok_choy.page_object import PageObject
from .instructor_dashboard import InstructorDashboardPage as EdXInstructorDashboardPage, \
MembershipPage as EdXMembershipPage
class InstructorDashboardPage(EdXInstructorDashboardPage):
"""
Instructor dashboard, where course staff can manage a course.
"""
def select_send_email(self):
"""
Selects the email tab and returns the EmailSection
"""
self.q(css='a[data-section=send_email]').first.click()
send_email_section = SendEmailPage(self.browser)
send_email_section.wait_for_page()
return send_email_section
def select_survey(self):
"""
Selects the survey tab and returns the SurveySection
"""
self.q(css='a[data-section=survey]').first.click()
survey_section = SurveyPageSection(self.browser)
survey_section.wait_for_page()
return survey_section
class SurveyPageSection(PageObject):
"""
Survey section of the Instructor dashboard.
"""
url = None
def is_browser_on_page(self):
return self.q(css='a[data-section=survey].active-section').present
def click_download_button(self):
"""
Click the download csv button
"""
self.q(css="input[name='list-survey']").click()
self.wait_for_ajax()
return self
def check_encoding_utf8(self, checked):
checkbox = self.q(css='input#encoding-utf8')
if checkbox.selected != checked:
checkbox.click()
self.wait_for(lambda: checked == checkbox.selected, 'Checkbox is not clicked')
return self
def is_encoding_utf8_selected(self):
return self.q(css='input#encoding-utf8').selected
class SendEmailPage(PageObject):
"""
Email section of the Instructor dashboard.
"""
url = None
def is_browser_on_page(self):
return self.q(css='a[data-section=send_email].active-section').present
def is_visible_optout_container(self):
"""
Return whether optout container is rendered.
"""
return self.q(css='.optout-container').visible
def select_send_to(self, send_to):
self.q(css="#id_to option").filter(lambda el: el.get_attribute('value') == send_to).first.click()
def set_title(self, title):
self.q(css="input#id_subject").fill(title)
def set_message(self, message):
self.browser.execute_script("tinyMCE.activeEditor.setContent('{}')".format(message))
def check_include_optout(self):
self.q(css="#section-send-email input[name='include-optout']").click()
def send(self):
self.q(css="input[name='send']").click()
def is_visible_advanced_course(self):
return self.q(css="select[name='advanced_course']").visible
def select_advanced_course(self, advanced_course_name):
self.q(css="select[name='advanced_course'] option").filter(lambda el: el.text == advanced_course_name).first.click()
class MembershipPageMemberListSection(EdXMembershipPage):
"""
Member list management section of the Membership tab of the Instructor dashboard.
"""
url = None
def select_role(self, role_name):
for option in self.q(css='#member-lists-selector option').results:
if role_name == option.text:
option.click()
def add_role(self, role_name, member):
self.select_role(role_name)
self.q(css='div[data-rolename="{}"] input.add-field'.format(role_name)).fill(member)
self.q(css='div[data-rolename="{}"] input.add'.format(role_name)).click()
self.wait_for_ajax()
def add_role_by_display_name(self, role_name, member):
self.select_role(role_name)
self.q(css='div[data-display-name="{}"] input.add-field'.format(role_name)).fill(member)
self.q(css='div[data-display-name="{}"] input.add'.format(role_name)).click()
self.wait_for_ajax()
|
nttks/edx-platform
|
common/test/acceptance/pages/lms/ga_instructor_dashboard.py
|
Python
|
agpl-3.0
| 3,984
|
import logging
from django.db import IntegrityError, transaction
import traceback
import sys
from moveon.models import Company, Transport, Line, Station, Node, Route, Stretch, RoutePoint
logger = logging.getLogger(__name__)
class OSMLineManager():
def __init__(self, osmline):
self.osmline = osmline
self.stations = dict()
self.routes = []
self.nodes = dict()
self.stretches = dict()
def save(self):
try:
with transaction.atomic():
self._save_line()
self._save_nodes()
self._save_stations()
self._assign_stations_to_line()
self._save_routes()
self._create_default_stretches()
self._save_route_points()
except IntegrityError:
print("Exception in user code:")
print("-"*60)
traceback.print_exc(file=sys.stdout)
print("-"*60)
def _save_line(self):
logger.debug('Saving line')
company = Company.objects.get_by_code(self.osmline['company'])
transport = Transport.objects.get_by_name(self.osmline['transport'])
self.line = Line.from_osm_adapter_data(self.osmline)
self.line.company = company
self.line.transport = transport
self.line.save()
def _save_nodes(self):
logger.debug('Saving nodes')
for osmnode in self.osmline['route_points'].values():
try:
node = Node.objects.get_by_id(osmnode['osmid'])
except Node.DoesNotExist:
node = Node.from_osm_adapter_data(osmnode)
node.save()
self.nodes[node.osmid] = node
def _save_stations(self):
logger.debug('Saving stations')
for osmstation in self.osmline['stations'].values():
try:
station = Station.objects.get_by_id(osmstation['osmid'])
except Station.DoesNotExist:
station = Station.from_osm_adapter_data(osmstation)
station.stop_node = self.nodes[osmstation['stop_node']]
station.save()
self.stations[station.osmid] = station
self.nodes[station.osmid] = station
def _assign_stations_to_line(self):
logger.debug('Assigning stations to line')
self.line.stations = self.stations.values()
self.line.save()
def _save_routes(self):
logger.debug('Saving routes')
for osmroute in self.osmline['routes'].values():
route = Route.from_osm_adapter_data(osmroute)
route.line = self.line
route.save()
self.routes.append(route)
def _create_default_stretches(self):
logger.debug('Creating default stretches')
for route in self.routes:
stretch = Stretch()
stretch.route = route
stretch.save()
self.stretches[route.osmid] = stretch
def _save_route_points(self):
logger.debug('Saving route points')
for osmroute in self.osmline['routes'].values():
routepoints = []
for osmroutepoint_collection in osmroute['route_points'].values():
for osmroutepoint in osmroutepoint_collection:
routepoint = RoutePoint.from_osm_adapter_data(osmroutepoint)
routepoint.node = self.nodes[osmroutepoint['node_id']]
routepoint.stretch = self.stretches[osmroute['osmid']]
routepoint.save()
routepoints.append(routepoint)
routepoints.sort(key=lambda x: x.order)
station_from = self.stations[routepoints[1].node_id]
station_to = self.stations[routepoints[len(routepoints)-1].node_id]
stretch = self.stretches[osmroute['osmid']]
stretch.station_from = station_from
stretch.station_to = station_to
|
SeGarVi/moveon-web
|
moveon/osmlinemanager.py
|
Python
|
agpl-3.0
| 4,081
|
# coding: utf-8
# Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public transport:
# a non ending quest to the responsive locomotion way of traveling!
#
# LICENCE: This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Stay tuned using
# twitter @navitia
# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org
# https://groups.google.com/d/forum/navitia
# www.navitia.io
from __future__ import absolute_import, print_function, division
from tests.check_utils import api_get, api_post, api_delete, api_put, _dt
import json
import pytest
import mock
from navitiacommon import models
from tyr.rabbit_mq_handler import RabbitMqHandler
from tyr import app
import urllib
@pytest.fixture
def geojson_polygon():
return {
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]],
},
}
@pytest.fixture
def geojson_multipolygon():
return {
"type": "Feature",
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]],
[
[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]],
[[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]],
],
],
},
}
@pytest.fixture
def invalid_geojsonfixture():
return {"type": "Feature", "geometry": {"type": "Point", "coordinates": []}}
@pytest.fixture
def create_user(geojson_polygon):
with app.app_context():
user = models.User('test', 'test@example.com')
user.end_point = models.EndPoint.get_default()
user.billing_plan = models.BillingPlan.get_default(user.end_point)
user.shape = json.dumps(geojson_polygon)
models.db.session.add(user)
models.db.session.commit()
return user.id
@pytest.fixture
def create_user_without_shape():
with app.app_context():
user = models.User('test', 'test@example.com')
user.end_point = models.EndPoint.get_default()
user.billing_plan = models.BillingPlan.get_default(user.end_point)
models.db.session.add(user)
models.db.session.commit()
return user.id
@pytest.fixture
def create_instance():
with app.app_context():
instance = models.Instance('instance')
models.db.session.add(instance)
models.db.session.commit()
return instance.id
@pytest.yield_fixture
def mock_rabbit():
with mock.patch.object(RabbitMqHandler, 'publish') as m:
yield m
@pytest.fixture
def create_multiple_users(request, geojson_polygon):
with app.app_context():
end_point = models.EndPoint()
end_point.name = 'myEndPoint'
billing_plan = models.BillingPlan()
billing_plan.name = 'free'
billing_plan.end_point = end_point
user1 = models.User('foo', 'foo@example.com')
user1.end_point = end_point
user1.billing_plan = billing_plan
user1.shape = json.dumps(geojson_polygon)
user2 = models.User('foodefault', 'foo@example.com')
user2.end_point = models.EndPoint.get_default()
user2.billing_plan = models.BillingPlan.get_default(user2.end_point)
models.db.session.add(end_point)
models.db.session.add(billing_plan)
models.db.session.add(user1)
models.db.session.add(user2)
models.db.session.commit()
# we end the context but need to keep some id for later (object won't survive this lost!)
d = {'user1': user1.id, 'user2': user2.id, 'end_point': end_point.id, 'billing_plan': billing_plan.id}
# we can't truncate end_point and billing_plan, so we have to delete them explicitly
def teardown():
with app.app_context():
end_point = models.EndPoint.query.get(d['end_point'])
billing_plan = models.BillingPlan.query.get(d['billing_plan'])
models.db.session.delete(end_point)
models.db.session.delete(billing_plan)
models.db.session.commit()
request.addfinalizer(teardown)
return d
@pytest.fixture
def create_billing_plan():
with app.app_context():
billing_plan = models.BillingPlan(
name='test',
max_request_count=10,
max_object_count=100,
end_point_id=models.EndPoint.get_default().id,
)
models.db.session.add(billing_plan)
models.db.session.commit()
return billing_plan.id
def test_get_users_empty():
resp = api_get('/v0/users/')
assert resp == []
def test_add_user_without_shape(mock_rabbit):
"""
creation of a user without shape
When we get this user, we should see
shape = None and has_shape = False
"""
user = {'login': 'user1', 'email': 'user1@example.com'}
data = json.dumps(user)
resp = api_post('/v0/users/', data=data, content_type='application/json')
def check(u):
gen = (k for k in user if k != 'shape')
for k in gen:
assert u[k] == user[k]
assert u['end_point']['name'] == 'navitia.io'
assert u['type'] == 'with_free_instances'
assert u['block_until'] is None
check(resp)
assert resp['shape'] is None
assert resp['has_shape'] is False
assert mock_rabbit.called
# we did not give any coord, so we don't have some
assert resp['default_coord'] is None
# with disable_geojson=true by default
resp = api_get('/v0/users/')
assert len(resp) == 1
check(resp[0])
assert resp[0]['shape'] is None
assert resp[0]['has_shape'] is False
# with disable_geojson=false
resp = api_get('/v0/users/?disable_geojson=false')
assert len(resp) == 1
check(resp[0])
assert resp[0]['shape'] is None
assert resp[0]['has_shape'] is False
def test_add_user(mock_rabbit, geojson_polygon):
"""
creation of a user passing arguments as a json
"""
coord = '2.37730;48.84550'
user = {
'login': 'user1',
'email': 'user1@example.com',
'shape': geojson_polygon,
'has_shape': True,
'default_coord': coord,
}
data = json.dumps(user)
resp = api_post('/v0/users/', data=data, content_type='application/json')
def check(u):
gen = (k for k in user if k != 'shape')
for k in gen:
assert u[k] == user[k]
assert u['end_point']['name'] == 'navitia.io'
assert u['type'] == 'with_free_instances'
assert u['block_until'] is None
check(resp)
assert resp['shape'] == geojson_polygon
assert resp['default_coord'] == coord
resp = api_get('/v0/users/')
assert len(resp) == 1
check(resp[0])
assert resp[0]['shape'] == {}
assert mock_rabbit.called
def test_add_user_with_multipolygon(mock_rabbit, geojson_multipolygon):
"""
creation of a user with multipolygon shape
status must be 200 when bragi will accept multipolygon shape
"""
user = {'login': 'user1', 'email': 'user1@example.com', 'shape': geojson_multipolygon, 'has_shape': True}
data = json.dumps(user)
resp, status = api_post('/v0/users/', check=False, data=data, content_type='application/json')
assert status == 400
assert mock_rabbit.call_count == 0
def test_add_user_with_invalid_geojson(mock_rabbit, invalid_geojsonfixture):
"""
creation of a user passing arguments as a json
"""
user = {'login': 'user1', 'email': 'user1@example.com', 'shape': invalid_geojsonfixture, 'has_shape': True}
data = json.dumps(user)
resp, status = api_post('/v0/users/', check=False, data=data, content_type='application/json')
assert status == 400
assert mock_rabbit.call_count == 0
def test_add_user_with_invalid_coord(mock_rabbit):
"""
creation of a user passing wrongly formated coord
"""
user = {'login': 'user1', 'email': 'user1@example.com', 'default_coord': 'bob'}
data = json.dumps(user)
resp, status = api_post('/v0/users/', check=False, data=data, content_type='application/json')
assert status == 400
assert mock_rabbit.call_count == 0
def test_add_user_with_plus(mock_rabbit):
"""
creation of a user with a "+" in the email
"""
user = {'login': 'user1+test@example.com', 'email': 'user1+test@example.com'}
resp = api_post('/v0/users/', data=json.dumps(user), content_type='application/json')
def check(u):
for k in user.iterkeys():
assert u[k] == user[k]
assert u['end_point']['name'] == 'navitia.io'
assert u['type'] == 'with_free_instances'
assert u['block_until'] is None
check(resp)
resp = api_get('/v0/users/')
assert len(resp) == 1
check(resp[0])
assert mock_rabbit.called
def test_add_user_with_plus_no_json(mock_rabbit):
"""
creation of a user with a "+" in the email
"""
user = {'login': 'user1+test@example.com', 'email': 'user1+test@example.com'}
resp = api_post('/v0/users/', data=user)
def check(u):
for k in user.iterkeys():
assert u[k] == user[k]
assert u['end_point']['name'] == 'navitia.io'
assert u['type'] == 'with_free_instances'
assert u['block_until'] is None
check(resp)
resp = api_get('/v0/users/')
assert len(resp) == 1
check(resp[0])
assert mock_rabbit.called
def test_add_user_with_plus_in_query(mock_rabbit):
"""
creation of a user with a "+" in the email
"""
user = {'email': 'user1+test@example.com', 'login': 'user1+test@example.com'}
_, status = api_post('/v0/users/?login={email}&email={email}'.format(email=user['email']), check=False)
assert status == 400
resp = api_post('/v0/users/?login={email}&email={email}'.format(email=urllib.quote(user['email'])))
def check(u):
for k in user.iterkeys():
assert u[k] == user[k]
assert u['end_point']['name'] == 'navitia.io'
assert u['type'] == 'with_free_instances'
assert u['block_until'] is None
check(resp)
resp = api_get('/v0/users/')
assert len(resp) == 1
check(resp[0])
assert mock_rabbit.called
def test_add_duplicate_login_user(create_user, mock_rabbit):
user = {'login': 'test', 'email': 'user1@example.com'}
resp, status = api_post('/v0/users/', check=False, data=json.dumps(user), content_type='application/json')
assert status == 409
assert mock_rabbit.call_count == 0
def test_add_duplicate_email_user(create_user, mock_rabbit):
user = {'login': 'user', 'email': 'test@example.com'}
resp, status = api_post('/v0/users/', check=False, data=json.dumps(user), content_type='application/json')
assert status == 409
assert mock_rabbit.call_count == 0
def test_add_user_invalid_email(mock_rabbit):
"""
creation of a user with an invalid email
"""
user = {'login': 'user1', 'email': 'user1'}
resp, status = api_post('/v0/users/', check=False, data=json.dumps(user), content_type='application/json')
assert status == 400
assert mock_rabbit.call_count == 0
def test_add_user_invalid_endpoint(mock_rabbit):
"""
creation of a user with an invalid endpoint
"""
user = {'login': 'user1', 'email': 'user1@example.com', 'end_point_id': 100}
resp, status = api_post('/v0/users/', check=False, data=json.dumps(user), content_type='application/json')
assert status == 400
assert mock_rabbit.call_count == 0
def test_add_user_invalid_billingplan(mock_rabbit):
"""
creation of a user with an invalid endpoint
"""
user = {'login': 'user1', 'email': 'user1@example.com', 'billing_plan_id': 100}
resp, status = api_post('/v0/users/', check=False, data=json.dumps(user), content_type='application/json')
assert status == 400
assert mock_rabbit.call_count == 0
def test_add_user_invalid_type(mock_rabbit):
"""
creation of a user with an invalid endpoint
"""
user = {'login': 'user1', 'email': 'user1@example.com', 'type': 'foo'}
resp, status = api_post('/v0/users/', check=False, data=json.dumps(user), content_type='application/json')
assert status == 400
assert mock_rabbit.call_count == 0
def test_multiple_users(create_multiple_users, mock_rabbit):
"""
check the list
"""
resp = api_get('/v0/users/')
assert len(resp) == 2
user1_found = False
user2_found = False
for u in resp:
if u['id'] == create_multiple_users['user1']:
user1_found = True
assert u['login'] == 'foo'
assert u['email'] == 'foo@example.com'
assert u['end_point']['name'] == 'myEndPoint'
assert u['billing_plan']['name'] == 'free'
if u['id'] == create_multiple_users['user2']:
user2_found = True
assert u['login'] == 'foodefault'
assert u['email'] == 'foo@example.com'
assert u['end_point']['name'] == 'navitia.io'
assert u['billing_plan']['name'] == 'nav_ctp'
assert user1_found
assert user2_found
assert mock_rabbit.call_count == 0
def test_delete_user(create_multiple_users, mock_rabbit):
"""
delete a user
"""
resp, status = api_delete('/v0/users/{}'.format(create_multiple_users['user1']), check=False, no_json=True)
assert status == 204
resp, status = api_get('/v0/users/{}'.format(create_multiple_users['user1']), check=False)
assert status == 404
resp = api_get('/v0/users/')
assert len(resp) == 1
u = resp[0]
assert u['id'] == create_multiple_users['user2']
assert u['login'] == 'foodefault'
assert u['email'] == 'foo@example.com'
assert u['end_point']['name'] == 'navitia.io'
assert u['billing_plan']['name'] == 'nav_ctp'
assert mock_rabbit.call_count == 1
def test_delete_invalid_user(create_multiple_users, mock_rabbit):
"""
we try to delete an invalid users, this must fail and after that we check out users to be sure
"""
to_delete = 0
while to_delete in create_multiple_users.values():
to_delete = to_delete + 1
resp, status = api_delete('/v0/users/{}'.format(to_delete), check=False, no_json=True)
assert status == 404
resp = api_get('/v0/users/')
assert len(resp) == 2
assert mock_rabbit.call_count == 0
def test_update_invalid_user(mock_rabbit):
"""
we try to update a user who dosn't exist
"""
user = {'login': 'user1', 'email': 'user1@example.com'}
resp, status = api_put('/v0/users/10', check=False, data=json.dumps(user), content_type='application/json')
assert status == 404
assert mock_rabbit.call_count == 0
def test_update_user(create_multiple_users, mock_rabbit, geojson_polygon):
"""
we update a user
"""
user = {'login': 'user1', 'email': 'user1@example.com', 'shape': geojson_polygon}
resp = api_put(
'/v0/users/{}'.format(create_multiple_users['user1']),
data=json.dumps(user),
content_type='application/json',
)
def check(u):
for k in user.iterkeys():
assert u[k] == user[k]
assert resp['id'] == create_multiple_users['user1']
assert resp['login'] == user['login']
assert resp['email'] == user['email']
check(resp)
assert mock_rabbit.called
def test_update_block_until(create_multiple_users, mock_rabbit, geojson_polygon):
"""
we update a user
"""
user = {'block_until': '20160128T111200Z'}
resp = api_put(
'/v0/users/{}'.format(create_multiple_users['user1']),
data=json.dumps(user),
content_type='application/json',
)
assert resp['id'] == create_multiple_users['user1']
assert resp['block_until'] == '2016-01-28T11:12:00'
assert resp['shape'] == geojson_polygon
assert mock_rabbit.called
def test_update_shape(create_multiple_users, mock_rabbit, geojson_polygon):
"""
we update a user
"""
user = {'shape': geojson_polygon}
resp = api_put(
'/v0/users/{}'.format(create_multiple_users['user1']),
data=json.dumps(user),
content_type='application/json',
)
def check(u):
for k in user.iterkeys():
assert u[k] == user[k]
assert resp['id'] == create_multiple_users['user1']
check(resp)
assert mock_rabbit.called
def test_update_shape_with_none(create_multiple_users, mock_rabbit):
"""
we update a user
"""
user = {'shape': None}
resp = api_put(
'/v0/users/{}'.format(create_multiple_users['user1']),
data=json.dumps(user),
content_type='application/json',
)
assert resp['id'] == create_multiple_users['user1']
assert resp['shape'] is None
assert mock_rabbit.called
def test_update_shape_with_empty(create_multiple_users, mock_rabbit, geojson_polygon):
"""
we update a user
"""
user = {'shape': {}}
resp = api_put(
'/v0/users/{}'.format(create_multiple_users['user1']),
data=json.dumps(user),
content_type='application/json',
)
assert resp['id'] == create_multiple_users['user1']
assert resp['shape'] == geojson_polygon
assert mock_rabbit.called
def test_full_registration_then_deletion(create_instance, mock_rabbit):
"""
we create a user, then a token for him, and finaly we give to him some authorization
after that we delete him
"""
user = {'login': 'user1', 'email': 'user1@example.com'}
resp_user = api_post('/v0/users/', data=json.dumps(user), content_type='application/json')
api_post(
'/v0/users/{}/keys'.format(resp_user['id']),
data=json.dumps({'app_name': 'myApp'}),
content_type='application/json',
)
auth = {'instance_id': create_instance, 'api_id': 1}
api_post(
'/v0/users/{}/authorizations'.format(resp_user['id']),
data=json.dumps(auth),
content_type='application/json',
)
resp = api_get('/v0/users/{}'.format(resp_user['id']))
assert len(resp['keys']) == 1
assert resp['keys'][0]['app_name'] == 'myApp'
assert len(resp['authorizations']) == 1
assert resp['authorizations'][0]['instance']['name'] == 'instance'
_, status = api_delete('/v0/users/{}'.format(resp_user['id']), check=False, no_json=True)
assert status == 204
assert mock_rabbit.called
_, status = api_get('/v0/users/{}'.format(resp_user['id']), check=False)
assert status == 404
def test_deletion_keys_and_auth(create_instance, mock_rabbit):
"""
We start by creating the user, it's easier than using a fixture, then we delete the auth and the key
"""
# first, test that with an unknown user, we get a 404
_, status = api_delete('/v0/users/75/keys/1', check=False, no_json=True)
assert status == 404
user = {'login': 'user1', 'email': 'user1@example.com'}
resp_user = api_post('/v0/users/', data=json.dumps(user), content_type='application/json')
api_post(
'/v0/users/{}/keys'.format(resp_user['id']),
data=json.dumps({'app_name': 'myApp'}),
content_type='application/json',
)
auth = {'instance_id': create_instance, 'api_id': 1}
api_post(
'/v0/users/{}/authorizations'.format(resp_user['id']),
data=json.dumps(auth),
content_type='application/json',
)
resp = api_get('/v0/users/{}'.format(resp_user['id']))
resp_key = api_delete(
'/v0/users/{user_id}/keys/{key_id}'.format(user_id=resp['id'], key_id=resp['keys'][0]['id'])
)
assert len(resp_key['keys']) == 0
resp_auth = api_delete(
'/v0/users/{}/authorizations/'.format(resp['id']), data=json.dumps(auth), content_type='application/json'
)
assert len(resp_auth['authorizations']) == 0
assert mock_rabbit.called
def test_get_user_with_shape(create_user, geojson_polygon):
"""
We start by creating the user with a shape,
and we test that the attribute shape={} and has_shape = True
"""
print(api_get('/v0/users'))
resp = api_get('/v0/users/{}'.format(create_user))
assert resp['has_shape'] is True
assert resp['shape'] == {}
def test_get_user_with_shape_and_disable_geojson_param_false(create_user, geojson_polygon):
"""
We start by creating the user with a shape.
We request the user with parameter disable_geojson=true
We test that shape = geojson and has_shape = True
"""
resp = api_get('/v0/users/{}?disable_geojson=false'.format(create_user))
assert resp['has_shape'] is True
assert resp['shape'] == geojson_polygon
def test_get_user_without_shape(create_user_without_shape):
"""
We start by creating the user without shape,
and we test that shape = None and has_shape = False
"""
resp = api_get('/v0/users/{}'.format(create_user_without_shape))
print(resp['shape'])
assert resp['has_shape'] is False
assert resp['shape'] is None
assert resp['shape'] is None
def test_get_user_without_shape_and_disable_geojson_param_false(create_user_without_shape):
"""
We start by creating the user without shape.
We request the user with parameter disable_geojson=true
We test that shape = None and has_shape = False
"""
resp = api_get('/v0/users/{}?disable_geojson=false'.format(create_user_without_shape))
assert resp['has_shape'] is False
assert resp['shape'] is None
def test_get_users(create_multiple_users):
"""
We start by creating a user with a shape and a user without shape,
we test that:
user1.has_shape = True
user1.shape = {}
user2.has_shape = False
user2.shape = None
"""
resp = api_get('/v0/users')
foo = next((u for u in resp if u.get('login') == 'foo'), None)
assert foo
assert foo.get('has_shape') is True
assert foo.get('shape') == {}
foodefault = next((u for u in resp if u.get('login') == 'foodefault'), None)
assert foodefault
assert foodefault.get('has_shape') is False
assert foodefault.get('shape') is None
def test_get_users_with_disable_geojson_false(create_multiple_users, geojson_polygon):
"""
We start by creating a user with a shape and a user without shape,
we test that requesting /users?disable_geojson=false:
user1.has_shape = True
user1.shape = geojson
user2.has_shape = False
user2.shape = None
"""
resp = api_get('/v0/users?disable_geojson=false')
foo = next((u for u in resp if u.get('login') == 'foo'), None)
assert foo
assert foo.get('has_shape') is True
assert foo.get('shape') == geojson_polygon
foodefault = next((u for u in resp if u.get('login') == 'foodefault'), None)
assert foodefault
assert foodefault.get('has_shape') is False
assert foodefault.get('shape') is None
def test_get_billing_plan(create_billing_plan):
"""
We create a billing_plan.
"""
resp = api_get('/v0/billing_plans/{}'.format(create_billing_plan))
assert resp['name'] == 'test'
assert resp['max_request_count'] == 10
assert resp['max_object_count'] == 100
def test_delete_billing_plan(create_billing_plan):
"""
We start by creating a billing_plan.
Delete the billing_plan
"""
resp = api_get('/v0/billing_plans/{}'.format(create_billing_plan))
_, status = api_delete('/v0/billing_plans/{}'.format(resp['id']), check=False, no_json=True)
assert status == 204
def test_delete_billing_plan_used_by_an_user(create_user, geojson_polygon):
"""
We start by creating the user with a shape.
We request the user with parameter disable_geojson=false
A default billing_plan is created and used with name = 'nav_ctp'
We try to delete the billing_plan of this user but in vain.
"""
resp = api_get('/v0/users/{}?disable_geojson=false'.format(create_user))
assert resp['billing_plan']['name'] == 'nav_ctp'
assert resp['has_shape'] is True
assert resp['shape'] == geojson_polygon
_, status = api_delete('/v0/billing_plans/{}'.format(resp['billing_plan']['id']), check=False, no_json=True)
assert status == 409
def test_filter_users_by_key(create_user, create_multiple_users):
resp_users = api_get('/v0/users')
assert len(resp_users) == 3
for user in resp_users:
api_post(
'/v0/users/{}/keys'.format(user['id']),
data=json.dumps({'app_name': 'myApp'}),
content_type='application/json',
)
resp_user = api_get('/v0/users/{}'.format(user['id']))
assert len(resp_user['keys']) == 1
assert 'token' in resp_user['keys'][0]
token = resp_user['keys'][0]['token']
resp_token = api_get('/v0/users?key={}'.format(token))
assert resp_token['id'] == user['id']
|
kinnou02/navitia
|
source/tyr/tests/integration/users_test.py
|
Python
|
agpl-3.0
| 25,630
|
# -*- coding: utf-8 -*-
import logging
import time
_logger = logging.getLogger(__name__)
from openerp import http
from openerp.addons.hw_proxy.controllers.main import Proxy
# drivers modules must add to drivers an object with a get_status() method
# so that 'status' can return the status of all active drivers
drivers = {}
from threading import Thread, Lock
from Queue import Queue, Empty
from openerp.http import request
import requests
import json
from openerp import exceptions
from pprint import pprint as pp
class IPFDriver(Thread):
def __init__(self):
Thread.__init__(self)
self.queue = Queue()
self.lock = Lock()
self.status = {'status':'connecting', 'messages':[]}
self.ipf_host = False
self.nif = False
self.pos_reference = False
self.user_id = False
self.ipf_odoo = False
self.ipf_ip = False
self.env = False
def lockedstart(self):
with self.lock:
if not self.isAlive():
self.daemon = True
self.start()
def connected_usb_devices(self):
# for device in self.supported_devices():
# if usb.core.find(idVendor=device['vendor'], idProduct=device['product']) != None:
# connected.append(device)
return {}
def set_status(self, status, message = None):
_logger.info(status+' : '+ (message or 'no message'))
if status == self.status['status']:
if message != None and (len(self.status['messages']) == 0 or message != self.status['messages'][-1]):
self.status['messages'].append(message)
else:
self.status['status'] = status
if message:
self.status['messages'] = [message]
else:
self.status['messages'] = []
if status == 'error' and message:
_logger.error('ESC/POS Error: '+message)
elif status == 'disconnected' and message:
_logger.warning('ESC/POS Device Disconnected: '+message)
def get_escpos_printer(self):
try:
printer = requests.get(self.ipf_host+"/state", headers={"Content-Type": "application/json"})
status_code = printer.status_code
if status_code == 200:
resp = printer.json()
if resp["response"]["printer_status"].get("state", False) == "online":
self.set_status('connected', 'Connected to impresora fiscal epson')
return resp
else:
self.set_status('disconnected', 'La interface no se puede comunicar con la impresora.')
return resp
elif status_code == 404:
self.set_status('disconnected', 'Fallo la conexion con el print-server de la impresora 404')
return None
else:
self.set_status('disconnected', 'Fallo la conexion con el print-server de la impresora 404')
return None
except Exception:
self.set_status('disconnected', 'Fallo la conexion con el print-server de la impresora NO HOST')
return None
except requests.exceptions.ConnectionError:
raise Exception
self.set_status('disconnected', 'Fallo la conexion con el print-server de la impresora NO HOST')
return None
def get_status(self):
self.push_task('status')
return self.status
def print_ipf(self):
self.push_task('ipf_print')
return self.nif
def send_ipf(self):
pass
def run(self):
if not self.ipf_host:
_logger.error('ESC/POS cannot initialize, please verify system dependencies.')
return
while True:
try:
error = True
timestamp, task, data = self.queue.get(True)
printer = self.get_escpos_printer()
if printer == None:
if task != 'status':
self.queue.put((timestamp,task,data))
error = False
time.sleep(5)
continue
# elif task == 'receipt':
# if timestamp >= time.time() - 1 * 60 * 60:
# self.print_receipt_body(printer,data)
# printer.cut()
elif task == 'ipf_print':
if timestamp >= time.time() - 1 * 60 * 60:
self.send_ipf()
# elif task == 'cashbox':
# if timestamp >= time.time() - 12:
# self.open_cashbox(printer)
elif task == 'printstatus':
# self.print_status(printer)
pass
elif task == 'status':
pass
error = False
except Exception as e:
self.stop_request = True
# except HandleDeviceError as e:
# print "Impossible to handle the device due to previous error %s" % str(e)
# except TicketNotPrinted as e:
# print "The ticket does not seems to have been fully printed %s" % str(e)
# except NoStatusError as e:
# print "Impossible to get the status of the printer %s" % str(e)
# except Exception as e:
# self.set_status('error', str(e))
# errmsg = str(e) + '\n' + '-'*60+'\n' + traceback.format_exc() + '-'*60 + '\n'
# _logger.error(errmsg);
finally:
if error:
self.queue.put((timestamp, task, data))
# if printer:
# printer.close()
def push_task(self, task, data = None):
self.lockedstart()
self.queue.put((time.time(), task ,data))
ipfdriver = IPFDriver()
class Proxy(Proxy):
def get_status(self):
statuses = {}
for driver in drivers:
statuses[driver] = drivers[driver].get_status()
return statuses
@http.route('/hw_proxy/status_json', type='json', auth='none', cors='*')
def status_json(self, ipf_odoo=False, ipf_ip=False):
if ipf_odoo and ipf_ip:
return self.get_ipf_status(ipf_ip)
return self.get_status()
def get_ipf_status(self, ipf_ip):
ipfdriver.ipf_host = ipf_ip
status = ipfdriver.get_status()
# _logger(status)
return status
@http.route('/hw_proxy/print_ipf_receipt', type='json', auth='user', cors='*')
def print_ipf_receipt(self, receipt, ipf_odoo=False, ipf_ip=False, ipf_host=False):
uid = receipt.get("uid", False)
if uid and ipf_odoo and ipf_ip:
time.sleep(2)
ipf_obj = request.env["ipf.printer.config"]
invoice_exists = False
while not invoice_exists:
request.env.cr.execute("SELECT invoice_id FROM pos_order WHERE pos_reference ILIKE %s", ("%{}%".format(uid),))
invoice_exists = request.env.cr.fetchone()
request.env.cr.commit()
if invoice_exists:
ipf_dict = request.env["ipf.printer.config"].with_context(active_model="account.invoice", active_id=invoice_exists[0], ipf_host=ipf_host).ipf_print()
if ipf_dict:
try:
resp = requests.post("{}{}".format(ipf_ip, "/invoice"), data=json.dumps(ipf_dict))
if resp.json().get("status", False) == "success":
response = resp.json().get("response", False)
id = ipf_dict.get("invoice_id")
nif = response.get("nif", "")
return request.env["account.invoice"].browse(id).write({"nif": nif})
else:
return False
except Exception:
return ipfdriver.set_status('disconnected', 'Fallo la conexion con el print-server de la impresora NO HOST')
|
MarcosCommunity/odoo
|
marcos_addons/marcos_pos/hw_proxy/main.py
|
Python
|
agpl-3.0
| 8,125
|
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("moderation_queue", "0012_auto_20150717_0811")]
operations = [
migrations.AlterField(
model_name="queuedimage",
name="why_allowed",
field=models.CharField(
default=b"other",
max_length=64,
choices=[
(
b"public-domain",
"This photograph is free of any copyright restrictions",
),
(
b"copyright-assigned",
"I own copyright of this photo and I assign the copyright to Democracy Club Limited in return for it being displayed on this site",
),
(
b"profile-photo",
"This is the candidate's public profile photo from social media (e.g. Twitter, Facebook) or their official campaign page",
),
(b"other", "Other"),
],
),
)
]
|
DemocracyClub/yournextrepresentative
|
ynr/apps/moderation_queue/migrations/0013_auto_20150916_1753.py
|
Python
|
agpl-3.0
| 1,141
|
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2018: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alignak is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Alignak. If not, see <http://www.gnu.org/licenses/>.
#
#
# This file incorporates work covered by the following copyright and
# permission notice:
#
# Copyright (C) 2009-2014:
# Grégory Starck, g.starck@gmail.com
# Sebastien Coavoux, s.coavoux@free.fr
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Shinken is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Shinken. If not, see <http://www.gnu.org/licenses/>.
"""
This module is used for common variables in Alignak.
Previously some of those variables were linked to a specific class which made no sense.
"""
import signal
from collections import namedtuple
try:
from setproctitle import setproctitle # pylint: disable=unused-import
except ImportError as err: # pragma: no cover, setproctitle is in the requirements.txt
def setproctitle(title):
"""
Return the name of the process
:param title: name of process
:type title: str
:return: None
"""
# Do nothing...
return title
# Friendly names for the system signals
SIGNALS_TO_NAMES_DICT = dict((k, v) for v, k in reversed(sorted(signal.__dict__.items()))
if v.startswith('SIG') and not v.startswith('SIG_'))
ModAttr = namedtuple('ModAttr', ['modattr', 'attribute', 'value'])
DICT_MODATTR = {
"MODATTR_NONE": ModAttr("MODATTR_NONE", "", 0),
"MODATTR_NOTIFICATIONS_ENABLED":
ModAttr("MODATTR_NOTIFICATIONS_ENABLED", "notifications_enabled", 1),
"notifications_enabled": ModAttr("MODATTR_NOTIFICATIONS_ENABLED", "notifications_enabled", 1),
"MODATTR_ACTIVE_CHECKS_ENABLED":
ModAttr("MODATTR_ACTIVE_CHECKS_ENABLED", "active_checks_enabled", 2),
"active_checks_enabled": ModAttr("MODATTR_ACTIVE_CHECKS_ENABLED", "active_checks_enabled", 2),
"MODATTR_PASSIVE_CHECKS_ENABLED":
ModAttr("MODATTR_PASSIVE_CHECKS_ENABLED", "passive_checks_enabled", 4),
"passive_checks_enabled":
ModAttr("MODATTR_PASSIVE_CHECKS_ENABLED", "passive_checks_enabled", 4),
"MODATTR_EVENT_HANDLER_ENABLED":
ModAttr("MODATTR_EVENT_HANDLER_ENABLED", "event_handler_enabled", 8),
"event_handler_enabled": ModAttr("MODATTR_EVENT_HANDLER_ENABLED", "event_handler_enabled", 8),
"MODATTR_FLAP_DETECTION_ENABLED":
ModAttr("MODATTR_FLAP_DETECTION_ENABLED", "flap_detection_enabled", 16),
"flap_detection_enabled":
ModAttr("MODATTR_FLAP_DETECTION_ENABLED", "flap_detection_enabled", 16),
"MODATTR_PERFORMANCE_DATA_ENABLED":
ModAttr("MODATTR_PERFORMANCE_DATA_ENABLED", "process_performance_data", 64),
"process_performance_data":
ModAttr("MODATTR_PERFORMANCE_DATA_ENABLED", "process_performance_data", 64),
"MODATTR_EVENT_HANDLER_COMMAND": ModAttr("MODATTR_EVENT_HANDLER_COMMAND", "event_handler", 256),
"event_handler": ModAttr("MODATTR_EVENT_HANDLER_COMMAND", "event_handler", 256),
"MODATTR_CHECK_COMMAND": ModAttr("MODATTR_CHECK_COMMAND", "check_command", 512),
"check_command": ModAttr("MODATTR_CHECK_COMMAND", "check_command", 512),
"MODATTR_NORMAL_CHECK_INTERVAL":
ModAttr("MODATTR_NORMAL_CHECK_INTERVAL", "check_interval", 1024),
"check_interval": ModAttr("MODATTR_NORMAL_CHECK_INTERVAL", "check_interval", 1024),
"MODATTR_RETRY_CHECK_INTERVAL": ModAttr("MODATTR_RETRY_CHECK_INTERVAL", "retry_interval", 2048),
"retry_interval": ModAttr("MODATTR_RETRY_CHECK_INTERVAL", "retry_interval", 2048),
"MODATTR_MAX_CHECK_ATTEMPTS": ModAttr("MODATTR_MAX_CHECK_ATTEMPTS", "max_check_attempts", 4096),
"max_check_attempts": ModAttr("MODATTR_MAX_CHECK_ATTEMPTS", "max_check_attempts", 4096),
"MODATTR_FRESHNESS_CHECKS_ENABLED":
ModAttr("MODATTR_FRESHNESS_CHECKS_ENABLED", "check_freshness", 8192),
"check_freshness": ModAttr("MODATTR_FRESHNESS_CHECKS_ENABLED", "check_freshness", 8192),
"MODATTR_CHECK_TIMEPERIOD": ModAttr("MODATTR_CHECK_TIMEPERIOD", "check_period", 16384),
"check_period": ModAttr("MODATTR_CHECK_TIMEPERIOD", "check_period", 16384),
"MODATTR_CUSTOM_VARIABLE": ModAttr("MODATTR_CUSTOM_VARIABLE", "customs", 32768),
"custom_variable": ModAttr("MODATTR_CUSTOM_VARIABLE", "customs", 32768),
"MODATTR_NOTIFICATION_TIMEPERIOD":
ModAttr("MODATTR_NOTIFICATION_TIMEPERIOD", "notification_period", 65536),
"notification_period": ModAttr("MODATTR_NOTIFICATION_TIMEPERIOD", "notification_period", 65536),
}
|
Alignak-monitoring/alignak
|
alignak/misc/common.py
|
Python
|
agpl-3.0
| 5,657
|
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
{
'name': 'Close residual order',
'version': '0.1',
'category': 'Sales',
'description': '''
Close residual order
Keep a history of element removed for statistics
Manage also an alert procedure for highligh order with residual value
''',
'author': 'Micronaet S.r.l. - Nicola Riolini',
'website': 'http://www.micronaet.it',
'license': 'AGPL-3',
'depends': [
'base',
'sale',
'mx_sale',
'mx_close_order',
],
'init_xml': [],
'demo': [],
'data': [
'security/residual_groups.xml',
#'security/ir.model.access.csv',
'residual_view.xml',
'report/closing_report.xml',
'scheduler.xml',
],
'active': False,
'installable': True,
'auto_install': False,
}
|
Micronaet/micronaet-order
|
close_residual_order/__openerp__.py
|
Python
|
agpl-3.0
| 1,752
|
# -*- encoding: utf-8 -*-
##############################################################################
#
# Author: Luis Felipe Miléo - mileo @ kmee.com.br
# Copyright 2014 KMEE - KM Enterprise Engineering
# https://www.kmee.com.br
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#-
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import orm, fields
import openerp.addons.decimal_precision as dp
class SaleOrderLine(orm.Model):
_inherit = 'sale.order.line'
def _prepare_order_line_invoice_line(self, cr, uid, line,
account_id=False, context=None):
result = super(SaleOrderLine, self)._prepare_order_line_invoice_line(
cr, uid, line, account_id, context)
result['price_unit'] = line.price_unit * (1 - (line.discount or 0.0) / 100.0)
result['discount'] = 0.00
return result
|
kmee/kmee_odoo_brasil_addons
|
__unported__/l10n_br_sale_discount_included_on_invoice/model/sale_order.py
|
Python
|
agpl-3.0
| 1,568
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
data = get_tracking_details(filters)
return columns, data
def get_columns():
return ["Franchise:Link/Franchise:130", "Device ID:data:100", "Sub-Franchise:Link/Sub Franchise:120","Visited (Yes/No):data:120","Visited Date Time:datetime:150","Reason:data:300"]
def get_tracking_details(filters):
#conditions = get_conditions(filters)
return webnotes.conn.sql("""select account_id,device_id,sf_name,visited,visited_date,reason from `tabSub Franchise Visiting Schedule` ORDER BY sf_name,visiting_date """)
|
gangadhar-kadam/powapp
|
selling/report/sub_franchise_visiting_schedule/sub_franchise_visiting_schedule.py
|
Python
|
agpl-3.0
| 845
|
# Ariane CLI Python 3
# Cluster acceptance tests
#
# Copyright (C) 2015 echinopsii
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from ariane_clip3.driver_factory import DriverFactory
from ariane_clip3.mapping import MappingService, Cluster, ClusterService, Container, SessionService, ContainerService
__author__ = 'mffrench'
class ClusterTest(unittest.TestCase):
def test_create_remove_cluster(self):
args = {'type': DriverFactory.DRIVER_REST, 'base_url': 'http://localhost:6969/ariane/',
'user': 'yoda', 'password': 'secret'}
MappingService(args)
new_cluster = Cluster(name="test_create_remove_cluster")
new_cluster.save()
self.assertIsNotNone(new_cluster.id)
self.assertIsNone(new_cluster.remove())
def test_find_cluster(self):
args = {'type': DriverFactory.DRIVER_REST, 'base_url': 'http://localhost:6969/ariane/',
'user': 'yoda', 'password': 'secret'}
MappingService(args)
new_cluster = Cluster(name="test_find_cluster")
new_cluster.save()
self.assertIsNotNone(ClusterService.find_cluster(cid=new_cluster.id))
self.assertIsNotNone(ClusterService.find_cluster(name=new_cluster.name))
new_cluster.remove()
self.assertIsNone(ClusterService.find_cluster(cid=new_cluster.id))
self.assertIsNone(ClusterService.find_cluster(name=new_cluster.name))
def test_get_clusters(self):
args = {'type': DriverFactory.DRIVER_REST, 'base_url': 'http://localhost:6969/ariane/',
'user': 'yoda', 'password': 'secret'}
MappingService(args)
new_cluster = Cluster(name="test_get_clusters")
new_cluster.save()
self.assertTrue(new_cluster in ClusterService.get_clusters())
new_cluster.remove()
self.assertFalse(new_cluster in ClusterService.get_clusters())
def test_cluster_link_to_container(self):
args = {'type': DriverFactory.DRIVER_REST, 'base_url': 'http://localhost:6969/ariane/',
'user': 'yoda', 'password': 'secret'}
MappingService(args)
cluster = Cluster(name="test_cluster_link_to_container")
container = Container(name="test_cluster_link_to_container_container",
gate_uri="ssh://my_host/docker/test_cluster_link_to_container_container",
primary_admin_gate_name="container name space (pid)", company="Docker",
product="Docker", c_type="container")
cluster.add_container(container, False)
self.assertTrue(container in cluster.containers_2_add)
self.assertIsNone(cluster.containers_id)
self.assertIsNone(container.cluster_id)
cluster.save()
self.assertFalse(container in cluster.containers_2_add)
self.assertTrue(container.id in cluster.containers_id)
self.assertTrue(container.cluster_id == cluster.id)
cluster.del_container(container, False)
self.assertTrue(container in cluster.containers_2_rm)
self.assertTrue(container.id in cluster.containers_id)
self.assertTrue(container.cluster_id == cluster.id)
cluster.save()
self.assertFalse(container in cluster.containers_2_rm)
self.assertTrue(cluster.containers_id.__len__() == 0)
self.assertIsNone(container.cluster_id)
cluster.add_container(container)
self.assertTrue(container.id in cluster.containers_id)
self.assertTrue(container.cluster_id == cluster.id)
cluster.del_container(container)
self.assertTrue(cluster.containers_id.__len__() == 0)
self.assertIsNone(container.cluster_id)
container.remove()
cluster.remove()
def test_transac_get_clusters(self):
args = {'type': DriverFactory.DRIVER_REST, 'base_url': 'http://localhost:6969/ariane/',
'user': 'yoda', 'password': 'secret'}
MappingService(args)
SessionService.open_session("test")
new_cluster = Cluster(name="test_transac_get_clusters")
new_cluster.save()
self.assertTrue(new_cluster in ClusterService.get_clusters())
SessionService.commit()
self.assertTrue(new_cluster in ClusterService.get_clusters())
new_cluster.remove()
self.assertTrue(new_cluster not in ClusterService.get_clusters())
SessionService.commit()
self.assertTrue(new_cluster not in ClusterService.get_clusters())
SessionService.close_session()
def test_transac_cluster_link_to_container(self):
args = {'type': DriverFactory.DRIVER_REST, 'base_url': 'http://localhost:6969/ariane/',
'user': 'yoda', 'password': 'secret'}
MappingService(args)
SessionService.open_session("test")
cluster = Cluster(name="test_transac_cluster_link_to_container")
container = Container(name="test_transac_cluster_link_to_container_container",
gate_uri="ssh://my_host/docker/test_transac_cluster_link_to_container_container",
primary_admin_gate_name="container name space (pid)", company="Docker",
product="Docker", c_type="container")
cluster.add_container(container, False)
self.assertTrue(container in cluster.containers_2_add)
self.assertIsNone(cluster.containers_id)
self.assertIsNone(container.cluster_id)
cluster.save()
self.assertTrue(cluster in ClusterService.get_clusters())
self.assertTrue(container in ContainerService.get_containers())
SessionService.commit()
self.assertTrue(cluster in ClusterService.get_clusters())
self.assertTrue(container in ContainerService.get_containers())
self.assertFalse(container in cluster.containers_2_add)
self.assertTrue(container.id in cluster.containers_id)
self.assertTrue(container.cluster_id == cluster.id)
cluster.del_container(container, False)
self.assertTrue(container in cluster.containers_2_rm)
self.assertTrue(container.id in cluster.containers_id)
self.assertTrue(container.cluster_id == cluster.id)
cluster.save()
SessionService.commit()
self.assertFalse(container in cluster.containers_2_rm)
self.assertTrue(cluster.containers_id.__len__() == 0)
self.assertIsNone(container.cluster_id)
cluster.add_container(container)
SessionService.commit()
self.assertTrue(container.id in cluster.containers_id)
self.assertTrue(container.cluster_id == cluster.id)
cluster.del_container(container)
SessionService.commit()
self.assertTrue(cluster.containers_id.__len__() == 0)
self.assertIsNone(container.cluster_id)
container.remove()
cluster.remove()
self.assertFalse(cluster in ClusterService.get_clusters())
self.assertFalse(container in ContainerService.get_containers())
SessionService.commit()
self.assertFalse(cluster in ClusterService.get_clusters())
self.assertFalse(container in ContainerService.get_containers())
SessionService.close_session()
|
echinopsii/net.echinopsii.ariane.community.cli.python3
|
tests/acceptance/mapping/cluster_rest_at.py
|
Python
|
agpl-3.0
| 7,827
|
from django.db.models.signals import post_delete, post_save
from django.db.utils import IntegrityError
from django.dispatch import receiver
from grouprise.features.memberships.models import Membership
from grouprise.features.subscriptions.models import Subscription
@receiver(post_save, sender=Membership)
def membership_saved(sender, instance, created, **kwargs):
if created:
try:
instance.member.subscriptions.create(
subscribed_to_type=instance.group.content_type,
subscribed_to_id=instance.group.id)
except IntegrityError:
pass
@receiver(post_delete, sender=Membership)
def membership_deleted(sender, instance, **kwargs):
try:
subscription = instance.member.subscriptions.get(
subscribed_to_type=instance.group.content_type,
subscribed_to_id=instance.group.id)
subscription.delete()
except Subscription.DoesNotExist:
pass
|
stadtgestalten/stadtgestalten
|
grouprise/features/subscriptions/signals.py
|
Python
|
agpl-3.0
| 979
|
# -*- coding: utf8 -*-
#
# Copyright (C) 2015 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
#
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from openerp import models, fields, api, exceptions, _
from openerp.tools import float_compare
class StockChangeQuantPicking(models.TransientModel):
_name = 'stock.quant.picking'
@api.model
def default_get(self, fields_list):
quants = self.env['stock.quant'].browse(self.env.context['active_ids'])
products = quants.mapped('product_id')
if len(products) != 1:
raise exceptions.except_orm(_("Error!"), _("Impossible to reserve quants of different products."))
return {}
partner_id = fields.Many2one('res.partner', string='Partner')
picking_id = fields.Many2one('stock.picking', string='Picking', context={'reserving_quant': True})
move_id = fields.Many2one('stock.move', string='Stock move', required=True, context={'reserving_quant': True},
index=True)
@api.onchange('partner_id')
def onchange_partner_id(self):
self.ensure_one()
self.picking_id = False
self.move_id = False
quant = self.env['stock.quant'].browse(self.env.context['active_ids'][0])
parent_locations = quant.location_id
parent_location = quant.location_id
while parent_location.location_id and parent_location.location_id.usage in ['internal', 'transit']:
parent_locations |= parent_location.location_id
parent_location = parent_location.location_id
move_domain = [('picking_id', '!=', False),
('product_id', '=', quant.product_id.id),
('state', 'in', ['confirmed', 'waiting', 'assigned']),
'|', ('location_id', 'child_of', quant.location_id.id),
('location_id', 'in', parent_locations.ids)]
if self.partner_id:
groups = self.env['procurement.group'].search([('partner_id', '=', self.partner_id.id)])
move_domain += [('picking_id.group_id', 'in', groups.ids)]
moves = self.env['stock.move'].search(move_domain)
picking_domain = [('id', 'in', moves.mapped('picking_id').ids)]
return {'domain': {'picking_id': picking_domain, 'move_id': move_domain}}
@api.onchange('picking_id')
def onchange_picking_id(self):
self.ensure_one()
self.move_id = False
quant = self.env['stock.quant'].browse(self.env.context['active_ids'][0])
parent_locations = quant.location_id
parent_location = quant.location_id
while parent_location.location_id and parent_location.location_id.usage in ['internal', 'transit']:
parent_locations |= parent_location.location_id
parent_location = parent_location.location_id
move_domain = [('product_id', '=', quant.product_id.id),
('state', 'in', ['confirmed', 'waiting', 'assigned']),
'|', ('location_id', 'child_of', quant.location_id.id),
('location_id', 'in', parent_locations.ids)]
if self.picking_id.group_id:
move_domain += [('group_id', '=', self.picking_id.group_id.id)]
return {'domain': {'move_id': move_domain}}
@api.multi
def do_apply(self):
self.ensure_one()
quants_ids = self.env.context.get('active_ids', [])
quants = self.env['stock.quant'].browse(quants_ids)
self.move_id.do_unreserve()
available_qty_on_move = self.move_id.product_qty
recalculate_state_for_moves = self.env['stock.move']
list_reservations = []
prec = self.move_id.product_id.uom_id.rounding
while quants and float_compare(available_qty_on_move, 0, precision_rounding=prec) > 0:
quant = quants[0]
quants -= quant
qty_to_reserve = min(quant.qty, available_qty_on_move)
move = quant.reservation_id
parent_move = quant.history_ids.filtered(lambda sm: sm.state == 'done' and
sm.location_dest_id == quant.location_id)
if parent_move and len(parent_move) == 1 and parent_move.move_dest_id and self.move_id.state == 'waiting':
parent_move.move_dest_id = self.move_id
self.move_id.action_confirm()
list_reservations += [(quant, qty_to_reserve)]
available_qty_on_move -= qty_to_reserve
if move:
recalculate_state_for_moves += move
self.env['stock.quant'].quants_reserve(list_reservations, self.move_id)
if recalculate_state_for_moves:
recalculate_state_for_moves.recalculate_move_state()
if self.picking_id.pack_operation_ids:
self.move_id.picking_id.do_prepare_partial()
if not self.move_id.picking_id and self.move_id.picking_type_id:
self.move_id.assign_to_picking()
if not self.move_id.picking_id:
return {'type': 'ir.actions.act_window_close'}
return {
'name': 'Stock Operation',
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'stock.picking',
'res_id': self.move_id.picking_id.id
}
|
ndp-systemes/odoo-addons
|
stock_change_quant_reservation/wizard/stock_change_quant_reservation_wizard.py
|
Python
|
agpl-3.0
| 5,975
|
# This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2013-2020 Alban 'spl0k' Féron
# 2017 Óscar García Amor
#
# Distributed under terms of the GNU AGPLv3 license.
import os
import sys
import tempfile
from configparser import RawConfigParser
current_config = None
def get_current_config():
return current_config or DefaultConfig()
class DefaultConfig:
DEBUG = False
tempdir = os.path.join(tempfile.gettempdir(), "supysonic")
BASE = {
"database_uri": "sqlite:///" + os.path.join(tempdir, "supysonic.db"),
"scanner_extensions": None,
"follow_symlinks": False,
}
WEBAPP = {
"cache_dir": tempdir,
"cache_size": 1024,
"transcode_cache_size": 512,
"log_file": None,
"log_level": "WARNING",
"mount_webui": True,
"mount_api": True,
"index_ignored_prefixes": "El La Le Las Les Los The",
}
DAEMON = {
"socket": r"\\.\pipe\supysonic"
if sys.platform == "win32"
else os.path.join(tempdir, "supysonic.sock"),
"run_watcher": True,
"wait_delay": 5,
"jukebox_command": None,
"log_file": None,
"log_level": "WARNING",
}
LASTFM = {"api_key": None, "secret": None}
TRANSCODING = {}
MIMETYPES = {}
def __init__(self):
current_config = self
class IniConfig(DefaultConfig):
common_paths = [
"/etc/supysonic",
os.path.expanduser("~/.supysonic"),
os.path.expanduser("~/.config/supysonic/supysonic.conf"),
"supysonic.conf",
]
def __init__(self, paths):
super().__init__()
parser = RawConfigParser()
parser.read(paths)
for section in parser.sections():
options = {k: self.__try_parse(v) for k, v in parser.items(section)}
section = section.upper()
if hasattr(self, section):
getattr(self, section).update(options)
else:
setattr(self, section, options)
@staticmethod
def __try_parse(value):
try:
return int(value)
except ValueError:
try:
return float(value)
except ValueError:
lv = value.lower()
if lv in ("yes", "true", "on"):
return True
if lv in ("no", "false", "off"):
return False
return value
@classmethod
def from_common_locations(cls):
return IniConfig(cls.common_paths)
|
spl0k/supysonic
|
supysonic/config.py
|
Python
|
agpl-3.0
| 2,620
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def data_migration(apps, schema_editor):
MicroServiceChain = apps.get_model('main', 'MicroServiceChain')
MicroServiceChainLink = apps.get_model('main', 'MicroServiceChainLink')
TaskConfig = apps.get_model('main', 'TaskConfig')
StandardTaskConfig = apps.get_model('main', 'StandardTaskConfig')
MicroServiceChainLinkExitCode = apps.get_model('main', 'MicroServiceChainLinkExitCode')
TaskConfigUnitVariableLinkPull = apps.get_model('main', 'TaskConfigUnitVariableLinkPull')
# Remove the original "index transfer contents" microservice during ingest
update_transfer_index = 'd46f6af8-bc4e-4369-a808-c0fedb439fef'
send_to_backlog = 'abd6d60c-d50f-4660-a189-ac1b34fafe85'
index_transfer_contents = 'eb52299b-9ae6-4a1f-831e-c7eee0de829f'
create_transfer_metadata_xml = 'db99ab43-04d7-44ab-89ec-e09d7bbdc39d'
# "Check for specialized processing" should point at the chainlink after indexing
TaskConfigUnitVariableLinkPull.objects.filter(defaultmicroservicechainlink=index_transfer_contents).update(defaultmicroservicechainlink=create_transfer_metadata_xml)
# "Identify DSpace METS file" should point at the chainlink after indexing
MicroServiceChainLink.objects.filter(id='8ec0b0c1-79ad-4d22-abcd-8e95fcceabbc').update(defaultnextchainlink=create_transfer_metadata_xml)
MicroServiceChainLinkExitCode.objects.filter(nextmicroservicechainlink=index_transfer_contents).update(nextmicroservicechainlink=create_transfer_metadata_xml)
# Delete STC from the old indexing MSCL, and exit codes rows
StandardTaskConfig.objects.filter(id='2c9fd8e4-a4f9-4aa6-b443-de8a9a49e396').delete()
MicroServiceChainLinkExitCode.objects.filter(microservicechainlink=index_transfer_contents).delete()
# Instead of updating the status of the file in the backlog,
# index the files freshly with a "backlog" status
TaskConfig.objects.filter(id='d6a0dec1-63e7-4c7c-b4c0-e68f0afcedd3').update(description='Index transfer contents')
StandardTaskConfig.objects.filter(id='16ce41d9-7bfa-4167-bca8-49fe358f53ba').update(execute='elasticSearchIndex_v0.0', arguments='"%SIPDirectory%" "%SIPUUID%" "backlog"')
# Also move this MSCL to the beginning of the "send to backlog" chain,
# since it requires having the files still physically accessible
MicroServiceChain.objects.filter(startinglink=send_to_backlog).update(startinglink=update_transfer_index)
MicroServiceChainLinkExitCode.objects.filter(microservicechainlink=update_transfer_index).update(nextmicroservicechainlink=send_to_backlog)
# Finally, mark nextMicroServiceChainLink as null for the new last link
MicroServiceChainLinkExitCode.objects.filter(microservicechainlink='561bbb52-d95c-4004-b0d3-739c0a65f406').update(nextmicroservicechainlink=None)
class Migration(migrations.Migration):
dependencies = [
('main', '0018_archivesspace_sip_arrange'),
]
operations = [
migrations.RunPython(data_migration),
]
|
sevein/archivematica
|
src/dashboard/src/main/migrations/0019_index_after_processing_decision.py
|
Python
|
agpl-3.0
| 3,090
|
"""
Tests for enrollment refund capabilities.
"""
from datetime import datetime, timedelta
import ddt
import httpretty
import logging
import pytz
import unittest
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.client import Client
from django.test.utils import override_settings
from mock import patch
from student.models import CourseEnrollment, CourseEnrollmentAttribute
from student.tests.factories import UserFactory, CourseModeFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
# These imports refer to lms djangoapps.
# Their testcases are only run under lms.
from certificates.models import CertificateStatuses # pylint: disable=import-error
from certificates.tests.factories import GeneratedCertificateFactory # pylint: disable=import-error
from openedx.core.djangoapps.commerce.utils import ECOMMERCE_DATE_FORMAT
# Explicitly import the cache from ConfigurationModel so we can reset it after each test
from config_models.models import cache
log = logging.getLogger(__name__)
TEST_API_URL = 'http://www-internal.example.com/api'
JSON = 'application/json'
@ddt.ddt
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class RefundableTest(SharedModuleStoreTestCase):
"""
Tests for dashboard utility functions
"""
@classmethod
def setUpClass(cls):
super(RefundableTest, cls).setUpClass()
cls.course = CourseFactory.create()
def setUp(self):
""" Setup components used by each refund test."""
super(RefundableTest, self).setUp()
self.user = UserFactory.create(username="jack", email="jack@fake.edx.org", password='test')
self.verified_mode = CourseModeFactory.create(
course_id=self.course.id,
mode_slug='verified',
mode_display_name='Verified',
expiration_datetime=datetime.now(pytz.UTC) + timedelta(days=1)
)
self.enrollment = CourseEnrollment.enroll(self.user, self.course.id, mode='verified')
self.client = Client()
cache.clear()
def test_refundable(self):
""" Assert base case is refundable"""
self.assertTrue(self.enrollment.refundable())
def test_refundable_expired_verification(self):
""" Assert that enrollment is not refundable if course mode has expired."""
self.verified_mode.expiration_datetime = datetime.now(pytz.UTC) - timedelta(days=1)
self.verified_mode.save()
self.assertFalse(self.enrollment.refundable())
# Assert that can_refund overrides this and allows refund
self.enrollment.can_refund = True
self.assertTrue(self.enrollment.refundable())
def test_refundable_of_purchased_course(self):
""" Assert that courses without a verified mode are not refundable"""
self.client.login(username="jack", password="test")
course = CourseFactory.create()
CourseModeFactory.create(
course_id=course.id,
mode_slug='honor',
min_price=10,
currency='usd',
mode_display_name='honor',
expiration_datetime=datetime.now(pytz.UTC) + timedelta(days=1)
)
enrollment = CourseEnrollment.enroll(self.user, course.id, mode='honor')
# TODO: Until we can allow course administrators to define a refund period for paid for courses show_refund_option should be False. # pylint: disable=fixme
self.assertFalse(enrollment.refundable())
resp = self.client.post(reverse('student.views.dashboard', args=[]))
self.assertIn('You will not be refunded the amount you paid.', resp.content)
def test_refundable_when_certificate_exists(self):
""" Assert that enrollment is not refundable once a certificat has been generated."""
self.assertTrue(self.enrollment.refundable())
GeneratedCertificateFactory.create(
user=self.user,
course_id=self.course.id,
status=CertificateStatuses.downloadable,
mode='verified'
)
self.assertFalse(self.enrollment.refundable())
# Assert that can_refund overrides this and allows refund
self.enrollment.can_refund = True
self.assertTrue(self.enrollment.refundable())
def test_refundable_with_cutoff_date(self):
""" Assert enrollment is refundable before cutoff and not refundable after."""
self.assertTrue(self.enrollment.refundable())
with patch('student.models.CourseEnrollment.refund_cutoff_date') as cutoff_date:
cutoff_date.return_value = datetime.now(pytz.UTC) - timedelta(minutes=5)
self.assertFalse(self.enrollment.refundable())
cutoff_date.return_value = datetime.now(pytz.UTC) + timedelta(minutes=5)
self.assertTrue(self.enrollment.refundable())
@ddt.data(
(timedelta(days=1), timedelta(days=2), timedelta(days=2), 14),
(timedelta(days=2), timedelta(days=1), timedelta(days=2), 14),
(timedelta(days=1), timedelta(days=2), timedelta(days=2), 1),
(timedelta(days=2), timedelta(days=1), timedelta(days=2), 1),
)
@ddt.unpack
@httpretty.activate
@override_settings(ECOMMERCE_API_URL=TEST_API_URL)
def test_refund_cutoff_date(self, order_date_delta, course_start_delta, expected_date_delta, days):
"""
Assert that the later date is used with the configurable refund period in calculating the returned cutoff date.
"""
now = datetime.now(pytz.UTC).replace(microsecond=0)
order_date = now + order_date_delta
course_start = now + course_start_delta
expected_date = now + expected_date_delta
refund_period = timedelta(days=days)
order_number = 'OSCR-1000'
expected_content = '{{"date_placed": "{date}"}}'.format(date=order_date.strftime(ECOMMERCE_DATE_FORMAT))
httpretty.register_uri(
httpretty.GET,
'{url}/orders/{order}/'.format(url=TEST_API_URL, order=order_number),
status=200, body=expected_content,
adding_headers={'Content-Type': JSON}
)
self.enrollment.course_overview.start = course_start
self.enrollment.attributes.add(CourseEnrollmentAttribute(
enrollment=self.enrollment,
namespace='order',
name='order_number',
value=order_number
))
with patch('student.models.EnrollmentRefundConfiguration.current') as config:
instance = config.return_value
instance.refund_window = refund_period
self.assertEqual(
self.enrollment.refund_cutoff_date(),
expected_date + refund_period
)
def test_refund_cutoff_date_no_attributes(self):
""" Assert that the None is returned when no order number attribute is found."""
self.assertIsNone(self.enrollment.refund_cutoff_date())
@httpretty.activate
@override_settings(ECOMMERCE_API_URL=TEST_API_URL)
def test_multiple_refunds_dashbaord_page_error(self):
""" Order with mutiple refunds will not throw 500 error when dashboard page will access."""
now = datetime.now(pytz.UTC).replace(microsecond=0)
order_date = now + timedelta(days=1)
order_number = 'OSCR-1000'
expected_content = '{{"date_placed": "{date}"}}'.format(date=order_date.strftime(ECOMMERCE_DATE_FORMAT))
httpretty.register_uri(
httpretty.GET,
'{url}/orders/{order}/'.format(url=TEST_API_URL, order=order_number),
status=200, body=expected_content,
adding_headers={'Content-Type': JSON}
)
# creating multiple attributes for same order.
for attribute_count in range(2): # pylint: disable=unused-variable
self.enrollment.attributes.add(CourseEnrollmentAttribute(
enrollment=self.enrollment,
namespace='order',
name='order_number',
value=order_number
))
self.client.login(username="jack", password="test")
resp = self.client.post(reverse('student.views.dashboard', args=[]))
self.assertEqual(resp.status_code, 200)
|
prarthitm/edxplatform
|
common/djangoapps/student/tests/test_refunds.py
|
Python
|
agpl-3.0
| 8,342
|
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
from pyramid.view import view_config
from dace.processinstance.core import (
DEFAULTMAPPING_ACTIONS_VIEWS)
from pontus.view import BasicView
from lac.content.processes.services_processes.\
newsletter_management.behaviors import (
SeeNewsletterHistory)
from lac.content.newsletter import Newsletter
from lac import _
@view_config(
name='seenewsletterhistory',
context=Newsletter,
renderer='pontus:templates/views_templates/grid.pt',
)
class SeeNewsletterHistoryView(BasicView):
title = _('Content history')
name = 'seenewsletterhistory'
behaviors = [SeeNewsletterHistory]
template = 'lac:views/services_processes/newsletter_service/newsletter_management/templates/newsletter_history.pt'
viewid = 'seenewsletterhistory'
def update(self):
self.execute(None)
result = {}
history = getattr(self.context, 'annotations', {}).get(
'newsletter_history', [])
values = {'context': self.context,
'history': history,
}
body = self.content(args=values, template=self.template)['body']
item = self.adapt_item(body, self.viewid)
result['coordinates'] = {self.coordinates: [item]}
return result
DEFAULTMAPPING_ACTIONS_VIEWS.update(
{SeeNewsletterHistory: SeeNewsletterHistoryView})
|
ecreall/lagendacommun
|
lac/views/services_processes/newsletter_service/newsletter_management/see_content_history.py
|
Python
|
agpl-3.0
| 1,496
|
#!/usr/bin/env python
import sys, os, json, re, uuid
if len(sys.argv) < 2:
print("Usage: generate_uuids <coursedir>")
sys.exit(0)
start_re = re.compile(r"^(\s*{ *\n)(.*)$", re.DOTALL)
def add_uuid_to_file(filename):
try:
with open(filename) as in_f:
contents = in_f.read()
data = json.loads(contents)
if "uuid" in data:
return 0
match = start_re.match(contents)
if match is None:
raise Exception("file does not begin with a single line containing a \"{\" character")
new_contents = match.group(1) + (" \"uuid\": \"%s\",\n" % uuid.uuid4()) + match.group(2)
tmp_filename = filename + ".tmp_with_uuid"
if os.path.exists(tmp_filename):
os.remove(tmp_filename) # needed on Windows
with open(tmp_filename, "w") as out_f:
out_f.write(new_contents)
os.remove(filename) # needed on Windows
os.rename(tmp_filename, filename)
return 1
except Exception as error:
print("WARNING: skipping %s: %s" % (filename, error))
return 0
def ensure_is_dir(path):
if not os.path.isdir(path):
print("ERROR: Not a directory: %s" % path)
sys.exit(1)
num_added = 0
course_dir = sys.argv[1]
print("Processing course directory: %s" % course_dir)
ensure_is_dir(course_dir)
num_added += add_uuid_to_file(os.path.join(course_dir, "infoCourse.json"))
questions_dir = os.path.join(course_dir, "questions")
print("Processing questions directory: %s" % questions_dir)
ensure_is_dir(questions_dir)
question_dir_names = os.listdir(questions_dir)
for question_dir_name in question_dir_names:
question_path = os.path.join(questions_dir, question_dir_name)
if os.path.isdir(question_path):
info_file_name = os.path.join(question_path, "info.json")
num_added += add_uuid_to_file(info_file_name)
course_instances_dir = os.path.join(course_dir, "courseInstances")
print("Processing courseInstances directory: %s" % course_instances_dir)
ensure_is_dir(course_instances_dir)
course_instance_dir_names = os.listdir(course_instances_dir)
for course_instance_dir_name in course_instance_dir_names:
course_instance_path = os.path.join(course_instances_dir, course_instance_dir_name)
if os.path.isdir(course_instance_path):
info_file_name = os.path.join(course_instance_path, "infoCourseInstance.json")
num_added += add_uuid_to_file(info_file_name)
assessments_dir = os.path.join(course_instance_path, "assessments")
print("Processing assessments directory: %s" % assessments_dir)
if os.path.isdir(assessments_dir):
assessment_dir_names = os.listdir(assessments_dir)
for assessment_dir_name in assessment_dir_names:
assessment_path = os.path.join(assessments_dir, assessment_dir_name)
if os.path.isdir(assessment_path):
info_file_name = os.path.join(assessment_path, "infoAssessment.json")
num_added += add_uuid_to_file(info_file_name)
print("Sucessfully completed")
print("Added UUID to %d files" % num_added)
|
lotrfan/PrairieLearn
|
tools/generate_uuids.py
|
Python
|
agpl-3.0
| 3,163
|
# Author: Damien Crier
# Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class ResCompany(models.Model):
_inherit = 'res.company'
def find_daterange_fy(self, date):
"""
try to find a date range with type 'fiscalyear'
with @param:date contained in its date_start/date_end interval
"""
fiscalyear = self.env['account.fiscal.year'].search([
('company_id', '=', self.id),
('date_from', '<=', date),
('date_to', '>=', date),
], limit=1)
return fiscalyear
|
avoinsystems/account-financial-tools
|
account_move_fiscal_year/models/res_company.py
|
Python
|
agpl-3.0
| 628
|
from odoo import models, fields
import logging
_logger = logging.getLogger(__name__)
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
group_choose_payment_type = fields.Boolean(
'Choose Payment Type on Payments',
implied_group='account_payment_group.group_choose_payment_type',
)
group_pay_now_customer_invoices = fields.Boolean(
'Allow pay now on customer invoices?',
implied_group='account_payment_group.group_pay_now_customer_invoices',
)
group_pay_now_vendor_invoices = fields.Boolean(
'Allow pay now on vendor invoices?',
help='Allow users to choose a payment journal on invoices so that '
'invoice is automatically paid after invoice validation. A payment '
'will be created using choosen journal',
implied_group='account_payment_group.group_pay_now_vendor_invoices',
)
double_validation = fields.Boolean(
related='company_id.double_validation',
readonly=False,
)
|
ingadhoc/account-payment
|
account_payment_group/wizards/res_config_settings.py
|
Python
|
agpl-3.0
| 1,029
|
import logging
import pecan
import time
from joulupukki.dispatcher.dispatcher.dispatcher import Dispatcher
from joulupukki.common.datamodel.build import Build
from joulupukki.common.datamodel.project import Project
from joulupukki.common.datamodel.user import User
from joulupukki.common.database import mongo
from joulupukki.common.carrier import Carrier
class Manager(object):
def __init__(self, app):
self.must_run = False
self.app = app
self.build_list = {}
self.carrier = Carrier(pecan.conf.rabbit_server,
pecan.conf.rabbit_port,
pecan.conf.rabbit_user,
pecan.conf.rabbit_password,
pecan.conf.rabbit_vhost,
pecan.conf.rabbit_db)
self.carrier.declare_queue('builds.queue')
def shutdown(self):
logging.debug("Stopping Manager")
self.carrier.closing = True
self.must_run = False
def run(self):
self.must_run = True
logging.debug("Starting Manager")
while self.must_run:
time.sleep(0.1)
new_build = self.carrier.get_message('builds.queue')
build = None
if new_build is not None:
build = Build(new_build)
if build:
build.user = User.fetch(new_build['username'],
sub_objects=False)
build.project = Project.fetch(build.username,
new_build['project_name'],
sub_objects=False)
logging.debug("Task received")
build.set_status("dispatching")
dispatcher = Dispatcher(build)
self.build_list[dispatcher.uuid2] = dispatcher
dispatcher.start()
self.check_builds_status()
def check_builds_status(self):
builds = mongo.builds.find({"status": {"$nin" : ["succeeded", "failed"]}})
for b in builds:
finished = 0
build = Build(b)
jobs = build.get_jobs()
if len(jobs) == build.job_count and build.job_count > 0:
for job in jobs:
if job.status in ['succeeded', 'failed']:
finished += 1
if finished == len(jobs):
if all([True if j.status == 'succeeded' else False for j in jobs]):
build.set_status('succeeded')
else:
build.set_status('failed')
build.finishing()
# collect old jammed build
time_limit = time.time() - pecan.conf.build_lifetime
builds = mongo.builds.find({"status": {"$nin" : ["succeeded", "failed"]},
"created" :{ "$lte": time_limit} })
for b in builds:
build = Build(b)
build.set_status('failed')
build.finishing()
jobs = build.get_jobs()
for job in jobs:
if job.status not in ['succeeded', 'failed']:
job.set_status('failed')
|
jlpk/joulupukki-dispatcher
|
joulupukki/dispatcher/dispatcher/manager.py
|
Python
|
agpl-3.0
| 3,271
|
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
# 因為 publishconf.py 在 pelicanconf.py 之後, 因此若兩處有相同變數的設定, 將以較後讀入的 publishconf.py 中的設定為主.
# 請注意, 為了在近端讓 Tipue search 傳回的搜尋結果連結正確, 必須使用 ./
SITEURL = 'http://ddss-40323123.rhcloud.com/static/blog/'
# 此設定用於近端靜態網頁查驗, 因此使用相對 URL
RELATIVE_URLS = False
# 為了要讓 local 與 gh-pages 上都能夠使用 Tipue search, 可能要採用不同的 theme
THEME = 'theme/pelican-bootstrap3'
#BOOTSTRAP_THEME = 'readable'
#BOOTSTRAP_THEME = 'readable-old'
BOOTSTRAP_THEME = 'united'
#PYGMENTS_STYLE = 'paraiso-drak'
#PYGMENTS_STYLE = 'fruity'
# 為了同時兼容 render_math, 必須放棄 fruity
PYGMENTS_STYLE = 'monokai'
FEED_ALL_ATOM = 'feeds/all.atom.xml'
CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml'
DELETE_OUTPUT_DIRECTORY = True
# Following items are often useful when publishing
DISQUS_SITENAME = "cadlabmanual"
#GOOGLE_ANALYTICS = ""
# 設定網誌以 md 檔案建立的 file system date 為準, 無需自行設定
DEFAULT_DATE = 'fs'
# 近端的 code hightlight
MD_EXTENSIONS = ['fenced_code', 'extra', 'codehilite(linenums=True)']
# 若要依照日期存檔呼叫
#ARTICLE_URL = 'posts/{date:%Y}/{date:%m}/{date:%d}/{slug}/index.html'
#ARTICLE_SAVE_AS = 'posts/{date:%Y}/{date:%m}/{date:%d}/{slug}/index.html'
PAGE_URL = 'pages/{slug}/'
PAGE_SAVE_AS = 'pages/{slug}/index.html'
SHOW_ARTICLE_AUTHOR = True
|
smpss91341/2016springcd_aG8
|
static/publishconf.py
|
Python
|
agpl-3.0
| 1,717
|
import datetime
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.core.management.base import BaseCommand
from django.db.models import Count
from badgeuser.models import BadgeUser, CachedEmailAddress
class Command(BaseCommand):
def handle(self, *args, **options):
self.log("started delete_superseded_users at {}".format(
datetime.datetime.now())
)
# All verified emails
cached = CachedEmailAddress.objects.filter(verified=True)
chunk_size = 1000
start_index = 0
processing_index = 1
continue_processing = True
while continue_processing:
start = start_index
end = start_index+chunk_size
# All non-unique emails
dup_emails = (BadgeUser.objects.values('email')
.annotate(Count('email'))
.filter(email__count__gt=1)
)[start:end]
self.log('----------------------------------------')
self.log('Processing chunk {}. Duplicates: {}'.format(processing_index, len(dup_emails)))
self.log('----------------------------------------')
for dup in dup_emails:
try:
# Find the verified cached email for this user email
verified = cached.get(email=dup['email'])
self.log("Verified email {0}: {1} {2} {3}".format(
verified.email, verified.user_id, verified.user.first_name, verified.user.last_name, ))
# get all the users with this email expect the verified id, delete them
users = (BadgeUser.objects
.filter(email=verified.email)
.exclude(id=verified.user_id))
for user in users:
if not user.cached_emails():
self.log(" Deleting duplicate {0}: {1} {2} {3}".format(
user.email, user.id, user.first_name, user.last_name))
BadgeUser.delete(user)
except MultipleObjectsReturned:
self.log("[ERROR] More then one verified CachedEmail found for: {}".format(dup['email']))
except ObjectDoesNotExist:
self.log("[ERROR] No verified CachedEmail found for: {}".format(dup['email']))
processing_index = processing_index + 1
continue_processing = len(dup_emails) >= chunk_size
start_index += chunk_size
self.log("finished delete_superseded_users at {}".format(datetime.datetime.now()))
def log(self, message):
self.stdout.write(message)
|
concentricsky/badgr-server
|
apps/badgeuser/management/commands/delete_superseded_users.py
|
Python
|
agpl-3.0
| 2,783
|
# vim:fileencoding=utf-8:sw=4:et:syntax=python
path = require("path")
fs = require("fs")
net = require("net")
dnsproxy = require("./dns-proxy")
reversesogouproxy = require("./reverse-sogou-proxy")
urllistmanager = require("./url-list-manager")
lutils = require("./lutils")
log = lutils.logger
appname = "ub.uku.droxy"
def load_resolv_conf():
"""Parse /etc/resolv.conf and return 1st dns host found"""
fname = "/etc/resolv.conf"
data = fs.readFileSync(fname, "utf-8")
lines = data.split("\n")
dns_host = None
for line in lines:
if line[0] == "#":continue
parts = line.split(" ")
if parts[0].toLowerCase() == "nameserver":
dns_host = parts[1]
break
return dns_host
def load_dns_map(target_ip):
"""Create a DNS router to map a list of domain name to a target ip"""
if not target_ip:
target_ip = "127.0.0.1"
domain_map = lutils.fetch_user_domain()
dmap = {}
for domain in Object.keys(domain_map):
dmap[domain] = target_ip
# our proxy test server
dmap["httpbin.org"] = target_ip
#log.debug(dmap)
return dmap
def load_router_from_file(fname, dns_map):
"""Load domain -> ip map from a JSON file"""
if not (fname and fs.existsSync(fname)):
log.error("extra router file not found:", fname)
process.exit(2)
data = fs.readFileSync(fname, "utf-8")
# fix loose JSON: extra comma before }]
data = data.replace(/,(\s*[\}|\]])/g, '$1')
rdict = JSON.parse(data)
for k in Object.keys(rdict):
dns_map[k] = rdict[k]
def host_list_from_file_string(fname):
""" Load list of address from the given string
The string is either a filename contains JSON list or a list of items
seperated by commas.
"""
if not (fname and fs.existsSync(fname)):
if fname.indexOf(".") > 0: # domain name list?
return fname.split(",")
else:
return None
data = fs.readFileSync(fname, "utf-8")
data = data.replace(/,(\s*[\}|\]])/g, '$1')
host_list = JSON.parse(data)
return host_list
def drop_root(options):
"""change root and drop root priviledge"""
# load system DNS lib before chroot, otherwise, getaddrinfo()
# will fail after chroot
_dns = require("dns")
_dns.lookup("baidu.com", def (err, addr, fam): pass;)
Date().toString() # load /etc/timezone too
# load libraries needed for https
_https = require("https")
url_s = "https://github.com"
def _on_error(e):
log.debug("https error", e, url_s)
_https.get(url_s).on("error", _on_error)
try:
chroot = require("chroot")
rdir = options["chroot_dir"]
ruser = options["run_as"]
chroot(rdir, ruser)
for k in Object.keys(process.env):
del process.env[k]
process.env["PWD"] = "/"
process.env["HOME"] = "/"
log.info('changed root to "%s" and user to "%s"', rdir, ruser)
# see if resolv.conf exists for getaddrinfo()
resolv_path = "/etc/resolv.conf"
try:
_ = fs.openSync(resolv_path, "r")
fs.close(_)
except as e:
log.warn("%s is not reachable", resolv_path)
except as e:
log.warn("Failed to chroot:", e)
class DroxyServer:
def __init__(self, options):
"""A dns reverse proxy server"""
self.options = options
self.dns_proxy = None
self.http_proxy = None
if options["extra_url_list"]:
ret = lutils.load_extra_url_list(options["extra_url_list"])
if not ret:
process.exit(2)
if options["access_control_list"]:
acl = host_list_from_file_string(options["access_control_list"])
if acl is None:
log.error("access control list(acl) file not found:", fname)
process.exit(2)
else:
acl_dict = {}
for i in [0 til acl.length]:
acl_dict[acl[i]] = True
options["acl"] = acl_dict
def setup_dns_options(self):
# setup dns proxy
options = self.options
dns_options = {
"listen_address": "0.0.0.0",
"listen_port": options["dns_port"],
"dns_relay": not options["dns_no_relay"],
"dns_rate_limit": int(options["dns_rate_limit"]),
"acl": options["acl"],
}
if options["ip"]:
dns_options["listen_address"] = options["ip"]
if options["dns_host"]:
dns_options["dns_host"] = options["dns_host"]
if not dns_options["dns_host"]:
dns_options["dns_host"] = load_resolv_conf()
return dns_options
def setup_proxy_options(self):
# setup http proxy
options = self.options
http_proxy_options = {
"listen_port": options["http_port"],
"listen_address": "127.0.0.1",
"sogou_dns": options["sogou_dns"],
"sogou_network": options["sogou_network"],
"http_rate_limit": int(options["http_rate_limit"]),
"proxy_list": None,
"acl": options["acl"],
}
if options["ip"]:
http_proxy_options["listen_address"] = options["ip"]
if options["ext_ip"]:
http_proxy_options["external_ip"] = options["ext_ip"]
if options["proxy_list"]:
proxy_list = host_list_from_file_string(options["proxy_list"])
if proxy_list is None:
log.error("user supplied proxy list file not found:", fname)
process.exit(2)
http_proxy_options["proxy_list"] = proxy_list
# https proxy
#http_proxy_options_s = JSON.parse(JSON.stringify(http_proxy_options))
#http_proxy_options_s["listen_port"] = 443
#log.debug("http_proxy_options_s:", http_proxy_options_s)
return http_proxy_options
def create_router(self, target_ip):
"""Create a router object for http proxy server"""
options = self.options
dns_map = load_dns_map(target_ip)
if options["dns_extra_router"]:
load_router_from_file(options["dns_extra_router"], dns_map)
#log.debug("dns_map:", dns_map)
drouter = dnsproxy.createBaseRouter(dns_map)
# if need lookup externel IP
if not (net.isIPv4(target_ip) or net.isIPv6(target_ip)):
ipbox = dnsproxy.createPublicIPBox(target_ip)
drouter.set_public_ip_box(ipbox)
return drouter
def start_reload_url_list(self):
"""Starting reload url list online """
options = self.options
url_list_reloader = urllistmanager.createURLListReloader(
options["extra_url_list"])
url_list_reloader.do_reload()
url_list_reloader.start()
def run(self):
options = self.options
dns_options = self.setup_dns_options()
log.debug("dns_options:", dns_options)
http_proxy_options = self.setup_proxy_options()
log.debug("http_proxy_options:", http_proxy_options)
# now we are set, create servers
target_ip = options["ext_ip"] or http_proxy_options["listen_address"]
drouter = self.create_router(target_ip)
dproxy = dnsproxy.createServer(dns_options, drouter)
hproxy = reversesogouproxy.createServer(http_proxy_options)
hproxy.set_public_ip_box(drouter.public_ip_box)
# drop root priviledge if run as root
server_count = 0
def _on_listen():
nonlocal server_count
server_count += 1
if server_count >= 2:
drop_root(options)
dproxy.on("listening", _on_listen)
hproxy.on("listening", _on_listen)
self.dns_proxy = dproxy
self.http_proxy = hproxy
dproxy.start()
hproxy.start()
self.start_reload_url_list()
def expand_user(txt):
"""Expand tild (~/) to user home directory"""
if txt == "~" or txt[:2] == "~/":
txt = process.env.HOME + txt.substr(1)
return txt
def fix_keys(dobj):
"""replace "-" in dict keys to "_" """
for k in Object.keys(dobj):
if k[0] == "#":
del dobj[k]
elif "-" in k:
nk = k.replace(/-/g, "_")
dobj[nk] = dobj[k]
del dobj[k]
def load_config(cfile):
"""Load config file and update argv"""
cdict = {}
if not cfile: cdict
cfile = expand_user(cfile)
if not (cfile and fs.existsSync(cfile)):
return cdict
# load config file as a JSON file
data = fs.readFileSync(cfile, "utf-8")
# naiive fix dict with unquoted keys
#data = data.replace(RegExp('([\'"])?(#?[-_a-zA-Z0-9]+)([\'"])?:', "g"),
# '"$2": ')
# extra comma before }]
data = data.replace(/,(\s*[\}|\]])/g, '$1')
log.debug("config data:", data)
cdict = JSON.parse(data)
fix_keys(cdict)
return cdict
def parse_args():
"""Cmdline argument parser"""
optimist = require("optimist")
# config file location. Borrow from blender
# http://wiki.blender.org/index.php/Doc:2.6/Manual/Introduction/Installing_Blender/DirectoryLayout
os = require("os")
platform = os.platform()
if platform == "win32":
config_dir = "AppData"
elif platform == "darwin": # Mac OSX
config_dir = "Library/:Application Support"
else:
config_dir = ".config"
config_path = path.join(expand_user("~/"), config_dir, appname,
"config.json")
cmd_args = {
"ip": {
"description": "local IP address to listen on",
"default": "0.0.0.0",
},
"dns-host": {
"description"
: "remote dns host. default: first in /etc/resolv.conf",
},
"sogou-dns": {
"description"
: "DNS used to lookup IP of sogou proxy servers",
},
"sogou-network": {
"description"
: 'choose between "edu" and "dxt"',
"default": None,
},
"proxy-list": {
"description" : \
'Load user supplied proxy servers either ' +
'from a comma seperated list or ' +
'from a JSON file as a list of strings.',
},
"extra-url-list": {
"description"
: "load extra url redirect list from a JSON file",
},
/* Advanced usage
"dns-extra-router": {
"description"
: "load extra domain -> ip map for DNS from a JSON file",
},
*/
"ext-ip": {
"description": \
'for public DNS, the DNS proxy route to the given ' +
'public IP. If set to "lookup", try to find the ' +
'public IP through http://httpbin.org/ip. If a ' +
'domain name is given, the IP will be lookup ' +
'through DNS',
},
"dns-no-relay": {
"description"
: "don't relay un-routed domain query to upstream DNS",
"boolean": True,
},
"dns-rate-limit": {
"description"
: "DNS query rate limit per sec per IP. -1 = no limit",
"default": 25,
},
"dns-port": {
"description"
: "local port for the DNS proxy to listen on. " +
"Useful with port forward",
"default": 53,
},
"http-port": {
"description"
: "local port for the HTTP proxy to listen on. " +
"Useful with port forward",
"default": 80,
},
"http-rate-limit": {
"description"
: "HTTP proxy rate limit per sec per IP. -1 = no limit",
"default": 20,
},
"access-control-list": {
"description" : \
"Load access control list(acl) of IPs either " +
'from a comma seperated list or ' +
'from a JSON file as a list of strings.',
"alias": "acl",
},
"run-as": {
"description": "run as unpriviledged user (sudo/root)",
"default": "nobody",
},
"chroot-dir": {
"description": "chroot to given directory (sudo/root). " +
"Should copy /etc/resolv.conf to " +
"/newroot/etc/resolv.conf and make it readable if needed",
"default": "/var/chroot/droxy",
},
"config": {
"description": "load the given configuration file",
"default": config_path,
"alias": "c",
},
"debug": {
"description": "debug mode",
"boolean": True,
"alias": "D",
},
"help": {
"alias": "h",
"description": "print help message",
"boolean": True,
},
}
opt = optimist.usage(
"DNS Reverse Proxy(droxy) server with unblock-youku\n" +
"Usage:\n\t$0 [--options]", cmd_args).wrap(78)
argv = opt.argv
# remove alias entries
for k in Object.keys(cmd_args):
item = cmd_args[k]
akey = item["alias"]
if akey:
del argv[akey]
fix_keys(argv)
if argv["sogou_network"]:
sd = argv["sogou_network"]
if not (sd == "dxt" or sd == "edu"):
opt.showHelp()
log.error('Bad value for option --sogou-network %s',
sd)
process.exit(code=2)
if argv.help:
opt.showHelp()
process.exit(code=0)
return argv
def main():
process.title = appname
argv = parse_args()
if argv.debug:
log.set_level(log.DEBUG)
log.debug("argv:", argv)
conf = load_config(argv["config"])
log.debug("config:", conf)
for k in Object.keys(conf):
argv[k] = conf[k]
log.debug("with config:", argv)
droxy = DroxyServer(argv)
droxy.run()
if require.main is JS("module"):
main()
exports.main = main
|
JuntianX/Unblock-Youku
|
dns-reverse-proxy/droxy.py
|
Python
|
agpl-3.0
| 14,679
|
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='rdfspace',
version='0.0.4',
description="""RDFSpace constructs a vector space
from any RDF dataset which can be used for
computing similarities between resources
in that dataset.""",
author='Yves Raimond',
author_email='yves.raimond@bbc.co.uk',
packages=['rdfspace'],
install_requires=[
'scipy',
'sparsesvd',
'cython',
],
)
|
bbcrd/rdfspace
|
setup.py
|
Python
|
agpl-3.0
| 566
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ===========================================================================
# NEWS CHANNEL GENERATION SCRIPT
# AUTHORS: LARSEN VALLECILLO
# ****************************************************************************
# Copyright (c) 2015-2022 RiiConnect24, and its (Lead) Developers
# ===========================================================================
import binascii
import calendar
import CloudFlare
import difflib
import glob
import json
import nlzss
import os
import pickle
import requests
import subprocess
import sys
import time
import utils
from datetime import timedelta, datetime, date
import rsa
from . import newsdownload
from datadog import statsd
from utils import setup_log, log, mkdir_p, u8, u16, u32, u32_littleendian
with open("./Channels/News_Channel/config.json", "rb") as f:
config = json.load(f) # load config
if config["production"]:
setup_log(config["sentry_url"], True) # error logging
sources = {
"ap_english": {
"topics_news": {
"National News": "national",
"International News": "world",
"Sports": "sports",
"Arts/Entertainment": "entertainment",
"Business": "business",
"Science/Health": "science",
"Technology": "technology",
"Oddities": "oddities",
},
"languages": [1, 3, 4],
"language_code": 1,
"country_code": 49, # USA
"picture": 0,
"position": 1,
"copyright": "Copyright {} The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.",
"countries": [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52],
},
"ap_spanish": {
"topics_news": {
"Generales": "general",
"Financieras": "finance",
"Deportivas": "sports",
"Espectáculos": "shows",
},
"languages": [1, 3, 4],
"language_code": 4,
"country_code": 49, # USA
"picture": 0,
"position": 1,
"copyright": "Copyright {} The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.",
"countries": [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 65, 66, 67, 74, 76, 77, 78, 79, 82, 83, 88, 94, 95, 96, 97, 98, 105, 107, 108, 110],
},
"reuters_europe_english": {
"topics_news": {
"World": "world",
"UK": "uk",
"Science": "science",
"Technology": "technology",
"Entertainment": "entertainment",
"Sports": "sports",
"Lifestyle": "lifestyle",
"Business": "business",
},
"languages": [1, 2, 3, 4, 5, 6],
"language_code": 1,
"country_code": 110, # UK
"picture": 0,
"position": 4,
"copyright": "© {} Thomson Reuters. All rights reserved. Republication or redistribution of Thomson Reuters content, including by framing or similar means, is prohibited without the prior written consent of Thomson Reuters. Thomson Reuters and the Kinesis logo are trademarks of Thomson Reuters and its affiliated companies.",
"countries": [65, 66, 67, 74, 76, 77, 78, 79, 82, 83, 88, 94, 95, 96, 97, 98, 105, 107, 108, 110],
},
"afp_french": {
"topics_news": {
"Monde": "world",
"Sport": "sports",
"Societe": "society",
"Culture": "culture",
"Economie": "economy",
"Politique": "politics",
},
"languages": [1, 2, 3, 4, 5, 6],
"language_code": 3,
"country_code": 110, # UK
"picture": 4,
"position": 4,
"copyright": "Tous droits de reproduction et de diffusion réservés. © {} Agence France-Presse",
"countries": [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 65, 66, 67, 74, 76, 77, 78, 79, 82, 83, 88, 94, 95, 96, 97, 98, 105, 107, 108, 110],
},
"dpa_german": {
"topics_news": {
"Deutschland": "germany",
"Nachrichten": "world",
"Politik": "politics",
"Wirtschaft": "economy",
"Gesundheit": "health",
"Boulevard": "boulevard",
"Unterhaltung": "entertainment",
"Sport": "sports",
},
"languages": [1, 2, 3, 4, 5, 6],
"language_code": 2,
"country_code": 110, # UK
"picture": 4,
"position": 4,
"copyright": "Alle Rechte für die Wiedergabe, Verwertung und Darstellung reserviert. © {} dpa",
"countries": [65, 66, 67, 74, 76, 77, 78, 79, 82, 83, 88, 94, 95, 96, 97, 98, 105, 107, 108, 110],
},
"ansa_italian": {
"topics_news": {
"Dal mondo": "world",
"Dall'Italia": "italy",
"Sport": "sports",
"Economia": "economy",
"Tecnologia": "technology",
"Cultura": "culture",
},
"languages": [1, 2, 3, 4, 5, 6],
"language_code": 5,
"country_code": 110, # UK
"picture": 6,
"position": 6,
"copyright": "© {} ANSA, Tutti i diritti riservati. Testi, foto, grafica non potranno essere pubblicali, riscritti, commercializzati, distribuiti, videotrasmessi, da parte dagli tanti e del terzi in genere, in alcun modo e sotto qualsiasi forma.",
"countries": [65, 66, 67, 74, 76, 77, 78, 79, 82, 83, 88, 94, 95, 96, 97, 98, 105, 107, 108, 110],
},
"anp_dutch": {
"topics_news": {
"Algemeen": "general",
"Economie": "economy",
"Sport": "sports",
"Entertainment": "entertainment",
"Lifestyle": "lifestyle",
},
"languages": [1, 2, 3, 4, 5, 6],
"language_code": 6,
"country_code": 110, # Uk
"picture": 0,
"position": 5,
"copyright": "© {} B.V. Algemeen Nederlands Persbureau ANP",
"countries": [65, 66, 67, 74, 76, 77, 78, 79, 82, 83, 88, 94, 95, 96, 97, 98, 105, 107, 108, 110],
},
"reuters_japanese": {
"topics_news": {
"ワールド": "world",
"ビジネス": "business",
"スポーツ": "sports",
"テクノロジー": "technology",
"エンタテインメント": "entertainment",
},
"languages": [0],
"language_code": 0,
"country_code": 1, # Japan
"picture": 0,
"position": 4,
"copyright": "© Copyright Reuters {}. All rights reserved. ユーザーは、自己の個人的使用及び非商用目的に限り、このサイトにおけるコンテンツの抜粋をダウンロードまたは印刷することができます。ロイターが事前に書面により承認した場合を除き、ロイター・コンテンツを再発行や再配布すること(フレーミングまたは類似の方法による場合を含む)は、明示的に禁止されています。Reutersおよび地球をデザインしたマークは、登録商標であり、全世界のロイター・グループの商標となっています。 ",\
"countries": [1],
},
}
def process_news(name, mode, language, region, d):
print("Making news.bin for {}...\n".format(name))
global language_code, newsfilename # I don't like global variables but we're still using them for now
language_code = language
data = d.newsdata
newsfilename = "news.bin.{}.{}".format(str(datetime.utcnow().hour).zfill(2), mode)
# This is where we do some checks so that the file doesn't get too large
# There's a limit on how much news we can have in total
# The maximum we can have is 25, but if the whole directory of news files is too large,
# multiple news articles will be removed
i = 0
limit = 20
if config[
"production"
]: # brilliant way to keep the news flowing when it's close to or over the file size limit, surprisingly seems to work?
path = "{}/v2/{}_{}".format(config["file_path"], language_code, region)
try:
size = round(
float(
subprocess.check_output(["du", "-sh", path])
.split()[0]
.decode("utf-8")
.replace("M", "")
)
- 3.7,
1,
)
if size >= 3.8:
limit -= 20
elif size == 3.7:
limit -= 15
elif size == 3.6:
limit -= 4
elif size == 3.5:
limit -= 3
filesize = sum(
os.path.getsize(f) - 320
for f in glob.glob(
path + "/news.bin.*"
)
) # let's do one more check to see if the filesize is ok
if filesize > 3712000:
log("News files exceed the maximum file size amount.", "error")
except:
pass
for key in list(data.keys()):
i += 1
if i > limit:
del data[key]
data = remove_duplicates(data)
locations_data = newsdownload.locations_download(language_code, data)
make_news = make_news_bin(mode, data, locations_data, region)
if config["production"]:
# Log stuff to Datadog
statsd.increment("news.total_files_built")
# This will use a webhook to log that the script has been ran
webhook = {
"username": "News Bot",
"content": "News Data has been updated!",
"avatar_url": "https://rc24.xyz/images/logo-small.png",
"attachments": [
{
"fallback": "News Data Update",
"color": "#1B691E",
"author_name": "RiiConnect24 News Script",
"author_icon": "https://rc24.xyz/images/webhooks/news/profile.png",
"text": make_news,
"title": "Update!",
"fields": [
{
"title": "Script",
"value": "News Channel (" + name + ")",
"short": "false",
}
],
"thumb_url": "https://rc24.xyz/images/webhooks/news/%s.png" % mode,
"footer": "RiiConnect24 Script",
"footer_icon": "https://rc24.xyz/images/logo-small.png",
"ts": int(calendar.timegm(datetime.utcnow().timetuple())),
}
],
}
for url in config["webhook_urls"]:
requests.post(url, json=webhook, allow_redirects=True)
copy_file(region)
if config["packVFF"]:
packVFF(region)
os.remove(newsfilename)
# copy the temp files to the correct path that the Wii will request from the server
def copy(region, hour):
newsfilename2 = "news.bin.{}".format(str(datetime.utcnow().hour).zfill(2))
path = "{}/v2/{}_{}".format(config["file_path"], language_code, region)
mkdir_p(path)
path = "{}/{}".format(path, newsfilename2)
subprocess.call(["cp", newsfilename, path])
def copy_file(region):
if config["force_all"]:
for hour in range(0, 24):
copy(region, hour) # copy to all 24 files
else:
copy(region, datetime.utcnow().hour)
# Run the functions to make the news
def make_news_bin(mode, data, locations_data, region):
global dictionaries, languages, country_code, language_code
source = sources[mode]
if source is None:
print("Could not find %s in sources.")
topics_news = source["topics_news"]
languages = source["languages"]
language_code = source["language_code"]
country_code = source["country_code"]
numbers = 0
if not os.path.exists("newstime"):
os.mkdir("newstime")
for topics in list(topics_news.values()):
newstime = {}
for keys in list(data.keys()):
if topics in keys:
numbers += 1
newstime[data[keys][3]] = get_timestamp(1) + u32(numbers)
pickle.dump(
newstime,
open(
"newstime/newstime.%s-%s-%s-wii"
% (str(datetime.now().hour).zfill(2), mode, topics),
"wb",
),
)
dictionaries = []
# ton of functions to make news
header = make_header(data)
make_wiimenu_articles(header, data)
topics_table = make_topics_table(header, topics_news)
make_timestamps_table(mode, topics_table, topics_news)
articles_table = make_articles_table(mode, locations_data, header, data)
source_table = make_source_table(header, articles_table, source, data)
locations_table = make_locations_table(header, locations_data)
pictures_table = make_pictures_table(header, data)
make_articles(articles_table, pictures_table, data)
make_topics(topics_table, topics_news)
make_source_name_copyright(source_table, source, data)
make_locations(locations_data, locations_table)
make_source_pictures(source_table, data)
make_pictures(pictures_table, data)
make_riiconnect24_text()
write_dictionary(mode)
headlines = []
for article in list(data.values()):
try:
if article[3].replace(b"\n", b"").decode("utf-16be") not in headlines:
headlines.append(
article[3].replace(b"\n", b"").decode("utf-16be") + "\n"
)
except UnicodeDecodeError:
pass
make_news = "".join(headlines)
purge_cache(region, source)
return make_news
# This is a function used to count offsets
def offset_count():
return u32(
12
+ sum(
len(values)
for dictionary in dictionaries
for values in list(dictionary.values())
if values
)
)
# Return a timestamp
def get_timestamp(mode):
if mode == 1:
return u32(
int((calendar.timegm(datetime.utcnow().timetuple()) - 946684800) / 60)
)
elif mode == 2:
return u32(
int((calendar.timegm(datetime.utcnow().timetuple()) - 946684800) / 60)
+ 1500
)
# Remove duplicate articles
def remove_duplicates(data):
headlines = []
for k, v in list(data.items()):
if v[3] not in headlines:
headlines.append(v[3])
elif v[3] in headlines:
del data[k]
return data
# Make the news.bin
# First part of the header
def make_header(data):
header = {}
dictionaries.append(header)
header["updated_timestamp_1"] = get_timestamp(1) # Updated time.
header["term_timestamp"] = get_timestamp(2) # Timestamp for the term.
header["country_code"] = u32_littleendian(country_code) # Wii Country Code.
header["updated_timestamp_2"] = get_timestamp(1) # 3rd timestamp.
# List of languages that appear on the language select screen
numbers = 0
for language in languages:
numbers += 1
header["language_select_%s" % numbers] = u8(language)
# Fills the rest of the languages as null
while numbers < 16:
numbers += 1
header["language_select_%s" % numbers] = u8(255)
header["language_code"] = u8(language_code) # Wii language code.
header["goo_flag"] = u8(0) # Flag to make the Globe display "Powered by Goo".
header["language_select_screen_flag"] = u8(
0
) # Flag to bring up the language select screen.
header["download_interval"] = u8(
30
) # Interval in minutes to check for new articles to display on the Wii Menu.
header["message_offset"] = u32(0) # Offset for a message.
header["topics_number"] = u32(0) # Number of entries for the topics table.
header["topics_offset"] = u32(0) # Offset for the topics table.
header["articles_number"] = u32(0) # Number of entries for the articles table.
header["articles_offset"] = u32(0) # Offset for the articles table.
header["source_number"] = u32(0) # Number of entries for the source table.
header["source_offset"] = u32(0) # Offset for the source table.
header["locations_number"] = u32(0) # Number of entries for the locations.
header["locations_offset"] = u32(0) # Offset for the locations table.
header["pictures_number"] = u32(0) # Number of entries for the pictures table.
header["pictures_offset"] = u32(0) # Offset for the pictures table.
header["count"] = u16(480) # Count value.
header["unknown"] = u16(0) # Unknown.
header["wiimenu_articles_number"] = u32(0) # Number of Wii Menu article entries.
header["wiimenu_articles_offset"] = u32(0) # Offset for the Wii Menu article table.
header[
"wiimenu_articles_offset"
] = offset_count() # Offset for the Wii Menu article table.
numbers = 0
headlines = []
for article in list(data.values()):
if numbers < 11:
if article[3].replace(b"\n", b"") not in headlines:
numbers += 1
headlines.append(article[3])
header["headline_%s_size" % numbers] = u32(0) # Size of the headline.
header["headline_%s_offset" % numbers] = u32(
0
) # Offset for the headline.
return header
# Headlines to display on the Wii Menu
def make_wiimenu_articles(header, data):
wiimenu_articles = {}
dictionaries.append(wiimenu_articles)
numbers = 0
headlines = []
for article in list(data.values()):
if numbers < 11:
if article[3] not in headlines:
numbers += 1
headlines.append(article[3])
header["headline_%s_size" % numbers] = u32(
len(article[3].replace(b"\n", b""))
) # Size of the headline.
header[
"headline_%s_offset" % numbers
] = offset_count() # Offset for the headline.
wiimenu_articles["headline_%s" % numbers] = article[3].replace(
b"\n", b""
) # Headline.
# for some reason, the News Channel uses this padding to separate news articles
if (int(binascii.hexlify(offset_count()), 16) + 2) % 4 == 0:
wiimenu_articles["padding_%s" % numbers] = u16(0) # Padding.
elif (int(binascii.hexlify(offset_count()), 16) + 4) % 4 == 0:
wiimenu_articles["padding_%s" % numbers] = u32(0) # Padding.
header["wiimenu_articles_number"] = u32(
numbers
) # Number of Wii Menu article entries.
return wiimenu_articles
# Topics table
def make_topics_table(header, topics_news):
topics_table = {}
dictionaries.append(topics_table)
header["topics_offset"] = offset_count() # Offset for the topics table.
topics_table["new_topics_offset"] = u32(0) # Offset for the newest topic.
topics_table["new_topics_article_size"] = u32(
0
) # Size for the amount of articles to choose for the newest topic.
topics_table["new_topics_article_offset"] = u32(
0
) # Offset for the articles to choose for the newest topic.
numbers = 0
for _ in list(topics_news.values()):
numbers += 1
topics_table["topics_%s_offset" % str(numbers)] = u32(
0
) # Offset for the topic.
topics_table["topics_%s_article_number" % str(numbers)] = u32(
0
) # Number of articles that will be in a certain topic.
topics_table["topics_%s_article_offset" % str(numbers)] = u32(
0
) # Offset for the articles to choose for the topic.
header["topics_number"] = u32(
numbers + 1
) # Number of entries for the topics table.
return topics_table
# Timestamps table
def make_timestamps_table(mode, topics_table, topics_news):
timestamps_table = {}
dictionaries.append(timestamps_table)
def timestamps_table_add(topics):
times = {}
times_files = []
for numbers in range(0, 24):
start_time = datetime.today() - timedelta(hours=numbers)
times_files.append(
"newstime/newstime.%s-%s-%s-wii"
% (str(start_time)[11:-13], str(mode), topics)
)
try:
for files in times_files:
with open(files, "rb") as pickled:
newstime = pickle.load(
pickled, encoding="bytes"
) # TODO: Change stored encoding later
for keys in list(newstime.keys()):
removed = False
if keys not in times:
for keys2 in times.keys():
if difflib.SequenceMatcher(None, keys.decode("utf-16be"), keys2.decode("utf-16be")).ratio() > 0.85:
removed = True
break
else:
removed = True
if not removed:
times[keys] = newstime[keys]
except:
pass
timestamps = b""
counter = 0
for value in times.values():
timestamps = timestamps + value
counter += 1
return timestamps, counter
numbers = 0
for topics in list(topics_news.values()):
numbers += 1
timestamps = timestamps_table_add(topics)
if timestamps[1] != 0:
topics_table["topics_%s_article_number" % numbers] = u32(timestamps[1])
topics_table[
"topics_%s_article_offset" % numbers
] = offset_count() # Offset for the articles to choose for the topic.
timestamps_table["timestamps_%s" % numbers] = timestamps[0] # Timestamps.
return timestamps_table
# Articles table
def make_articles_table(mode, locations_data, header, data):
articles_table = {}
dictionaries.append(articles_table)
p_number = 0
numbers = 0
header["articles_offset"] = offset_count()
for keys, article in list(data.items()):
numbers += 1
articles_table["article_%s_number" % numbers] = u32(
numbers
) # Number for the article.
articles_table["source_%s_number" % numbers] = u32(0) # Number for the source.
articles_table["location_%s_number" % numbers] = u32(
4294967295
) # Number for the location.
for locations in list(locations_data.keys()):
for article_name in locations_data[locations][2]:
if keys == article_name:
articles_table["location_%s_number" % numbers] = u32(
list(locations_data.keys()).index(locations)
) # Number for the location.
if article[4] is not None:
articles_table["term_timestamp_%s" % numbers] = get_timestamp(
1
) # Timestamp for the term.
articles_table["picture_%s_number" % numbers] = u32(
p_number
) # Number for the picture.
p_number += 1
else:
articles_table["term_timestamp_%s" % numbers] = u32(
0
) # Timestamp for the term.
articles_table["picture_%s_number" % numbers] = u32(
4294967295
) # Number for the picture.
articles_table["published_time_%s" % numbers] = article[0] # Published time.
articles_table["updated_time_%s" % numbers] = get_timestamp(1) # Updated time.
articles_table["headline_%s_size" % numbers] = u32(
len(article[3].replace(b"\n", b""))
) # Size of the headline.
articles_table["headline_%s_offset" % numbers] = u32(
0
) # Offset for the headline.
articles_table["article_%s_size" % numbers] = u32(
len(article[2])
) # Size of the article.
articles_table["article_%s_offset" % numbers] = u32(
0
) # Offset for the article.
header["articles_number"] = u32(
numbers
) # Number of entries for the articles table.
if config["production"]:
statsd.increment("news.total_articles", numbers)
statsd.increment("news.articles." + mode, numbers)
return articles_table
# Source table
def make_source_table(header, articles_table, source, data):
source_table = {}
dictionaries.append(source_table)
header["source_offset"] = offset_count() # Offset for the source table.
source_articles = []
numbers = 0
numbers_article = 0
for article in list(data.values()):
if article[8] not in source_articles:
source_articles.append(article[8])
source_table["source_picture_%s" % article[8]] = u8(
source["picture"]
) # Picture for the source.
source_table["source_position_%s" % article[8]] = u8(
source["position"]
) # Position for the source.
source_table["padding_%s" % article[8]] = u16(0) # Padding.
source_table["pictures_size_%s" % article[8]] = u32(
0
) # Size of the source picture.
source_table["pictures_offset_%s" % article[8]] = u32(
0
) # Offset for the source picture.
source_table["name_size_%s" % article[8]] = u32(
0
) # Size of the source name.
source_table["name_offset_%s" % article[8]] = u32(
0
) # Offset for the source name.
source_table["copyright_size_%s" % article[8]] = u32(
0
) # Size of the copyright.
source_table["copyright_offset_%s" % article[8]] = u32(
0
) # Offset for the copyright.
numbers += 1
for article in list(data.values()):
numbers_article += 1
articles_table["source_%s_number" % numbers_article] = u32(
source_articles.index(article[8])
) # Number for the source.
header["source_number"] = u32(numbers) # Number of entries for the source table.
return source_table
# Locations data table
def make_locations_table(header, locations_data):
locations_table = {}
dictionaries.append(locations_table)
header["locations_offset"] = offset_count() # Offset for the locations table.
locations_number = 0
for loc_coord in list(locations_data.values()):
locations_table["location_%s_offset" % locations_number] = u32(
0
) # Offset for the locations.
locations_table["location_%s_coordinates" % locations_number] = loc_coord[
0
] # Coordinates of the locations.
locations_number += 1
header["locations_number"] = u32(
locations_number
) # Number of entries for the locations.
if config["production"]:
statsd.increment("news.total_locations", locations_number)
return locations_table
# Pictures table
def make_pictures_table(header, data):
pictures_table = {}
dictionaries.append(pictures_table)
header["pictures_offset"] = offset_count() # Offset for the pictures table.
pictures_number = 0
numbers = 0
for article in list(data.values()):
numbers += 1
if article[4] is not None:
if article[5] is not None:
pictures_table["credits_%s_size" % numbers] = u32(
len(article[5])
) # Size of the credits.
pictures_table["credits_%s_offset" % numbers] = u32(
0
) # Offset for the credits.
else:
pictures_table["credits_%s_size" % numbers] = u32(
0
) # Size of the credits.
pictures_table["credits_%s_offset" % numbers] = u32(
0
) # Offset for the credits.
if article[6] is not None:
pictures_table["captions_%s_size" % numbers] = u32(
len(article[6])
) # Size of the captions.
pictures_table["captions_%s_offset" % numbers] = u32(
0
) # Offset for the captions.
else:
pictures_table["captions_%s_size" % numbers] = u32(
0
) # Size of the credits.
pictures_table["captions_%s_offset" % numbers] = u32(
0
) # Offset for the captions.
pictures_number += 1
pictures_table["pictures_%s_size" % numbers] = u32(
len(article[4])
) # Size of the pictures.
pictures_table["pictures_%s_offset" % numbers] = u32(
0
) # Offset for the pictures.
header["pictures_number"] = u32(
pictures_number
) # Number of entries for the pictures table.
if config["production"]:
statsd.increment("news.total_pictures", pictures_number)
return pictures_table
# Add the articles
def make_articles(articles_table, pictures_table, data):
articles = {}
dictionaries.append(articles)
numbers = 0
for article in list(data.values()):
numbers += 1
articles_table[
"headline_%s_offset" % numbers
] = offset_count() # Offset for the headline.
articles["headline_%s_read" % numbers] = article[3].replace(
b"\n", b""
) # Read the headline.
articles["padding_%s_headline" % numbers] = u16(0) # Padding for the headline.
articles_table[
"article_%s_offset" % numbers
] = offset_count() # Offset for the article.
articles["article_%s_read" % numbers] = article[2] # Read the article.
articles["padding_%s_article" % numbers] = u16(0) # Padding for the article.
if article[4] is not None:
if article[6] is not None:
pictures_table[
"captions_%s_offset" % numbers
] = offset_count() # Offset for the caption.
articles["captions_%s_read" % numbers] = article[6] # Read the caption.
articles["padding_%s_captions" % numbers] = u16(
0
) # Padding for the caption.
if article[5] is not None:
pictures_table[
"credits_%s_offset" % numbers
] = offset_count() # Offset for the credits.
articles["credits_%s_read" % numbers] = article[5] # Read the credits.
articles["padding_%s_credits" % numbers] = u16(
0
) # Padding for the credits.
return articles
# Add the topics
def make_topics(topics_table, topics_news):
topics = {}
dictionaries.append(topics)
numbers = 0
for keys in list(topics_news.keys()):
numbers += 1
topics_table[
"topics_%s_offset" % str(numbers)
] = offset_count() # Offset for the topics.
topics["topics_%s_read" % numbers] = newsdownload.enc(keys) # Read the topics.
topics["padding_%s_topics" % numbers] = u16(0) # Padding for the topics.
return topics
def make_source_name_copyright(source_table, source, data):
source_name_copyright = {}
dictionaries.append(source_name_copyright)
sources = []
source_names = {}
for article in list(data.values()):
if article[8] not in sources:
if article[8] in source_names:
source_name = source_names[article[8]]
source_table["name_size_%s" % article[8]] = u32(
len(source_name)
) # Size of the source name.
source_table[
"name_offset_%s" % article[8]
] = offset_count() # Offset for the source name.
source_name_copyright[
"source_name_read_%s" % article[8]
] = source_name # Read the source name.
source_name_copyright["padding_source_name_%s" % article[8]] = u16(
0
) # Padding for the source name.
copyright = newsdownload.enc(source["copyright"].format(date.today().year))
source_table["copyright_size_%s" % article[8]] = u32(
len(copyright)
) # Size of the copyright.
source_table[
"copyright_offset_%s" % article[8]
] = offset_count() # Offset for the copyright.
source_name_copyright[
"copyright_read_%s" % article[8]
] = copyright # Read the copyright.
source_name_copyright["padding_copyright_%s" % article[8]] = u16(
0
) # Padding for the copyright.
sources.append(article[8])
# Add the locations
def make_locations(locations_data, locations_table):
locations = {}
dictionaries.append(locations)
numbers = 0
for loc_text in list(locations_data.values()):
locations_table[
"location_%s_offset" % numbers
] = offset_count() # Offset for the locations.
locations["location_%s_read" % numbers] = loc_text[1] # Read the locations.
locations["nullbyte_%s_locations" % numbers] = u16(
0
) # Null byte for the locations.
numbers += 1
return locations
# Add the source pictures
def make_source_pictures(source_table, data):
source_pictures = {}
dictionaries.append(source_pictures)
source_articles = []
sources = [
"ANP",
"AP",
"dpa",
"Reuters",
"SID",
] # these are the news sources which will use a custom JPG for the logo
for article in list(data.values()):
if article[8] not in source_articles:
if article[8] in sources:
source_articles.append(article[8])
source_table["pictures_offset_%s" % article[8]] = offset_count()
with open(
"./Channels/News_Channel/logos/%s.jpg" % article[8], "rb"
) as source_file:
image = source_pictures["logo_%s" % article[8]] = source_file.read()
source_table["pictures_size_%s" % article[8]] = u32(len(image))
if source_table["source_picture_%s" % article[8]] != u8(0):
source_table["source_picture_%s" % article[8]] = u8(0)
return source_pictures
# Add the pictures
def make_pictures(pictures_table, data):
pictures = {}
dictionaries.append(pictures)
numbers = 0
for article in list(data.values()):
numbers += 1
if article[4] is not None:
if "pictures_%s_offset" % numbers in pictures_table:
pictures_table[
"pictures_%s_offset" % numbers
] = offset_count() # Offset for the pictures.
pictures["pictures_%s_read" % numbers] = article[4] # Read the pictures.
pictures["nullbyte_%s_pictures" % numbers] = u8(
0
) # Null byte for the pictures.
for types in ["captions", "credits"]:
if pictures_table["%s_%s_offset" % (types, numbers)] != u32(
0
) and pictures_table["%s_%s_size" % (types, numbers)] == u32(0):
pictures_table["%s_%s_offset" % (types, numbers)] = u32(0)
return pictures
# Add RiiConnect24 text
def make_riiconnect24_text():
riiconnect24_text = {}
dictionaries.append(riiconnect24_text)
# This can be used to identify that we made this file
riiconnect24_text["padding"] = u32(0) * 4 # Padding.
riiconnect24_text["text"] = "RIICONNECT24".encode("ascii") # Text.
def purge_cache(region, source):
if config["production"]:
if config["cloudflare_cache_purge"]:
print("\nPurging cache...")
cf = CloudFlare.CloudFlare(token=config["cloudflare_token"])
for country in source["countries"]:
url = "http://{}/v2/{}/{}/news.bin.{}".format(
config["cloudflare_hostname"],
str(source["language_code"]),
str(country).zfill(3),
str(datetime.utcnow().hour).zfill(2),
)
purge_cache2(url)
url = "http://{}/v2/{}_{}/wc24dl.vff".format(
config["cloudflare_hostname"],
str(source["language_code"]),
region,
)
purge_cache2(url)
def purge_cache2(url):
cf = CloudFlare.CloudFlare(token=config["cloudflare_token"])
cf.zones.purge_cache.post(
config["cloudflare_zone_name"],
data={
"files": [
url,
]
},
)
def packVFF(region):
path = "{}/v2/{}_{}/".format(config["file_path"], language_code, region)
os.makedirs(path + "wc24dl", exist_ok=True)
for i in range(0, 24):
with open(path + "news.bin.%s" % str(i).zfill(2), "rb") as source:
with open(path + "wc24dl/2.BIN.%s" % str(i).zfill(2), "wb") as dest:
dest.write(source.read()[320:])
subprocess.call(
[
config["winePath"],
config["prfArcPath"],
"-v",
"3712",
path + "wc24dl",
path + "wc24dl.vff",
],
stdout=subprocess.DEVNULL,
) # Pack VFF
for i in range(0, 24):
os.remove(path + "wc24dl/2.BIN.%s" % str(i).zfill(2))
os.rmdir(path + "wc24dl")
# Write everything to the file
def write_dictionary(mode):
for dictionary in dictionaries:
for name, value in dictionary.items():
with open(newsfilename + "-1", "ba+") as dest_file:
dest_file.write(value)
with open(newsfilename + "-1", "rb") as source_file:
read = source_file.read()
with open(newsfilename, "bw+") as dest_file:
dest_file.write(u32(512))
dest_file.write(u32(len(read) + 12))
dest_file.write(
binascii.unhexlify(format(binascii.crc32(read) & 0xFFFFFFFF, "08x"))
)
dest_file.write(read)
if config["production"]:
nlzss.encode_file(newsfilename, newsfilename)
with open(newsfilename, "rb") as source_file:
read = source_file.read()
with open(config["key_path"], "rb") as source_file:
private_key_data = source_file.read()
private_key = rsa.PrivateKey.load_pkcs1(private_key_data, "PEM")
signature = rsa.sign(read, private_key, "SHA-1")
with open(newsfilename, "wb") as dest_file:
dest_file.write(binascii.unhexlify("0".zfill(128)))
dest_file.write(signature)
dest_file.write(read)
# Remove the rest of the other files
os.remove(newsfilename + "-1")
print("\n")
print("Wrote " + newsfilename)
|
RiiConnect24/File-Maker
|
Channels/News_Channel/newsmake.py
|
Python
|
agpl-3.0
| 39,847
|
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) cgstudiomap <cgstudiomap@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import logging
import datetime
from openerp import models, fields, api
_logger = logging.getLogger(__name__)
class ResPartnerCountView(models.Model):
"""Represent the visit from a partner to a company page."""
_name = 'res.partner.count.view'
_description = __doc__
active_partner_id = fields.Many2one('res.partner', string='Viewer')
passive_partner_id = fields.Many2one('res.partner', string='Viewed')
host = fields.Char('Host the viewer used')
class ResPartner(models.Model):
"""Add a method to add a count."""
_inherit = 'res.partner'
@api.model
def add_count_view(self, viewed_partner, request):
"""Add an entry res.partner.count.view.
:param viewed_partner: The visited partner.
:param werkzeug.local.LocalStack request: request the view has been done with.
:return: the new res.partner.count.view entry.
"""
counter_pool = self.env['res.partner.count.view']
return counter_pool.create({
'active_partner_id': self.id,
'passive_partner_id': viewed_partner.id,
'host': request.httprequest.host,
})
|
cgstudiomap/cgstudiomap
|
main/local_modules/res_partner_count/res_partner.py
|
Python
|
agpl-3.0
| 2,136
|
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# LICENSE
#
# Copyright (C) 2010-2022 GEM Foundation, G. Weatherill, M. Pagani,
# D. Monelli.
#
# The Hazard Modeller's Toolkit is free software: you can redistribute
# it and/or modify it under the terms of the GNU Affero General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
#
# You should have received a copy of the GNU Affero General Public License
# along with OpenQuake. If not, see <http://www.gnu.org/licenses/>
#
# DISCLAIMER
#
# The software Hazard Modeller's Toolkit (openquake.hmtk) provided herein
# is released as a prototype implementation on behalf of
# scientists and engineers working within the GEM Foundation (Global
# Earthquake Model).
#
# It is distributed for the purpose of open collaboration and in the
# hope that it will be useful to the scientific, engineering, disaster
# risk and software design communities.
#
# The software is NOT distributed as part of GEM’s OpenQuake suite
# (https://www.globalquakemodel.org/tools-products) and must be considered as a
# separate entity. The software provided herein is designed and implemented
# by scientific staff. It is not developed to the design standards, nor
# subject to same level of critical review by professional software
# developers, as GEM’s OpenQuake software suite.
#
# Feedback and contribution to the software is welcome, and can be
# directed to the hazard scientific staff of the GEM Model Facility
# (hazard@globalquakemodel.org).
#
# The Hazard Modeller's Toolkit (openquake.hmtk) is therefore distributed WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# The GEM Foundation, and the authors of the software, assume no
# liability for use of the software.
"""
Module :mod:`openquake.hmtk.parsers.catalogue.base` defines an abstract base
class for :class:`CatalogueParser <BaseCatalogueParser>`.
"""
import abc
import os.path
class BaseCatalogueParser(object):
"""
A base class for a Catalogue Parser
"""
def __init__(self, input_file):
"""
Initialise the object and check input file existance
"""
self.input_file = input_file
if not os.path.exists(self.input_file):
raise IOError('File not found: %s' % input_file)
@abc.abstractmethod
def read_file(self):
"""
Return an instance of the class :class:`Catalogue`
"""
class BaseCatalogueWriter(object):
"""
A base class for a Catalogue writer
"""
def __init__(self, output_file):
"""
Initialise the object and check output file existance. If file already
exists then raise error
"""
self.output_file = output_file
if os.path.exists(self.output_file):
raise IOError('Catalogue output file %s already exists!' %
self.output_file)
@abc.abstractmethod
def write_file(self):
"""
Return an instance of the class :class:`Catalogue`
"""
|
gem/oq-engine
|
openquake/hmtk/parsers/catalogue/base.py
|
Python
|
agpl-3.0
| 3,213
|
# -*- coding: UTF-8 -*-
"""Multi-platform terminal size get function.
Source: https://gist.githubusercontent.com/jtriley/1108174/raw/6ec4c846427120aa342912956c7f717b586f1ddb/terminalsize.py
"""
import os
import shlex
import struct
import platform
import subprocess
__author__ = "Justin Riley (https://gist.github.com/jtriley)"
__all__ = __features__ = ["get_terminal_size"]
def get_terminal_size():
""" getTerminalSize()
- get width and height of console
- works on linux,os x,windows,cygwin(windows)
originally retrieved from:
http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python
"""
current_os = platform.system()
tuple_xy = None
if current_os == 'Windows':
tuple_xy = _get_terminal_size_windows()
if tuple_xy is None:
tuple_xy = _get_terminal_size_tput()
# needed for window's python in cygwin's xterm!
if current_os in ['Linux', 'Darwin'] or current_os.startswith('CYGWIN'):
tuple_xy = _get_terminal_size_linux()
return tuple_xy
def _get_terminal_size_windows():
try:
from ctypes import windll, create_string_buffer
# stdin handle is -10
# stdout handle is -11
# stderr handle is -12
h = windll.kernel32.GetStdHandle(-12)
csbi = create_string_buffer(22)
res = windll.kernel32.GetConsoleScreenBufferInfo(h, csbi)
if res:
(bufx, bufy, curx, cury, wattr,
left, top, right, bottom,
maxx, maxy) = struct.unpack("hhhhHhhhhhh", csbi.raw)
sizex = right - left + 1
sizey = bottom - top + 1
return sizex, sizey
except:
pass
def _get_terminal_size_tput():
# get terminal width
# src: http://stackoverflow.com/questions/263890/how-do-i-find-the-width-height-of-a-terminal-window
try:
cols = int(subprocess.check_call(shlex.split('tput cols')))
rows = int(subprocess.check_call(shlex.split('tput lines')))
return cols, rows
except:
pass
def _get_terminal_size_linux():
def ioctl_gwinsz(fd):
try:
import fcntl
import termios
cr = struct.unpack('hh',
fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
return cr
except:
pass
cr = ioctl_gwinsz(0) or ioctl_gwinsz(1) or ioctl_gwinsz(2)
if not cr:
try:
fd = os.open(os.ctermid(), os.O_RDONLY)
cr = ioctl_gwinsz(fd)
os.close(fd)
except:
pass
if not cr:
try:
cr = (os.environ['LINES'], os.environ['COLUMNS'])
except:
return None
return int(cr[1]), int(cr[0])
if __name__ == "__main__":
print("width = {}, height = {}".format(*get_terminal_size()))
|
dhondta/tinyscript
|
tinyscript/helpers/termsize.py
|
Python
|
agpl-3.0
| 2,855
|
from __future__ import absolute_import
# coding=utf-8
__author__ = "Gina Häußge <osd@foosel.net> based on work by David Braam"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
import os
import glob
import time
import re
import threading
import Queue as queue
import logging
import serial
import octoprint.plugin
from collections import deque
from octoprint.util.avr_isp import stk500v2
from octoprint.util.avr_isp import ispBase
from octoprint.settings import settings
from octoprint.events import eventManager, Events
from octoprint.filemanager import valid_file_type
from octoprint.filemanager.destinations import FileDestinations
from octoprint.util import getExceptionString, getNewTimeout, sanitizeAscii, filterNonAscii
from octoprint.util.virtual import VirtualPrinter
try:
import _winreg
except:
pass
def serialList():
baselist=[]
if os.name=="nt":
try:
key=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,"HARDWARE\\DEVICEMAP\\SERIALCOMM")
i=0
while(1):
baselist+=[_winreg.EnumValue(key,i)[1]]
i+=1
except:
pass
baselist = baselist \
+ glob.glob("/dev/ttyUSB*") \
+ glob.glob("/dev/ttyACM*") \
+ glob.glob("/dev/ttyAMA*") \
+ glob.glob("/dev/tty.usb*") \
+ glob.glob("/dev/cu.*") \
+ glob.glob("/dev/cuaU*") \
+ glob.glob("/dev/rfcomm*")
additionalPorts = settings().get(["serial", "additionalPorts"])
for additional in additionalPorts:
baselist += glob.glob(additional)
prev = settings().get(["serial", "port"])
if prev in baselist:
baselist.remove(prev)
baselist.insert(0, prev)
if settings().getBoolean(["devel", "virtualPrinter", "enabled"]):
baselist.append("VIRTUAL")
return baselist
def baudrateList():
ret = [250000, 230400, 115200, 57600, 38400, 19200, 9600]
prev = settings().getInt(["serial", "baudrate"])
if prev in ret:
ret.remove(prev)
ret.insert(0, prev)
return ret
gcodeToEvent = {
# pause for user input
"M226": Events.WAITING,
"M0": Events.WAITING,
"M1": Events.WAITING,
# part cooler
"M245": Events.COOLING,
# part conveyor
"M240": Events.CONVEYOR,
# part ejector
"M40": Events.EJECT,
# user alert
"M300": Events.ALERT,
# home print head
"G28": Events.HOME,
# emergency stop
"M112": Events.E_STOP,
# motors on/off
"M80": Events.POWER_ON,
"M81": Events.POWER_OFF,
}
class MachineCom(object):
STATE_NONE = 0
STATE_OPEN_SERIAL = 1
STATE_DETECT_SERIAL = 2
STATE_DETECT_BAUDRATE = 3
STATE_CONNECTING = 4
STATE_OPERATIONAL = 5
STATE_PRINTING = 6
STATE_PAUSED = 7
STATE_CLOSED = 8
STATE_ERROR = 9
STATE_CLOSED_WITH_ERROR = 10
STATE_TRANSFERING_FILE = 11
def __init__(self, port = None, baudrate = None, callbackObject = None):
self._logger = logging.getLogger(__name__)
self._serialLogger = logging.getLogger("SERIAL")
if port == None:
port = settings().get(["serial", "port"])
if baudrate == None:
settingsBaudrate = settings().getInt(["serial", "baudrate"])
if settingsBaudrate is None:
baudrate = 0
else:
baudrate = settingsBaudrate
if callbackObject == None:
callbackObject = MachineComPrintCallback()
self._port = port
self._baudrate = baudrate
self._callback = callbackObject
self._state = self.STATE_NONE
self._serial = None
self._baudrateDetectList = baudrateList()
self._baudrateDetectRetry = 0
self._temp = {}
self._tempOffset = {}
self._bedTemp = None
self._bedTempOffset = 0
self._commandQueue = queue.Queue()
self._currentZ = None
self._heatupWaitStartTime = 0
self._heatupWaitTimeLost = 0.0
self._currentExtruder = 0
self._alwaysSendChecksum = settings().getBoolean(["feature", "alwaysSendChecksum"])
self._currentLine = 1
self._resendDelta = None
self._lastLines = deque([], 50)
# enabled grbl mode if requested
self._grbl = settings().getBoolean(["feature", "grbl"])
# hooks
self._pluginManager = octoprint.plugin.plugin_manager()
self._gcode_hooks = self._pluginManager.get_hooks("octoprint.comm.protocol.gcode")
# SD status data
self._sdAvailable = False
self._sdFileList = False
self._sdFiles = []
# print job
self._currentFile = None
# regexes
floatPattern = "[-+]?[0-9]*\.?[0-9]+"
positiveFloatPattern = "[+]?[0-9]*\.?[0-9]+"
intPattern = "\d+"
self._regex_command = re.compile("^\s*([GM]\d+|T)")
self._regex_float = re.compile(floatPattern)
self._regex_paramZFloat = re.compile("Z(%s)" % floatPattern)
self._regex_paramSInt = re.compile("S(%s)" % intPattern)
self._regex_paramNInt = re.compile("N(%s)" % intPattern)
self._regex_paramTInt = re.compile("T(%s)" % intPattern)
self._regex_minMaxError = re.compile("Error:[0-9]\n")
self._regex_sdPrintingByte = re.compile("([0-9]*)/([0-9]*)")
self._regex_sdFileOpened = re.compile("File opened:\s*(.*?)\s+Size:\s*(%s)" % intPattern)
# Regex matching temperature entries in line. Groups will be as follows:
# - 1: whole tool designator incl. optional toolNumber ("T", "Tn", "B")
# - 2: toolNumber, if given ("", "n", "")
# - 3: actual temperature
# - 4: whole target substring, if given (e.g. " / 22.0")
# - 5: target temperature
self._regex_temp = re.compile("(B|T(\d*)):\s*(%s)(\s*\/?\s*(%s))?" % (positiveFloatPattern, positiveFloatPattern))
self._regex_repetierTempExtr = re.compile("TargetExtr([0-9]+):(%s)" % positiveFloatPattern)
self._regex_repetierTempBed = re.compile("TargetBed:(%s)" % positiveFloatPattern)
# multithreading locks
self._sendNextLock = threading.Lock()
self._sendingLock = threading.Lock()
# monitoring thread
self.thread = threading.Thread(target=self._monitor)
self.thread.daemon = True
self.thread.start()
def __del__(self):
self.close()
##~~ internal state management
def _changeState(self, newState):
if self._state == newState:
return
if newState == self.STATE_CLOSED or newState == self.STATE_CLOSED_WITH_ERROR:
if settings().get(["feature", "sdSupport"]):
self._sdFileList = False
self._sdFiles = []
self._callback.mcSdFiles([])
oldState = self.getStateString()
self._state = newState
self._log('Changing monitoring state from \'%s\' to \'%s\'' % (oldState, self.getStateString()))
self._callback.mcStateChange(newState)
def _log(self, message):
self._callback.mcLog(message)
self._serialLogger.debug(message)
def _addToLastLines(self, cmd):
self._lastLines.append(cmd)
self._logger.debug("Got %d lines of history in memory" % len(self._lastLines))
##~~ getters
def getState(self):
return self._state
def getStateString(self):
if self._state == self.STATE_NONE:
return "Offline"
if self._state == self.STATE_OPEN_SERIAL:
return "Opening serial port"
if self._state == self.STATE_DETECT_SERIAL:
return "Detecting serial port"
if self._state == self.STATE_DETECT_BAUDRATE:
return "Detecting baudrate"
if self._state == self.STATE_CONNECTING:
return "Connecting"
if self._state == self.STATE_OPERATIONAL:
return "Operational"
if self._state == self.STATE_PRINTING:
if self.isSdFileSelected():
return "Printing from SD"
elif self.isStreaming():
return "Sending file to SD"
else:
return "Printing"
if self._state == self.STATE_PAUSED:
return "Paused"
if self._state == self.STATE_CLOSED:
return "Closed"
if self._state == self.STATE_ERROR:
return "Error: %s" % (self.getShortErrorString())
if self._state == self.STATE_CLOSED_WITH_ERROR:
return "Error: %s" % (self.getShortErrorString())
if self._state == self.STATE_TRANSFERING_FILE:
return "Transfering file to SD"
return "?%d?" % (self._state)
def getShortErrorString(self):
if len(self._errorValue) < 20:
return self._errorValue
return self._errorValue[:20] + "..."
def getErrorString(self):
return self._errorValue
def isClosedOrError(self):
return self._state == self.STATE_ERROR or self._state == self.STATE_CLOSED_WITH_ERROR or self._state == self.STATE_CLOSED
def isError(self):
return self._state == self.STATE_ERROR or self._state == self.STATE_CLOSED_WITH_ERROR
def isOperational(self):
return self._state == self.STATE_OPERATIONAL or self._state == self.STATE_PRINTING or self._state == self.STATE_PAUSED or self._state == self.STATE_TRANSFERING_FILE
def isPrinting(self):
return self._state == self.STATE_PRINTING
def isSdPrinting(self):
return self.isSdFileSelected() and self.isPrinting()
def isSdFileSelected(self):
return self._currentFile is not None and isinstance(self._currentFile, PrintingSdFileInformation)
def isStreaming(self):
return self._currentFile is not None and isinstance(self._currentFile, StreamingGcodeFileInformation)
def isPaused(self):
return self._state == self.STATE_PAUSED
def isBusy(self):
return self.isPrinting() or self.isPaused()
def isSdReady(self):
return self._sdAvailable
def getPrintProgress(self):
if self._currentFile is None:
return None
return self._currentFile.getProgress()
def getPrintFilepos(self):
if self._currentFile is None:
return None
return self._currentFile.getFilepos()
def getPrintTime(self):
if self._currentFile is None or self._currentFile.getStartTime() is None:
return None
else:
return time.time() - self._currentFile.getStartTime()
def getPrintTimeRemainingEstimate(self):
printTime = self.getPrintTime()
if printTime is None:
return None
printTime /= 60
progress = self._currentFile.getProgress()
if progress:
printTimeTotal = printTime / progress
return printTimeTotal - printTime
else:
return None
def getTemp(self):
return self._temp
def getBedTemp(self):
return self._bedTemp
def getOffsets(self):
return self._tempOffset, self._bedTempOffset
def getConnection(self):
return self._port, self._baudrate
##~~ external interface
def close(self, isError = False):
printing = self.isPrinting() or self.isPaused()
if self._serial is not None:
if isError:
self._changeState(self.STATE_CLOSED_WITH_ERROR)
else:
self._changeState(self.STATE_CLOSED)
self._serial.close()
self._serial = None
if settings().get(["feature", "sdSupport"]):
self._sdFileList = []
if printing:
payload = None
if self._currentFile is not None:
payload = {
"file": self._currentFile.getFilename(),
"filename": os.path.basename(self._currentFile.getFilename()),
"origin": self._currentFile.getFileLocation()
}
eventManager().fire(Events.PRINT_FAILED, payload)
eventManager().fire(Events.DISCONNECTED)
def setTemperatureOffset(self, tool=None, bed=None):
if tool is not None:
self._tempOffset = tool
if bed is not None:
self._bedTempOffset = bed
def sendCommand(self, cmd):
cmd = cmd.encode('ascii', 'replace')
if self.isPrinting() and not self.isSdFileSelected():
self._commandQueue.put(cmd)
elif self.isOperational():
self._sendCommand(cmd)
def startPrint(self):
if not self.isOperational() or self.isPrinting():
return
if self._currentFile is None:
raise ValueError("No file selected for printing")
try:
self._currentFile.start()
wasPaused = self.isPaused()
self._changeState(self.STATE_PRINTING)
eventManager().fire(Events.PRINT_STARTED, {
"file": self._currentFile.getFilename(),
"filename": os.path.basename(self._currentFile.getFilename()),
"origin": self._currentFile.getFileLocation()
})
if self.isSdFileSelected():
if wasPaused:
self.sendCommand("M26 S0")
self._currentFile.setFilepos(0)
self.sendCommand("M24")
else:
self._sendNext()
except:
self._logger.exception("Error while trying to start printing")
self._errorValue = getExceptionString()
self._changeState(self.STATE_ERROR)
eventManager().fire(Events.ERROR, {"error": self.getErrorString()})
def startFileTransfer(self, filename, localFilename, remoteFilename):
if not self.isOperational() or self.isBusy():
logging.info("Printer is not operation or busy")
return
self._currentFile = StreamingGcodeFileInformation(filename, localFilename, remoteFilename)
self._currentFile.start()
self.sendCommand("M28 %s" % remoteFilename)
eventManager().fire(Events.TRANSFER_STARTED, {"local": localFilename, "remote": remoteFilename})
self._callback.mcFileTransferStarted(remoteFilename, self._currentFile.getFilesize())
def selectFile(self, filename, sd):
if self.isBusy():
return
if sd:
if not self.isOperational():
# printer is not connected, can't use SD
return
self.sendCommand("M23 %s" % filename)
else:
self._currentFile = PrintingGcodeFileInformation(filename, self.getOffsets)
eventManager().fire(Events.FILE_SELECTED, {
"file": self._currentFile.getFilename(),
"origin": self._currentFile.getFileLocation()
})
self._callback.mcFileSelected(filename, self._currentFile.getFilesize(), False)
def unselectFile(self):
if self.isBusy():
return
self._currentFile = None
eventManager().fire(Events.FILE_DESELECTED)
self._callback.mcFileSelected(None, None, False)
def cancelPrint(self):
if not self.isOperational() or self.isStreaming():
return
self._changeState(self.STATE_OPERATIONAL)
if self.isSdFileSelected():
self.sendCommand("M25") # pause print
self.sendCommand("M26 S0") # reset position in file to byte 0
eventManager().fire(Events.PRINT_CANCELLED, {
"file": self._currentFile.getFilename(),
"filename": os.path.basename(self._currentFile.getFilename()),
"origin": self._currentFile.getFileLocation()
})
def setPause(self, pause):
if self.isStreaming():
return
if not pause and self.isPaused():
self._changeState(self.STATE_PRINTING)
if self.isSdFileSelected():
self.sendCommand("M24")
else:
self._sendNext()
eventManager().fire(Events.PRINT_RESUMED, {
"file": self._currentFile.getFilename(),
"filename": os.path.basename(self._currentFile.getFilename()),
"origin": self._currentFile.getFileLocation()
})
elif pause and self.isPrinting():
self._changeState(self.STATE_PAUSED)
if self.isSdFileSelected():
self.sendCommand("M25") # pause print
eventManager().fire(Events.PRINT_PAUSED, {
"file": self._currentFile.getFilename(),
"filename": os.path.basename(self._currentFile.getFilename()),
"origin": self._currentFile.getFileLocation()
})
def getSdFiles(self):
return self._sdFiles
def startSdFileTransfer(self, filename):
if not self.isOperational() or self.isBusy():
return
self._changeState(self.STATE_TRANSFERING_FILE)
self.sendCommand("M28 %s" % filename.lower())
def endSdFileTransfer(self, filename):
if not self.isOperational() or self.isBusy():
return
self.sendCommand("M29 %s" % filename.lower())
self._changeState(self.STATE_OPERATIONAL)
self.refreshSdFiles()
def deleteSdFile(self, filename):
if not self.isOperational() or (self.isBusy() and
isinstance(self._currentFile, PrintingSdFileInformation) and
self._currentFile.getFilename() == filename):
# do not delete a file from sd we are currently printing from
return
self.sendCommand("M30 %s" % filename.lower())
self.refreshSdFiles()
def refreshSdFiles(self):
if not self.isOperational() or self.isBusy():
return
self.sendCommand("M20")
def initSdCard(self):
if not self.isOperational():
return
self.sendCommand("M21")
if settings().getBoolean(["feature", "sdAlwaysAvailable"]):
self._sdAvailable = True
self.refreshSdFiles()
self._callback.mcSdStateChange(self._sdAvailable)
def releaseSdCard(self):
if not self.isOperational() or (self.isBusy() and self.isSdFileSelected()):
# do not release the sd card if we are currently printing from it
return
self.sendCommand("M22")
self._sdAvailable = False
self._sdFiles = []
self._callback.mcSdStateChange(self._sdAvailable)
self._callback.mcSdFiles(self._sdFiles)
##~~ communication monitoring and handling
def _parseTemperatures(self, line):
result = {}
maxToolNum = 0
for match in re.finditer(self._regex_temp, line):
tool = match.group(1)
toolNumber = int(match.group(2)) if match.group(2) and len(match.group(2)) > 0 else None
if toolNumber > maxToolNum:
maxToolNum = toolNumber
try:
actual = float(match.group(3))
target = None
if match.group(4) and match.group(5):
target = float(match.group(5))
result[tool] = (toolNumber, actual, target)
except ValueError:
# catch conversion issues, we'll rather just not get the temperature update instead of killing the connection
pass
if "T0" in result.keys() and "T" in result.keys():
del result["T"]
return maxToolNum, result
def _processTemperatures(self, line):
maxToolNum, parsedTemps = self._parseTemperatures(line)
# extruder temperatures
if not "T0" in parsedTemps.keys() and not "T1" in parsedTemps.keys() and "T" in parsedTemps.keys():
# no T1 so only single reporting, "T" is our one and only extruder temperature
toolNum, actual, target = parsedTemps["T"]
if target is not None:
self._temp[0] = (actual, target)
elif 0 in self._temp.keys() and self._temp[0] is not None and isinstance(self._temp[0], tuple):
(oldActual, oldTarget) = self._temp[0]
self._temp[0] = (actual, oldTarget)
else:
self._temp[0] = (actual, None)
elif not "T0" in parsedTemps.keys() and "T" in parsedTemps.keys():
# Smoothieware sends multi extruder temperature data this way: "T:<first extruder> T1:<second extruder> ..." and therefore needs some special treatment...
_, actual, target = parsedTemps["T"]
del parsedTemps["T"]
parsedTemps["T0"] = (0, actual, target)
if "T0" in parsedTemps.keys():
for n in range(maxToolNum + 1):
tool = "T%d" % n
if not tool in parsedTemps.keys():
continue
toolNum, actual, target = parsedTemps[tool]
if target is not None:
self._temp[toolNum] = (actual, target)
elif toolNum in self._temp.keys() and self._temp[toolNum] is not None and isinstance(self._temp[toolNum], tuple):
(oldActual, oldTarget) = self._temp[toolNum]
self._temp[toolNum] = (actual, oldTarget)
else:
self._temp[toolNum] = (actual, None)
# bed temperature
if "B" in parsedTemps.keys():
toolNum, actual, target = parsedTemps["B"]
if target is not None:
self._bedTemp = (actual, target)
elif self._bedTemp is not None and isinstance(self._bedTemp, tuple):
(oldActual, oldTarget) = self._bedTemp
self._bedTemp = (actual, oldTarget)
else:
self._bedTemp = (actual, None)
def _monitor(self):
feedbackControls = settings().getFeedbackControls()
pauseTriggers = settings().getPauseTriggers()
feedbackErrors = []
#Open the serial port.
if not self._openSerial():
return
self._log("Connected to: %s, starting monitor" % self._serial)
if self._baudrate == 0:
self._log("Starting baud rate detection")
self._changeState(self.STATE_DETECT_BAUDRATE)
else:
self._changeState(self.STATE_CONNECTING)
#Start monitoring the serial port.
timeout = getNewTimeout("communication")
tempRequestTimeout = getNewTimeout("temperature")
sdStatusRequestTimeout = getNewTimeout("sdStatus")
startSeen = not settings().getBoolean(["feature", "waitForStartOnConnect"])
heatingUp = False
swallowOk = False
supportRepetierTargetTemp = settings().getBoolean(["feature", "repetierTargetTemp"])
while True:
try:
line = self._readline()
if line is None:
break
if line.strip() is not "":
timeout = getNewTimeout("communication")
##~~ Error handling
line = self._handleErrors(line)
##~~ SD file list
# if we are currently receiving an sd file list, each line is just a filename, so just read it and abort processing
if self._sdFileList and not "End file list" in line:
preprocessed_line = line.strip().lower()
fileinfo = preprocessed_line.rsplit(None, 1)
if len(fileinfo) > 1:
# we might have extended file information here, so let's split filename and size and try to make them a bit nicer
filename, size = fileinfo
try:
size = int(size)
except ValueError:
# whatever that was, it was not an integer, so we'll just use the whole line as filename and set size to None
filename = preprocessed_line
size = None
else:
# no extended file information, so only the filename is there and we set size to None
filename = preprocessed_line
size = None
if valid_file_type(filename, "gcode"):
if filterNonAscii(filename):
self._logger.warn("Got a file from printer's SD that has a non-ascii filename (%s), that shouldn't happen according to the protocol" % filename)
else:
self._sdFiles.append((filename, size))
continue
##~~ Temperature processing
if ' T:' in line or line.startswith('T:') or ' T0:' in line or line.startswith('T0:'):
self._processTemperatures(line)
self._callback.mcTempUpdate(self._temp, self._bedTemp)
#If we are waiting for an M109 or M190 then measure the time we lost during heatup, so we can remove that time from our printing time estimate.
if not 'ok' in line:
heatingUp = True
if self._heatupWaitStartTime != 0:
t = time.time()
self._heatupWaitTimeLost = t - self._heatupWaitStartTime
self._heatupWaitStartTime = t
elif supportRepetierTargetTemp and ('TargetExtr' in line or 'TargetBed' in line):
matchExtr = self._regex_repetierTempExtr.match(line)
matchBed = self._regex_repetierTempBed.match(line)
if matchExtr is not None:
toolNum = int(matchExtr.group(1))
try:
target = float(matchExtr.group(2))
if toolNum in self._temp.keys() and self._temp[toolNum] is not None and isinstance(self._temp[toolNum], tuple):
(actual, oldTarget) = self._temp[toolNum]
self._temp[toolNum] = (actual, target)
else:
self._temp[toolNum] = (None, target)
self._callback.mcTempUpdate(self._temp, self._bedTemp)
except ValueError:
pass
elif matchBed is not None:
try:
target = float(matchBed.group(1))
if self._bedTemp is not None and isinstance(self._bedTemp, tuple):
(actual, oldTarget) = self._bedTemp
self._bedTemp = (actual, target)
else:
self._bedTemp = (None, target)
self._callback.mcTempUpdate(self._temp, self._bedTemp)
except ValueError:
pass
##~~ SD Card handling
elif 'SD init fail' in line or 'volume.init failed' in line or 'openRoot failed' in line:
self._sdAvailable = False
self._sdFiles = []
self._callback.mcSdStateChange(self._sdAvailable)
elif 'Not SD printing' in line:
if self.isSdFileSelected() and self.isPrinting():
# something went wrong, printer is reporting that we actually are not printing right now...
self._sdFilePos = 0
self._changeState(self.STATE_OPERATIONAL)
elif 'SD card ok' in line and not self._sdAvailable:
self._sdAvailable = True
self.refreshSdFiles()
self._callback.mcSdStateChange(self._sdAvailable)
elif 'Begin file list' in line:
self._sdFiles = []
self._sdFileList = True
elif 'End file list' in line:
self._sdFileList = False
self._callback.mcSdFiles(self._sdFiles)
elif 'SD printing byte' in line:
# answer to M27, at least on Marlin, Repetier and Sprinter: "SD printing byte %d/%d"
match = self._regex_sdPrintingByte.search(line)
self._currentFile.setFilepos(int(match.group(1)))
self._callback.mcProgress()
elif 'File opened' in line:
# answer to M23, at least on Marlin, Repetier and Sprinter: "File opened:%s Size:%d"
match = self._regex_sdFileOpened.search(line)
self._currentFile = PrintingSdFileInformation(match.group(1), int(match.group(2)))
elif 'File selected' in line:
# final answer to M23, at least on Marlin, Repetier and Sprinter: "File selected"
if self._currentFile is not None:
self._callback.mcFileSelected(self._currentFile.getFilename(), self._currentFile.getFilesize(), True)
eventManager().fire(Events.FILE_SELECTED, {
"file": self._currentFile.getFilename(),
"origin": self._currentFile.getFileLocation()
})
elif 'Writing to file' in line:
# anwer to M28, at least on Marlin, Repetier and Sprinter: "Writing to file: %s"
self._printSection = "CUSTOM"
self._changeState(self.STATE_PRINTING)
line = "ok"
elif 'Done printing file' in line:
# printer is reporting file finished printing
self._sdFilePos = 0
self._callback.mcPrintjobDone()
self._changeState(self.STATE_OPERATIONAL)
eventManager().fire(Events.PRINT_DONE, {
"file": self._currentFile.getFilename(),
"filename": os.path.basename(self._currentFile.getFilename()),
"origin": self._currentFile.getFileLocation(),
"time": self.getPrintTime()
})
elif 'Done saving file' in line:
self.refreshSdFiles()
##~~ Message handling
elif line.strip() != '' \
and line.strip() != 'ok' and not line.startswith("wait") \
and not line.startswith('Resend:') \
and line != 'echo:Unknown command:""\n' \
and line != "Unsupported statement" \
and self.isOperational():
self._callback.mcMessage(line)
##~~ Parsing for feedback commands
if feedbackControls:
for name, matcher, template in feedbackControls:
if name in feedbackErrors:
# we previously had an error with that one, so we'll skip it now
continue
try:
match = matcher.search(line)
if match is not None:
formatFunction = None
if isinstance(template, str):
formatFunction = str.format
elif isinstance(template, unicode):
formatFunction = unicode.format
if formatFunction is not None:
self._callback.mcReceivedRegisteredMessage(name, formatFunction(template, *(match.groups("n/a"))))
except:
if not name in feedbackErrors:
self._logger.info("Something went wrong with feedbackControl \"%s\": " % name, exc_info=True)
feedbackErrors.append(name)
pass
##~~ Parsing for pause triggers
if pauseTriggers and not self.isStreaming():
if "enable" in pauseTriggers.keys() and pauseTriggers["enable"].search(line) is not None:
self.setPause(True)
elif "disable" in pauseTriggers.keys() and pauseTriggers["disable"].search(line) is not None:
self.setPause(False)
elif "toggle" in pauseTriggers.keys() and pauseTriggers["toggle"].search(line) is not None:
self.setPause(not self.isPaused())
if "ok" in line and heatingUp:
heatingUp = False
### Baudrate detection
if self._state == self.STATE_DETECT_BAUDRATE:
if line == '' or time.time() > timeout:
if len(self._baudrateDetectList) < 1:
self.close()
self._errorValue = "No more baudrates to test, and no suitable baudrate found."
self._changeState(self.STATE_ERROR)
eventManager().fire(Events.ERROR, {"error": self.getErrorString()})
elif self._baudrateDetectRetry > 0:
self._baudrateDetectRetry -= 1
self._serial.write('\n')
self._log("Baudrate test retry: %d" % (self._baudrateDetectRetry))
# self._sendCommand("M105")
if self._grbl:
self._sendCommand("$")
else:
self._sendCommand("M105")
self._testingBaudrate = True
else:
baudrate = self._baudrateDetectList.pop(0)
try:
self._serial.baudrate = baudrate
self._serial.timeout = settings().getFloat(["serial", "timeout", "detection"])
self._log("Trying baudrate: %d" % (baudrate))
self._baudrateDetectRetry = 5
self._baudrateDetectTestOk = 0
timeout = getNewTimeout("communication")
self._serial.write('\n')
# self._sendCommand("M105")
if self._grbl:
self._sendCommand("$")
else:
self._sendCommand("M105")
self._testingBaudrate = True
except:
self._log("Unexpected error while setting baudrate: %d %s" % (baudrate, getExceptionString()))
elif self._grbl and '$$' in line:
self._log("Baudrate test ok: %d" % (self._baudrateDetectTestOk))
self._changeState(self.STATE_OPERATIONAL)
elif 'ok' in line and 'T:' in line:
self._baudrateDetectTestOk += 1
if self._baudrateDetectTestOk < 10:
self._log("Baudrate test ok: %d" % (self._baudrateDetectTestOk))
self._sendCommand("M105")
else:
self._sendCommand("M999")
self._serial.timeout = settings().getFloat(["serial", "timeout", "connection"])
self._changeState(self.STATE_OPERATIONAL)
if self._sdAvailable:
self.refreshSdFiles()
else:
self.initSdCard()
eventManager().fire(Events.CONNECTED, {"port": self._port, "baudrate": self._baudrate})
else:
self._testingBaudrate = False
### Connection attempt
elif self._state == self.STATE_CONNECTING:
if self._grbl:
if "Grbl" in line:
self._changeState(self.STATE_OPERATIONAL)
else:
if (line == "" or "wait" in line) and startSeen:
self._sendCommand("M105")
elif "start" in line:
startSeen = True
elif "ok" in line and startSeen:
self._changeState(self.STATE_OPERATIONAL)
if self._sdAvailable:
self.refreshSdFiles()
else:
self.initSdCard()
eventManager().fire(Events.CONNECTED, {"port": self._port, "baudrate": self._baudrate})
elif time.time() > timeout:
self.close()
### Operational
elif self._state == self.STATE_OPERATIONAL or self._state == self.STATE_PAUSED:
#Request the temperature on comm timeout (every 5 seconds) when we are not printing.
if line == "" or "wait" in line:
if self._resendDelta is not None:
self._resendNextCommand()
elif not self._commandQueue.empty():
self._sendCommand(self._commandQueue.get())
else:
if not self._grbl:
self._sendCommand("M105")
tempRequestTimeout = getNewTimeout("temperature")
# resend -> start resend procedure from requested line
elif line.lower().startswith("resend") or line.lower().startswith("rs"):
if settings().get(["feature", "swallowOkAfterResend"]):
swallowOk = True
self._handleResendRequest(line)
### Printing
elif self._state == self.STATE_PRINTING:
if line == "" and time.time() > timeout:
self._log("Communication timeout during printing, forcing a line")
line = 'ok'
if self.isSdPrinting():
if time.time() > tempRequestTimeout and not heatingUp:
if not self._grbl:
self._sendCommand("M105")
tempRequestTimeout = getNewTimeout("temperature")
if time.time() > sdStatusRequestTimeout and not heatingUp:
self._sendCommand("M27")
sdStatusRequestTimeout = getNewTimeout("sdStatus")
else:
# Even when printing request the temperature every 5 seconds.
if time.time() > tempRequestTimeout and not self.isStreaming():
if not self._grbl:
self._commandQueue.put("M105")
tempRequestTimeout = getNewTimeout("temperature")
if "ok" in line and swallowOk:
swallowOk = False
elif "ok" in line:
if self._resendDelta is not None:
self._resendNextCommand()
elif not self._commandQueue.empty() and not self.isStreaming():
self._sendCommand(self._commandQueue.get(), True)
else:
self._sendNext()
elif line.lower().startswith("resend") or line.lower().startswith("rs"):
if settings().get(["feature", "swallowOkAfterResend"]):
swallowOk = True
self._handleResendRequest(line)
except:
self._logger.exception("Something crashed inside the serial connection loop, please report this in OctoPrint's bug tracker:")
errorMsg = "See octoprint.log for details"
self._log(errorMsg)
self._errorValue = errorMsg
self._changeState(self.STATE_ERROR)
eventManager().fire(Events.ERROR, {"error": self.getErrorString()})
self._log("Connection closed, closing down monitor")
def _openSerial(self):
if self._port == 'AUTO':
self._changeState(self.STATE_DETECT_SERIAL)
programmer = stk500v2.Stk500v2()
self._log("Serial port list: %s" % (str(serialList())))
for p in serialList():
try:
self._log("Connecting to: %s" % (p))
programmer.connect(p)
self._serial = programmer.leaveISP()
break
except ispBase.IspError as (e):
self._log("Error while connecting to %s: %s" % (p, str(e)))
pass
except:
self._log("Unexpected error while connecting to serial port: %s %s" % (p, getExceptionString()))
programmer.close()
if self._serial is None:
self._log("Failed to autodetect serial port")
self._errorValue = 'Failed to autodetect serial port.'
self._changeState(self.STATE_ERROR)
eventManager().fire(Events.ERROR, {"error": self.getErrorString()})
return False
elif self._port == 'VIRTUAL':
self._changeState(self.STATE_OPEN_SERIAL)
self._serial = VirtualPrinter()
else:
self._changeState(self.STATE_OPEN_SERIAL)
try:
self._log("Connecting to: %s" % self._port)
if self._baudrate == 0:
self._serial = serial.Serial(str(self._port), 115200, timeout=settings().getFloat(["serial", "timeout", "connection"]), writeTimeout=10000)
else:
self._serial = serial.Serial(str(self._port), self._baudrate, timeout=settings().getFloat(["serial", "timeout", "connection"]), writeTimeout=10000)
except:
self._log("Unexpected error while connecting to serial port: %s %s" % (self._port, getExceptionString()))
self._errorValue = "Failed to open serial port, permissions correct?"
self._changeState(self.STATE_ERROR)
eventManager().fire(Events.ERROR, {"error": self.getErrorString()})
return False
return True
def _handleErrors(self, line):
# No matter the state, if we see an error, goto the error state and store the error for reference.
if line.startswith('Error:') or line.startswith('!!'):
#Oh YEAH, consistency.
# Marlin reports an MIN/MAX temp error as "Error:x\n: Extruder switched off. MAXTEMP triggered !\n"
# But a bed temp error is reported as "Error: Temperature heated bed switched off. MAXTEMP triggered !!"
# So we can have an extra newline in the most common case. Awesome work people.
if self._regex_minMaxError.match(line):
line = line.rstrip() + self._readline()
#Skip the communication errors, as those get corrected.
if 'checksum mismatch' in line \
or 'Wrong checksum' in line \
or 'Line Number is not Last Line Number' in line \
or 'expected line' in line \
or 'No Line Number with checksum' in line \
or 'No Checksum with line number' in line \
or 'Missing checksum' in line:
pass
elif not self.isError():
self._errorValue = line[6:]
self._changeState(self.STATE_ERROR)
eventManager().fire(Events.ERROR, {"error": self.getErrorString()})
return line
def _readline(self):
if self._serial == None:
return None
try:
ret = self._serial.readline()
except:
self._log("Unexpected error while reading serial port: %s" % (getExceptionString()))
self._errorValue = getExceptionString()
self.close(True)
return None
if ret == '':
#self._log("Recv: TIMEOUT")
return ''
self._log("Recv: %s" % sanitizeAscii(ret))
return ret
def _sendNext(self):
with self._sendNextLock:
line = self._currentFile.getNext()
if line is None:
if self.isStreaming():
self._sendCommand("M29")
remote = self._currentFile.getRemoteFilename()
payload = {
"local": self._currentFile.getLocalFilename(),
"remote": remote,
"time": self.getPrintTime()
}
self._currentFile = None
self._changeState(self.STATE_OPERATIONAL)
self._callback.mcFileTransferDone(remote)
eventManager().fire(Events.TRANSFER_DONE, payload)
self.refreshSdFiles()
else:
payload = {
"file": self._currentFile.getFilename(),
"filename": os.path.basename(self._currentFile.getFilename()),
"origin": self._currentFile.getFileLocation(),
"time": self.getPrintTime()
}
self._callback.mcPrintjobDone()
self._changeState(self.STATE_OPERATIONAL)
eventManager().fire(Events.PRINT_DONE, payload)
return
self._sendCommand(line, True)
self._callback.mcProgress()
def _handleResendRequest(self, line):
lineToResend = None
try:
lineToResend = int(line.replace("N:", " ").replace("N", " ").replace(":", " ").split()[-1])
except:
if "rs" in line:
lineToResend = int(line.split()[1])
if lineToResend is not None:
self._resendDelta = self._currentLine - lineToResend
if self._resendDelta > len(self._lastLines) or len(self._lastLines) == 0 or self._resendDelta <= 0:
self._errorValue = "Printer requested line %d but no sufficient history is available, can't resend" % lineToResend
self._logger.warn(self._errorValue)
if self.isPrinting():
# abort the print, there's nothing we can do to rescue it now
self._changeState(self.STATE_ERROR)
eventManager().fire(Events.ERROR, {"error": self.getErrorString()})
else:
# reset resend delta, we can't do anything about it
self._resendDelta = None
else:
self._resendNextCommand()
def _resendNextCommand(self):
# Make sure we are only handling one sending job at a time
with self._sendingLock:
self._logger.debug("Resending line %d, delta is %d, history log is %s items strong" % (self._currentLine - self._resendDelta, self._resendDelta, len(self._lastLines)))
cmd = self._lastLines[-self._resendDelta]
lineNumber = self._currentLine - self._resendDelta
self._doSendWithChecksum(cmd, lineNumber)
self._resendDelta -= 1
if self._resendDelta <= 0:
self._resendDelta = None
def _sendCommand(self, cmd, sendChecksum=False):
# Make sure we are only handling one sending job at a time
with self._sendingLock:
if self._serial is None:
return
if not self.isStreaming():
for hook in self._gcode_hooks:
hook_cmd = self._gcode_hooks[hook](self, cmd)
if hook_cmd and isinstance(hook_cmd, basestring):
cmd = hook_cmd
gcode = self._regex_command.search(cmd)
if gcode:
gcode = gcode.group(1)
if gcode in gcodeToEvent:
eventManager().fire(gcodeToEvent[gcode])
gcodeHandler = "_gcode_" + gcode
if hasattr(self, gcodeHandler):
cmd = getattr(self, gcodeHandler)(cmd)
if cmd is not None:
self._doSend(cmd, sendChecksum)
def _doSend(self, cmd, sendChecksum=False):
if sendChecksum or self._alwaysSendChecksum:
lineNumber = self._currentLine
self._addToLastLines(cmd)
self._currentLine += 1
# self._doSendWithChecksum(cmd, lineNumber)
if self._grbl:
self._doSendWithoutChecksum(cmd)
else:
self._doSendWithChecksum(cmd, lineNumber)
else:
self._doSendWithoutChecksum(cmd)
def _doSendWithChecksum(self, cmd, lineNumber):
self._logger.debug("Sending cmd '%s' with lineNumber %r" % (cmd, lineNumber))
commandToSend = "N%d %s" % (lineNumber, cmd)
checksum = reduce(lambda x,y:x^y, map(ord, commandToSend))
commandToSend = "%s*%d" % (commandToSend, checksum)
self._doSendWithoutChecksum(commandToSend)
def _doSendWithoutChecksum(self, cmd):
self._log("Send: %s" % cmd)
try:
self._serial.write(cmd + '\n')
except serial.SerialTimeoutException:
self._log("Serial timeout while writing to serial port, trying again.")
try:
self._serial.write(cmd + '\n')
except:
self._log("Unexpected error while writing serial port: %s" % (getExceptionString()))
self._errorValue = getExceptionString()
self.close(True)
except:
self._log("Unexpected error while writing serial port: %s" % (getExceptionString()))
self._errorValue = getExceptionString()
self.close(True)
def _gcode_T(self, cmd):
toolMatch = self._regex_paramTInt.search(cmd)
if toolMatch:
self._currentExtruder = int(toolMatch.group(1))
return cmd
def _gcode_G0(self, cmd):
if 'Z' in cmd:
match = self._regex_paramZFloat.search(cmd)
if match:
try:
z = float(match.group(1))
if self._currentZ != z:
self._currentZ = z
self._callback.mcZChange(z)
except ValueError:
pass
return cmd
_gcode_G1 = _gcode_G0
def _gcode_M0(self, cmd):
self.setPause(True)
return "M105" # Don't send the M0 or M1 to the machine, as M0 and M1 are handled as an LCD menu pause.
_gcode_M1 = _gcode_M0
def _gcode_M104(self, cmd):
toolNum = self._currentExtruder
toolMatch = self._regex_paramTInt.search(cmd)
if toolMatch:
toolNum = int(toolMatch.group(1))
match = self._regex_paramSInt.search(cmd)
if match:
try:
target = float(match.group(1))
if toolNum in self._temp.keys() and self._temp[toolNum] is not None and isinstance(self._temp[toolNum], tuple):
(actual, oldTarget) = self._temp[toolNum]
self._temp[toolNum] = (actual, target)
else:
self._temp[toolNum] = (None, target)
except ValueError:
pass
return cmd
def _gcode_M140(self, cmd):
match = self._regex_paramSInt.search(cmd)
if match:
try:
target = float(match.group(1))
if self._bedTemp is not None and isinstance(self._bedTemp, tuple):
(actual, oldTarget) = self._bedTemp
self._bedTemp = (actual, target)
else:
self._bedTemp = (None, target)
except ValueError:
pass
return cmd
def _gcode_M109(self, cmd):
self._heatupWaitStartTime = time.time()
return self._gcode_M104(cmd)
def _gcode_M190(self, cmd):
self._heatupWaitStartTime = time.time()
return self._gcode_M140(cmd)
def _gcode_M110(self, cmd):
newLineNumber = None
match = self._regex_paramNInt.search(cmd)
if match:
try:
newLineNumber = int(match.group(1))
except:
pass
else:
newLineNumber = 0
# send M110 command with new line number
self._doSendWithChecksum(cmd, newLineNumber)
self._currentLine = newLineNumber + 1
# after a reset of the line number we have no way to determine what line exactly the printer now wants
self._lastLines.clear()
self._resendDelta = None
return None
def _gcode_M112(self, cmd): # It's an emergency what todo? Canceling the print should be the minimum
self.cancelPrint()
return cmd
def _gcode_M112(self, cmd): # It's an emergency what todo? Canceling the print should be the minimum
self.cancelPrint()
return cmd
### MachineCom callback ################################################################################################
class MachineComPrintCallback(object):
def mcLog(self, message):
pass
def mcTempUpdate(self, temp, bedTemp):
pass
def mcStateChange(self, state):
pass
def mcMessage(self, message):
pass
def mcProgress(self):
pass
def mcZChange(self, newZ):
pass
def mcFileSelected(self, filename, filesize, sd):
pass
def mcSdStateChange(self, sdReady):
pass
def mcSdFiles(self, files):
pass
def mcSdPrintingDone(self):
pass
def mcFileTransferStarted(self, filename, filesize):
pass
def mcReceivedRegisteredMessage(self, command, message):
pass
### Printing file information classes ##################################################################################
class PrintingFileInformation(object):
"""
Encapsulates information regarding the current file being printed: file name, current position, total size and
time the print started.
Allows to reset the current file position to 0 and to calculate the current progress as a floating point
value between 0 and 1.
"""
def __init__(self, filename):
self._filename = filename
self._filepos = 0
self._filesize = None
self._startTime = None
def getStartTime(self):
return self._startTime
def getFilename(self):
return self._filename
def getFilesize(self):
return self._filesize
def getFilepos(self):
return self._filepos
def getFileLocation(self):
return FileDestinations.LOCAL
def getProgress(self):
"""
The current progress of the file, calculated as relation between file position and absolute size. Returns -1
if file size is None or < 1.
"""
if self._filesize is None or not self._filesize > 0:
return -1
return float(self._filepos) / float(self._filesize)
def reset(self):
"""
Resets the current file position to 0.
"""
self._filepos = 0
def start(self):
"""
Marks the print job as started and remembers the start time.
"""
self._startTime = time.time()
class PrintingSdFileInformation(PrintingFileInformation):
"""
Encapsulates information regarding an ongoing print from SD.
"""
def __init__(self, filename, filesize):
PrintingFileInformation.__init__(self, filename)
self._filesize = filesize
def setFilepos(self, filepos):
"""
Sets the current file position.
"""
self._filepos = filepos
def getFileLocation(self):
return FileDestinations.SDCARD
class PrintingGcodeFileInformation(PrintingFileInformation):
"""
Encapsulates information regarding an ongoing direct print. Takes care of the needed file handle and ensures
that the file is closed in case of an error.
"""
def __init__(self, filename, offsetCallback):
PrintingFileInformation.__init__(self, filename)
self._filehandle = None
self._filesetMenuModehandle = None
self._lineCount = None
self._firstLine = None
self._currentTool = 0
self._offsetCallback = offsetCallback
self._regex_tempCommand = re.compile("M(104|109|140|190)")
self._regex_tempCommandTemperature = re.compile("S([-+]?\d*\.?\d*)")
self._regex_tempCommandTool = re.compile("T(\d+)")
self._regex_toolCommand = re.compile("^T(\d+)")
if not os.path.exists(self._filename) or not os.path.isfile(self._filename):
raise IOError("File %s does not exist" % self._filename)
self._filesize = os.stat(self._filename).st_size
def start(self):
"""
Opens the file for reading and determines the file size. Start time won't be recorded until 100 lines in
"""
self._filehandle = open(self._filename, "r")
self._lineCount = None
self._startTime = None
def getNext(self):
"""
Retrieves the next line for printing.
"""
if self._filehandle is None:
raise ValueError("File %s is not open for reading" % self._filename)
if self._lineCount is None:
self._lineCount = 0
return "M110 N0"
try:
processedLine = None
while processedLine is None:
if self._filehandle is None:
# file got closed just now
return None
line = self._filehandle.readline()
if not line:
self._filehandle.close()
self._filehandle = None
processedLine = self._processLine(line)
self._lineCount += 1
self._filepos = self._filehandle.tell()
if self._lineCount >= 100 and self._startTime is None:
self._startTime = time.time()
return processedLine
except Exception as (e):
if self._filehandle is not None:
self._filehandle.close()
self._filehandle = None
raise e
def _processLine(self, line):
if ";" in line:
line = line[0:line.find(";")]
line = line.strip()
if len(line) > 0:
toolMatch = self._regex_toolCommand.match(line)
if toolMatch is not None:
# track tool changes
self._currentTool = int(toolMatch.group(1))
else:
## apply offsets
if self._offsetCallback is not None:
tempMatch = self._regex_tempCommand.match(line)
if tempMatch is not None:
# if we have a temperature command, retrieve current offsets
tempOffset, bedTempOffset = self._offsetCallback()
if tempMatch.group(1) == "104" or tempMatch.group(1) == "109":
# extruder temperature, determine which one and retrieve corresponding offset
toolNum = self._currentTool
toolNumMatch = self._regex_tempCommandTool.search(line)
if toolNumMatch is not None:
try:
toolNum = int(toolNumMatch.group(1))
except ValueError:
pass
offset = tempOffset[toolNum] if toolNum in tempOffset.keys() and tempOffset[toolNum] is not None else 0
elif tempMatch.group(1) == "140" or tempMatch.group(1) == "190":
# bed temperature
offset = bedTempOffset
else:
# unknown, should never happen
offset = 0
if not offset == 0:
# if we have an offset != 0, we need to get the temperature to be set and apply the offset to it
tempValueMatch = self._regex_tempCommandTemperature.search(line)
if tempValueMatch is not None:
try:
temp = float(tempValueMatch.group(1))
if temp > 0:
newTemp = temp + offset
line = line.replace("S" + tempValueMatch.group(1), "S%f" % newTemp)
except ValueError:
pass
return line
else:
return None
class StreamingGcodeFileInformation(PrintingGcodeFileInformation):
def __init__(self, path, localFilename, remoteFilename):
PrintingGcodeFileInformation.__init__(self, path, None)
self._localFilename = localFilename
self._remoteFilename = remoteFilename
def start(self):
PrintingGcodeFileInformation.start(self)
self._startTime = time.time()
def getLocalFilename(self):
return self._localFilename
def getRemoteFilename(self):
return self._remoteFilename
|
ymilord/OctoPrint-MrBeam
|
src/octoprint/util/comm.py
|
Python
|
agpl-3.0
| 49,358
|
import unittest
import signal
import dbus
from systemd.manager import Manager
from systemd.exceptions import SystemdError
from systemd.unit import Unit
from systemd.job import Job
class ManagerTest(unittest.TestCase):
# Stolen from Django framework
def assertRaisesErrorWithMessage(self, error, message, callable, *args, **kwargs):
self.assertRaises(error, callable, *args, **kwargs)
try:
callable(*args, **kwargs)
except error as e:
self.assertEqual(message, str(e))
def setUp(self):
self.manager = Manager()
#def test_get_unit(self):
# self.assertIsInstance(self.manager.get_unit('network.service'), Unit)
#Put this variables to a file named tests_settings.py
# NO_EXIST_SERVICE = 'noexisssssst.service'
# self.assertRaisesErrorWithMessage(
# SystemdError,
# 'NoSuchUnit(Unit %s is not loaded.)' % NO_EXIST_SERVICE,
# self.manager.get_unit, NO_EXIST_SERVICE)
#def test_get_unit_by_pid(self):
# #Put this variables to a file named tests_settings.py
# EXIST_PID = 0
# NO_EXIST_PID = 0
# self.assertIsInstance(self.manager.get_unit_by_pid(EXIST_PID), Unit)
# self.assertRaisesErrorWithMessage(
# SystemdError,
# 'NoSuchUnit(No unit for PID %s is loaded.' % NO_PID,
# self.manager.get_unit_by_pid, NO_PID)
# This will HALT your computer
#def test_halt(self):
# self.manager.halt()
#def test_k_exec(self):
# self.manager.k_exec()
#def test_kill_unit(self):
# self.manager.kill_unit('sshd.service', 'main', 'control-group', 9)
# self.manager.kill_unit('sshd.service', 'control', 'control-group', 9)
# self.manager.kill_unit('sshd.service', 'all', 'control-group', 9)
# self.manager.kill_unit('sshd.service', 'all', 'process-group', 9)
# self.manager.kill_unit('sshd.service', 'all', 'process', 9)
#def test_list_jobs(self):
# self.assertIsInstance(self.manager.list_jobs(), tuple)
#def test_list_units(self):
# self.assertIsInstance(self.manager.list_units(), tuple)
#def test_load_unit(self):
# self.assertIsInstance(self.manager.load_unit('sshd.service'), Unit)
# This will POWEROFF your computer
#def test_power_off(self):
# self.manager.power_off()
# This will REBOOT your computer
#def test_reboot(self):
# self.manager.reboot()
#def test_reexecute(self):
# self.manager.reexecute()
#def test_reload(self):
# self.manager.reload()
"""
def test_reload_or_restart_unit(self):
self.assertIsInstance(
self.manager.reload_or_restart_unit('sshd.service', 'fail'),
Job)
self.assertIsInstance(
self.manager.reload_or_restart_unit('sshd.service', 'replace'),
Job)
def test_reload_or_try_restart_unit(self):
self.assertIsInstance(
self.manager.reload_or_try_restart_unit('sshd.service', 'fail'),
Job)
self.assertIsInstance(
self.manager.reload_or_try_restart_unit('sshd.service', 'replace'),
Job)
self.assertIsInstance(
self.manager.reload_or_try_restart_unit('sshd.service', 'isolate'),
Job)
"""
#TODO: START TESTING FROM HERE TODO
#def test_reload_unit(self):
# self.assertIsInstance(
# self.manager.reload_unit('sshd.service', 'fail'), Job)
# self.assertIsInstance(
# self.manager.reload_unit('sshd.service', 'replace'),e Job)
# def test_reset_failed(self):
# self.manager.reset_failed()
#def test_reset_failed_unit(self):
# self.manager.reset_failed_unit()
#def test_restart_unit(self):
# self.assertIsInstance(
# self.manager.restart_unit('sshd.service', 'fail'), Job)
# self.assertIsInstance(
# self.manager.restart_unit('sshd.service', 'replace'), Job)
#TODO:Calling this with TELEPHONE crash systemd or dbus
#def test_set_environment(self):
# self.manager.set_environment('TELEPHONE')
#def test_start_unit(self):
# self.assertIsInstance(
# self.manager.start_unit('sshd.service', 'fail'), Job)
# self.assertIsInstance(
# self.manager.start_unit('sshd.service', 'replace'), Job)
#the below mode note acepted
# self.assertIsInstance(
# self.manager.start_unit('sshd.service', 'isolate'), Job)
# self.assertIsInstance(
# self.manager.start_unit('sshd.service', 'rescue'), Job)
# self.assertIsInstance(
# self.manager.start_unit('sshd.service', 'emergency'), Job)
#def test_start_unit_replace(self):
# self.manager.start_unit_replace(old_unit, new_unit, mode)
#def test_stop_unit(self):
# self.assertIsInstance(
# self.manager.stop_unit('sshd.service', 'fail'), Job)
# self.assertIsInstance(
# self.manager.stop_unit('sshd.service', 'replace'), Job)
#def test_subscribe(self):
# self.manager.subscribe()
#def test_try_restart_unit(self):
# self.assertIsInstance(
# self.manager.restart_unit('sshd.service', 'fail'), Job)
# self.assertIsInstance(
# self.manager.restart_unit('sshd.service', 'replace'), Job)
#def test_try_restart_unit(self):
# self.manager.try_restart_unit('network.service', 'fail')
# self.manager.try_restart_unit('network.service', 'replace')
# self.assertRaisesErrorWithMessage(
# SystemdError,
# "LoadFailed(Unit noexist.service failed to load: No such file or directory. See system logs and 'systemctl status' for details.)",
# self.manager.try_restart_unit, 'noexist.service', 'fail')
#TODO:Calling this with TELEPHONE crash systemd or dbus
#def test_unset_environment(self):
# self.manager.unset_environment('TELEPHONE')
#def test_unsubscribe(self):
# self.assertRaisesErrorWithMessage(
# SystemdError,
# 'NotSubscribed(Client is not subscribed.)',
# self.manager.unsubscribe)
|
wiliamsouza/python-systemd
|
tests/manager_test.py
|
Python
|
lgpl-2.1
| 6,219
|
#!/usr/bin/env python
#------------------------------------------------------------------------------
#
# Meta Data Cutting
#
# Author: kevin.kreiser@mapquest.com
#
# Copyright 2010-1 Mapquest, Inc. All Rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#------------------------------------------------------------------------------
#for rectangle clipping math
import math
#for doing geojson features
from geojson import FeatureCollection, Feature, MultiPolygon, dumps
#for NMS logging library
import mq_logging
#used to create static member functions
class Callable:
def __init__(self, anycallable):
self.__call__ = anycallable
'''expects MAPWARE formatted poi data'''
#given poi data return a geojson feature collection of poi data that was rasterized into the mapware tile
def extractFeaturesMW(metaData):
#to hold the features
features = FeatureCollection([])
#plugin didn't return anything
if metaData is None:
return features
try:
#for each poi in the meta data
for poi in metaData['pois']:
#try to get the id, icon, label, and name
try:
#add the positions of the rectangles to the multi polygon
#format is: multipolygon[ polygon[ linestring[position[], position[]], linestring[position[], position[]] ]]
label = poi['label']
icon = poi['icon']
#create the multipolygon
geometry = MultiPolygon([ [[ [label['x1'], label['y1']], [label['x2'], label['y1']], [label['x2'], label['y2']], [label['x1'], label['y2']] ]],\
[[ [icon['x1'], icon['y1']], [icon['x2'], icon['y1']], [icon['x2'], icon['y2']], [icon['x1'], icon['y2']] ]] ])
#throws an exception if id and name aren't in the poi
features.features.append(Feature(poi['id'], geometry, {'name': poi['name'], 'type': 'poi'}))
#if there is a problem ignore this one
except Exception as exception:
#print out bad entries
mq_logging.warning('metacutter cant get poi: %s: %s' (exception, poi))
#didn't find the attribute pois
except Exception as exception:
#print out bad poi data
mq_logging.error('metacutter cant get attribute poi: %s: %s' (exception, str(metaData)))
#hand them back
return features
'''expects MAPNIK formatted poi data'''
#given poi data return a geojson feature collection of poi data that was rasterized into the mapnik tile
def extractFeaturesMNK(metaData):
#to hold the features
featureCollection = FeatureCollection([])
try:
#for each rasterized object
for poi in metaData:
#try to get the id, icon, label, and name
try:
#expand the box to include the subpixel portion of the region
box = (int(poi.box[0]), int(poi.box[1]), int(poi.box[2]) + 1, int(poi.box[3]) + 1)
#create the multipolygon
geometry = MultiPolygon([ [[ [box[0], box[1]], [box[2], box[1]], [box[2], box[3]], [box[0], box[3]] ]] ])
#throws an exception if id and name aren't in the poi
poi = dict(poi.properties)
#WARNING: efficiency hack: mapnik search plugin returns features sorted by their search id we need only look at previous feature
id = int(poi['id'])
previous = len(featureCollection.features) - 1
#if the previous feature was this same one
if previous > -1 and featureCollection.features[previous].id == id:
featureCollection.features[previous].geometry.coordinates.append(geometry.coordinates[0])
#make a new feature
else:
featureCollection.features.append(Feature(id, geometry, {'name': poi['name'], 'type': 'poi'}))
#if there is a problem ignore this one
except Exception as exception:
#print out bad entries
mq_logging.warning('metacutter cant get poi: %s: %s' (exception, poi))
#didn't find the attribute pois
except Exception as exception:
#print out bad poi data
mq_logging.warning('metacutter cant get attribute poi: %s: %s' (exception, metaData))
#hand them back
return featureCollection
#given a rect and the pixels (width, height), dimensions (rows,columns) of a grid
#returns a list of rects clipped to the grid's cells
def clipGeometry(pixels, dimensions, geometry):
#no clipped rects yet
geometries = {}
width = pixels[0]
height = pixels[1]
try:
#only support multipolygon for now
if geometry.type == 'MultiPolygon':
#get each polygon
for polygon in geometry.coordinates:
#TODO: unhack to support all geometries and real polygons instead of just assuming rect
#since each polygon is defined as an outer ring and a bunch of inner rings we just grab the outer
polygon = polygon[0]
rect = (polygon[0][0], polygon[0][1], polygon[2][0], polygon[2][1])
#skip degenerate polygons
if rect[3] - rect[1] == 0 and rect[2] - rect[0] == 0:
continue
#for each sub tile that this rect overlaps
for r in range(int(math.floor(rect[1] / height)), int(math.floor(rect[3] / height)) + 1):
for c in range(int(math.floor(rect[0] / width)), int(math.floor(rect[2] / width)) + 1):
#not keeping these
if r < 0 or r >= dimensions[0] or c < 0 or c >= dimensions[1]:
continue
#get the tile's pixel extents
tile = (width * c, height * r, width * (c + 1), height * (r + 1))
#get the upper left
x0 = rect[0] - tile[0] if rect[0] > tile[0] else 0
y0 = rect[1] - tile[1] if rect[1] > tile[1] else 0
#get the lower right
x1 = rect[2] - tile[0] if rect[2] < tile[2] else width - 1
y1 = rect[3] - tile[1] if rect[3] < tile[3] else height - 1
#just need to add another polygon to this multipolygon
if (r, c) in geometries:
geometries[(r, c)].coordinates.append([[ [x0, y0], [x1, y0], [x1, y1], [x0, y1] ]])
else:
geometries[(r, c)] = MultiPolygon([[[ [x0, y0], [x1, y0], [x1, y1], [x0, y1] ]]])
#something wasn't there
except Exception as exception:
mq_logging.error('problem parsing geometry')
#return the features
return geometries
#given a dictionary where the search id is the key and the values are geojson features (containing polygons)
#and the pixels (width, height) of the tile and dimensions (rows, columns) of the master tile is divided into
#returns a dictionary where the keys are tuples (row, column) and the values are geojson feature collections
def cutFeatures(features, pixels, dimensions, dump = False):
#to hold the cut features
cutFeatures = {}
#invalid input
if pixels[0] < 1 or pixels[1] < 1 or dimensions[0] < 1 or dimensions[1] < 1:
return cutFeatures
#figure out how big the sub tiles will be
width = pixels[0] / dimensions[1]
height = pixels[1] / dimensions[0]
#invalid input
if width < 1 or height < 1:
return cutFeatures
#make sure every sub tile has a blank feature collection
for y in range(dimensions[0]):
for x in range(dimensions[1]):
cutFeatures[(y, x)] = FeatureCollection([])
#for each feature
if features is not None:
for feature in features.features:
#to keep each clipped geometry
clippedGeometries = clipGeometry((width, height), dimensions, feature.geometry)
#save them to their respective meta tiles
for location, clippedGeometry in clippedGeometries.iteritems():
#add it to the feature collection
cutFeatures[location].features.append(Feature(feature.id, clippedGeometry, feature.properties))
#serialize them
if dump is True:
for location, featureCollection in cutFeatures.iteritems():
cutFeatures[location] = dumps(featureCollection)
#hand them back
return cutFeatures
|
artemp/MapQuest-Render-Stack
|
py/metacutter.py
|
Python
|
lgpl-2.1
| 8,060
|
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class PerlTestDifferences(PerlPackage):
"""Test strings and data structures and show differences if not ok"""
homepage = "http://search.cpan.org/~dcantrell/Test-Differences-0.64/lib/Test/Differences.pm"
url = "http://search.cpan.org/CPAN/authors/id/D/DC/DCANTRELL/Test-Differences-0.64.tar.gz"
version('0.64', 'ecfda620fe133e36a6e392d94ab8424d')
depends_on('perl-module-build', type='build')
depends_on('perl-capture-tiny', type=('build', 'run'))
depends_on('perl-text-diff', type=('build', 'run'))
|
lgarren/spack
|
var/spack/repos/builtin/packages/perl-test-differences/package.py
|
Python
|
lgpl-2.1
| 1,791
|
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
class PyPybind11(CMakePackage):
"""pybind11 -- Seamless operability between C++11 and Python.
pybind11 is a lightweight header-only library that exposes C++ types in
Python and vice versa, mainly to create Python bindings of existing C++
code. Its goals and syntax are similar to the excellent Boost.Python
library by David Abrahams: to minimize boilerplate code in traditional
extension modules by inferring type information using compile-time
introspection."""
homepage = "https://pybind11.readthedocs.io"
url = "https://github.com/pybind/pybind11/archive/v2.1.0.tar.gz"
git = "https://github.com/pybind/pybind11.git"
maintainers = ['ax3l']
version('master', branch='master')
version('2.5.0', sha256='97504db65640570f32d3fdf701c25a340c8643037c3b69aec469c10c93dc8504')
version('2.4.3', sha256='1eed57bc6863190e35637290f97a20c81cfe4d9090ac0a24f3bbf08f265eb71d')
version('2.3.0', sha256='0f34838f2c8024a6765168227ba587b3687729ebf03dc912f88ff75c7aa9cfe8')
version('2.2.4', sha256='b69e83658513215b8d1443544d0549b7d231b9f201f6fc787a2b2218b408181e')
version('2.2.3', sha256='3a3b7b651afab1c5ba557f4c37d785a522b8030dfc765da26adc2ecd1de940ea')
version('2.2.2', sha256='b639a2b2cbf1c467849660801c4665ffc1a4d0a9e153ae1996ed6f21c492064e')
version('2.2.1', sha256='f8bd1509578b2a1e7407d52e6ee8afe64268909a1bbda620ca407318598927e7')
version('2.2.0', sha256='1b0fda17c650c493f5862902e90f426df6751da8c0b58c05983ab009951ed769')
version('2.1.1', sha256='f2c6874f1ea5b4ad4ffffe352413f7d2cd1a49f9050940805c2a082348621540')
version('2.1.0', sha256='2860f2b8d0c9f65f0698289a161385f59d099b7ead1bf64e8993c486f2b93ee0')
depends_on('py-pytest', type='test')
depends_on('py-setuptools', type='build')
extends('python')
# compiler support
conflicts('%gcc@:4.7')
conflicts('%clang@:3.2')
conflicts('%intel@:16')
def cmake_args(self):
args = []
args.append('-DPYTHON_EXECUTABLE:FILEPATH=%s'
% self.spec['python'].command.path)
args += [
'-DPYBIND11_TEST:BOOL={0}'.format(
'ON' if self.run_tests else 'OFF')
]
return args
def setup_build_environment(self, env):
env.set('PYBIND11_USE_CMAKE', 1)
# https://github.com/pybind/pybind11/pull/1995
@when('@:2.4.99')
def patch(self):
""" see https://github.com/spack/spack/issues/13559 """
filter_file('import sys',
'import sys; return "{0}"'.format(self.prefix.include),
'pybind11/__init__.py',
string=True)
def install(self, spec, prefix):
super(PyPybind11, self).install(spec, prefix)
setup_py('install', '--single-version-externally-managed', '--root=/',
'--prefix={0}'.format(prefix))
@run_after('install')
@on_package_attributes(run_tests=True)
def test(self):
with working_dir('spack-test', create=True):
# test include helper points to right location
python = self.spec['python'].command
py_inc = python(
'-c',
'import pybind11 as py; ' +
self.spec['python'].package.print_string('py.get_include()'),
output=str).strip()
for inc in [py_inc, self.prefix.include]:
inc_file = join_path(inc, 'pybind11', 'pybind11.h')
assert os.path.isfile(inc_file)
|
rspavel/spack
|
var/spack/repos/builtin/packages/py-pybind11/package.py
|
Python
|
lgpl-2.1
| 3,731
|
# python
# This file is generated by a program (mib2py).
import CONFIG_MIB
OIDMAP = {
'1.3.6.1.4.1.11.2.14.11.5.1.7': CONFIG_MIB.hpConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1': CONFIG_MIB.hpSwitchConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.1': CONFIG_MIB.hpSwitchSystemConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.2': CONFIG_MIB.hpSwitchConsoleConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3': CONFIG_MIB.hpSwitchPortConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.4': CONFIG_MIB.hpSwitchIpxConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.5': CONFIG_MIB.hpSwitchIpConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.6': CONFIG_MIB.hpSwitchSerialLinkConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.8': CONFIG_MIB.hpSwitchFilterConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.9': CONFIG_MIB.hpSwitchProbeConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.11': CONFIG_MIB.hpSwitchFddiIpFragConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.12': CONFIG_MIB.hpSwitchABCConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.14': CONFIG_MIB.hpSwitchStpConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15': CONFIG_MIB.hpSwitchIgmpConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17': CONFIG_MIB.hpSwitchCosConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.5': CONFIG_MIB.hpSwitchCosTosConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.18': CONFIG_MIB.hpSwitchMeshConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.19': CONFIG_MIB.hpSwitchPortIsolationConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.20': CONFIG_MIB.hpSwitchSshConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.21': CONFIG_MIB.hpSwitchPendingConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.22': CONFIG_MIB.hpSwitchBWMinConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.23': CONFIG_MIB.hpSwitchRateLimitPortConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.1.1': CONFIG_MIB.hpSwitchAutoReboot,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.1.2': CONFIG_MIB.hpSwitchTimeZone,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.1.3': CONFIG_MIB.hpSwitchDaylightTimeRule,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.1.4': CONFIG_MIB.hpSwitchDaylightBeginningMonth,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.1.5': CONFIG_MIB.hpSwitchDaylightBeginningDay,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.1.6': CONFIG_MIB.hpSwitchDaylightEndingMonth,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.1.7': CONFIG_MIB.hpSwitchDaylightEndingDay,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.1.8': CONFIG_MIB.hpSwitchSystemConfigStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.1.9': CONFIG_MIB.hpSwitchSystemPortLEDMode,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.1.10': CONFIG_MIB.hpSwitchControlUnknownIPMulticast,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.2.2': CONFIG_MIB.hpSwitchTerminalType,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.2.3': CONFIG_MIB.hpSwitchConsoleRefRate,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.2.4': CONFIG_MIB.hpSwitchDisplayedEvent,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.2.5': CONFIG_MIB.hpSwitchConsoleConfigStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.2': CONFIG_MIB.hpSwitchPortConfigStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.4.2': CONFIG_MIB.hpSwitchIpxConfigStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.5.1': CONFIG_MIB.hpSwitchIpTimepAdminStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.5.2': CONFIG_MIB.hpSwitchIpTimepServerAddr,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.5.3': CONFIG_MIB.hpSwitchIpTimepPollInterval,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.5.6': CONFIG_MIB.hpSwitchIpTftpMode,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.6.1': CONFIG_MIB.hpSwitchSLinkBaudRate,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.6.2': CONFIG_MIB.hpSwitchSLinkFlowCtrl,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.6.3': CONFIG_MIB.hpSwitchSLinkConnInactTime,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.6.4': CONFIG_MIB.hpSwitchSLinkModemConnTime,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.6.5': CONFIG_MIB.hpSwitchSLinkModemLostRecvTime,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.6.6': CONFIG_MIB.hpSwitchSLinkModemDisConnTime,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.6.7': CONFIG_MIB.hpSwitchSLinkParity,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.6.8': CONFIG_MIB.hpSwitchSLinkCharBits,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.6.9': CONFIG_MIB.hpSwitchSLinkStopBits,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.6.10': CONFIG_MIB.hpSwitchSLinkConfigStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.4': CONFIG_MIB.hpSwitchIgmpForcedLeaveInterval,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.5.1': CONFIG_MIB.hpSwitchCosTosConfigMode,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.8': CONFIG_MIB.hpSwitchCosLastChange,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.18.2': CONFIG_MIB.hpSwitchMeshBackwardCompatibility,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.19.1': CONFIG_MIB.hpSwitchPortIsolationMode,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.20.1': CONFIG_MIB.hpSwitchSshAdminStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.20.2': CONFIG_MIB.hpSwitchSshVersion,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.20.3': CONFIG_MIB.hpSwitchSshTimeout,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.20.4': CONFIG_MIB.hpSwitchSshPortNumber,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.20.5': CONFIG_MIB.hpSwitchSshServerKeySize,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.20.6': CONFIG_MIB.hpSwitchSshFileServerAdminStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.21.1': CONFIG_MIB.hpSwitchPendingConfigControl,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.1': CONFIG_MIB.hpSwitchPortIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.2': CONFIG_MIB.hpSwitchPortType,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.3': CONFIG_MIB.hpSwitchPortDescr,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.4': CONFIG_MIB.hpSwitchPortAdminStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.5': CONFIG_MIB.hpSwitchPortEtherMode,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.6': CONFIG_MIB.hpSwitchPortVgMode,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.7': CONFIG_MIB.hpSwitchPortLinkbeat,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.8': CONFIG_MIB.hpSwitchPortTrunkGroup,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.9': CONFIG_MIB.hpSwitchPortBcastLimit,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.10': CONFIG_MIB.hpSwitchPortFastEtherMode,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.11': CONFIG_MIB.hpSwitchPortFlowControl,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.13': CONFIG_MIB.hpSwitchPortTrunkType,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.14': CONFIG_MIB.hpSwitchPortTrunkLACPStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.15': CONFIG_MIB.hpSwitchPortMDIXStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.3.1.1.16': CONFIG_MIB.hpSwitchPortAutoMDIX,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.8.1.1.1': CONFIG_MIB.hpSwitchFilterIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.8.1.1.2': CONFIG_MIB.hpSwitchFilterType,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.8.1.1.3': CONFIG_MIB.hpSwitchFilterSrcPort,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.8.1.1.4': CONFIG_MIB.hpSwitchFilterMacAddr,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.8.1.1.5': CONFIG_MIB.hpSwitchFilterProtocolType,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.8.1.1.6': CONFIG_MIB.hpSwitchFilterPortMask,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.8.1.1.7': CONFIG_MIB.hpSwitchFilterEntryStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.11.1.1.1': CONFIG_MIB.hpSwitchFddiIpFragConfigIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.11.1.1.2': CONFIG_MIB.hpSwitchFddiIpFragConfigStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.12.1.1.1': CONFIG_MIB.hpSwitchABCConfigVlan,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.12.1.1.2': CONFIG_MIB.hpSwitchABCConfigControl,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.12.1.1.3': CONFIG_MIB.hpSwitchABCConfigIpRipControl,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.12.1.1.4': CONFIG_MIB.hpSwitchABCConfigIpxRipSapControl,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.12.1.1.5': CONFIG_MIB.hpSwitchABCConfigVlanBcastLimit,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.12.1.1.7': CONFIG_MIB.hpSwitchABCConfigAutoGatewayConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.14.1.1.1': CONFIG_MIB.hpSwitchStpVlan,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.14.1.1.2': CONFIG_MIB.hpSwitchStpAdminStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.14.1.1.3': CONFIG_MIB.hpSwitchStpPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.14.1.1.4': CONFIG_MIB.hpSwitchStpMaxAge,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.14.1.1.5': CONFIG_MIB.hpSwitchStpHelloTime,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.14.1.1.6': CONFIG_MIB.hpSwitchStpForwardDelay,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.14.2.1.1': CONFIG_MIB.hpSwitchStpPort,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.14.2.1.2': CONFIG_MIB.hpSwitchStpPortType,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.14.2.1.3': CONFIG_MIB.hpSwitchStpPortSrcMac,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.14.2.1.4': CONFIG_MIB.hpSwitchStpPortPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.14.2.1.5': CONFIG_MIB.hpSwitchStpPortPathCost,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.14.2.1.6': CONFIG_MIB.hpSwitchStpPortMode,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.1.1.1': CONFIG_MIB.hpSwitchIgmpVlanIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.1.1.2': CONFIG_MIB.hpSwitchIgmpState,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.1.1.3': CONFIG_MIB.hpSwitchIgmpQuerierState,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.1.1.4': CONFIG_MIB.hpSwitchIgmpPriorityState,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.2.1.1': CONFIG_MIB.hpSwitchIgmpPortIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.2.1.2': CONFIG_MIB.hpSwitchIgmpPortType,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.2.1.3': CONFIG_MIB.hpSwitchIgmpIpMcastState,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.3.1.1': CONFIG_MIB.hpSwitchIgmpPortVlanIndex2,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.3.1.2': CONFIG_MIB.hpSwitchIgmpPortIndex2,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.3.1.3': CONFIG_MIB.hpSwitchIgmpPortType2,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.3.1.4': CONFIG_MIB.hpSwitchIgmpIpMcastState2,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.3.1.5': CONFIG_MIB.hpSwitchIgmpPortForcedLeaveState,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.3.1.6': CONFIG_MIB.hpSwitchIgmpPortFastLeaveState,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.1.1.1': CONFIG_MIB.hpSwitchCosPortIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.1.1.2': CONFIG_MIB.hpSwitchCosPortType,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.1.1.3': CONFIG_MIB.hpSwitchCosPortPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.1.1.4': CONFIG_MIB.hpSwitchCosPortDSCPPolicy,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.1.1.5': CONFIG_MIB.hpSwitchCosPortResolvedPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.1.1.6': CONFIG_MIB.hpSwitchCosPortApplyPolicy,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.2.1.1': CONFIG_MIB.hpSwitchCosVlanIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.2.1.2': CONFIG_MIB.hpSwitchCosVlanPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.2.1.3': CONFIG_MIB.hpSwitchCosVlanDSCPPolicy,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.2.1.4': CONFIG_MIB.hpSwitchCosVlanResolvedPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.2.1.5': CONFIG_MIB.hpSwitchCosVlanApplyPolicy,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.3.1.1': CONFIG_MIB.hpSwitchCosProtocolType,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.3.1.2': CONFIG_MIB.hpSwitchCosProtocolPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.4.1.1': CONFIG_MIB.hpSwitchCosAddressIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.4.1.2': CONFIG_MIB.hpSwitchCosAddressType,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.4.1.3': CONFIG_MIB.hpSwitchCosAddressIp,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.4.1.4': CONFIG_MIB.hpSwitchCosAddressPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.4.1.5': CONFIG_MIB.hpSwitchCosAddressStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.4.1.6': CONFIG_MIB.hpSwitchCosAddressDSCPPolicy,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.4.1.7': CONFIG_MIB.hpSwitchCosAddressResolvedPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.4.1.8': CONFIG_MIB.hpSwitchCosAddressApplyPolicy,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.5.2.1.1': CONFIG_MIB.hpSwitchCosTosIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.5.2.1.2': CONFIG_MIB.hpSwitchCosTosPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.5.2.1.3': CONFIG_MIB.hpSwitchCosTosDSCPPolicy,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.5.2.1.4': CONFIG_MIB.hpSwitchCosTosResolvedPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.5.2.1.5': CONFIG_MIB.hpSwitchCosTosApplyPolicy,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.6.1.1': CONFIG_MIB.hpSwitchCosDSCPPolicyIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.6.1.2': CONFIG_MIB.hpSwitchCosDSCPPolicyPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.6.1.3': CONFIG_MIB.hpSwitchCosDSCPPolicyName,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.7.1.1': CONFIG_MIB.hpSwitchCosAppTypeConfigIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.7.1.2': CONFIG_MIB.hpSwitchCosAppTypeConfigType,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.7.1.3': CONFIG_MIB.hpSwitchCosAppTypeSrcPort,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.7.1.4': CONFIG_MIB.hpSwitchCosAppTypeDestPort,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.7.1.5': CONFIG_MIB.hpSwitchCosAppTypePriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.7.1.6': CONFIG_MIB.hpSwitchCosAppTypeDSCPPolicy,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.7.1.7': CONFIG_MIB.hpSwitchCosAppTypeResolvedPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.7.1.8': CONFIG_MIB.hpSwitchCosAppTypeApplyPolicy,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.17.7.1.9': CONFIG_MIB.hpSwitchCosAppTypeStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.19.2.1.1': CONFIG_MIB.hpSwitchPortIsolationPort,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.19.2.1.2': CONFIG_MIB.hpSwitchPortIsolationPortMode,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.22.1.1.1': CONFIG_MIB.hpSwitchBWMinIngressPortIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.22.1.1.2': CONFIG_MIB.hpSwitchBWMinIngressPortPrctLowPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.22.1.1.3': CONFIG_MIB.hpSwitchBWMinIngressPortPrctNormalPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.22.1.1.4': CONFIG_MIB.hpSwitchBWMinIngressPortPrctMedPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.22.1.1.5': CONFIG_MIB.hpSwitchBWMinIngressPortPrctHighPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.22.1.1.6': CONFIG_MIB.hpSwitchBWMinIngressPortStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.22.2.1.1': CONFIG_MIB.hpSwitchBWMinEgressPortIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.22.2.1.2': CONFIG_MIB.hpSwitchBWMinEgressPortPrctLowPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.22.2.1.3': CONFIG_MIB.hpSwitchBWMinEgressPortPrctNormalPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.22.2.1.4': CONFIG_MIB.hpSwitchBWMinEgressPortPrctMedPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.22.2.1.5': CONFIG_MIB.hpSwitchBWMinEgressPortPrctHighPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.22.2.1.6': CONFIG_MIB.hpSwitchBWMinEgressPortStatus,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.23.1.1.1': CONFIG_MIB.hpSwitchRateLimitPortIndex,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.23.1.1.2': CONFIG_MIB.hpSwitchRateLimitPortControlMode,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.23.1.1.3': CONFIG_MIB.hpSwitchRateLimitPortPrctLowPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.23.1.1.4': CONFIG_MIB.hpSwitchRateLimitPortPrctNormalPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.23.1.1.5': CONFIG_MIB.hpSwitchRateLimitPortPrctMedPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.23.1.1.6': CONFIG_MIB.hpSwitchRateLimitPortPrctHighPriority,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.23.1.1.7': CONFIG_MIB.hpSwitchRateLimitPortSingleControlPrct,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.23.1.1.8': CONFIG_MIB.hpSwitchRateLimitPortStatus,
}
|
xiangke/pycopia
|
mibs/pycopia/mibs/CONFIG_MIB_OID.py
|
Python
|
lgpl-2.1
| 14,182
|
#!/usr/bin/env python3
from gi.repository import LibvirtGObject
from gi.repository import LibvirtSandbox
from gi.repository import GLib
from gi.repository import Gtk
import sys
import os
args = sys.argv[1:]
LibvirtGObject.init_object_check(None)
cfg = LibvirtSandbox.ConfigInteractive.new("sandbox")
if len(args) > 0:
cfg.set_command(args)
if os.isatty(sys.stdin.fileno()):
cfg.set_tty(True)
conn = LibvirtGObject.Connection.new("qemu:///session")
conn.open(None)
ctxt = LibvirtSandbox.ContextInteractive.new(conn, cfg)
ctxt.start()
con = ctxt.get_app_console()
def closed(obj, error):
Gtk.main_quit()
con.connect("closed", closed)
con.attach_stdio()
Gtk.main()
try:
con.detach()
except:
pass
try:
ctxt.stop()
except:
pass
|
libvirt/libvirt-sandbox
|
examples/virt-sandbox.py
|
Python
|
lgpl-2.1
| 762
|
import base64
import sys
import time
__all__ = [
"BytesIO",
"MAXSIZE",
"PY2",
"StringIO",
"b",
"b2s",
"builtins",
"byte_chr",
"byte_mask",
"byte_ord",
"bytes",
"bytes_types",
"decodebytes",
"encodebytes",
"input",
"integer_types",
"is_callable",
"long",
"next",
"string_types",
"text_type",
"u",
]
PY2 = sys.version_info[0] < 3
if PY2:
import __builtin__ as builtins
import locale
string_types = basestring # NOQA
text_type = unicode # NOQA
bytes_types = str
bytes = str
integer_types = (int, long) # NOQA
long = long # NOQA
input = raw_input # NOQA
decodebytes = base64.decodestring
encodebytes = base64.encodestring
def bytestring(s): # NOQA
if isinstance(s, unicode): # NOQA
return s.encode("utf-8")
return s
byte_ord = ord # NOQA
byte_chr = chr # NOQA
def byte_mask(c, mask):
return chr(ord(c) & mask)
def b(s, encoding="utf8"): # NOQA
"""cast unicode or bytes to bytes"""
if isinstance(s, str):
return s
elif isinstance(s, unicode): # NOQA
return s.encode(encoding)
elif isinstance(s, buffer): # NOQA
return s
else:
raise TypeError("Expected unicode or bytes, got {!r}".format(s))
def u(s, encoding="utf8"): # NOQA
"""cast bytes or unicode to unicode"""
if isinstance(s, str):
return s.decode(encoding)
elif isinstance(s, unicode): # NOQA
return s
elif isinstance(s, buffer): # NOQA
return s.decode(encoding)
else:
raise TypeError("Expected unicode or bytes, got {!r}".format(s))
def b2s(s):
return s
import cStringIO
StringIO = cStringIO.StringIO
BytesIO = StringIO
def is_callable(c): # NOQA
return callable(c)
def get_next(c): # NOQA
return c.next
def next(c):
return c.next()
# It's possible to have sizeof(long) != sizeof(Py_ssize_t).
class X(object):
def __len__(self):
return 1 << 31
try:
len(X())
except OverflowError:
# 32-bit
MAXSIZE = int((1 << 31) - 1) # NOQA
else:
# 64-bit
MAXSIZE = int((1 << 63) - 1) # NOQA
del X
def strftime(format, t):
"""Same as time.strftime but returns unicode."""
_, encoding = locale.getlocale(locale.LC_TIME)
return time.strftime(format, t).decode(encoding or "ascii")
else:
import collections
import struct
import builtins
string_types = str
text_type = str
bytes = bytes
bytes_types = bytes
integer_types = int
class long(int):
pass
input = input
decodebytes = base64.decodebytes
encodebytes = base64.encodebytes
def byte_ord(c):
# In case we're handed a string instead of an int.
if not isinstance(c, int):
c = ord(c)
return c
def byte_chr(c):
assert isinstance(c, int)
return struct.pack("B", c)
def byte_mask(c, mask):
assert isinstance(c, int)
return struct.pack("B", c & mask)
def b(s, encoding="utf8"):
"""cast unicode or bytes to bytes"""
if isinstance(s, bytes):
return s
elif isinstance(s, str):
return s.encode(encoding)
else:
raise TypeError("Expected unicode or bytes, got {!r}".format(s))
def u(s, encoding="utf8"):
"""cast bytes or unicode to unicode"""
if isinstance(s, bytes):
return s.decode(encoding)
elif isinstance(s, str):
return s
else:
raise TypeError("Expected unicode or bytes, got {!r}".format(s))
def b2s(s):
return s.decode() if isinstance(s, bytes) else s
import io
StringIO = io.StringIO # NOQA
BytesIO = io.BytesIO # NOQA
def is_callable(c):
return isinstance(c, collections.Callable)
def get_next(c):
return c.__next__
next = next
MAXSIZE = sys.maxsize # NOQA
strftime = time.strftime # NOQA
|
paramiko/paramiko
|
paramiko/py3compat.py
|
Python
|
lgpl-2.1
| 4,211
|
# -*- Mode: Python -*-
# coding=utf-8
# GDBus - GLib D-Bus Library
#
# Copyright (C) 2008-2018 Red Hat, Inc.
# Copyright (C) 2018 Iñigo Martínez <inigomartinez@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General
# Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
#
# Author: David Zeuthen <davidz@redhat.com>
from . import config
from . import utils
from . import dbustypes
from .utils import print_error
LICENSE_STR = """/*
* This file is generated by gdbus-codegen, do not modify it.
*
* The license of this code is the same as for the D-Bus interface description
* it was derived from. Note that it links to GLib, so must comply with the
* LGPL linking clauses.
*/\n"""
# Disable line length warnings as wrapping the C code templates would be hard
# flake8: noqa: E501
def generate_namespace(namespace):
ns = namespace
if len(namespace) > 0:
if utils.is_ugly_case(namespace):
ns = namespace.replace("_", "")
ns_upper = namespace.upper() + "_"
ns_lower = namespace.lower() + "_"
else:
ns_upper = utils.camel_case_to_uscore(namespace).upper() + "_"
ns_lower = utils.camel_case_to_uscore(namespace).lower() + "_"
else:
ns_upper = ""
ns_lower = ""
return (ns, ns_upper, ns_lower)
def generate_header_guard(header_name):
# There might be more characters that are safe to use than these, but lets
# stay conservative.
safe_valid_chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
return "".join(
map(lambda c: c if c in safe_valid_chars else "_", header_name.upper())
)
class HeaderCodeGenerator:
def __init__(
self,
ifaces,
namespace,
generate_objmanager,
generate_autocleanup,
header_name,
input_files_basenames,
use_pragma,
glib_min_required,
symbol_decorator,
symbol_decorator_header,
outfile,
):
self.ifaces = ifaces
self.namespace, self.ns_upper, self.ns_lower = generate_namespace(namespace)
self.generate_objmanager = generate_objmanager
self.generate_autocleanup = generate_autocleanup
self.header_guard = generate_header_guard(header_name)
self.input_files_basenames = input_files_basenames
self.use_pragma = use_pragma
self.glib_min_required = glib_min_required
self.symbol_decorator = symbol_decorator
self.symbol_decorator_header = symbol_decorator_header
self.outfile = outfile
# ----------------------------------------------------------------------------------------------------
def generate_header_preamble(self):
basenames = ", ".join(self.input_files_basenames)
self.outfile.write(LICENSE_STR.format(config.VERSION, basenames))
self.outfile.write("\n")
if self.use_pragma:
self.outfile.write("#pragma once\n")
else:
self.outfile.write("#ifndef __{!s}__\n".format(self.header_guard))
self.outfile.write("#define __{!s}__\n".format(self.header_guard))
if self.symbol_decorator_header is not None:
self.outfile.write("\n")
self.outfile.write('#include "%s"\n' % self.symbol_decorator_header)
self.outfile.write("\n")
self.outfile.write("#include <gio/gio.h>\n")
self.outfile.write("\n")
self.outfile.write("G_BEGIN_DECLS\n")
self.outfile.write("\n")
# ----------------------------------------------------------------------------------------------------
def declare_types(self):
for i in self.ifaces:
self.outfile.write("\n")
self.outfile.write(
"/* ------------------------------------------------------------------------ */\n"
)
self.outfile.write("/* Declarations for %s */\n" % i.name)
self.outfile.write("\n")
# First the GInterface
self.outfile.write(
"#define %sTYPE_%s (%s_get_type ())\n"
% (i.ns_upper, i.name_upper, i.name_lower)
)
self.outfile.write(
"#define %s%s(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_%s, %s))\n"
% (i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name)
)
self.outfile.write(
"#define %sIS_%s(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_%s))\n"
% (i.ns_upper, i.name_upper, i.ns_upper, i.name_upper)
)
self.outfile.write(
"#define %s%s_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), %sTYPE_%s, %sIface))\n"
% (i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name)
)
self.outfile.write("\n")
self.outfile.write("struct _%s;\n" % (i.camel_name))
self.outfile.write(
"typedef struct _%s %s;\n" % (i.camel_name, i.camel_name)
)
self.outfile.write(
"typedef struct _%sIface %sIface;\n" % (i.camel_name, i.camel_name)
)
self.outfile.write("\n")
self.outfile.write("struct _%sIface\n" % (i.camel_name))
self.outfile.write("{\n")
self.outfile.write(" GTypeInterface parent_iface;\n")
function_pointers = {}
# vfuncs for methods
if len(i.methods) > 0:
self.outfile.write("\n")
for m in i.methods:
key = (m.since, "_method_%s" % m.name_lower)
value = " gboolean (*handle_%s) (\n" % (m.name_lower)
value += " %s *object,\n" % (i.camel_name)
value += " GDBusMethodInvocation *invocation"
if m.unix_fd:
value += ",\n GUnixFDList *fd_list"
for a in m.in_args:
value += ",\n %sarg_%s" % (a.ctype_in, a.name)
value += ");\n\n"
function_pointers[key] = value
# vfuncs for signals
if len(i.signals) > 0:
self.outfile.write("\n")
for s in i.signals:
key = (s.since, "_signal_%s" % s.name_lower)
value = " void (*%s) (\n" % (s.name_lower)
value += " %s *object" % (i.camel_name)
for a in s.args:
value += ",\n %sarg_%s" % (a.ctype_in, a.name)
value += ");\n\n"
function_pointers[key] = value
# vfuncs for properties
if len(i.properties) > 0:
self.outfile.write("\n")
for p in i.properties:
key = (p.since, "_prop_get_%s" % p.name_lower)
value = " %s (*get_%s) (%s *object);\n\n" % (
p.arg.ctype_in,
p.name_lower,
i.camel_name,
)
function_pointers[key] = value
# Sort according to @since tag, then name.. this ensures
# that the function pointers don't change order assuming
# judicious use of @since
#
# Also use a proper version comparison function so e.g.
# 10.0 comes after 2.0.
#
# See https://bugzilla.gnome.org/show_bug.cgi?id=647577#c5
# for discussion
for key in sorted(function_pointers.keys(), key=utils.version_cmp_key):
self.outfile.write("%s" % function_pointers[key])
self.outfile.write("};\n")
self.outfile.write("\n")
if self.generate_autocleanup == "all":
self.outfile.write("#if GLIB_CHECK_VERSION(2, 44, 0)\n")
self.outfile.write(
"G_DEFINE_AUTOPTR_CLEANUP_FUNC (%s, g_object_unref)\n"
% (i.camel_name)
)
self.outfile.write("#endif\n")
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"GType %s_get_type (void) G_GNUC_CONST;\n" % (i.name_lower)
)
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"GDBusInterfaceInfo *%s_interface_info (void);\n" % (i.name_lower)
)
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"guint %s_override_properties (GObjectClass *klass, guint property_id_begin);\n"
% (i.name_lower)
)
self.outfile.write("\n")
# Then method call completion functions
if len(i.methods) > 0:
self.outfile.write("\n")
self.outfile.write("/* D-Bus method call completion functions: */\n")
for m in i.methods:
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if m.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"void %s_complete_%s (\n"
" %s *object,\n"
" GDBusMethodInvocation *invocation"
% (i.name_lower, m.name_lower, i.camel_name)
)
if m.unix_fd:
self.outfile.write(",\n GUnixFDList *fd_list")
for a in m.out_args:
self.outfile.write(",\n %s%s" % (a.ctype_in, a.name))
self.outfile.write(");\n")
self.outfile.write("\n")
self.outfile.write("\n")
# Then signal emission functions
if len(i.signals) > 0:
self.outfile.write("\n")
self.outfile.write("/* D-Bus signal emissions functions: */\n")
for s in i.signals:
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if s.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"void %s_emit_%s (\n"
" %s *object" % (i.name_lower, s.name_lower, i.camel_name)
)
for a in s.args:
self.outfile.write(",\n %sarg_%s" % (a.ctype_in, a.name))
self.outfile.write(");\n")
self.outfile.write("\n")
self.outfile.write("\n")
# Then method call declarations
if len(i.methods) > 0:
self.outfile.write("\n")
self.outfile.write("/* D-Bus method calls: */\n")
for m in i.methods:
# async begin
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if m.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"void %s_call_%s (\n"
" %s *proxy" % (i.name_lower, m.name_lower, i.camel_name)
)
for a in m.in_args:
self.outfile.write(",\n %sarg_%s" % (a.ctype_in, a.name))
if self.glib_min_required >= (2, 64):
self.outfile.write(
",\n GDBusCallFlags call_flags"
",\n gint timeout_msec"
)
if m.unix_fd:
self.outfile.write(",\n GUnixFDList *fd_list")
self.outfile.write(
",\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data);\n"
)
self.outfile.write("\n")
# async finish
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if m.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"gboolean %s_call_%s_finish (\n"
" %s *proxy" % (i.name_lower, m.name_lower, i.camel_name)
)
for a in m.out_args:
self.outfile.write(",\n %sout_%s" % (a.ctype_out, a.name))
if m.unix_fd:
self.outfile.write(",\n GUnixFDList **out_fd_list")
self.outfile.write(
",\n" " GAsyncResult *res,\n" " GError **error);\n"
)
self.outfile.write("\n")
# sync
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if m.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"gboolean %s_call_%s_sync (\n"
" %s *proxy" % (i.name_lower, m.name_lower, i.camel_name)
)
for a in m.in_args:
self.outfile.write(",\n %sarg_%s" % (a.ctype_in, a.name))
if self.glib_min_required >= (2, 64):
self.outfile.write(
",\n GDBusCallFlags call_flags"
",\n gint timeout_msec"
)
if m.unix_fd:
self.outfile.write(",\n GUnixFDList *fd_list")
for a in m.out_args:
self.outfile.write(",\n %sout_%s" % (a.ctype_out, a.name))
if m.unix_fd:
self.outfile.write(",\n GUnixFDList **out_fd_list")
self.outfile.write(
",\n"
" GCancellable *cancellable,\n"
" GError **error);\n"
)
self.outfile.write("\n")
self.outfile.write("\n")
# Then the property accessor declarations
if len(i.properties) > 0:
self.outfile.write("\n")
self.outfile.write("/* D-Bus property accessors: */\n")
for p in i.properties:
# getter
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if p.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"%s%s_get_%s (%s *object);\n"
% (p.arg.ctype_in, i.name_lower, p.name_lower, i.camel_name)
)
if p.arg.free_func is not None:
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if p.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"%s%s_dup_%s (%s *object);\n"
% (
p.arg.ctype_in_dup,
i.name_lower,
p.name_lower,
i.camel_name,
)
)
# setter
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if p.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"void %s_set_%s (%s *object, %svalue);\n"
% (i.name_lower, p.name_lower, i.camel_name, p.arg.ctype_in)
)
self.outfile.write("\n")
# Then the proxy
self.outfile.write("\n")
self.outfile.write("/* ---- */\n")
self.outfile.write("\n")
self.outfile.write(
"#define %sTYPE_%s_PROXY (%s_proxy_get_type ())\n"
% (i.ns_upper, i.name_upper, i.name_lower)
)
self.outfile.write(
"#define %s%s_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_%s_PROXY, %sProxy))\n"
% (i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name)
)
self.outfile.write(
"#define %s%s_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_%s_PROXY, %sProxyClass))\n"
% (i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name)
)
self.outfile.write(
"#define %s%s_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_%s_PROXY, %sProxyClass))\n"
% (i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name)
)
self.outfile.write(
"#define %sIS_%s_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_%s_PROXY))\n"
% (i.ns_upper, i.name_upper, i.ns_upper, i.name_upper)
)
self.outfile.write(
"#define %sIS_%s_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), %sTYPE_%s_PROXY))\n"
% (i.ns_upper, i.name_upper, i.ns_upper, i.name_upper)
)
self.outfile.write("\n")
self.outfile.write(
"typedef struct _%sProxy %sProxy;\n" % (i.camel_name, i.camel_name)
)
self.outfile.write(
"typedef struct _%sProxyClass %sProxyClass;\n"
% (i.camel_name, i.camel_name)
)
self.outfile.write(
"typedef struct _%sProxyPrivate %sProxyPrivate;\n"
% (i.camel_name, i.camel_name)
)
self.outfile.write("\n")
self.outfile.write("struct _%sProxy\n" % (i.camel_name))
self.outfile.write("{\n")
self.outfile.write(" /*< private >*/\n")
self.outfile.write(" GDBusProxy parent_instance;\n")
self.outfile.write(" %sProxyPrivate *priv;\n" % (i.camel_name))
self.outfile.write("};\n")
self.outfile.write("\n")
self.outfile.write("struct _%sProxyClass\n" % (i.camel_name))
self.outfile.write("{\n")
self.outfile.write(" GDBusProxyClass parent_class;\n")
self.outfile.write("};\n")
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"GType %s_proxy_get_type (void) G_GNUC_CONST;\n" % (i.name_lower)
)
self.outfile.write("\n")
if self.generate_autocleanup in ("objects", "all"):
self.outfile.write("#if GLIB_CHECK_VERSION(2, 44, 0)\n")
self.outfile.write(
"G_DEFINE_AUTOPTR_CLEANUP_FUNC (%sProxy, g_object_unref)\n"
% (i.camel_name)
)
self.outfile.write("#endif\n")
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if i.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"void %s_proxy_new (\n"
" GDBusConnection *connection,\n"
" GDBusProxyFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data);\n" % (i.name_lower)
)
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if i.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"%s *%s_proxy_new_finish (\n"
" GAsyncResult *res,\n"
" GError **error);\n" % (i.camel_name, i.name_lower)
)
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if i.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"%s *%s_proxy_new_sync (\n"
" GDBusConnection *connection,\n"
" GDBusProxyFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GError **error);\n" % (i.camel_name, i.name_lower)
)
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if i.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"void %s_proxy_new_for_bus (\n"
" GBusType bus_type,\n"
" GDBusProxyFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data);\n" % (i.name_lower)
)
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if i.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"%s *%s_proxy_new_for_bus_finish (\n"
" GAsyncResult *res,\n"
" GError **error);\n" % (i.camel_name, i.name_lower)
)
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if i.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"%s *%s_proxy_new_for_bus_sync (\n"
" GBusType bus_type,\n"
" GDBusProxyFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GError **error);\n" % (i.camel_name, i.name_lower)
)
self.outfile.write("\n")
# Then the skeleton
self.outfile.write("\n")
self.outfile.write("/* ---- */\n")
self.outfile.write("\n")
self.outfile.write(
"#define %sTYPE_%s_SKELETON (%s_skeleton_get_type ())\n"
% (i.ns_upper, i.name_upper, i.name_lower)
)
self.outfile.write(
"#define %s%s_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_%s_SKELETON, %sSkeleton))\n"
% (i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name)
)
self.outfile.write(
"#define %s%s_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_%s_SKELETON, %sSkeletonClass))\n"
% (i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name)
)
self.outfile.write(
"#define %s%s_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_%s_SKELETON, %sSkeletonClass))\n"
% (i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name)
)
self.outfile.write(
"#define %sIS_%s_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_%s_SKELETON))\n"
% (i.ns_upper, i.name_upper, i.ns_upper, i.name_upper)
)
self.outfile.write(
"#define %sIS_%s_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), %sTYPE_%s_SKELETON))\n"
% (i.ns_upper, i.name_upper, i.ns_upper, i.name_upper)
)
self.outfile.write("\n")
self.outfile.write(
"typedef struct _%sSkeleton %sSkeleton;\n"
% (i.camel_name, i.camel_name)
)
self.outfile.write(
"typedef struct _%sSkeletonClass %sSkeletonClass;\n"
% (i.camel_name, i.camel_name)
)
self.outfile.write(
"typedef struct _%sSkeletonPrivate %sSkeletonPrivate;\n"
% (i.camel_name, i.camel_name)
)
self.outfile.write("\n")
self.outfile.write("struct _%sSkeleton\n" % (i.camel_name))
self.outfile.write("{\n")
self.outfile.write(" /*< private >*/\n")
self.outfile.write(" GDBusInterfaceSkeleton parent_instance;\n")
self.outfile.write(" %sSkeletonPrivate *priv;\n" % (i.camel_name))
self.outfile.write("};\n")
self.outfile.write("\n")
self.outfile.write("struct _%sSkeletonClass\n" % (i.camel_name))
self.outfile.write("{\n")
self.outfile.write(" GDBusInterfaceSkeletonClass parent_class;\n")
self.outfile.write("};\n")
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"GType %s_skeleton_get_type (void) G_GNUC_CONST;\n" % (i.name_lower)
)
self.outfile.write("\n")
if self.generate_autocleanup in ("objects", "all"):
self.outfile.write("#if GLIB_CHECK_VERSION(2, 44, 0)\n")
self.outfile.write(
"G_DEFINE_AUTOPTR_CLEANUP_FUNC (%sSkeleton, g_object_unref)\n"
% (i.camel_name)
)
self.outfile.write("#endif\n")
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if i.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"%s *%s_skeleton_new (void);\n" % (i.camel_name, i.name_lower)
)
self.outfile.write("\n")
# Finally, the Object, ObjectProxy, ObjectSkeleton and ObjectManagerClient
if self.generate_objmanager:
self.outfile.write("\n")
self.outfile.write("/* ---- */\n")
self.outfile.write("\n")
self.outfile.write(
"#define %sTYPE_OBJECT (%sobject_get_type ())\n"
% (self.ns_upper, self.ns_lower)
)
self.outfile.write(
"#define %sOBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_OBJECT, %sObject))\n"
% (self.ns_upper, self.ns_upper, self.namespace)
)
self.outfile.write(
"#define %sIS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_OBJECT))\n"
% (self.ns_upper, self.ns_upper)
)
self.outfile.write(
"#define %sOBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), %sTYPE_OBJECT, %sObject))\n"
% (self.ns_upper, self.ns_upper, self.namespace)
)
self.outfile.write("\n")
self.outfile.write("struct _%sObject;\n" % (self.namespace))
self.outfile.write(
"typedef struct _%sObject %sObject;\n"
% (self.namespace, self.namespace)
)
self.outfile.write(
"typedef struct _%sObjectIface %sObjectIface;\n"
% (self.namespace, self.namespace)
)
self.outfile.write("\n")
self.outfile.write("struct _%sObjectIface\n" % (self.namespace))
self.outfile.write("{\n" " GTypeInterface parent_iface;\n" "};\n" "\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"GType %sobject_get_type (void) G_GNUC_CONST;\n" "\n" % (self.ns_lower)
)
if self.generate_autocleanup == "all":
self.outfile.write("#if GLIB_CHECK_VERSION(2, 44, 0)\n")
self.outfile.write(
"G_DEFINE_AUTOPTR_CLEANUP_FUNC (%sObject, g_object_unref)\n"
% (self.namespace)
)
self.outfile.write("#endif\n")
self.outfile.write("\n")
for i in self.ifaces:
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if i.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"%s *%sobject_get_%s (%sObject *object);\n"
% (
i.camel_name,
self.ns_lower,
i.name_upper.lower(),
self.namespace,
)
)
for i in self.ifaces:
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if i.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"%s *%sobject_peek_%s (%sObject *object);\n"
% (
i.camel_name,
self.ns_lower,
i.name_upper.lower(),
self.namespace,
)
)
self.outfile.write("\n")
self.outfile.write(
"#define %sTYPE_OBJECT_PROXY (%sobject_proxy_get_type ())\n"
% (self.ns_upper, self.ns_lower)
)
self.outfile.write(
"#define %sOBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_OBJECT_PROXY, %sObjectProxy))\n"
% (self.ns_upper, self.ns_upper, self.namespace)
)
self.outfile.write(
"#define %sOBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_OBJECT_PROXY, %sObjectProxyClass))\n"
% (self.ns_upper, self.ns_upper, self.namespace)
)
self.outfile.write(
"#define %sOBJECT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_OBJECT_PROXY, %sObjectProxyClass))\n"
% (self.ns_upper, self.ns_upper, self.namespace)
)
self.outfile.write(
"#define %sIS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_OBJECT_PROXY))\n"
% (self.ns_upper, self.ns_upper)
)
self.outfile.write(
"#define %sIS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), %sTYPE_OBJECT_PROXY))\n"
% (self.ns_upper, self.ns_upper)
)
self.outfile.write("\n")
self.outfile.write(
"typedef struct _%sObjectProxy %sObjectProxy;\n"
% (self.namespace, self.namespace)
)
self.outfile.write(
"typedef struct _%sObjectProxyClass %sObjectProxyClass;\n"
% (self.namespace, self.namespace)
)
self.outfile.write(
"typedef struct _%sObjectProxyPrivate %sObjectProxyPrivate;\n"
% (self.namespace, self.namespace)
)
self.outfile.write("\n")
self.outfile.write("struct _%sObjectProxy\n" % (self.namespace))
self.outfile.write("{\n")
self.outfile.write(" /*< private >*/\n")
self.outfile.write(" GDBusObjectProxy parent_instance;\n")
self.outfile.write(" %sObjectProxyPrivate *priv;\n" % (self.namespace))
self.outfile.write("};\n")
self.outfile.write("\n")
self.outfile.write("struct _%sObjectProxyClass\n" % (self.namespace))
self.outfile.write("{\n")
self.outfile.write(" GDBusObjectProxyClass parent_class;\n")
self.outfile.write("};\n")
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"GType %sobject_proxy_get_type (void) G_GNUC_CONST;\n" % (self.ns_lower)
)
self.outfile.write("\n")
if self.generate_autocleanup in ("objects", "all"):
self.outfile.write("#if GLIB_CHECK_VERSION(2, 44, 0)\n")
self.outfile.write(
"G_DEFINE_AUTOPTR_CLEANUP_FUNC (%sObjectProxy, g_object_unref)\n"
% (self.namespace)
)
self.outfile.write("#endif\n")
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"%sObjectProxy *%sobject_proxy_new (GDBusConnection *connection, const gchar *object_path);\n"
% (self.namespace, self.ns_lower)
)
self.outfile.write("\n")
self.outfile.write(
"#define %sTYPE_OBJECT_SKELETON (%sobject_skeleton_get_type ())\n"
% (self.ns_upper, self.ns_lower)
)
self.outfile.write(
"#define %sOBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_OBJECT_SKELETON, %sObjectSkeleton))\n"
% (self.ns_upper, self.ns_upper, self.namespace)
)
self.outfile.write(
"#define %sOBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_OBJECT_SKELETON, %sObjectSkeletonClass))\n"
% (self.ns_upper, self.ns_upper, self.namespace)
)
self.outfile.write(
"#define %sOBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_OBJECT_SKELETON, %sObjectSkeletonClass))\n"
% (self.ns_upper, self.ns_upper, self.namespace)
)
self.outfile.write(
"#define %sIS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_OBJECT_SKELETON))\n"
% (self.ns_upper, self.ns_upper)
)
self.outfile.write(
"#define %sIS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), %sTYPE_OBJECT_SKELETON))\n"
% (self.ns_upper, self.ns_upper)
)
self.outfile.write("\n")
self.outfile.write(
"typedef struct _%sObjectSkeleton %sObjectSkeleton;\n"
% (self.namespace, self.namespace)
)
self.outfile.write(
"typedef struct _%sObjectSkeletonClass %sObjectSkeletonClass;\n"
% (self.namespace, self.namespace)
)
self.outfile.write(
"typedef struct _%sObjectSkeletonPrivate %sObjectSkeletonPrivate;\n"
% (self.namespace, self.namespace)
)
self.outfile.write("\n")
self.outfile.write("struct _%sObjectSkeleton\n" % (self.namespace))
self.outfile.write("{\n")
self.outfile.write(" /*< private >*/\n")
self.outfile.write(" GDBusObjectSkeleton parent_instance;\n")
self.outfile.write(" %sObjectSkeletonPrivate *priv;\n" % (self.namespace))
self.outfile.write("};\n")
self.outfile.write("\n")
self.outfile.write("struct _%sObjectSkeletonClass\n" % (self.namespace))
self.outfile.write("{\n")
self.outfile.write(" GDBusObjectSkeletonClass parent_class;\n")
self.outfile.write("};\n")
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"GType %sobject_skeleton_get_type (void) G_GNUC_CONST;\n"
% (self.ns_lower)
)
self.outfile.write("\n")
if self.generate_autocleanup in ("objects", "all"):
self.outfile.write("#if GLIB_CHECK_VERSION(2, 44, 0)\n")
self.outfile.write(
"G_DEFINE_AUTOPTR_CLEANUP_FUNC (%sObjectSkeleton, g_object_unref)\n"
% (self.namespace)
)
self.outfile.write("#endif\n")
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"%sObjectSkeleton *%sobject_skeleton_new (const gchar *object_path);\n"
% (self.namespace, self.ns_lower)
)
for i in self.ifaces:
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
if i.deprecated:
self.outfile.write("G_GNUC_DEPRECATED ")
self.outfile.write(
"void %sobject_skeleton_set_%s (%sObjectSkeleton *object, %s *interface_);\n"
% (
self.ns_lower,
i.name_upper.lower(),
self.namespace,
i.camel_name,
)
)
self.outfile.write("\n")
self.outfile.write("/* ---- */\n")
self.outfile.write("\n")
self.outfile.write(
"#define %sTYPE_OBJECT_MANAGER_CLIENT (%sobject_manager_client_get_type ())\n"
% (self.ns_upper, self.ns_lower)
)
self.outfile.write(
"#define %sOBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_OBJECT_MANAGER_CLIENT, %sObjectManagerClient))\n"
% (self.ns_upper, self.ns_upper, self.namespace)
)
self.outfile.write(
"#define %sOBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_OBJECT_MANAGER_CLIENT, %sObjectManagerClientClass))\n"
% (self.ns_upper, self.ns_upper, self.namespace)
)
self.outfile.write(
"#define %sOBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_OBJECT_MANAGER_CLIENT, %sObjectManagerClientClass))\n"
% (self.ns_upper, self.ns_upper, self.namespace)
)
self.outfile.write(
"#define %sIS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_OBJECT_MANAGER_CLIENT))\n"
% (self.ns_upper, self.ns_upper)
)
self.outfile.write(
"#define %sIS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), %sTYPE_OBJECT_MANAGER_CLIENT))\n"
% (self.ns_upper, self.ns_upper)
)
self.outfile.write("\n")
self.outfile.write(
"typedef struct _%sObjectManagerClient %sObjectManagerClient;\n"
% (self.namespace, self.namespace)
)
self.outfile.write(
"typedef struct _%sObjectManagerClientClass %sObjectManagerClientClass;\n"
% (self.namespace, self.namespace)
)
self.outfile.write(
"typedef struct _%sObjectManagerClientPrivate %sObjectManagerClientPrivate;\n"
% (self.namespace, self.namespace)
)
self.outfile.write("\n")
self.outfile.write("struct _%sObjectManagerClient\n" % (self.namespace))
self.outfile.write("{\n")
self.outfile.write(" /*< private >*/\n")
self.outfile.write(" GDBusObjectManagerClient parent_instance;\n")
self.outfile.write(
" %sObjectManagerClientPrivate *priv;\n" % (self.namespace)
)
self.outfile.write("};\n")
self.outfile.write("\n")
self.outfile.write(
"struct _%sObjectManagerClientClass\n" % (self.namespace)
)
self.outfile.write("{\n")
self.outfile.write(" GDBusObjectManagerClientClass parent_class;\n")
self.outfile.write("};\n")
self.outfile.write("\n")
if self.generate_autocleanup in ("objects", "all"):
self.outfile.write("#if GLIB_CHECK_VERSION(2, 44, 0)\n")
self.outfile.write(
"G_DEFINE_AUTOPTR_CLEANUP_FUNC (%sObjectManagerClient, g_object_unref)\n"
% (self.namespace)
)
self.outfile.write("#endif\n")
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"GType %sobject_manager_client_get_type (void) G_GNUC_CONST;\n"
% (self.ns_lower)
)
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"GType %sobject_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data);\n"
% (self.ns_lower)
)
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"void %sobject_manager_client_new (\n"
" GDBusConnection *connection,\n"
" GDBusObjectManagerClientFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data);\n" % (self.ns_lower)
)
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"GDBusObjectManager *%sobject_manager_client_new_finish (\n"
" GAsyncResult *res,\n"
" GError **error);\n" % (self.ns_lower)
)
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"GDBusObjectManager *%sobject_manager_client_new_sync (\n"
" GDBusConnection *connection,\n"
" GDBusObjectManagerClientFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GError **error);\n" % (self.ns_lower)
)
self.outfile.write("\n")
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"void %sobject_manager_client_new_for_bus (\n"
" GBusType bus_type,\n"
" GDBusObjectManagerClientFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data);\n" % (self.ns_lower)
)
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"GDBusObjectManager *%sobject_manager_client_new_for_bus_finish (\n"
" GAsyncResult *res,\n"
" GError **error);\n" % (self.ns_lower)
)
if self.symbol_decorator is not None:
self.outfile.write("%s\n" % self.symbol_decorator)
self.outfile.write(
"GDBusObjectManager *%sobject_manager_client_new_for_bus_sync (\n"
" GBusType bus_type,\n"
" GDBusObjectManagerClientFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GError **error);\n" % (self.ns_lower)
)
self.outfile.write("\n")
# ----------------------------------------------------------------------------------------------------
def generate_header_postamble(self):
self.outfile.write("\n")
self.outfile.write("G_END_DECLS\n")
if not self.use_pragma:
self.outfile.write("\n")
self.outfile.write("#endif /* __{!s}__ */\n".format(self.header_guard))
# ----------------------------------------------------------------------------------------------------
def generate(self):
self.generate_header_preamble()
self.declare_types()
self.generate_header_postamble()
# ----------------------------------------------------------------------------------------------------
class InterfaceInfoHeaderCodeGenerator:
def __init__(
self,
ifaces,
namespace,
header_name,
input_files_basenames,
use_pragma,
glib_min_required,
symbol_decorator,
symbol_decorator_header,
outfile,
):
self.ifaces = ifaces
self.namespace, self.ns_upper, self.ns_lower = generate_namespace(namespace)
self.header_guard = generate_header_guard(header_name)
self.input_files_basenames = input_files_basenames
self.use_pragma = use_pragma
self.glib_min_required = glib_min_required
self.symbol_decorator = symbol_decorator
if self.symbol_decorator is None:
self.symbol_decorator = ""
self.symbol_decorator_header = symbol_decorator_header
self.outfile = outfile
# ----------------------------------------------------------------------------------------------------
def generate_header_preamble(self):
basenames = ", ".join(self.input_files_basenames)
self.outfile.write(LICENSE_STR.format(config.VERSION, basenames))
self.outfile.write("\n")
if self.use_pragma:
self.outfile.write("#pragma once\n")
else:
self.outfile.write("#ifndef __{!s}__\n".format(self.header_guard))
self.outfile.write("#define __{!s}__\n".format(self.header_guard))
if self.symbol_decorator_header is not None:
self.outfile.write("\n")
self.outfile.write('#include "%s"\n' % self.symbol_decorator_header)
self.outfile.write("\n")
self.outfile.write("#include <gio/gio.h>\n")
self.outfile.write("\n")
self.outfile.write("G_BEGIN_DECLS\n")
self.outfile.write("\n")
# ----------------------------------------------------------------------------------------------------
def declare_infos(self):
for i in self.ifaces:
self.outfile.write(
"extern %s const GDBusInterfaceInfo %s_interface;\n"
% (self.symbol_decorator, i.name_lower)
)
# ----------------------------------------------------------------------------------------------------
def generate_header_postamble(self):
self.outfile.write("\n")
self.outfile.write("G_END_DECLS\n")
if not self.use_pragma:
self.outfile.write("\n")
self.outfile.write("#endif /* __{!s}__ */\n".format(self.header_guard))
# ----------------------------------------------------------------------------------------------------
def generate(self):
self.generate_header_preamble()
self.declare_infos()
self.generate_header_postamble()
# ----------------------------------------------------------------------------------------------------
class InterfaceInfoBodyCodeGenerator:
def __init__(
self,
ifaces,
namespace,
header_name,
input_files_basenames,
glib_min_required,
symbol_decoration_define,
outfile,
):
self.ifaces = ifaces
self.namespace, self.ns_upper, self.ns_lower = generate_namespace(namespace)
self.header_name = header_name
self.input_files_basenames = input_files_basenames
self.glib_min_required = glib_min_required
self.symbol_decoration_define = symbol_decoration_define
self.outfile = outfile
# ----------------------------------------------------------------------------------------------------
def generate_body_preamble(self):
basenames = ", ".join(self.input_files_basenames)
self.outfile.write(LICENSE_STR.format(config.VERSION, basenames))
if self.symbol_decoration_define is not None:
self.outfile.write("\n")
self.outfile.write("#define %s\n" % self.symbol_decoration_define)
self.outfile.write("\n")
self.outfile.write(
"#ifdef HAVE_CONFIG_H\n"
'# include "config.h"\n'
"#endif\n"
"\n"
'#include "%s"\n'
"\n"
"#include <string.h>\n" % (self.header_name)
)
self.outfile.write("\n")
# ----------------------------------------------------------------------------------------------------
def generate_array(self, array_name_lower, element_type, elements):
self.outfile.write(
"const %s * const %s[] =\n" % (element_type, array_name_lower)
)
self.outfile.write("{\n")
for (_, name) in elements:
self.outfile.write(" &%s,\n" % name)
self.outfile.write(" NULL,\n")
self.outfile.write("};\n")
self.outfile.write("\n")
def define_annotations(self, array_name_lower, annotations):
if len(annotations) == 0:
return
annotation_pointers = []
for a in annotations:
# Skip internal annotations.
if a.key.startswith("org.gtk.GDBus"):
continue
self.define_annotations(
"%s__%s_annotations" % (array_name_lower, a.key_lower), a.annotations
)
self.outfile.write(
"const GDBusAnnotationInfo %s__%s_annotation =\n"
% (array_name_lower, a.key_lower)
)
self.outfile.write("{\n")
self.outfile.write(" -1, /* ref count */\n")
self.outfile.write(' (gchar *) "%s",\n' % a.key)
self.outfile.write(' (gchar *) "%s",\n' % a.value)
if len(a.annotations) > 0:
self.outfile.write(
" (GDBusAnnotationInfo **) %s__%s_annotations,\n"
% (array_name_lower, a.key_lower)
)
else:
self.outfile.write(" NULL, /* no annotations */\n")
self.outfile.write("};\n")
self.outfile.write("\n")
key = (a.since, "%s__%s_annotation" % (array_name_lower, a.key_lower))
annotation_pointers.append(key)
self.generate_array(
array_name_lower, "GDBusAnnotationInfo", annotation_pointers
)
def define_args(self, array_name_lower, args):
if len(args) == 0:
return
arg_pointers = []
for a in args:
self.define_annotations(
"%s__%s_arg_annotations" % (array_name_lower, a.name), a.annotations
)
self.outfile.write(
"const GDBusArgInfo %s__%s_arg =\n" % (array_name_lower, a.name)
)
self.outfile.write("{\n")
self.outfile.write(" -1, /* ref count */\n")
self.outfile.write(' (gchar *) "%s",\n' % a.name)
self.outfile.write(' (gchar *) "%s",\n' % a.signature)
if len(a.annotations) > 0:
self.outfile.write(
" (GDBusAnnotationInfo **) %s__%s_arg_annotations,\n"
% (array_name_lower, a.name)
)
else:
self.outfile.write(" NULL, /* no annotations */\n")
self.outfile.write("};\n")
self.outfile.write("\n")
key = (a.since, "%s__%s_arg" % (array_name_lower, a.name))
arg_pointers.append(key)
self.generate_array(array_name_lower, "GDBusArgInfo", arg_pointers)
def define_infos(self):
for i in self.ifaces:
self.outfile.write(
"/* ------------------------------------------------------------------------ */\n"
)
self.outfile.write("/* Definitions for %s */\n" % i.name)
self.outfile.write("\n")
# GDBusMethodInfos.
if len(i.methods) > 0:
method_pointers = []
for m in i.methods:
self.define_args(
"%s_interface__%s_method_in_args"
% (i.name_lower, m.name_lower),
m.in_args,
)
self.define_args(
"%s_interface__%s_method_out_args"
% (i.name_lower, m.name_lower),
m.out_args,
)
self.define_annotations(
"%s_interface__%s_method_annotations"
% (i.name_lower, m.name_lower),
m.annotations,
)
self.outfile.write(
"const GDBusMethodInfo %s_interface__%s_method =\n"
% (i.name_lower, m.name_lower)
)
self.outfile.write("{\n")
self.outfile.write(" -1, /* ref count */\n")
self.outfile.write(' (gchar *) "%s",\n' % m.name)
if len(m.in_args) > 0:
self.outfile.write(
" (GDBusArgInfo **) %s_interface__%s_method_in_args,\n"
% (i.name_lower, m.name_lower)
)
else:
self.outfile.write(" NULL, /* no in args */\n")
if len(m.out_args) > 0:
self.outfile.write(
" (GDBusArgInfo **) %s_interface__%s_method_out_args,\n"
% (i.name_lower, m.name_lower)
)
else:
self.outfile.write(" NULL, /* no out args */\n")
if len(m.annotations) > 0:
self.outfile.write(
" (GDBusAnnotationInfo **) %s_interface__%s_method_annotations,\n"
% (i.name_lower, m.name_lower)
)
else:
self.outfile.write(" NULL, /* no annotations */\n")
self.outfile.write("};\n")
self.outfile.write("\n")
key = (
m.since,
"%s_interface__%s_method" % (i.name_lower, m.name_lower),
)
method_pointers.append(key)
self.generate_array(
"%s_interface_methods" % i.name_lower,
"GDBusMethodInfo",
method_pointers,
)
# GDBusSignalInfos.
if len(i.signals) > 0:
signal_pointers = []
for s in i.signals:
self.define_args(
"%s_interface__%s_signal_args" % (i.name_lower, s.name_lower),
s.args,
)
self.define_annotations(
"%s_interface__%s_signal_annotations"
% (i.name_lower, s.name_lower),
s.annotations,
)
self.outfile.write(
"const GDBusSignalInfo %s_interface__%s_signal =\n"
% (i.name_lower, s.name_lower)
)
self.outfile.write("{\n")
self.outfile.write(" -1, /* ref count */\n")
self.outfile.write(' (gchar *) "%s",\n' % s.name)
if len(s.args) > 0:
self.outfile.write(
" (GDBusArgInfo **) %s_interface__%s_signal_args,\n"
% (i.name_lower, s.name_lower)
)
else:
self.outfile.write(" NULL, /* no args */\n")
if len(s.annotations) > 0:
self.outfile.write(
" (GDBusAnnotationInfo **) %s_interface__%s_signal_annotations,\n"
% (i.name_lower, s.name_lower)
)
else:
self.outfile.write(" NULL, /* no annotations */\n")
self.outfile.write("};\n")
self.outfile.write("\n")
key = (
s.since,
"%s_interface__%s_signal" % (i.name_lower, s.name_lower),
)
signal_pointers.append(key)
self.generate_array(
"%s_interface_signals" % i.name_lower,
"GDBusSignalInfo",
signal_pointers,
)
# GDBusPropertyInfos.
if len(i.properties) > 0:
property_pointers = []
for p in i.properties:
if p.readable and p.writable:
flags = "G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE"
elif p.readable:
flags = "G_DBUS_PROPERTY_INFO_FLAGS_READABLE"
elif p.writable:
flags = "G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE"
else:
flags = "G_DBUS_PROPERTY_INFO_FLAGS_NONE"
self.define_annotations(
"%s_interface__%s_property_annotations"
% (i.name_lower, p.name_lower),
p.annotations,
)
self.outfile.write(
"const GDBusPropertyInfo %s_interface__%s_property =\n"
% (i.name_lower, p.name_lower)
)
self.outfile.write("{\n")
self.outfile.write(" -1, /* ref count */\n")
self.outfile.write(' (gchar *) "%s",\n' % p.name)
self.outfile.write(' (gchar *) "%s",\n' % p.signature)
self.outfile.write(" %s,\n" % flags)
if len(p.annotations) > 0:
self.outfile.write(
" (GDBusAnnotationInfo **) %s_interface__%s_property_annotations,\n"
% (i.name_lower, p.name_lower)
)
else:
self.outfile.write(" NULL, /* no annotations */\n")
self.outfile.write("};\n")
self.outfile.write("\n")
key = (
p.since,
"%s_interface__%s_property" % (i.name_lower, p.name_lower),
)
property_pointers.append(key)
self.generate_array(
"%s_interface_properties" % i.name_lower,
"GDBusPropertyInfo",
property_pointers,
)
# Finally the GDBusInterfaceInfo.
self.define_annotations(
"%s_interface_annotations" % i.name_lower, i.annotations
)
self.outfile.write(
"const GDBusInterfaceInfo %s_interface =\n" % i.name_lower
)
self.outfile.write("{\n")
self.outfile.write(" -1, /* ref count */\n")
self.outfile.write(' (gchar *) "%s",\n' % i.name)
if len(i.methods) > 0:
self.outfile.write(
" (GDBusMethodInfo **) %s_interface_methods,\n" % i.name_lower
)
else:
self.outfile.write(" NULL, /* no methods */\n")
if len(i.signals) > 0:
self.outfile.write(
" (GDBusSignalInfo **) %s_interface_signals,\n" % i.name_lower
)
else:
self.outfile.write(" NULL, /* no signals */\n")
if len(i.properties) > 0:
self.outfile.write(
" (GDBusPropertyInfo **) %s_interface_properties,\n" % i.name_lower
)
else:
self.outfile.write("NULL, /* no properties */\n")
if len(i.annotations) > 0:
self.outfile.write(
" (GDBusAnnotationInfo **) %s_interface_annotations,\n"
% i.name_lower
)
else:
self.outfile.write(" NULL, /* no annotations */\n")
self.outfile.write("};\n")
self.outfile.write("\n")
# ----------------------------------------------------------------------------------------------------
def generate(self):
self.generate_body_preamble()
self.define_infos()
# ----------------------------------------------------------------------------------------------------
class CodeGenerator:
def __init__(
self,
ifaces,
namespace,
generate_objmanager,
header_name,
input_files_basenames,
docbook_gen,
glib_min_required,
symbol_decoration_define,
outfile,
):
self.ifaces = ifaces
self.namespace, self.ns_upper, self.ns_lower = generate_namespace(namespace)
self.generate_objmanager = generate_objmanager
self.header_name = header_name
self.input_files_basenames = input_files_basenames
self.docbook_gen = docbook_gen
self.glib_min_required = glib_min_required
self.symbol_decoration_define = symbol_decoration_define
self.outfile = outfile
# ----------------------------------------------------------------------------------------------------
def generate_body_preamble(self):
basenames = ", ".join(self.input_files_basenames)
self.outfile.write(LICENSE_STR.format(config.VERSION, basenames))
if self.symbol_decoration_define is not None:
self.outfile.write("\n")
self.outfile.write("#define %s\n" % self.symbol_decoration_define)
self.outfile.write("\n")
self.outfile.write(
"#ifdef HAVE_CONFIG_H\n"
'# include "config.h"\n'
"#endif\n"
"\n"
'#include "%s"\n'
"\n"
"#include <string.h>\n" % (self.header_name)
)
self.outfile.write(
"#ifdef G_OS_UNIX\n" "# include <gio/gunixfdlist.h>\n" "#endif\n" "\n"
)
self.outfile.write(
"typedef struct\n"
"{\n"
" GDBusArgInfo parent_struct;\n"
" gboolean use_gvariant;\n"
"} _ExtendedGDBusArgInfo;\n"
"\n"
)
self.outfile.write(
"typedef struct\n"
"{\n"
" GDBusMethodInfo parent_struct;\n"
" const gchar *signal_name;\n"
" gboolean pass_fdlist;\n"
"} _ExtendedGDBusMethodInfo;\n"
"\n"
)
self.outfile.write(
"typedef struct\n"
"{\n"
" GDBusSignalInfo parent_struct;\n"
" const gchar *signal_name;\n"
"} _ExtendedGDBusSignalInfo;\n"
"\n"
)
self.outfile.write(
"typedef struct\n"
"{\n"
" GDBusPropertyInfo parent_struct;\n"
" const gchar *hyphen_name;\n"
" guint use_gvariant : 1;\n"
" guint emits_changed_signal : 1;\n"
"} _ExtendedGDBusPropertyInfo;\n"
"\n"
)
self.outfile.write(
"typedef struct\n"
"{\n"
" GDBusInterfaceInfo parent_struct;\n"
" const gchar *hyphen_name;\n"
"} _ExtendedGDBusInterfaceInfo;\n"
"\n"
)
self.outfile.write(
"typedef struct\n"
"{\n"
" const _ExtendedGDBusPropertyInfo *info;\n"
" guint prop_id;\n"
" GValue orig_value; /* the value before the change */\n"
"} ChangedProperty;\n"
"\n"
"static void\n"
"_changed_property_free (ChangedProperty *data)\n"
"{\n"
" g_value_unset (&data->orig_value);\n"
" g_free (data);\n"
"}\n"
"\n"
)
self.outfile.write(
"static gboolean\n"
"_g_strv_equal0 (gchar **a, gchar **b)\n"
"{\n"
" gboolean ret = FALSE;\n"
" guint n;\n"
" if (a == NULL && b == NULL)\n"
" {\n"
" ret = TRUE;\n"
" goto out;\n"
" }\n"
" if (a == NULL || b == NULL)\n"
" goto out;\n"
" if (g_strv_length (a) != g_strv_length (b))\n"
" goto out;\n"
" for (n = 0; a[n] != NULL; n++)\n"
" if (g_strcmp0 (a[n], b[n]) != 0)\n"
" goto out;\n"
" ret = TRUE;\n"
"out:\n"
" return ret;\n"
"}\n"
"\n"
)
self.outfile.write(
"static gboolean\n"
"_g_variant_equal0 (GVariant *a, GVariant *b)\n"
"{\n"
" gboolean ret = FALSE;\n"
" if (a == NULL && b == NULL)\n"
" {\n"
" ret = TRUE;\n"
" goto out;\n"
" }\n"
" if (a == NULL || b == NULL)\n"
" goto out;\n"
" ret = g_variant_equal (a, b);\n"
"out:\n"
" return ret;\n"
"}\n"
"\n"
)
# simplified - only supports the types we use
self.outfile.write(
"G_GNUC_UNUSED static gboolean\n"
"_g_value_equal (const GValue *a, const GValue *b)\n"
"{\n"
" gboolean ret = FALSE;\n"
" g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));\n"
" switch (G_VALUE_TYPE (a))\n"
" {\n"
" case G_TYPE_BOOLEAN:\n"
" ret = (g_value_get_boolean (a) == g_value_get_boolean (b));\n"
" break;\n"
" case G_TYPE_UCHAR:\n"
" ret = (g_value_get_uchar (a) == g_value_get_uchar (b));\n"
" break;\n"
" case G_TYPE_INT:\n"
" ret = (g_value_get_int (a) == g_value_get_int (b));\n"
" break;\n"
" case G_TYPE_UINT:\n"
" ret = (g_value_get_uint (a) == g_value_get_uint (b));\n"
" break;\n"
" case G_TYPE_INT64:\n"
" ret = (g_value_get_int64 (a) == g_value_get_int64 (b));\n"
" break;\n"
" case G_TYPE_UINT64:\n"
" ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));\n"
" break;\n"
" case G_TYPE_DOUBLE:\n"
" {\n"
" /* Avoid -Wfloat-equal warnings by doing a direct bit compare */\n"
" gdouble da = g_value_get_double (a);\n"
" gdouble db = g_value_get_double (b);\n"
" ret = memcmp (&da, &db, sizeof (gdouble)) == 0;\n"
" }\n"
" break;\n"
" case G_TYPE_STRING:\n"
" ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);\n"
" break;\n"
" case G_TYPE_VARIANT:\n"
" ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));\n"
" break;\n"
" default:\n"
" if (G_VALUE_TYPE (a) == G_TYPE_STRV)\n"
" ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));\n"
" else\n"
' g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));\n'
" break;\n"
" }\n"
" return ret;\n"
"}\n"
"\n"
)
def generate_annotations(self, prefix, annotations):
if annotations is None:
return
n = 0
for a in annotations:
# self.generate_annotations('%s_%d'%(prefix, n), a.get_annotations())
# skip internal annotations
if a.key.startswith("org.gtk.GDBus"):
continue
self.outfile.write(
"static const GDBusAnnotationInfo %s_%d =\n"
"{\n"
" -1,\n"
' (gchar *) "%s",\n'
' (gchar *) "%s",\n' % (prefix, n, a.key, a.value)
)
if len(a.annotations) == 0:
self.outfile.write(" NULL\n")
else:
self.outfile.write(
" (GDBusAnnotationInfo **) &%s_%d_pointers\n" % (prefix, n)
)
self.outfile.write("};\n" "\n")
n += 1
if n > 0:
self.outfile.write(
"static const GDBusAnnotationInfo * const %s_pointers[] =\n"
"{\n" % (prefix)
)
m = 0
for a in annotations:
if a.key.startswith("org.gtk.GDBus"):
continue
self.outfile.write(" &%s_%d,\n" % (prefix, m))
m += 1
self.outfile.write(" NULL\n" "};\n" "\n")
return n
def generate_args(self, prefix, args):
for a in args:
num_anno = self.generate_annotations(
"%s_arg_%s_annotation_info" % (prefix, a.name), a.annotations
)
self.outfile.write(
"static const _ExtendedGDBusArgInfo %s_%s =\n"
"{\n"
" {\n"
" -1,\n"
' (gchar *) "%s",\n'
' (gchar *) "%s",\n' % (prefix, a.name, a.name, a.signature)
)
if num_anno == 0:
self.outfile.write(" NULL\n")
else:
self.outfile.write(
" (GDBusAnnotationInfo **) &%s_arg_%s_annotation_info_pointers\n"
% (prefix, a.name)
)
self.outfile.write(" },\n")
if not utils.lookup_annotation(
a.annotations, "org.gtk.GDBus.C.ForceGVariant"
):
self.outfile.write(" FALSE\n")
else:
self.outfile.write(" TRUE\n")
self.outfile.write("};\n" "\n")
if len(args) > 0:
self.outfile.write(
"static const GDBusArgInfo * const %s_pointers[] =\n" "{\n" % (prefix)
)
for a in args:
self.outfile.write(" &%s_%s.parent_struct,\n" % (prefix, a.name))
self.outfile.write(" NULL\n" "};\n" "\n")
def generate_introspection_for_interface(self, i):
self.outfile.write(
"/* ---- Introspection data for %s ---- */\n" "\n" % (i.name)
)
if len(i.methods) > 0:
for m in i.methods:
self.generate_args(
"_%s_method_info_%s_IN_ARG" % (i.name_lower, m.name_lower),
m.in_args,
)
self.generate_args(
"_%s_method_info_%s_OUT_ARG" % (i.name_lower, m.name_lower),
m.out_args,
)
num_anno = self.generate_annotations(
"_%s_method_%s_annotation_info" % (i.name_lower, m.name_lower),
m.annotations,
)
self.outfile.write(
"static const _ExtendedGDBusMethodInfo _%s_method_info_%s =\n"
"{\n"
" {\n"
" -1,\n"
' (gchar *) "%s",\n' % (i.name_lower, m.name_lower, m.name)
)
if len(m.in_args) == 0:
self.outfile.write(" NULL,\n")
else:
self.outfile.write(
" (GDBusArgInfo **) &_%s_method_info_%s_IN_ARG_pointers,\n"
% (i.name_lower, m.name_lower)
)
if len(m.out_args) == 0:
self.outfile.write(" NULL,\n")
else:
self.outfile.write(
" (GDBusArgInfo **) &_%s_method_info_%s_OUT_ARG_pointers,\n"
% (i.name_lower, m.name_lower)
)
if num_anno == 0:
self.outfile.write(" NULL\n")
else:
self.outfile.write(
" (GDBusAnnotationInfo **) &_%s_method_%s_annotation_info_pointers\n"
% (i.name_lower, m.name_lower)
)
self.outfile.write(
" },\n"
' "handle-%s",\n'
" %s\n" % (m.name_hyphen, "TRUE" if m.unix_fd else "FALSE")
)
self.outfile.write("};\n" "\n")
self.outfile.write(
"static const GDBusMethodInfo * const _%s_method_info_pointers[] =\n"
"{\n" % (i.name_lower)
)
for m in i.methods:
self.outfile.write(
" &_%s_method_info_%s.parent_struct,\n"
% (i.name_lower, m.name_lower)
)
self.outfile.write(" NULL\n" "};\n" "\n")
# ---
if len(i.signals) > 0:
for s in i.signals:
self.generate_args(
"_%s_signal_info_%s_ARG" % (i.name_lower, s.name_lower), s.args
)
num_anno = self.generate_annotations(
"_%s_signal_%s_annotation_info" % (i.name_lower, s.name_lower),
s.annotations,
)
self.outfile.write(
"static const _ExtendedGDBusSignalInfo _%s_signal_info_%s =\n"
"{\n"
" {\n"
" -1,\n"
' (gchar *) "%s",\n' % (i.name_lower, s.name_lower, s.name)
)
if len(s.args) == 0:
self.outfile.write(" NULL,\n")
else:
self.outfile.write(
" (GDBusArgInfo **) &_%s_signal_info_%s_ARG_pointers,\n"
% (i.name_lower, s.name_lower)
)
if num_anno == 0:
self.outfile.write(" NULL\n")
else:
self.outfile.write(
" (GDBusAnnotationInfo **) &_%s_signal_%s_annotation_info_pointers\n"
% (i.name_lower, s.name_lower)
)
self.outfile.write(" },\n" ' "%s"\n' % (s.name_hyphen))
self.outfile.write("};\n" "\n")
self.outfile.write(
"static const GDBusSignalInfo * const _%s_signal_info_pointers[] =\n"
"{\n" % (i.name_lower)
)
for s in i.signals:
self.outfile.write(
" &_%s_signal_info_%s.parent_struct,\n"
% (i.name_lower, s.name_lower)
)
self.outfile.write(" NULL\n" "};\n" "\n")
# ---
if len(i.properties) > 0:
for p in i.properties:
if p.readable and p.writable:
access = "G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE"
elif p.readable:
access = "G_DBUS_PROPERTY_INFO_FLAGS_READABLE"
elif p.writable:
access = "G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE"
else:
access = "G_DBUS_PROPERTY_INFO_FLAGS_NONE"
num_anno = self.generate_annotations(
"_%s_property_%s_annotation_info" % (i.name_lower, p.name_lower),
p.annotations,
)
self.outfile.write(
"static const _ExtendedGDBusPropertyInfo _%s_property_info_%s =\n"
"{\n"
" {\n"
" -1,\n"
' (gchar *) "%s",\n'
' (gchar *) "%s",\n'
" %s,\n"
% (i.name_lower, p.name_lower, p.name, p.arg.signature, access)
)
if num_anno == 0:
self.outfile.write(" NULL\n")
else:
self.outfile.write(
" (GDBusAnnotationInfo **) &_%s_property_%s_annotation_info_pointers\n"
% (i.name_lower, p.name_lower)
)
self.outfile.write(" },\n" ' "%s",\n' % (p.name_hyphen))
if not utils.lookup_annotation(
p.annotations, "org.gtk.GDBus.C.ForceGVariant"
):
self.outfile.write(" FALSE,\n")
else:
self.outfile.write(" TRUE,\n")
if p.emits_changed_signal:
self.outfile.write(" TRUE\n")
else:
self.outfile.write(" FALSE\n")
self.outfile.write("};\n" "\n")
self.outfile.write(
"static const GDBusPropertyInfo * const _%s_property_info_pointers[] =\n"
"{\n" % (i.name_lower)
)
for p in i.properties:
self.outfile.write(
" &_%s_property_info_%s.parent_struct,\n"
% (i.name_lower, p.name_lower)
)
self.outfile.write(" NULL\n" "};\n" "\n")
num_anno = self.generate_annotations(
"_%s_annotation_info" % (i.name_lower), i.annotations
)
self.outfile.write(
"static const _ExtendedGDBusInterfaceInfo _%s_interface_info =\n"
"{\n"
" {\n"
" -1,\n"
' (gchar *) "%s",\n' % (i.name_lower, i.name)
)
if len(i.methods) == 0:
self.outfile.write(" NULL,\n")
else:
self.outfile.write(
" (GDBusMethodInfo **) &_%s_method_info_pointers,\n" % (i.name_lower)
)
if len(i.signals) == 0:
self.outfile.write(" NULL,\n")
else:
self.outfile.write(
" (GDBusSignalInfo **) &_%s_signal_info_pointers,\n" % (i.name_lower)
)
if len(i.properties) == 0:
self.outfile.write(" NULL,\n")
else:
self.outfile.write(
" (GDBusPropertyInfo **) &_%s_property_info_pointers,\n"
% (i.name_lower)
)
if num_anno == 0:
self.outfile.write(" NULL\n")
else:
self.outfile.write(
" (GDBusAnnotationInfo **) &_%s_annotation_info_pointers\n"
% (i.name_lower)
)
self.outfile.write(" },\n" ' "%s",\n' "};\n" "\n" % (i.name_hyphen))
self.outfile.write("\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %s_interface_info:\n"
" *\n"
" * Gets a machine-readable description of the #%s D-Bus interface.\n"
" *\n"
" * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.\n"
% (i.name_lower, i.name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write(
"GDBusInterfaceInfo *\n"
"%s_interface_info (void)\n"
"{\n"
" return (GDBusInterfaceInfo *) &_%s_interface_info.parent_struct;\n"
"}\n"
"\n" % (i.name_lower, i.name_lower)
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %s_override_properties:\n"
" * @klass: The class structure for a #GObject derived class.\n"
" * @property_id_begin: The property id to assign to the first overridden property.\n"
" *\n"
" * Overrides all #GObject properties in the #%s interface for a concrete class.\n"
" * The properties are overridden in the order they are defined.\n"
" *\n"
" * Returns: The last property id.\n" % (i.name_lower, i.camel_name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write(
"guint\n" "%s_override_properties (GObjectClass *klass" % (i.name_lower)
)
if len(i.properties) == 0:
self.outfile.write(" G_GNUC_UNUSED")
self.outfile.write(", guint property_id_begin)\n" "{\n")
for p in i.properties:
self.outfile.write(
' g_object_class_override_property (klass, property_id_begin++, "%s");\n'
% (p.name_hyphen)
)
self.outfile.write(" return property_id_begin - 1;\n" "}\n" "\n")
self.outfile.write("\n")
# ----------------------------------------------------------------------------------------------------
def generate_interface(self, i):
self.outfile.write("\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %s:\n"
" *\n"
" * Abstract interface type for the D-Bus interface #%s.\n"
% (i.camel_name, i.name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write("\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sIface:\n"
" * @parent_iface: The parent interface.\n" % (i.camel_name),
False,
)
)
doc_bits = {}
if len(i.methods) > 0:
for m in i.methods:
key = (m.since, "_method_%s" % m.name_lower)
value = "@handle_%s: " % (m.name_lower)
value += "Handler for the #%s::handle-%s signal." % (
i.camel_name,
m.name_hyphen,
)
doc_bits[key] = value
if len(i.signals) > 0:
for s in i.signals:
key = (s.since, "_signal_%s" % s.name_lower)
value = "@%s: " % (s.name_lower)
value += "Handler for the #%s::%s signal." % (
i.camel_name,
s.name_hyphen,
)
doc_bits[key] = value
if len(i.properties) > 0:
for p in i.properties:
key = (p.since, "_prop_get_%s" % p.name_lower)
value = "@get_%s: " % (p.name_lower)
value += "Getter for the #%s:%s property." % (
i.camel_name,
p.name_hyphen,
)
doc_bits[key] = value
for key in sorted(doc_bits.keys(), key=utils.version_cmp_key):
self.outfile.write(" * %s\n" % doc_bits[key])
self.outfile.write(
self.docbook_gen.expand(
" *\n" " * Virtual table for the D-Bus interface #%s.\n" % (i.name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write("\n")
self.outfile.write(
"typedef %sIface %sInterface;\n" % (i.camel_name, i.camel_name)
)
self.outfile.write(
"G_DEFINE_INTERFACE (%s, %s, G_TYPE_OBJECT)\n"
% (i.camel_name, i.name_lower)
)
self.outfile.write("\n")
self.outfile.write(
"static void\n"
"%s_default_init (%sIface *iface" % (i.name_lower, i.camel_name)
)
if len(i.methods) == 0 and len(i.signals) == 0 and len(i.properties) == 0:
self.outfile.write(" G_GNUC_UNUSED)\n")
else:
self.outfile.write(")\n")
self.outfile.write("{\n")
if len(i.methods) > 0:
self.outfile.write(
" /* GObject signals for incoming D-Bus method calls: */\n"
)
for m in i.methods:
self.outfile.write(
self.docbook_gen.expand(
" /**\n"
" * %s::handle-%s:\n"
" * @object: A #%s.\n"
" * @invocation: A #GDBusMethodInvocation.\n"
% (i.camel_name, m.name_hyphen, i.camel_name),
False,
)
)
if m.unix_fd:
self.outfile.write(
" * @fd_list: (nullable): A #GUnixFDList or %NULL.\n"
)
for a in m.in_args:
self.outfile.write(
" * @arg_%s: Argument passed by remote caller.\n" % (a.name)
)
self.outfile.write(
self.docbook_gen.expand(
" *\n"
" * Signal emitted when a remote caller is invoking the %s.%s() D-Bus method.\n"
" *\n"
" * If a signal handler returns %%TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call %s_complete_%s() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %%G_DBUS_ERROR_UNKNOWN_METHOD error is returned.\n"
" *\n"
" * Returns: %%G_DBUS_METHOD_INVOCATION_HANDLED or %%TRUE if the invocation was handled, %%G_DBUS_METHOD_INVOCATION_UNHANDLED or %%FALSE to let other signal handlers run.\n"
% (i.name, m.name, i.name_lower, m.name_lower),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(m, self.outfile, 2)
if m.unix_fd:
extra_args = 2
else:
extra_args = 1
self.outfile.write(
' g_signal_new ("handle-%s",\n'
" G_TYPE_FROM_INTERFACE (iface),\n"
" G_SIGNAL_RUN_LAST,\n"
" G_STRUCT_OFFSET (%sIface, handle_%s),\n"
" g_signal_accumulator_true_handled,\n"
" NULL,\n" # accu_data
" g_cclosure_marshal_generic,\n"
" G_TYPE_BOOLEAN,\n"
" %d,\n"
" G_TYPE_DBUS_METHOD_INVOCATION"
% (
m.name_hyphen,
i.camel_name,
m.name_lower,
len(m.in_args) + extra_args,
)
)
if m.unix_fd:
self.outfile.write(", G_TYPE_UNIX_FD_LIST")
for a in m.in_args:
self.outfile.write(", %s" % (a.gtype))
self.outfile.write(");\n")
self.outfile.write("\n")
if len(i.signals) > 0:
self.outfile.write(" /* GObject signals for received D-Bus signals: */\n")
for s in i.signals:
self.outfile.write(
self.docbook_gen.expand(
" /**\n"
" * %s::%s:\n"
" * @object: A #%s.\n"
% (i.camel_name, s.name_hyphen, i.camel_name),
False,
)
)
for a in s.args:
self.outfile.write(" * @arg_%s: Argument.\n" % (a.name))
self.outfile.write(
self.docbook_gen.expand(
" *\n"
" * On the client-side, this signal is emitted whenever the D-Bus signal #%s::%s is received.\n"
" *\n"
" * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.\n"
% (i.name, s.name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(s, self.outfile, 2)
self.outfile.write(
' g_signal_new ("%s",\n'
" G_TYPE_FROM_INTERFACE (iface),\n"
" G_SIGNAL_RUN_LAST,\n"
" G_STRUCT_OFFSET (%sIface, %s),\n"
" NULL,\n" # accumulator
" NULL,\n" # accu_data
" g_cclosure_marshal_generic,\n"
" G_TYPE_NONE,\n"
" %d" % (s.name_hyphen, i.camel_name, s.name_lower, len(s.args))
)
for a in s.args:
self.outfile.write(", %s" % (a.gtype))
self.outfile.write(");\n")
self.outfile.write("\n")
if len(i.properties) > 0:
self.outfile.write(" /* GObject properties for D-Bus properties: */\n")
for p in i.properties:
if p.readable and p.writable:
hint = "Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side."
elif p.readable:
hint = "Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side."
elif p.writable:
hint = "Since the D-Bus property for this #GObject property is writable but not readable, it is meaningful to write to it on both the client- and service-side. It is only meaningful, however, to read from it on the service-side."
else:
print_error(
'Cannot handle property "{}" that neither readable nor writable'.format(
p.name
)
)
self.outfile.write(
self.docbook_gen.expand(
" /**\n"
" * %s:%s:\n"
" *\n"
" * Represents the D-Bus property #%s:%s.\n"
" *\n"
" * %s\n"
% (i.camel_name, p.name_hyphen, i.name, p.name, hint),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(p, self.outfile, 2)
self.outfile.write(" g_object_interface_install_property (iface,\n")
if p.arg.gtype == "G_TYPE_VARIANT":
s = (
'g_param_spec_variant ("%s", "%s", "%s", G_VARIANT_TYPE ("%s"), NULL'
% (p.name_hyphen, p.name, p.name, p.arg.signature)
)
elif p.arg.signature == "b":
s = 'g_param_spec_boolean ("%s", "%s", "%s", FALSE' % (
p.name_hyphen,
p.name,
p.name,
)
elif p.arg.signature == "y":
s = 'g_param_spec_uchar ("%s", "%s", "%s", 0, 255, 0' % (
p.name_hyphen,
p.name,
p.name,
)
elif p.arg.signature == "n":
s = (
'g_param_spec_int ("%s", "%s", "%s", G_MININT16, G_MAXINT16, 0'
% (p.name_hyphen, p.name, p.name)
)
elif p.arg.signature == "q":
s = 'g_param_spec_uint ("%s", "%s", "%s", 0, G_MAXUINT16, 0' % (
p.name_hyphen,
p.name,
p.name,
)
elif p.arg.signature == "i":
s = (
'g_param_spec_int ("%s", "%s", "%s", G_MININT32, G_MAXINT32, 0'
% (p.name_hyphen, p.name, p.name)
)
elif p.arg.signature == "u":
s = 'g_param_spec_uint ("%s", "%s", "%s", 0, G_MAXUINT32, 0' % (
p.name_hyphen,
p.name,
p.name,
)
elif p.arg.signature == "x":
s = (
'g_param_spec_int64 ("%s", "%s", "%s", G_MININT64, G_MAXINT64, 0'
% (p.name_hyphen, p.name, p.name)
)
elif p.arg.signature == "t":
s = 'g_param_spec_uint64 ("%s", "%s", "%s", 0, G_MAXUINT64, 0' % (
p.name_hyphen,
p.name,
p.name,
)
elif p.arg.signature == "d":
s = (
'g_param_spec_double ("%s", "%s", "%s", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0'
% (p.name_hyphen, p.name, p.name)
)
elif p.arg.signature == "s":
s = 'g_param_spec_string ("%s", "%s", "%s", NULL' % (
p.name_hyphen,
p.name,
p.name,
)
elif p.arg.signature == "o":
s = 'g_param_spec_string ("%s", "%s", "%s", NULL' % (
p.name_hyphen,
p.name,
p.name,
)
elif p.arg.signature == "g":
s = 'g_param_spec_string ("%s", "%s", "%s", NULL' % (
p.name_hyphen,
p.name,
p.name,
)
elif p.arg.signature == "ay":
s = 'g_param_spec_string ("%s", "%s", "%s", NULL' % (
p.name_hyphen,
p.name,
p.name,
)
elif p.arg.signature == "as":
s = 'g_param_spec_boxed ("%s", "%s", "%s", G_TYPE_STRV' % (
p.name_hyphen,
p.name,
p.name,
)
elif p.arg.signature == "ao":
s = 'g_param_spec_boxed ("%s", "%s", "%s", G_TYPE_STRV' % (
p.name_hyphen,
p.name,
p.name,
)
elif p.arg.signature == "aay":
s = 'g_param_spec_boxed ("%s", "%s", "%s", G_TYPE_STRV' % (
p.name_hyphen,
p.name,
p.name,
)
else:
print_error(
'Unsupported gtype "{}" for GParamSpec'.format(p.arg.gtype)
)
flags = "G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS"
if p.deprecated:
flags = "G_PARAM_DEPRECATED | " + flags
self.outfile.write(" %s, %s));" % (s, flags))
self.outfile.write("\n")
self.outfile.write("}\n" "\n")
# ----------------------------------------------------------------------------------------------------
def generate_property_accessors(self, i):
for p in i.properties:
# getter
if p.readable and p.writable:
hint = "Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side."
elif p.readable:
hint = "Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side."
elif p.writable:
hint = "Since this D-Bus property is not readable, it is only meaningful to use this function on the service-side."
else:
print_error(
'Cannot handle property "{}" that neither readable nor writable'.format(
p.name
)
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %s_get_%s: (skip)\n"
" * @object: A #%s.\n"
" *\n"
" * Gets the value of the #%s:%s D-Bus property.\n"
" *\n"
" * %s\n"
" *\n"
% (i.name_lower, p.name_lower, i.camel_name, i.name, p.name, hint),
False,
)
)
if p.arg.free_func is not None:
self.outfile.write(
" * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use %s_dup_%s() if on another thread.\n"
" *\n"
" * Returns: (transfer none) (nullable): The property value or %%NULL if the property is not set. Do not free the returned value, it belongs to @object.\n"
% (i.name_lower, p.name_lower)
)
else:
self.outfile.write(" * Returns: The property value.\n")
self.write_gtkdoc_deprecated_and_since_and_close(p, self.outfile, 0)
self.outfile.write(
"%s\n"
"%s_get_%s (%s *object)\n"
"{\n" % (p.arg.ctype_in, i.name_lower, p.name_lower, i.camel_name)
)
self.outfile.write(
" return %s%s_GET_IFACE (object)->get_%s (object);\n"
% (i.ns_upper, i.name_upper, p.name_lower)
)
self.outfile.write("}\n")
self.outfile.write("\n")
if p.arg.free_func is not None:
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %s_dup_%s: (skip)\n"
" * @object: A #%s.\n"
" *\n"
" * Gets a copy of the #%s:%s D-Bus property.\n"
" *\n"
" * %s\n"
" *\n"
" * Returns: (transfer full) (nullable): The property value or %%NULL if the property is not set. The returned value should be freed with %s().\n"
% (
i.name_lower,
p.name_lower,
i.camel_name,
i.name,
p.name,
hint,
p.arg.free_func,
),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(p, self.outfile, 0)
self.outfile.write(
"%s\n"
"%s_dup_%s (%s *object)\n"
"{\n"
" %svalue;\n"
% (
p.arg.ctype_in_dup,
i.name_lower,
p.name_lower,
i.camel_name,
p.arg.ctype_in_dup,
)
)
self.outfile.write(
' g_object_get (G_OBJECT (object), "%s", &value, NULL);\n'
% (p.name_hyphen)
)
self.outfile.write(" return value;\n")
self.outfile.write("}\n")
self.outfile.write("\n")
# setter
if p.readable and p.writable:
hint = "Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side."
elif p.readable:
hint = "Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side."
elif p.writable:
hint = "Since this D-Bus property is writable, it is meaningful to use this function on both the client- and service-side."
else:
print_error(
'Cannot handle property "{}" that neither readable nor writable'.format(
p.name
)
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %s_set_%s: (skip)\n"
" * @object: A #%s.\n"
" * @value: The value to set.\n"
" *\n"
" * Sets the #%s:%s D-Bus property to @value.\n"
" *\n"
" * %s\n"
% (i.name_lower, p.name_lower, i.camel_name, i.name, p.name, hint),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(p, self.outfile, 0)
self.outfile.write(
"void\n"
"%s_set_%s (%s *object, %svalue)\n"
"{\n" % (i.name_lower, p.name_lower, i.camel_name, p.arg.ctype_in)
)
self.outfile.write(
' g_object_set (G_OBJECT (object), "%s", value, NULL);\n'
% (p.name_hyphen)
)
self.outfile.write("}\n")
self.outfile.write("\n")
# ---------------------------------------------------------------------------------------------------
def generate_signal_emitters(self, i):
for s in i.signals:
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %s_emit_%s:\n"
" * @object: A #%s.\n" % (i.name_lower, s.name_lower, i.camel_name),
False,
)
)
for a in s.args:
self.outfile.write(
" * @arg_%s: Argument to pass with the signal.\n" % (a.name)
)
self.outfile.write(
self.docbook_gen.expand(
" *\n" " * Emits the #%s::%s D-Bus signal.\n" % (i.name, s.name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(s, self.outfile, 0)
self.outfile.write(
"void\n"
"%s_emit_%s (\n"
" %s *object" % (i.name_lower, s.name_lower, i.camel_name)
)
for a in s.args:
self.outfile.write(",\n %sarg_%s" % (a.ctype_in, a.name))
self.outfile.write(
")\n" "{\n" ' g_signal_emit_by_name (object, "%s"' % (s.name_hyphen)
)
for a in s.args:
self.outfile.write(", arg_%s" % a.name)
self.outfile.write(");\n")
self.outfile.write("}\n" "\n")
# ---------------------------------------------------------------------------------------------------
def generate_method_calls(self, i):
for m in i.methods:
# async begin
self.outfile.write(
"/**\n"
" * %s_call_%s:\n"
" * @proxy: A #%sProxy.\n" % (i.name_lower, m.name_lower, i.camel_name)
)
for a in m.in_args:
self.outfile.write(
" * @arg_%s: Argument to pass with the method invocation.\n"
% (a.name)
)
if self.glib_min_required >= (2, 64):
self.outfile.write(
" * @call_flags: Flags from the #GDBusCallFlags enumeration. If you want to allow interactive\n"
" authorization be sure to set %G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION.\n"
' * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or\n'
" -1 to use the proxy default timeout.\n"
)
if m.unix_fd:
self.outfile.write(
" * @fd_list: (nullable): A #GUnixFDList or %NULL.\n"
)
self.outfile.write(
self.docbook_gen.expand(
" * @cancellable: (nullable): A #GCancellable or %%NULL.\n"
" * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %%NULL.\n"
" * @user_data: User data to pass to @callback.\n"
" *\n"
" * Asynchronously invokes the %s.%s() D-Bus method on @proxy.\n"
" * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).\n"
" * You can then call %s_call_%s_finish() to get the result of the operation.\n"
" *\n"
" * See %s_call_%s_sync() for the synchronous, blocking version of this method.\n"
% (
i.name,
m.name,
i.name_lower,
m.name_lower,
i.name_lower,
m.name_lower,
),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(m, self.outfile, 0)
self.outfile.write(
"void\n"
"%s_call_%s (\n"
" %s *proxy" % (i.name_lower, m.name_lower, i.camel_name)
)
for a in m.in_args:
self.outfile.write(",\n %sarg_%s" % (a.ctype_in, a.name))
if self.glib_min_required >= (2, 64):
self.outfile.write(
",\n GDBusCallFlags call_flags" ",\n gint timeout_msec"
)
if m.unix_fd:
self.outfile.write(",\n GUnixFDList *fd_list")
self.outfile.write(
",\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)\n"
"{\n"
)
if m.unix_fd:
self.outfile.write(
" g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy),\n"
)
else:
self.outfile.write(" g_dbus_proxy_call (G_DBUS_PROXY (proxy),\n")
self.outfile.write(' "%s",\n' ' g_variant_new ("(' % (m.name))
for a in m.in_args:
self.outfile.write("%s" % (a.format_in))
self.outfile.write(')"')
for a in m.in_args:
self.outfile.write(",\n arg_%s" % (a.name))
self.outfile.write("),\n")
if self.glib_min_required >= (2, 64):
self.outfile.write(" call_flags,\n" " timeout_msec,\n")
else:
self.outfile.write(" G_DBUS_CALL_FLAGS_NONE,\n" " -1,\n")
if m.unix_fd:
self.outfile.write(" fd_list,\n")
self.outfile.write(
" cancellable,\n" " callback,\n" " user_data);\n"
)
self.outfile.write("}\n" "\n")
# async finish
self.outfile.write(
"/**\n"
" * %s_call_%s_finish:\n"
" * @proxy: A #%sProxy.\n" % (i.name_lower, m.name_lower, i.camel_name)
)
for a in m.out_args:
self.outfile.write(
" * @out_%s: (out) (optional)%s: Return location for return parameter or %%NULL to ignore.\n"
% (a.name, " " + a.array_annotation if a.array_annotation else "")
)
if m.unix_fd:
self.outfile.write(
" * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore.\n"
)
self.outfile.write(
self.docbook_gen.expand(
" * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to %s_call_%s().\n"
" * @error: Return location for error or %%NULL.\n"
" *\n"
" * Finishes an operation started with %s_call_%s().\n"
" *\n"
" * Returns: (skip): %%TRUE if the call succeeded, %%FALSE if @error is set.\n"
% (i.name_lower, m.name_lower, i.name_lower, m.name_lower),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(m, self.outfile, 0)
self.outfile.write(
"gboolean\n"
"%s_call_%s_finish (\n"
" %s *proxy" % (i.name_lower, m.name_lower, i.camel_name)
)
for a in m.out_args:
self.outfile.write(",\n %sout_%s" % (a.ctype_out, a.name))
if m.unix_fd:
self.outfile.write(",\n GUnixFDList **out_fd_list")
self.outfile.write(
",\n"
" GAsyncResult *res,\n"
" GError **error)\n"
"{\n"
" GVariant *_ret;\n"
)
if m.unix_fd:
self.outfile.write(
" _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error);\n"
)
else:
self.outfile.write(
" _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);\n"
)
self.outfile.write(" if (_ret == NULL)\n" " goto _out;\n")
self.outfile.write(" g_variant_get (_ret,\n" ' "(')
for a in m.out_args:
self.outfile.write("%s" % (a.format_out))
self.outfile.write(')"')
for a in m.out_args:
self.outfile.write(",\n out_%s" % (a.name))
self.outfile.write(");\n" " g_variant_unref (_ret);\n")
self.outfile.write("_out:\n" " return _ret != NULL;\n" "}\n" "\n")
# sync
self.outfile.write(
"/**\n"
" * %s_call_%s_sync:\n"
" * @proxy: A #%sProxy.\n" % (i.name_lower, m.name_lower, i.camel_name)
)
for a in m.in_args:
self.outfile.write(
" * @arg_%s: Argument to pass with the method invocation.\n"
% (a.name)
)
if self.glib_min_required >= (2, 64):
self.outfile.write(
" * @call_flags: Flags from the #GDBusCallFlags enumeration. If you want to allow interactive\n"
" authorization be sure to set %G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION.\n"
' * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or\n'
" -1 to use the proxy default timeout.\n"
)
if m.unix_fd:
self.outfile.write(
" * @fd_list: (nullable): A #GUnixFDList or %NULL.\n"
)
for a in m.out_args:
self.outfile.write(
" * @out_%s: (out) (optional)%s: Return location for return parameter or %%NULL to ignore.\n"
% (a.name, " " + a.array_annotation if a.array_annotation else "")
)
if m.unix_fd:
self.outfile.write(
" * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.\n"
)
self.outfile.write(
self.docbook_gen.expand(
" * @cancellable: (nullable): A #GCancellable or %%NULL.\n"
" * @error: Return location for error or %%NULL.\n"
" *\n"
" * Synchronously invokes the %s.%s() D-Bus method on @proxy. The calling thread is blocked until a reply is received.\n"
" *\n"
" * See %s_call_%s() for the asynchronous version of this method.\n"
" *\n"
" * Returns: (skip): %%TRUE if the call succeeded, %%FALSE if @error is set.\n"
% (i.name, m.name, i.name_lower, m.name_lower),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(m, self.outfile, 0)
self.outfile.write(
"gboolean\n"
"%s_call_%s_sync (\n"
" %s *proxy" % (i.name_lower, m.name_lower, i.camel_name)
)
for a in m.in_args:
self.outfile.write(",\n %sarg_%s" % (a.ctype_in, a.name))
if self.glib_min_required >= (2, 64):
self.outfile.write(
",\n GDBusCallFlags call_flags" ",\n gint timeout_msec"
)
if m.unix_fd:
self.outfile.write(",\n GUnixFDList *fd_list")
for a in m.out_args:
self.outfile.write(",\n %sout_%s" % (a.ctype_out, a.name))
if m.unix_fd:
self.outfile.write(",\n GUnixFDList **out_fd_list")
self.outfile.write(
",\n"
" GCancellable *cancellable,\n"
" GError **error)\n"
"{\n"
" GVariant *_ret;\n"
)
if m.unix_fd:
self.outfile.write(
" _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy),\n"
)
else:
self.outfile.write(
" _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),\n"
)
self.outfile.write(' "%s",\n' ' g_variant_new ("(' % (m.name))
for a in m.in_args:
self.outfile.write("%s" % (a.format_in))
self.outfile.write(')"')
for a in m.in_args:
self.outfile.write(",\n arg_%s" % (a.name))
self.outfile.write("),\n")
if self.glib_min_required >= (2, 64):
self.outfile.write(" call_flags,\n" " timeout_msec,\n")
else:
self.outfile.write(" G_DBUS_CALL_FLAGS_NONE,\n" " -1,\n")
if m.unix_fd:
self.outfile.write(" fd_list,\n" " out_fd_list,\n")
self.outfile.write(
" cancellable,\n"
" error);\n"
" if (_ret == NULL)\n"
" goto _out;\n"
)
self.outfile.write(" g_variant_get (_ret,\n" ' "(')
for a in m.out_args:
self.outfile.write("%s" % (a.format_out))
self.outfile.write(')"')
for a in m.out_args:
self.outfile.write(",\n out_%s" % (a.name))
self.outfile.write(");\n" " g_variant_unref (_ret);\n")
self.outfile.write("_out:\n" " return _ret != NULL;\n" "}\n" "\n")
# ---------------------------------------------------------------------------------------------------
def generate_method_completers(self, i):
for m in i.methods:
self.outfile.write(
"/**\n"
" * %s_complete_%s:\n"
" * @object: A #%s.\n"
" * @invocation: (transfer full): A #GDBusMethodInvocation.\n"
% (i.name_lower, m.name_lower, i.camel_name)
)
if m.unix_fd:
self.outfile.write(
" * @fd_list: (nullable): A #GUnixFDList or %NULL.\n"
)
for a in m.out_args:
self.outfile.write(" * @%s: Parameter to return.\n" % (a.name))
self.outfile.write(
self.docbook_gen.expand(
" *\n"
" * Helper function used in service implementations to finish handling invocations of the %s.%s() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.\n"
" *\n"
" * This method will free @invocation, you cannot use it afterwards.\n"
% (i.name, m.name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(m, self.outfile, 0)
self.outfile.write(
"void\n"
"%s_complete_%s (\n"
" %s *object G_GNUC_UNUSED,\n"
" GDBusMethodInvocation *invocation"
% (i.name_lower, m.name_lower, i.camel_name)
)
if m.unix_fd:
self.outfile.write(",\n GUnixFDList *fd_list")
for a in m.out_args:
self.outfile.write(",\n %s%s" % (a.ctype_in, a.name))
self.outfile.write(")\n" "{\n")
if m.unix_fd:
self.outfile.write(
" g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,\n"
' g_variant_new ("('
)
else:
self.outfile.write(
" g_dbus_method_invocation_return_value (invocation,\n"
' g_variant_new ("('
)
for a in m.out_args:
self.outfile.write("%s" % (a.format_in))
self.outfile.write(')"')
for a in m.out_args:
self.outfile.write(",\n %s" % (a.name))
if m.unix_fd:
self.outfile.write("),\n fd_list);\n")
else:
self.outfile.write("));\n")
self.outfile.write("}\n" "\n")
# ---------------------------------------------------------------------------------------------------
def generate_proxy(self, i):
# class boilerplate
self.outfile.write(
"/* ------------------------------------------------------------------------ */\n"
"\n"
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sProxy:\n"
" *\n"
" * The #%sProxy structure contains only private data and should only be accessed using the provided API.\n"
% (i.camel_name, i.camel_name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write("\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sProxyClass:\n"
" * @parent_class: The parent class.\n"
" *\n"
" * Class structure for #%sProxy.\n" % (i.camel_name, i.camel_name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write("\n")
self.outfile.write(
"struct _%sProxyPrivate\n"
"{\n"
" GData *qdata;\n"
"};\n"
"\n" % i.camel_name
)
self.outfile.write(
"static void %s_proxy_iface_init (%sIface *iface);\n"
"\n" % (i.name_lower, i.camel_name)
)
self.outfile.write("#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38\n")
self.outfile.write(
"G_DEFINE_TYPE_WITH_CODE (%sProxy, %s_proxy, G_TYPE_DBUS_PROXY,\n"
% (i.camel_name, i.name_lower)
)
self.outfile.write(
" G_ADD_PRIVATE (%sProxy)\n" % (i.camel_name)
)
self.outfile.write(
" G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_proxy_iface_init))\n\n"
% (i.ns_upper, i.name_upper, i.name_lower)
)
self.outfile.write("#else\n")
self.outfile.write(
"G_DEFINE_TYPE_WITH_CODE (%sProxy, %s_proxy, G_TYPE_DBUS_PROXY,\n"
% (i.camel_name, i.name_lower)
)
self.outfile.write(
" G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_proxy_iface_init))\n\n"
% (i.ns_upper, i.name_upper, i.name_lower)
)
self.outfile.write("#endif\n")
# finalize
self.outfile.write(
"static void\n"
"%s_proxy_finalize (GObject *object)\n"
"{\n" % (i.name_lower)
)
self.outfile.write(
" %sProxy *proxy = %s%s_PROXY (object);\n"
% (i.camel_name, i.ns_upper, i.name_upper)
)
self.outfile.write(" g_datalist_clear (&proxy->priv->qdata);\n")
self.outfile.write(
" G_OBJECT_CLASS (%s_proxy_parent_class)->finalize (object);\n"
"}\n"
"\n" % (i.name_lower)
)
# property accessors
#
# Note that we are guaranteed that prop_id starts at 1 and is
# laid out in the same order as introspection data pointers
#
self.outfile.write(
"static void\n"
"%s_proxy_get_property (GObject *object" % (i.name_lower)
)
if len(i.properties) == 0:
self.outfile.write(
" G_GNUC_UNUSED,\n"
" guint prop_id G_GNUC_UNUSED,\n"
" GValue *value G_GNUC_UNUSED,\n"
)
else:
self.outfile.write(
",\n" " guint prop_id,\n" " GValue *value,\n"
)
self.outfile.write(" GParamSpec *pspec G_GNUC_UNUSED)\n" "{\n")
if len(i.properties) > 0:
self.outfile.write(
" const _ExtendedGDBusPropertyInfo *info;\n"
" GVariant *variant;\n"
" g_assert (prop_id != 0 && prop_id - 1 < %d);\n"
" info = (const _ExtendedGDBusPropertyInfo *) _%s_property_info_pointers[prop_id - 1];\n"
" variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);\n"
" if (info->use_gvariant)\n"
" {\n"
" g_value_set_variant (value, variant);\n"
" }\n"
" else\n"
" {\n"
# could be that we don't have the value in cache - in that case, we do
# nothing and the user gets the default value for the GType
" if (variant != NULL)\n"
" g_dbus_gvariant_to_gvalue (variant, value);\n"
" }\n"
" if (variant != NULL)\n"
" g_variant_unref (variant);\n" % (len(i.properties), i.name_lower)
)
self.outfile.write("}\n" "\n")
if len(i.properties) > 0:
self.outfile.write(
"static void\n"
"%s_proxy_set_property_cb (GDBusProxy *proxy,\n"
" GAsyncResult *res,\n"
" gpointer user_data)\n"
"{\n" % (i.name_lower)
)
self.outfile.write(
" const _ExtendedGDBusPropertyInfo *info = user_data;\n"
" GError *error;\n"
" GVariant *_ret;\n"
" error = NULL;\n"
" _ret = g_dbus_proxy_call_finish (proxy, res, &error);\n"
" if (!_ret)\n"
" {\n"
" g_warning (\"Error setting property '%%s' on interface %s: %%s (%%s, %%d)\",\n"
" info->parent_struct.name, \n"
" error->message, g_quark_to_string (error->domain), error->code);\n"
" g_error_free (error);\n"
" }\n"
" else\n"
" {\n"
" g_variant_unref (_ret);\n"
" }\n" % (i.name)
)
self.outfile.write("}\n" "\n")
self.outfile.write("static void\n" "%s_proxy_set_property (" % (i.name_lower))
if len(i.properties) == 0:
self.outfile.write(
"GObject *object G_GNUC_UNUSED,\n"
" guint prop_id G_GNUC_UNUSED,\n"
" const GValue *value G_GNUC_UNUSED,\n"
)
else:
self.outfile.write(
"GObject *object,\n"
" guint prop_id,\n"
" const GValue *value,\n"
)
self.outfile.write(" GParamSpec *pspec G_GNUC_UNUSED)\n" "{\n")
if len(i.properties) > 0:
self.outfile.write(
" const _ExtendedGDBusPropertyInfo *info;\n"
" GVariant *variant;\n"
" g_assert (prop_id != 0 && prop_id - 1 < %d);\n"
" info = (const _ExtendedGDBusPropertyInfo *) _%s_property_info_pointers[prop_id - 1];\n"
" variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));\n"
" g_dbus_proxy_call (G_DBUS_PROXY (object),\n"
' "org.freedesktop.DBus.Properties.Set",\n'
' g_variant_new ("(ssv)", "%s", info->parent_struct.name, variant),\n'
" G_DBUS_CALL_FLAGS_NONE,\n"
" -1,\n"
" NULL, (GAsyncReadyCallback) %s_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);\n"
" g_variant_unref (variant);\n"
% (len(i.properties), i.name_lower, i.name, i.name_lower)
)
self.outfile.write("}\n" "\n")
# signal received
self.outfile.write(
"static void\n"
"%s_proxy_g_signal (GDBusProxy *proxy,\n"
" const gchar *sender_name G_GNUC_UNUSED,\n"
" const gchar *signal_name,\n"
" GVariant *parameters)\n"
"{\n" % (i.name_lower)
)
self.outfile.write(
" _ExtendedGDBusSignalInfo *info;\n"
" GVariantIter iter;\n"
" GVariant *child;\n"
" GValue *paramv;\n"
" gsize num_params;\n"
" gsize n;\n"
" guint signal_id;\n"
)
# Note: info could be NULL if we are talking to a newer version of the interface
self.outfile.write(
" info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_%s_interface_info.parent_struct, signal_name);\n"
" if (info == NULL)\n"
" return;\n" % (i.name_lower)
)
self.outfile.write(
" num_params = g_variant_n_children (parameters);\n"
" paramv = g_new0 (GValue, num_params + 1);\n"
" g_value_init (¶mv[0], %sTYPE_%s);\n"
" g_value_set_object (¶mv[0], proxy);\n" % (i.ns_upper, i.name_upper)
)
self.outfile.write(
" g_variant_iter_init (&iter, parameters);\n"
" n = 1;\n"
" while ((child = g_variant_iter_next_value (&iter)) != NULL)\n"
" {\n"
" _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];\n"
" if (arg_info->use_gvariant)\n"
" {\n"
" g_value_init (¶mv[n], G_TYPE_VARIANT);\n"
" g_value_set_variant (¶mv[n], child);\n"
" n++;\n"
" }\n"
" else\n"
" g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);\n"
" g_variant_unref (child);\n"
" }\n"
)
self.outfile.write(
" signal_id = g_signal_lookup (info->signal_name, %sTYPE_%s);\n"
% (i.ns_upper, i.name_upper)
)
self.outfile.write(" g_signal_emitv (paramv, signal_id, 0, NULL);\n")
self.outfile.write(
" for (n = 0; n < num_params + 1; n++)\n"
" g_value_unset (¶mv[n]);\n"
" g_free (paramv);\n"
)
self.outfile.write("}\n" "\n")
# property changed
self.outfile.write(
"static void\n"
"%s_proxy_g_properties_changed (GDBusProxy *_proxy,\n"
" GVariant *changed_properties,\n"
" const gchar *const *invalidated_properties)\n"
"{\n" % (i.name_lower)
)
# Note: info could be NULL if we are talking to a newer version of the interface
self.outfile.write(
" %sProxy *proxy = %s%s_PROXY (_proxy);\n"
" guint n;\n"
" const gchar *key;\n"
" GVariantIter *iter;\n"
" _ExtendedGDBusPropertyInfo *info;\n"
' g_variant_get (changed_properties, "a{sv}", &iter);\n'
' while (g_variant_iter_next (iter, "{&sv}", &key, NULL))\n'
" {\n"
" info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_%s_interface_info.parent_struct, key);\n"
" g_datalist_remove_data (&proxy->priv->qdata, key);\n"
" if (info != NULL)\n"
" g_object_notify (G_OBJECT (proxy), info->hyphen_name);\n"
" }\n"
" g_variant_iter_free (iter);\n"
" for (n = 0; invalidated_properties[n] != NULL; n++)\n"
" {\n"
" info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_%s_interface_info.parent_struct, invalidated_properties[n]);\n"
" g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);\n"
" if (info != NULL)\n"
" g_object_notify (G_OBJECT (proxy), info->hyphen_name);\n"
" }\n"
"}\n"
"\n" % (i.camel_name, i.ns_upper, i.name_upper, i.name_lower, i.name_lower)
)
# property vfuncs
for p in i.properties:
nul_value = "0"
if p.arg.free_func is not None:
nul_value = "NULL"
self.outfile.write(
"static %s\n"
"%s_proxy_get_%s (%s *object)\n"
"{\n"
" %sProxy *proxy = %s%s_PROXY (object);\n"
" GVariant *variant;\n"
" %svalue = %s;\n"
% (
p.arg.ctype_in,
i.name_lower,
p.name_lower,
i.camel_name,
i.camel_name,
i.ns_upper,
i.name_upper,
p.arg.ctype_in,
nul_value,
)
)
# For some property types, we have to free the returned
# value (or part of it, e.g. the container) because of how
# GVariant works.. see https://bugzilla.gnome.org/show_bug.cgi?id=657100
# for details
#
free_container = False
if (
p.arg.gvariant_get == "g_variant_get_strv"
or p.arg.gvariant_get == "g_variant_get_objv"
or p.arg.gvariant_get == "g_variant_get_bytestring_array"
):
free_container = True
# If already using an old value for strv, objv, bytestring_array (see below),
# then just return that... that way the result from multiple consecutive calls
# to the getter are valid as long as they're freed
#
if free_container:
self.outfile.write(
' value = g_datalist_get_data (&proxy->priv->qdata, "%s");\n'
" if (value != NULL)\n"
" return value;\n" % (p.name)
)
self.outfile.write(
' variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "%s");\n'
% (p.name)
)
if p.arg.gtype == "G_TYPE_VARIANT":
self.outfile.write(" value = variant;\n")
self.outfile.write(" if (variant != NULL)\n")
self.outfile.write(" g_variant_unref (variant);\n")
else:
self.outfile.write(" if (variant != NULL)\n" " {\n")
extra_len = ""
if (
p.arg.gvariant_get == "g_variant_get_string"
or p.arg.gvariant_get == "g_variant_get_strv"
or p.arg.gvariant_get == "g_variant_get_objv"
or p.arg.gvariant_get == "g_variant_get_bytestring_array"
):
extra_len = ", NULL"
self.outfile.write(
" value = %s (variant%s);\n" % (p.arg.gvariant_get, extra_len)
)
if free_container:
self.outfile.write(
' g_datalist_set_data_full (&proxy->priv->qdata, "%s", (gpointer) value, g_free);\n'
% (p.name)
)
self.outfile.write(" g_variant_unref (variant);\n")
self.outfile.write(" }\n")
self.outfile.write(" return value;\n")
self.outfile.write("}\n")
self.outfile.write("\n")
# class boilerplate
self.outfile.write(
"static void\n"
"%s_proxy_init (%sProxy *proxy)\n"
"{\n"
"#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38\n"
" proxy->priv = %s_proxy_get_instance_private (proxy);\n"
"#else\n"
" proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, %sTYPE_%s_PROXY, %sProxyPrivate);\n"
"#endif\n\n"
" g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), %s_interface_info ());\n"
"}\n"
"\n"
% (
i.name_lower,
i.camel_name,
i.name_lower,
i.ns_upper,
i.name_upper,
i.camel_name,
i.name_lower,
)
)
self.outfile.write(
"static void\n"
"%s_proxy_class_init (%sProxyClass *klass)\n"
"{\n"
" GObjectClass *gobject_class;\n"
" GDBusProxyClass *proxy_class;\n"
"\n"
" gobject_class = G_OBJECT_CLASS (klass);\n"
" gobject_class->finalize = %s_proxy_finalize;\n"
" gobject_class->get_property = %s_proxy_get_property;\n"
" gobject_class->set_property = %s_proxy_set_property;\n"
"\n"
" proxy_class = G_DBUS_PROXY_CLASS (klass);\n"
" proxy_class->g_signal = %s_proxy_g_signal;\n"
" proxy_class->g_properties_changed = %s_proxy_g_properties_changed;\n"
"\n"
% (
i.name_lower,
i.camel_name,
i.name_lower,
i.name_lower,
i.name_lower,
i.name_lower,
i.name_lower,
)
)
if len(i.properties) > 0:
self.outfile.write(
" %s_override_properties (gobject_class, 1);\n\n" % (i.name_lower)
)
self.outfile.write(
"#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38\n"
" g_type_class_add_private (klass, sizeof (%sProxyPrivate));\n"
"#endif\n" % (i.camel_name)
)
self.outfile.write("}\n" "\n")
self.outfile.write(
"static void\n"
"%s_proxy_iface_init (%sIface *iface" % (i.name_lower, i.camel_name)
)
if len(i.properties) == 0:
self.outfile.write(" G_GNUC_UNUSED)\n")
else:
self.outfile.write(")\n")
self.outfile.write("{\n")
for p in i.properties:
self.outfile.write(
" iface->get_%s = %s_proxy_get_%s;\n"
% (p.name_lower, i.name_lower, p.name_lower)
)
self.outfile.write("}\n" "\n")
# constructors
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %s_proxy_new:\n"
" * @connection: A #GDBusConnection.\n"
" * @flags: Flags from the #GDBusProxyFlags enumeration.\n"
" * @name: (nullable): A bus name (well-known or unique) or %%NULL if @connection is not a message bus connection.\n"
" * @object_path: An object path.\n"
" * @cancellable: (nullable): A #GCancellable or %%NULL.\n"
" * @callback: A #GAsyncReadyCallback to call when the request is satisfied.\n"
" * @user_data: User data to pass to @callback.\n"
" *\n"
" * Asynchronously creates a proxy for the D-Bus interface #%s. See g_dbus_proxy_new() for more details.\n"
" *\n"
" * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).\n"
" * You can then call %s_proxy_new_finish() to get the result of the operation.\n"
" *\n"
" * See %s_proxy_new_sync() for the synchronous, blocking version of this constructor.\n"
% (i.name_lower, i.name, i.name_lower, i.name_lower),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write(
"void\n"
"%s_proxy_new (\n"
" GDBusConnection *connection,\n"
" GDBusProxyFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)\n"
"{\n"
' g_async_initable_new_async (%sTYPE_%s_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "%s", NULL);\n'
"}\n"
"\n" % (i.name_lower, i.ns_upper, i.name_upper, i.name)
)
self.outfile.write(
"/**\n"
" * %s_proxy_new_finish:\n"
" * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to %s_proxy_new().\n"
" * @error: Return location for error or %%NULL\n"
" *\n"
" * Finishes an operation started with %s_proxy_new().\n"
" *\n"
" * Returns: (transfer full) (type %sProxy): The constructed proxy object or %%NULL if @error is set.\n"
% (i.name_lower, i.name_lower, i.name_lower, i.camel_name)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write(
"%s *\n"
"%s_proxy_new_finish (\n"
" GAsyncResult *res,\n"
" GError **error)\n"
"{\n"
" GObject *ret;\n"
" GObject *source_object;\n"
" source_object = g_async_result_get_source_object (res);\n"
" ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);\n"
" g_object_unref (source_object);\n"
" if (ret != NULL)\n"
" return %s%s (ret);\n"
" else\n"
" return NULL;\n"
"}\n"
"\n" % (i.camel_name, i.name_lower, i.ns_upper, i.name_upper)
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %s_proxy_new_sync:\n"
" * @connection: A #GDBusConnection.\n"
" * @flags: Flags from the #GDBusProxyFlags enumeration.\n"
" * @name: (nullable): A bus name (well-known or unique) or %%NULL if @connection is not a message bus connection.\n"
" * @object_path: An object path.\n"
" * @cancellable: (nullable): A #GCancellable or %%NULL.\n"
" * @error: Return location for error or %%NULL\n"
" *\n"
" * Synchronously creates a proxy for the D-Bus interface #%s. See g_dbus_proxy_new_sync() for more details.\n"
" *\n"
" * The calling thread is blocked until a reply is received.\n"
" *\n"
" * See %s_proxy_new() for the asynchronous version of this constructor.\n"
" *\n"
" * Returns: (transfer full) (type %sProxy): The constructed proxy object or %%NULL if @error is set.\n"
% (i.name_lower, i.name, i.name_lower, i.camel_name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write(
"%s *\n"
"%s_proxy_new_sync (\n"
" GDBusConnection *connection,\n"
" GDBusProxyFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GError **error)\n"
"{\n"
" GInitable *ret;\n"
' ret = g_initable_new (%sTYPE_%s_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "%s", NULL);\n'
" if (ret != NULL)\n"
" return %s%s (ret);\n"
" else\n"
" return NULL;\n"
"}\n"
"\n"
% (
i.camel_name,
i.name_lower,
i.ns_upper,
i.name_upper,
i.name,
i.ns_upper,
i.name_upper,
)
)
self.outfile.write("\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %s_proxy_new_for_bus:\n"
" * @bus_type: A #GBusType.\n"
" * @flags: Flags from the #GDBusProxyFlags enumeration.\n"
" * @name: A bus name (well-known or unique).\n"
" * @object_path: An object path.\n"
" * @cancellable: (nullable): A #GCancellable or %%NULL.\n"
" * @callback: A #GAsyncReadyCallback to call when the request is satisfied.\n"
" * @user_data: User data to pass to @callback.\n"
" *\n"
" * Like %s_proxy_new() but takes a #GBusType instead of a #GDBusConnection.\n"
" *\n"
" * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).\n"
" * You can then call %s_proxy_new_for_bus_finish() to get the result of the operation.\n"
" *\n"
" * See %s_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.\n"
% (i.name_lower, i.name_lower, i.name_lower, i.name_lower),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write(
"void\n"
"%s_proxy_new_for_bus (\n"
" GBusType bus_type,\n"
" GDBusProxyFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)\n"
"{\n"
' g_async_initable_new_async (%sTYPE_%s_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "%s", NULL);\n'
"}\n"
"\n" % (i.name_lower, i.ns_upper, i.name_upper, i.name)
)
self.outfile.write(
"/**\n"
" * %s_proxy_new_for_bus_finish:\n"
" * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to %s_proxy_new_for_bus().\n"
" * @error: Return location for error or %%NULL\n"
" *\n"
" * Finishes an operation started with %s_proxy_new_for_bus().\n"
" *\n"
" * Returns: (transfer full) (type %sProxy): The constructed proxy object or %%NULL if @error is set.\n"
% (i.name_lower, i.name_lower, i.name_lower, i.camel_name)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write(
"%s *\n"
"%s_proxy_new_for_bus_finish (\n"
" GAsyncResult *res,\n"
" GError **error)\n"
"{\n"
" GObject *ret;\n"
" GObject *source_object;\n"
" source_object = g_async_result_get_source_object (res);\n"
" ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);\n"
" g_object_unref (source_object);\n"
" if (ret != NULL)\n"
" return %s%s (ret);\n"
" else\n"
" return NULL;\n"
"}\n"
"\n" % (i.camel_name, i.name_lower, i.ns_upper, i.name_upper)
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %s_proxy_new_for_bus_sync:\n"
" * @bus_type: A #GBusType.\n"
" * @flags: Flags from the #GDBusProxyFlags enumeration.\n"
" * @name: A bus name (well-known or unique).\n"
" * @object_path: An object path.\n"
" * @cancellable: (nullable): A #GCancellable or %%NULL.\n"
" * @error: Return location for error or %%NULL\n"
" *\n"
" * Like %s_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.\n"
" *\n"
" * The calling thread is blocked until a reply is received.\n"
" *\n"
" * See %s_proxy_new_for_bus() for the asynchronous version of this constructor.\n"
" *\n"
" * Returns: (transfer full) (type %sProxy): The constructed proxy object or %%NULL if @error is set.\n"
% (i.name_lower, i.name_lower, i.name_lower, i.camel_name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write(
"%s *\n"
"%s_proxy_new_for_bus_sync (\n"
" GBusType bus_type,\n"
" GDBusProxyFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GError **error)\n"
"{\n"
" GInitable *ret;\n"
' ret = g_initable_new (%sTYPE_%s_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "%s", NULL);\n'
" if (ret != NULL)\n"
" return %s%s (ret);\n"
" else\n"
" return NULL;\n"
"}\n"
"\n"
% (
i.camel_name,
i.name_lower,
i.ns_upper,
i.name_upper,
i.name,
i.ns_upper,
i.name_upper,
)
)
self.outfile.write("\n")
# ---------------------------------------------------------------------------------------------------
def generate_skeleton(self, i):
# class boilerplate
self.outfile.write(
"/* ------------------------------------------------------------------------ */\n"
"\n"
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sSkeleton:\n"
" *\n"
" * The #%sSkeleton structure contains only private data and should only be accessed using the provided API.\n"
% (i.camel_name, i.camel_name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write("\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sSkeletonClass:\n"
" * @parent_class: The parent class.\n"
" *\n"
" * Class structure for #%sSkeleton.\n" % (i.camel_name, i.camel_name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write("\n")
self.outfile.write(
"struct _%sSkeletonPrivate\n"
"{\n"
" GValue *properties;\n"
" GList *changed_properties;\n"
" GSource *changed_properties_idle_source;\n"
" GMainContext *context;\n"
" GMutex lock;\n"
"};\n"
"\n" % i.camel_name
)
self.outfile.write(
"static void\n"
"_%s_skeleton_handle_method_call (\n"
" GDBusConnection *connection G_GNUC_UNUSED,\n"
" const gchar *sender G_GNUC_UNUSED,\n"
" const gchar *object_path G_GNUC_UNUSED,\n"
" const gchar *interface_name,\n"
" const gchar *method_name,\n"
" GVariant *parameters,\n"
" GDBusMethodInvocation *invocation,\n"
" gpointer user_data)\n"
"{\n"
" %sSkeleton *skeleton = %s%s_SKELETON (user_data);\n"
" _ExtendedGDBusMethodInfo *info;\n"
" GVariantIter iter;\n"
" GVariant *child;\n"
" GValue *paramv;\n"
" gsize num_params;\n"
" guint num_extra;\n"
" gsize n;\n"
" guint signal_id;\n"
" GValue return_value = G_VALUE_INIT;\n"
% (i.name_lower, i.camel_name, i.ns_upper, i.name_upper)
)
self.outfile.write(
" info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);\n"
" g_assert (info != NULL);\n"
)
self.outfile.write(
" num_params = g_variant_n_children (parameters);\n"
" num_extra = info->pass_fdlist ? 3 : 2;"
" paramv = g_new0 (GValue, num_params + num_extra);\n"
" n = 0;\n"
" g_value_init (¶mv[n], %sTYPE_%s);\n"
" g_value_set_object (¶mv[n++], skeleton);\n"
" g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);\n"
" g_value_set_object (¶mv[n++], invocation);\n"
" if (info->pass_fdlist)\n"
" {\n"
"#ifdef G_OS_UNIX\n"
" g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);\n"
" g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));\n"
"#else\n"
" g_assert_not_reached ();\n"
"#endif\n"
" }\n" % (i.ns_upper, i.name_upper)
)
self.outfile.write(
" g_variant_iter_init (&iter, parameters);\n"
" while ((child = g_variant_iter_next_value (&iter)) != NULL)\n"
" {\n"
" _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];\n"
" if (arg_info->use_gvariant)\n"
" {\n"
" g_value_init (¶mv[n], G_TYPE_VARIANT);\n"
" g_value_set_variant (¶mv[n], child);\n"
" n++;\n"
" }\n"
" else\n"
" g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);\n"
" g_variant_unref (child);\n"
" }\n"
)
self.outfile.write(
" signal_id = g_signal_lookup (info->signal_name, %sTYPE_%s);\n"
% (i.ns_upper, i.name_upper)
)
self.outfile.write(
" g_value_init (&return_value, G_TYPE_BOOLEAN);\n"
" g_signal_emitv (paramv, signal_id, 0, &return_value);\n"
" if (!g_value_get_boolean (&return_value))\n"
' g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);\n'
" g_value_unset (&return_value);\n"
)
self.outfile.write(
" for (n = 0; n < num_params + num_extra; n++)\n"
" g_value_unset (¶mv[n]);\n"
" g_free (paramv);\n"
)
self.outfile.write("}\n" "\n")
self.outfile.write(
"static GVariant *\n"
"_%s_skeleton_handle_get_property (\n"
" GDBusConnection *connection G_GNUC_UNUSED,\n"
" const gchar *sender G_GNUC_UNUSED,\n"
" const gchar *object_path G_GNUC_UNUSED,\n"
" const gchar *interface_name G_GNUC_UNUSED,\n"
" const gchar *property_name,\n"
" GError **error,\n"
" gpointer user_data)\n"
"{\n"
" %sSkeleton *skeleton = %s%s_SKELETON (user_data);\n"
" GValue value = G_VALUE_INIT;\n"
" GParamSpec *pspec;\n"
" _ExtendedGDBusPropertyInfo *info;\n"
" GVariant *ret;\n"
% (i.name_lower, i.camel_name, i.ns_upper, i.name_upper)
)
self.outfile.write(
" ret = NULL;\n"
" info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_%s_interface_info.parent_struct, property_name);\n"
" g_assert (info != NULL);\n"
" pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);\n"
" if (pspec == NULL)\n"
" {\n"
' g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %%s", property_name);\n'
" }\n"
" else\n"
" {\n"
" g_value_init (&value, pspec->value_type);\n"
" g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);\n"
" ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));\n"
" g_value_unset (&value);\n"
" }\n"
" return ret;\n"
"}\n"
"\n" % (i.name_lower)
)
self.outfile.write(
"static gboolean\n"
"_%s_skeleton_handle_set_property (\n"
" GDBusConnection *connection G_GNUC_UNUSED,\n"
" const gchar *sender G_GNUC_UNUSED,\n"
" const gchar *object_path G_GNUC_UNUSED,\n"
" const gchar *interface_name G_GNUC_UNUSED,\n"
" const gchar *property_name,\n"
" GVariant *variant,\n"
" GError **error,\n"
" gpointer user_data)\n"
"{\n"
" %sSkeleton *skeleton = %s%s_SKELETON (user_data);\n"
" GValue value = G_VALUE_INIT;\n"
" GParamSpec *pspec;\n"
" _ExtendedGDBusPropertyInfo *info;\n"
" gboolean ret;\n" % (i.name_lower, i.camel_name, i.ns_upper, i.name_upper)
)
self.outfile.write(
" ret = FALSE;\n"
" info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_%s_interface_info.parent_struct, property_name);\n"
" g_assert (info != NULL);\n"
" pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);\n"
" if (pspec == NULL)\n"
" {\n"
' g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %%s", property_name);\n'
" }\n"
" else\n"
" {\n"
" if (info->use_gvariant)\n"
" g_value_set_variant (&value, variant);\n"
" else\n"
" g_dbus_gvariant_to_gvalue (variant, &value);\n"
" g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);\n"
" g_value_unset (&value);\n"
" ret = TRUE;\n"
" }\n"
" return ret;\n"
"}\n"
"\n" % (i.name_lower)
)
self.outfile.write(
"static const GDBusInterfaceVTable _%s_skeleton_vtable =\n"
"{\n"
" _%s_skeleton_handle_method_call,\n"
" _%s_skeleton_handle_get_property,\n"
" _%s_skeleton_handle_set_property,\n"
" {NULL}\n"
"};\n"
"\n" % (i.name_lower, i.name_lower, i.name_lower, i.name_lower)
)
self.outfile.write(
"static GDBusInterfaceInfo *\n"
"%s_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)\n"
"{\n"
" return %s_interface_info ();\n" % (i.name_lower, i.name_lower)
)
self.outfile.write("}\n" "\n")
self.outfile.write(
"static GDBusInterfaceVTable *\n"
"%s_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)\n"
"{\n"
" return (GDBusInterfaceVTable *) &_%s_skeleton_vtable;\n"
% (i.name_lower, i.name_lower)
)
self.outfile.write("}\n" "\n")
self.outfile.write(
"static GVariant *\n"
"%s_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)\n"
"{\n"
" %sSkeleton *skeleton = %s%s_SKELETON (_skeleton);\n"
% (i.name_lower, i.camel_name, i.ns_upper, i.name_upper)
)
self.outfile.write(
"\n"
" GVariantBuilder builder;\n"
" guint n;\n"
' g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));\n'
" if (_%s_interface_info.parent_struct.properties == NULL)\n"
" goto out;\n"
" for (n = 0; _%s_interface_info.parent_struct.properties[n] != NULL; n++)\n"
" {\n"
" GDBusPropertyInfo *info = _%s_interface_info.parent_struct.properties[n];\n"
" if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)\n"
" {\n"
" GVariant *value;\n"
' value = _%s_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "%s", info->name, NULL, skeleton);\n'
" if (value != NULL)\n"
" {\n"
" g_variant_take_ref (value);\n"
' g_variant_builder_add (&builder, "{sv}", info->name, value);\n'
" g_variant_unref (value);\n"
" }\n"
" }\n"
" }\n"
"out:\n"
" return g_variant_builder_end (&builder);\n"
"}\n"
"\n" % (i.name_lower, i.name_lower, i.name_lower, i.name_lower, i.name)
)
if len(i.properties) > 0:
self.outfile.write(
"static gboolean _%s_emit_changed (gpointer user_data);\n"
"\n" % (i.name_lower)
)
self.outfile.write(
"static void\n"
"%s_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton"
% (i.name_lower)
)
if len(i.properties) == 0:
self.outfile.write(" G_GNUC_UNUSED)\n")
else:
self.outfile.write(")\n")
self.outfile.write("{\n")
if len(i.properties) > 0:
self.outfile.write(
" %sSkeleton *skeleton = %s%s_SKELETON (_skeleton);\n"
" gboolean emit_changed = FALSE;\n"
"\n"
" g_mutex_lock (&skeleton->priv->lock);\n"
" if (skeleton->priv->changed_properties_idle_source != NULL)\n"
" {\n"
" g_source_destroy (skeleton->priv->changed_properties_idle_source);\n"
" skeleton->priv->changed_properties_idle_source = NULL;\n"
" emit_changed = TRUE;\n"
" }\n"
" g_mutex_unlock (&skeleton->priv->lock);\n"
"\n"
" if (emit_changed)\n"
" _%s_emit_changed (skeleton);\n"
% (i.camel_name, i.ns_upper, i.name_upper, i.name_lower)
)
self.outfile.write("}\n" "\n")
for s in i.signals:
self.outfile.write(
"static void\n"
"_%s_on_signal_%s (\n"
" %s *object" % (i.name_lower, s.name_lower, i.camel_name)
)
for a in s.args:
self.outfile.write(",\n %sarg_%s" % (a.ctype_in, a.name))
self.outfile.write(
")\n"
"{\n"
" %sSkeleton *skeleton = %s%s_SKELETON (object);\n\n"
" GList *connections, *l;\n"
" GVariant *signal_variant;\n"
" connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));\n"
% (i.camel_name, i.ns_upper, i.name_upper)
)
self.outfile.write(
"\n" ' signal_variant = g_variant_ref_sink (g_variant_new ("('
)
for a in s.args:
self.outfile.write("%s" % (a.format_in))
self.outfile.write(')"')
for a in s.args:
self.outfile.write(",\n arg_%s" % (a.name))
self.outfile.write("));\n")
self.outfile.write(
" for (l = connections; l != NULL; l = l->next)\n"
" {\n"
" GDBusConnection *connection = l->data;\n"
" g_dbus_connection_emit_signal (connection,\n"
' NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "%s", "%s",\n'
" signal_variant, NULL);\n"
" }\n" % (i.name, s.name)
)
self.outfile.write(" g_variant_unref (signal_variant);\n")
self.outfile.write(" g_list_free_full (connections, g_object_unref);\n")
self.outfile.write("}\n" "\n")
self.outfile.write(
"static void %s_skeleton_iface_init (%sIface *iface);\n"
% (i.name_lower, i.camel_name)
)
self.outfile.write("#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38\n")
self.outfile.write(
"G_DEFINE_TYPE_WITH_CODE (%sSkeleton, %s_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,\n"
% (i.camel_name, i.name_lower)
)
self.outfile.write(
" G_ADD_PRIVATE (%sSkeleton)\n" % (i.camel_name)
)
self.outfile.write(
" G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_skeleton_iface_init))\n\n"
% (i.ns_upper, i.name_upper, i.name_lower)
)
self.outfile.write("#else\n")
self.outfile.write(
"G_DEFINE_TYPE_WITH_CODE (%sSkeleton, %s_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,\n"
% (i.camel_name, i.name_lower)
)
self.outfile.write(
" G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_skeleton_iface_init))\n\n"
% (i.ns_upper, i.name_upper, i.name_lower)
)
self.outfile.write("#endif\n")
# finalize
self.outfile.write(
"static void\n"
"%s_skeleton_finalize (GObject *object)\n"
"{\n" % (i.name_lower)
)
self.outfile.write(
" %sSkeleton *skeleton = %s%s_SKELETON (object);\n"
% (i.camel_name, i.ns_upper, i.name_upper)
)
if len(i.properties) > 0:
self.outfile.write(
" guint n;\n"
" for (n = 0; n < %d; n++)\n"
" g_value_unset (&skeleton->priv->properties[n]);\n"
% (len(i.properties))
)
self.outfile.write(" g_free (skeleton->priv->properties);\n")
self.outfile.write(
" g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);\n"
)
self.outfile.write(
" if (skeleton->priv->changed_properties_idle_source != NULL)\n"
)
self.outfile.write(
" g_source_destroy (skeleton->priv->changed_properties_idle_source);\n"
)
self.outfile.write(" g_main_context_unref (skeleton->priv->context);\n")
self.outfile.write(" g_mutex_clear (&skeleton->priv->lock);\n")
self.outfile.write(
" G_OBJECT_CLASS (%s_skeleton_parent_class)->finalize (object);\n"
"}\n"
"\n" % (i.name_lower)
)
# property accessors (TODO: generate PropertiesChanged signals in setter)
if len(i.properties) > 0:
self.outfile.write(
"static void\n"
"%s_skeleton_get_property (GObject *object,\n"
" guint prop_id,\n"
" GValue *value,\n"
" GParamSpec *pspec G_GNUC_UNUSED)\n"
"{\n" % (i.name_lower)
)
self.outfile.write(
" %sSkeleton *skeleton = %s%s_SKELETON (object);\n"
" g_assert (prop_id != 0 && prop_id - 1 < %d);\n"
" g_mutex_lock (&skeleton->priv->lock);\n"
" g_value_copy (&skeleton->priv->properties[prop_id - 1], value);\n"
" g_mutex_unlock (&skeleton->priv->lock);\n"
% (i.camel_name, i.ns_upper, i.name_upper, len(i.properties))
)
self.outfile.write("}\n" "\n")
# if property is already scheduled then re-use entry.. though it could be
# that the user did
#
# foo_set_prop_bar (object, "");
# foo_set_prop_bar (object, "blah");
#
# say, every update... In this case, where nothing happens, we obviously
# don't want a PropertiesChanged() event. We can easily check for this
# by comparing against the _original value_ recorded before the first
# change event. If the latest value is not different from the original
# one, we can simply ignore the ChangedProperty
#
self.outfile.write(
"static gboolean\n"
"_%s_emit_changed (gpointer user_data)\n"
"{\n"
" %sSkeleton *skeleton = %s%s_SKELETON (user_data);\n"
% (i.name_lower, i.camel_name, i.ns_upper, i.name_upper)
)
self.outfile.write(
" GList *l;\n"
" GVariantBuilder builder;\n"
" GVariantBuilder invalidated_builder;\n"
" guint num_changes;\n"
"\n"
" g_mutex_lock (&skeleton->priv->lock);\n"
' g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));\n'
' g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));\n'
" for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)\n"
" {\n"
" ChangedProperty *cp = l->data;\n"
" GVariant *variant;\n"
" const GValue *cur_value;\n"
"\n"
" cur_value = &skeleton->priv->properties[cp->prop_id - 1];\n"
" if (!_g_value_equal (cur_value, &cp->orig_value))\n"
" {\n"
" variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));\n"
' g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);\n'
" g_variant_unref (variant);\n"
" num_changes++;\n"
" }\n"
" }\n"
" if (num_changes > 0)\n"
" {\n"
" GList *connections, *ll;\n"
" GVariant *signal_variant;"
"\n"
' signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "%s",\n'
" &builder, &invalidated_builder));\n"
" connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));\n"
" for (ll = connections; ll != NULL; ll = ll->next)\n"
" {\n"
" GDBusConnection *connection = ll->data;\n"
"\n"
" g_dbus_connection_emit_signal (connection,\n"
" NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),\n"
' "org.freedesktop.DBus.Properties",\n'
' "PropertiesChanged",\n'
" signal_variant,\n"
" NULL);\n"
" }\n"
" g_variant_unref (signal_variant);\n"
" g_list_free_full (connections, g_object_unref);\n"
" }\n"
" else\n"
" {\n"
" g_variant_builder_clear (&builder);\n"
" g_variant_builder_clear (&invalidated_builder);\n"
" }\n" % (i.name)
)
self.outfile.write(
" g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);\n"
)
self.outfile.write(" skeleton->priv->changed_properties = NULL;\n")
self.outfile.write(
" skeleton->priv->changed_properties_idle_source = NULL;\n"
)
self.outfile.write(" g_mutex_unlock (&skeleton->priv->lock);\n")
self.outfile.write(" return FALSE;\n" "}\n" "\n")
# holding lock while being called
self.outfile.write(
"static void\n"
"_%s_schedule_emit_changed (%sSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)\n"
"{\n"
" ChangedProperty *cp;\n"
" GList *l;\n"
" cp = NULL;\n"
" for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)\n"
" {\n"
" ChangedProperty *i_cp = l->data;\n"
" if (i_cp->info == info)\n"
" {\n"
" cp = i_cp;\n"
" break;\n"
" }\n"
" }\n" % (i.name_lower, i.camel_name)
)
self.outfile.write(
" if (cp == NULL)\n"
" {\n"
" cp = g_new0 (ChangedProperty, 1);\n"
" cp->prop_id = prop_id;\n"
" cp->info = info;\n"
" skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);\n"
" g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));\n"
" g_value_copy (orig_value, &cp->orig_value);\n"
" }\n"
"}\n"
"\n"
)
# Postpone setting up the refresh source until the ::notify signal is emitted as
# this allows use of g_object_freeze_notify()/g_object_thaw_notify() ...
# This is useful when updating several properties from another thread than
# where the idle will be emitted from
self.outfile.write(
"static void\n"
"%s_skeleton_notify (GObject *object,\n"
" GParamSpec *pspec G_GNUC_UNUSED)\n"
"{\n"
" %sSkeleton *skeleton = %s%s_SKELETON (object);\n"
" g_mutex_lock (&skeleton->priv->lock);\n"
" if (skeleton->priv->changed_properties != NULL &&\n"
" skeleton->priv->changed_properties_idle_source == NULL)\n"
" {\n"
" skeleton->priv->changed_properties_idle_source = g_idle_source_new ();\n"
" g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);\n"
" g_source_set_callback (skeleton->priv->changed_properties_idle_source, _%s_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);\n"
' g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _%s_emit_changed");\n'
" g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);\n"
" g_source_unref (skeleton->priv->changed_properties_idle_source);\n"
" }\n"
" g_mutex_unlock (&skeleton->priv->lock);\n"
"}\n"
"\n"
% (
i.name_lower,
i.camel_name,
i.ns_upper,
i.name_upper,
i.name_lower,
i.name_lower,
)
)
self.outfile.write(
"static void\n"
"%s_skeleton_set_property (GObject *object,\n"
" guint prop_id,\n"
" const GValue *value,\n"
" GParamSpec *pspec)\n"
"{\n" % (i.name_lower)
)
self.outfile.write(
" const _ExtendedGDBusPropertyInfo *info;\n"
" %sSkeleton *skeleton = %s%s_SKELETON (object);\n"
" g_assert (prop_id != 0 && prop_id - 1 < %d);\n"
" info = (const _ExtendedGDBusPropertyInfo *) _%s_property_info_pointers[prop_id - 1];\n"
" g_mutex_lock (&skeleton->priv->lock);\n"
" g_object_freeze_notify (object);\n"
" if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))\n"
" {\n"
" if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL &&\n"
" info->emits_changed_signal)\n"
" _%s_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]);\n"
" g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);\n"
" g_object_notify_by_pspec (object, pspec);\n"
" }\n"
" g_mutex_unlock (&skeleton->priv->lock);\n"
" g_object_thaw_notify (object);\n"
% (
i.camel_name,
i.ns_upper,
i.name_upper,
len(i.properties),
i.name_lower,
i.name_lower,
)
)
self.outfile.write("}\n" "\n")
self.outfile.write(
"static void\n"
"%s_skeleton_init (%sSkeleton *skeleton)\n"
"{\n"
"#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38\n"
" skeleton->priv = %s_skeleton_get_instance_private (skeleton);\n"
"#else\n"
" skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, %sTYPE_%s_SKELETON, %sSkeletonPrivate);\n"
"#endif\n\n"
% (
i.name_lower,
i.camel_name,
i.name_lower,
i.ns_upper,
i.name_upper,
i.camel_name,
)
)
self.outfile.write(" g_mutex_init (&skeleton->priv->lock);\n")
self.outfile.write(
" skeleton->priv->context = g_main_context_ref_thread_default ();\n"
)
if len(i.properties) > 0:
self.outfile.write(
" skeleton->priv->properties = g_new0 (GValue, %d);\n"
% (len(i.properties))
)
n = 0
for p in i.properties:
self.outfile.write(
" g_value_init (&skeleton->priv->properties[%d], %s);\n"
% (n, p.arg.gtype)
)
n += 1
self.outfile.write("}\n" "\n")
# property vfuncs
n = 0
for p in i.properties:
self.outfile.write(
"static %s\n"
"%s_skeleton_get_%s (%s *object)\n"
"{\n" % (p.arg.ctype_in, i.name_lower, p.name_lower, i.camel_name)
)
self.outfile.write(
" %sSkeleton *skeleton = %s%s_SKELETON (object);\n"
% (i.camel_name, i.ns_upper, i.name_upper)
)
self.outfile.write(
" %svalue;\n"
" g_mutex_lock (&skeleton->priv->lock);\n"
" value = %s (&(skeleton->priv->properties[%d]));\n"
" g_mutex_unlock (&skeleton->priv->lock);\n"
% (p.arg.ctype_in_g, p.arg.gvalue_get, n)
)
self.outfile.write(" return value;\n")
self.outfile.write("}\n")
self.outfile.write("\n")
n += 1
self.outfile.write(
"static void\n"
"%s_skeleton_class_init (%sSkeletonClass *klass)\n"
"{\n"
" GObjectClass *gobject_class;\n"
" GDBusInterfaceSkeletonClass *skeleton_class;\n"
"\n"
" gobject_class = G_OBJECT_CLASS (klass);\n"
" gobject_class->finalize = %s_skeleton_finalize;\n"
% (i.name_lower, i.camel_name, i.name_lower)
)
if len(i.properties) > 0:
self.outfile.write(
" gobject_class->get_property = %s_skeleton_get_property;\n"
" gobject_class->set_property = %s_skeleton_set_property;\n"
" gobject_class->notify = %s_skeleton_notify;\n"
"\n" % (i.name_lower, i.name_lower, i.name_lower)
)
self.outfile.write(
"\n" " %s_override_properties (gobject_class, 1);\n" % (i.name_lower)
)
self.outfile.write(
"\n" " skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);\n"
)
self.outfile.write(
" skeleton_class->get_info = %s_skeleton_dbus_interface_get_info;\n"
% (i.name_lower)
)
self.outfile.write(
" skeleton_class->get_properties = %s_skeleton_dbus_interface_get_properties;\n"
% (i.name_lower)
)
self.outfile.write(
" skeleton_class->flush = %s_skeleton_dbus_interface_flush;\n"
% (i.name_lower)
)
self.outfile.write(
" skeleton_class->get_vtable = %s_skeleton_dbus_interface_get_vtable;\n"
% (i.name_lower)
)
self.outfile.write(
"\n"
"#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38\n"
" g_type_class_add_private (klass, sizeof (%sSkeletonPrivate));\n"
"#endif\n" % (i.camel_name)
)
self.outfile.write("}\n" "\n")
self.outfile.write(
"static void\n"
"%s_skeleton_iface_init (%sIface *iface" % (i.name_lower, i.camel_name)
)
if len(i.signals) == 0 and len(i.properties) == 0:
self.outfile.write(" G_GNUC_UNUSED)\n")
else:
self.outfile.write(")\n")
self.outfile.write("{\n")
for s in i.signals:
self.outfile.write(
" iface->%s = _%s_on_signal_%s;\n"
% (s.name_lower, i.name_lower, s.name_lower)
)
for p in i.properties:
self.outfile.write(
" iface->get_%s = %s_skeleton_get_%s;\n"
% (p.name_lower, i.name_lower, p.name_lower)
)
self.outfile.write("}\n" "\n")
# constructors
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %s_skeleton_new:\n"
" *\n"
" * Creates a skeleton object for the D-Bus interface #%s.\n"
" *\n"
" * Returns: (transfer full) (type %sSkeleton): The skeleton object.\n"
% (i.name_lower, i.name, i.camel_name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write(
"%s *\n"
"%s_skeleton_new (void)\n"
"{\n"
" return %s%s (g_object_new (%sTYPE_%s_SKELETON, NULL));\n"
"}\n"
"\n"
% (
i.camel_name,
i.name_lower,
i.ns_upper,
i.name_upper,
i.ns_upper,
i.name_upper,
)
)
# ---------------------------------------------------------------------------------------------------
def generate_object(self):
self.outfile.write(
"/* ------------------------------------------------------------------------\n"
" * Code for Object, ObjectProxy and ObjectSkeleton\n"
" * ------------------------------------------------------------------------\n"
" */\n"
"\n"
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * SECTION:%sObject\n"
" * @title: %sObject\n"
" * @short_description: Specialized GDBusObject types\n"
" *\n"
" * This section contains the #%sObject, #%sObjectProxy, and #%sObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.\n"
" */\n"
% (
self.namespace,
self.namespace,
self.namespace,
self.namespace,
self.namespace,
),
False,
)
)
self.outfile.write("\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sObject:\n"
" *\n"
" * The #%sObject type is a specialized container of interfaces.\n"
" */\n" % (self.namespace, self.namespace),
False,
)
)
self.outfile.write("\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sObjectIface:\n"
" * @parent_iface: The parent interface.\n"
" *\n"
" * Virtual table for the #%sObject interface.\n"
" */\n" % (self.namespace, self.namespace),
False,
)
)
self.outfile.write("\n")
self.outfile.write(
"typedef %sObjectIface %sObjectInterface;\n"
% (self.namespace, self.namespace)
)
self.outfile.write(
"G_DEFINE_INTERFACE_WITH_CODE (%sObject, %sobject, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT);)\n"
% (self.namespace, self.ns_lower)
)
self.outfile.write("\n")
self.outfile.write(
"static void\n"
"%sobject_default_init (%sObjectIface *iface)\n"
"{\n" % (self.ns_lower, self.namespace)
)
for i in self.ifaces:
self.outfile.write(
self.docbook_gen.expand(
" /**\n"
" * %sObject:%s:\n"
" *\n"
" * The #%s instance corresponding to the D-Bus interface #%s, if any.\n"
" *\n"
" * Connect to the #GObject::notify signal to get informed of property changes.\n"
% (self.namespace, i.name_hyphen, i.camel_name, i.name),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 2)
flags = "G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS"
if i.deprecated:
flags = "G_PARAM_DEPRECATED | " + flags
self.outfile.write(
' g_object_interface_install_property (iface, g_param_spec_object ("%s", "%s", "%s", %sTYPE_%s, %s));\n'
"\n"
% (
i.name_hyphen,
i.name_hyphen,
i.name_hyphen,
self.ns_upper,
i.name_upper,
flags,
)
)
self.outfile.write("}\n" "\n")
for i in self.ifaces:
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sobject_get_%s:\n"
" * @object: A #%sObject.\n"
" *\n"
" * Gets the #%s instance for the D-Bus interface #%s on @object, if any.\n"
" *\n"
" * Returns: (transfer full) (nullable): A #%s that must be freed with g_object_unref() or %%NULL if @object does not implement the interface.\n"
% (
self.ns_lower,
i.name_upper.lower(),
self.namespace,
i.camel_name,
i.name,
i.camel_name,
),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write(
"%s *%sobject_get_%s (%sObject *object)\n"
% (i.camel_name, self.ns_lower, i.name_upper.lower(), self.namespace)
)
self.outfile.write(
"{\n"
" GDBusInterface *ret;\n"
' ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "%s");\n'
" if (ret == NULL)\n"
" return NULL;\n"
" return %s%s (ret);\n"
"}\n"
"\n" % (i.name, self.ns_upper, i.name_upper)
)
self.outfile.write("\n")
for i in self.ifaces:
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sobject_peek_%s: (skip)\n"
" * @object: A #%sObject.\n"
" *\n"
" * Like %sobject_get_%s() but doesn't increase the reference count on the returned object.\n"
" *\n"
" * It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.\n"
" *\n"
" * Returns: (transfer none) (nullable): A #%s or %%NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.\n"
% (
self.ns_lower,
i.name_upper.lower(),
self.namespace,
self.ns_lower,
i.name_upper.lower(),
i.camel_name,
),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write(
"%s *%sobject_peek_%s (%sObject *object)\n"
% (i.camel_name, self.ns_lower, i.name_upper.lower(), self.namespace)
)
self.outfile.write(
"{\n"
" GDBusInterface *ret;\n"
' ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "%s");\n'
" if (ret == NULL)\n"
" return NULL;\n"
" g_object_unref (ret);\n"
" return %s%s (ret);\n"
"}\n"
"\n" % (i.name, self.ns_upper, i.name_upper)
)
self.outfile.write("\n")
# shared by ObjectProxy and ObjectSkeleton classes
self.outfile.write(
"static void\n"
"%sobject_notify (GDBusObject *object, GDBusInterface *interface)\n"
"{\n"
" _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);\n"
" /* info can be NULL if the other end is using a D-Bus interface we don't know\n"
" * anything about, for example old generated code in this process talking to\n"
" * newer generated code in the other process. */\n"
" if (info != NULL)\n"
" g_object_notify (G_OBJECT (object), info->hyphen_name);\n"
"}\n"
"\n" % (self.ns_lower)
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sObjectProxy:\n"
" *\n"
" * The #%sObjectProxy structure contains only private data and should only be accessed using the provided API.\n"
% (self.namespace, self.namespace),
False,
)
)
self.outfile.write(" */\n")
self.outfile.write("\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sObjectProxyClass:\n"
" * @parent_class: The parent class.\n"
" *\n"
" * Class structure for #%sObjectProxy.\n"
% (self.namespace, self.namespace),
False,
)
)
self.outfile.write(" */\n")
self.outfile.write("\n")
# class boilerplate
self.outfile.write(
"static void\n"
"%sobject_proxy__%sobject_iface_init (%sObjectIface *iface G_GNUC_UNUSED)\n"
"{\n"
"}\n"
"\n" % (self.ns_lower, self.ns_lower, self.namespace)
)
self.outfile.write(
"static void\n"
"%sobject_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)\n"
"{\n"
" iface->interface_added = %sobject_notify;\n"
" iface->interface_removed = %sobject_notify;\n"
"}\n"
"\n" % (self.ns_lower, self.ns_lower, self.ns_lower)
)
self.outfile.write("\n")
self.outfile.write(
"G_DEFINE_TYPE_WITH_CODE (%sObjectProxy, %sobject_proxy, G_TYPE_DBUS_OBJECT_PROXY,\n"
" G_IMPLEMENT_INTERFACE (%sTYPE_OBJECT, %sobject_proxy__%sobject_iface_init)\n"
" G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, %sobject_proxy__g_dbus_object_iface_init))\n"
"\n"
% (
self.namespace,
self.ns_lower,
self.ns_upper,
self.ns_lower,
self.ns_lower,
self.ns_lower,
)
)
# class boilerplate
self.outfile.write(
"static void\n"
"%sobject_proxy_init (%sObjectProxy *object G_GNUC_UNUSED)\n"
"{\n"
"}\n"
"\n" % (self.ns_lower, self.namespace)
)
self.outfile.write(
"static void\n"
"%sobject_proxy_set_property (GObject *gobject,\n"
" guint prop_id,\n"
" const GValue *value G_GNUC_UNUSED,\n"
" GParamSpec *pspec)\n"
"{\n"
" G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);\n"
% (self.ns_lower)
)
self.outfile.write("}\n" "\n")
self.outfile.write(
"static void\n"
"%sobject_proxy_get_property (GObject *gobject,\n"
" guint prop_id,\n"
" GValue *value,\n"
" GParamSpec *pspec)\n"
"{\n"
" %sObjectProxy *object = %sOBJECT_PROXY (gobject);\n"
" GDBusInterface *interface;\n"
"\n"
" switch (prop_id)\n"
" {\n" % (self.ns_lower, self.namespace, self.ns_upper)
)
n = 1
for i in self.ifaces:
self.outfile.write(
" case %d:\n"
' interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "%s");\n'
" g_value_take_object (value, interface);\n"
" break;\n"
"\n" % (n, i.name)
)
n += 1
self.outfile.write(
" default:\n"
" G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);\n"
" break;\n"
" }\n"
"}\n"
"\n"
)
self.outfile.write(
"static void\n"
"%sobject_proxy_class_init (%sObjectProxyClass *klass)\n"
"{\n"
" GObjectClass *gobject_class = G_OBJECT_CLASS (klass);\n"
"\n"
" gobject_class->set_property = %sobject_proxy_set_property;\n"
" gobject_class->get_property = %sobject_proxy_get_property;\n"
"\n" % (self.ns_lower, self.namespace, self.ns_lower, self.ns_lower)
)
n = 1
for i in self.ifaces:
self.outfile.write(
' g_object_class_override_property (gobject_class, %d, "%s");'
"\n" % (n, i.name_hyphen)
)
n += 1
self.outfile.write("}\n" "\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sobject_proxy_new:\n"
" * @connection: A #GDBusConnection.\n"
" * @object_path: An object path.\n"
" *\n"
" * Creates a new proxy object.\n"
" *\n"
" * Returns: (transfer full): The proxy object.\n"
" */\n" % (self.ns_lower),
False,
)
)
self.outfile.write(
"%sObjectProxy *\n"
"%sobject_proxy_new (GDBusConnection *connection,\n"
" const gchar *object_path)\n"
"{\n"
" g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);\n"
" g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);\n"
' return %sOBJECT_PROXY (g_object_new (%sTYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));\n'
"}\n"
"\n" % (self.namespace, self.ns_lower, self.ns_upper, self.ns_upper)
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sObjectSkeleton:\n"
" *\n"
" * The #%sObjectSkeleton structure contains only private data and should only be accessed using the provided API.\n"
% (self.namespace, self.namespace),
False,
)
)
self.outfile.write(" */\n")
self.outfile.write("\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sObjectSkeletonClass:\n"
" * @parent_class: The parent class.\n"
" *\n"
" * Class structure for #%sObjectSkeleton.\n"
% (self.namespace, self.namespace),
False,
)
)
self.outfile.write(" */\n")
self.outfile.write("\n")
# class boilerplate
self.outfile.write(
"static void\n"
"%sobject_skeleton__%sobject_iface_init (%sObjectIface *iface G_GNUC_UNUSED)\n"
"{\n"
"}\n"
"\n" % (self.ns_lower, self.ns_lower, self.namespace)
)
self.outfile.write("\n")
self.outfile.write(
"static void\n"
"%sobject_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)\n"
"{\n"
" iface->interface_added = %sobject_notify;\n"
" iface->interface_removed = %sobject_notify;\n"
"}\n"
"\n" % (self.ns_lower, self.ns_lower, self.ns_lower)
)
self.outfile.write(
"G_DEFINE_TYPE_WITH_CODE (%sObjectSkeleton, %sobject_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,\n"
" G_IMPLEMENT_INTERFACE (%sTYPE_OBJECT, %sobject_skeleton__%sobject_iface_init)\n"
" G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, %sobject_skeleton__g_dbus_object_iface_init))\n"
"\n"
% (
self.namespace,
self.ns_lower,
self.ns_upper,
self.ns_lower,
self.ns_lower,
self.ns_lower,
)
)
# class boilerplate
self.outfile.write(
"static void\n"
"%sobject_skeleton_init (%sObjectSkeleton *object G_GNUC_UNUSED)\n"
"{\n"
"}\n"
"\n" % (self.ns_lower, self.namespace)
)
self.outfile.write(
"static void\n"
"%sobject_skeleton_set_property (GObject *gobject,\n"
" guint prop_id,\n"
" const GValue *value,\n"
" GParamSpec *pspec)\n"
"{\n"
" %sObjectSkeleton *object = %sOBJECT_SKELETON (gobject);\n"
" GDBusInterfaceSkeleton *interface;\n"
"\n"
" switch (prop_id)\n"
" {\n" % (self.ns_lower, self.namespace, self.ns_upper)
)
n = 1
for i in self.ifaces:
self.outfile.write(
" case %d:\n"
" interface = g_value_get_object (value);\n"
" if (interface != NULL)\n"
" {\n"
" g_warn_if_fail (%sIS_%s (interface));\n"
" g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);\n"
" }\n"
" else\n"
" {\n"
' g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "%s");\n'
" }\n"
" break;\n"
"\n" % (n, self.ns_upper, i.name_upper, i.name)
)
n += 1
self.outfile.write(
" default:\n"
" G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);\n"
" break;\n"
" }\n"
"}\n"
"\n"
)
self.outfile.write(
"static void\n"
"%sobject_skeleton_get_property (GObject *gobject,\n"
" guint prop_id,\n"
" GValue *value,\n"
" GParamSpec *pspec)\n"
"{\n"
" %sObjectSkeleton *object = %sOBJECT_SKELETON (gobject);\n"
" GDBusInterface *interface;\n"
"\n"
" switch (prop_id)\n"
" {\n" % (self.ns_lower, self.namespace, self.ns_upper)
)
n = 1
for i in self.ifaces:
self.outfile.write(
" case %d:\n"
' interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "%s");\n'
" g_value_take_object (value, interface);\n"
" break;\n"
"\n" % (n, i.name)
)
n += 1
self.outfile.write(
" default:\n"
" G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);\n"
" break;\n"
" }\n"
"}\n"
"\n"
)
self.outfile.write(
"static void\n"
"%sobject_skeleton_class_init (%sObjectSkeletonClass *klass)\n"
"{\n"
" GObjectClass *gobject_class = G_OBJECT_CLASS (klass);\n"
"\n"
" gobject_class->set_property = %sobject_skeleton_set_property;\n"
" gobject_class->get_property = %sobject_skeleton_get_property;\n"
"\n" % (self.ns_lower, self.namespace, self.ns_lower, self.ns_lower)
)
n = 1
for i in self.ifaces:
self.outfile.write(
' g_object_class_override_property (gobject_class, %d, "%s");'
"\n" % (n, i.name_hyphen)
)
n += 1
self.outfile.write("}\n" "\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sobject_skeleton_new:\n"
" * @object_path: An object path.\n"
" *\n"
" * Creates a new skeleton object.\n"
" *\n"
" * Returns: (transfer full): The skeleton object.\n"
" */\n" % (self.ns_lower),
False,
)
)
self.outfile.write(
"%sObjectSkeleton *\n"
"%sobject_skeleton_new (const gchar *object_path)\n"
"{\n"
" g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);\n"
' return %sOBJECT_SKELETON (g_object_new (%sTYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));\n'
"}\n"
"\n" % (self.namespace, self.ns_lower, self.ns_upper, self.ns_upper)
)
for i in self.ifaces:
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sobject_skeleton_set_%s:\n"
" * @object: A #%sObjectSkeleton.\n"
" * @interface_: (nullable): A #%s or %%NULL to clear the interface.\n"
" *\n"
" * Sets the #%s instance for the D-Bus interface #%s on @object.\n"
% (
self.ns_lower,
i.name_upper.lower(),
self.namespace,
i.camel_name,
i.camel_name,
i.name,
),
False,
)
)
self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 0)
self.outfile.write(
"void %sobject_skeleton_set_%s (%sObjectSkeleton *object, %s *interface_)\n"
% (self.ns_lower, i.name_upper.lower(), self.namespace, i.camel_name)
)
self.outfile.write(
"{\n"
' g_object_set (G_OBJECT (object), "%s", interface_, NULL);\n'
"}\n"
"\n" % (i.name_hyphen)
)
self.outfile.write("\n")
def generate_object_manager_client(self):
self.outfile.write(
"/* ------------------------------------------------------------------------\n"
" * Code for ObjectManager client\n"
" * ------------------------------------------------------------------------\n"
" */\n"
"\n"
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * SECTION:%sObjectManagerClient\n"
" * @title: %sObjectManagerClient\n"
" * @short_description: Generated GDBusObjectManagerClient type\n"
" *\n"
" * This section contains a #GDBusObjectManagerClient that uses %sobject_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.\n"
" */\n" % (self.namespace, self.namespace, self.ns_lower),
False,
)
)
self.outfile.write("\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sObjectManagerClient:\n"
" *\n"
" * The #%sObjectManagerClient structure contains only private data and should only be accessed using the provided API.\n"
% (self.namespace, self.namespace),
False,
)
)
self.outfile.write(" */\n")
self.outfile.write("\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sObjectManagerClientClass:\n"
" * @parent_class: The parent class.\n"
" *\n"
" * Class structure for #%sObjectManagerClient.\n"
% (self.namespace, self.namespace),
False,
)
)
self.outfile.write(" */\n")
self.outfile.write("\n")
# class boilerplate
self.outfile.write(
"G_DEFINE_TYPE (%sObjectManagerClient, %sobject_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT)\n"
"\n" % (self.namespace, self.ns_lower)
)
# class boilerplate
self.outfile.write(
"static void\n"
"%sobject_manager_client_init (%sObjectManagerClient *manager G_GNUC_UNUSED)\n"
"{\n"
"}\n"
"\n" % (self.ns_lower, self.namespace)
)
self.outfile.write(
"static void\n"
"%sobject_manager_client_class_init (%sObjectManagerClientClass *klass G_GNUC_UNUSED)\n"
"{\n"
"}\n"
"\n" % (self.ns_lower, self.namespace)
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sobject_manager_client_get_proxy_type:\n"
" * @manager: A #GDBusObjectManagerClient.\n"
" * @object_path: The object path of the remote object (unused).\n"
" * @interface_name: (nullable): Interface name of the remote object or %%NULL to get the object proxy #GType.\n"
" * @user_data: User data (unused).\n"
" *\n"
" * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy derived and #GDBusProxy derived types.\n"
" *\n"
" * Returns: A #GDBusProxy derived #GType if @interface_name is not %%NULL, otherwise the #GType for #%sObjectProxy.\n"
% (self.ns_lower, self.namespace),
False,
)
)
self.outfile.write(" */\n")
self.outfile.write(
"GType\n"
"%sobject_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)\n"
"{\n" % (self.ns_lower)
)
self.outfile.write(
" static gsize once_init_value = 0;\n"
" static GHashTable *lookup_hash;\n"
" GType ret;\n"
"\n"
" if (interface_name == NULL)\n"
" return %sTYPE_OBJECT_PROXY;\n"
" if (g_once_init_enter (&once_init_value))\n"
" {\n"
" lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);\n"
% (self.ns_upper)
)
for i in self.ifaces:
self.outfile.write(
' g_hash_table_insert (lookup_hash, (gpointer) "%s", GSIZE_TO_POINTER (%sTYPE_%s_PROXY));\n'
% (i.name, i.ns_upper, i.name_upper)
)
self.outfile.write(" g_once_init_leave (&once_init_value, 1);\n" " }\n")
self.outfile.write(
" ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));\n"
" if (ret == (GType) 0)\n"
" ret = G_TYPE_DBUS_PROXY;\n"
)
self.outfile.write(" return ret;\n" "}\n" "\n")
# constructors
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sobject_manager_client_new:\n"
" * @connection: A #GDBusConnection.\n"
" * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.\n"
" * @name: (nullable): A bus name (well-known or unique) or %%NULL if @connection is not a message bus connection.\n"
" * @object_path: An object path.\n"
" * @cancellable: (nullable): A #GCancellable or %%NULL.\n"
" * @callback: A #GAsyncReadyCallback to call when the request is satisfied.\n"
" * @user_data: User data to pass to @callback.\n"
" *\n"
" * Asynchronously creates #GDBusObjectManagerClient using %sobject_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.\n"
" *\n"
" * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).\n"
" * You can then call %sobject_manager_client_new_finish() to get the result of the operation.\n"
" *\n"
" * See %sobject_manager_client_new_sync() for the synchronous, blocking version of this constructor.\n"
% (self.ns_lower, self.ns_lower, self.ns_lower, self.ns_lower),
False,
)
)
self.outfile.write(" */\n")
self.outfile.write(
"void\n"
"%sobject_manager_client_new (\n"
" GDBusConnection *connection,\n"
" GDBusObjectManagerClientFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)\n"
"{\n"
' g_async_initable_new_async (%sTYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", %sobject_manager_client_get_proxy_type, NULL);\n'
"}\n"
"\n" % (self.ns_lower, self.ns_upper, self.ns_lower)
)
self.outfile.write(
"/**\n"
" * %sobject_manager_client_new_finish:\n"
" * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to %sobject_manager_client_new().\n"
" * @error: Return location for error or %%NULL\n"
" *\n"
" * Finishes an operation started with %sobject_manager_client_new().\n"
" *\n"
" * Returns: (transfer full) (type %sObjectManagerClient): The constructed object manager client or %%NULL if @error is set.\n"
% (self.ns_lower, self.ns_lower, self.ns_lower, self.namespace)
)
self.outfile.write(" */\n")
self.outfile.write(
"GDBusObjectManager *\n"
"%sobject_manager_client_new_finish (\n"
" GAsyncResult *res,\n"
" GError **error)\n"
"{\n"
" GObject *ret;\n"
" GObject *source_object;\n"
" source_object = g_async_result_get_source_object (res);\n"
" ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);\n"
" g_object_unref (source_object);\n"
" if (ret != NULL)\n"
" return G_DBUS_OBJECT_MANAGER (ret);\n"
" else\n"
" return NULL;\n"
"}\n"
"\n" % (self.ns_lower)
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sobject_manager_client_new_sync:\n"
" * @connection: A #GDBusConnection.\n"
" * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.\n"
" * @name: (nullable): A bus name (well-known or unique) or %%NULL if @connection is not a message bus connection.\n"
" * @object_path: An object path.\n"
" * @cancellable: (nullable): A #GCancellable or %%NULL.\n"
" * @error: Return location for error or %%NULL\n"
" *\n"
" * Synchronously creates #GDBusObjectManagerClient using %sobject_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.\n"
" *\n"
" * The calling thread is blocked until a reply is received.\n"
" *\n"
" * See %sobject_manager_client_new() for the asynchronous version of this constructor.\n"
" *\n"
" * Returns: (transfer full) (type %sObjectManagerClient): The constructed object manager client or %%NULL if @error is set.\n"
% (self.ns_lower, self.ns_lower, self.ns_lower, self.namespace),
False,
)
)
self.outfile.write(" */\n")
self.outfile.write(
"GDBusObjectManager *\n"
"%sobject_manager_client_new_sync (\n"
" GDBusConnection *connection,\n"
" GDBusObjectManagerClientFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GError **error)\n"
"{\n"
" GInitable *ret;\n"
' ret = g_initable_new (%sTYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", %sobject_manager_client_get_proxy_type, NULL);\n'
" if (ret != NULL)\n"
" return G_DBUS_OBJECT_MANAGER (ret);\n"
" else\n"
" return NULL;\n"
"}\n"
"\n" % (self.ns_lower, self.ns_upper, self.ns_lower)
)
self.outfile.write("\n")
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sobject_manager_client_new_for_bus:\n"
" * @bus_type: A #GBusType.\n"
" * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.\n"
" * @name: A bus name (well-known or unique).\n"
" * @object_path: An object path.\n"
" * @cancellable: (nullable): A #GCancellable or %%NULL.\n"
" * @callback: A #GAsyncReadyCallback to call when the request is satisfied.\n"
" * @user_data: User data to pass to @callback.\n"
" *\n"
" * Like %sobject_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.\n"
" *\n"
" * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).\n"
" * You can then call %sobject_manager_client_new_for_bus_finish() to get the result of the operation.\n"
" *\n"
" * See %sobject_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.\n"
% (self.ns_lower, self.ns_lower, self.ns_lower, self.ns_lower),
False,
)
)
self.outfile.write(" */\n")
self.outfile.write(
"void\n"
"%sobject_manager_client_new_for_bus (\n"
" GBusType bus_type,\n"
" GDBusObjectManagerClientFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)\n"
"{\n"
' g_async_initable_new_async (%sTYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", %sobject_manager_client_get_proxy_type, NULL);\n'
"}\n"
"\n" % (self.ns_lower, self.ns_upper, self.ns_lower)
)
self.outfile.write(
"/**\n"
" * %sobject_manager_client_new_for_bus_finish:\n"
" * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to %sobject_manager_client_new_for_bus().\n"
" * @error: Return location for error or %%NULL\n"
" *\n"
" * Finishes an operation started with %sobject_manager_client_new_for_bus().\n"
" *\n"
" * Returns: (transfer full) (type %sObjectManagerClient): The constructed object manager client or %%NULL if @error is set.\n"
% (self.ns_lower, self.ns_lower, self.ns_lower, self.namespace)
)
self.outfile.write(" */\n")
self.outfile.write(
"GDBusObjectManager *\n"
"%sobject_manager_client_new_for_bus_finish (\n"
" GAsyncResult *res,\n"
" GError **error)\n"
"{\n"
" GObject *ret;\n"
" GObject *source_object;\n"
" source_object = g_async_result_get_source_object (res);\n"
" ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);\n"
" g_object_unref (source_object);\n"
" if (ret != NULL)\n"
" return G_DBUS_OBJECT_MANAGER (ret);\n"
" else\n"
" return NULL;\n"
"}\n"
"\n" % (self.ns_lower)
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * %sobject_manager_client_new_for_bus_sync:\n"
" * @bus_type: A #GBusType.\n"
" * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.\n"
" * @name: A bus name (well-known or unique).\n"
" * @object_path: An object path.\n"
" * @cancellable: (nullable): A #GCancellable or %%NULL.\n"
" * @error: Return location for error or %%NULL\n"
" *\n"
" * Like %sobject_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.\n"
" *\n"
" * The calling thread is blocked until a reply is received.\n"
" *\n"
" * See %sobject_manager_client_new_for_bus() for the asynchronous version of this constructor.\n"
" *\n"
" * Returns: (transfer full) (type %sObjectManagerClient): The constructed object manager client or %%NULL if @error is set.\n"
% (self.ns_lower, self.ns_lower, self.ns_lower, self.namespace),
False,
)
)
self.outfile.write(" */\n")
self.outfile.write(
"GDBusObjectManager *\n"
"%sobject_manager_client_new_for_bus_sync (\n"
" GBusType bus_type,\n"
" GDBusObjectManagerClientFlags flags,\n"
" const gchar *name,\n"
" const gchar *object_path,\n"
" GCancellable *cancellable,\n"
" GError **error)\n"
"{\n"
" GInitable *ret;\n"
' ret = g_initable_new (%sTYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", %sobject_manager_client_get_proxy_type, NULL);\n'
" if (ret != NULL)\n"
" return G_DBUS_OBJECT_MANAGER (ret);\n"
" else\n"
" return NULL;\n"
"}\n"
"\n" % (self.ns_lower, self.ns_upper, self.ns_lower)
)
self.outfile.write("\n")
# ---------------------------------------------------------------------------------------------------
def write_gtkdoc_deprecated_and_since_and_close(self, obj, f, indent):
if len(obj.since) > 0:
f.write("%*s *\n" "%*s * Since: %s\n" % (indent, "", indent, "", obj.since))
if obj.deprecated:
if isinstance(obj, dbustypes.Interface):
thing = "The D-Bus interface"
elif isinstance(obj, dbustypes.Method):
thing = "The D-Bus method"
elif isinstance(obj, dbustypes.Signal):
thing = "The D-Bus signal"
elif isinstance(obj, dbustypes.Property):
thing = "The D-Bus property"
else:
print_error('Cannot handle object "{}"'.format(obj))
f.write(
self.docbook_gen.expand(
"%*s *\n"
"%*s * Deprecated: %s has been deprecated.\n"
% (indent, "", indent, "", thing),
False,
)
)
f.write("%*s */\n" % (indent, ""))
# ---------------------------------------------------------------------------------------------------
def generate_interface_intro(self, i):
self.outfile.write(
"/* ------------------------------------------------------------------------\n"
" * Code for interface %s\n"
" * ------------------------------------------------------------------------\n"
" */\n"
"\n" % (i.name)
)
self.outfile.write(
self.docbook_gen.expand(
"/**\n"
" * SECTION:%s\n"
" * @title: %s\n"
" * @short_description: Generated C code for the %s D-Bus interface\n"
" *\n"
" * This section contains code for working with the #%s D-Bus interface in C.\n"
" */\n" % (i.camel_name, i.camel_name, i.name, i.name),
False,
)
)
self.outfile.write("\n")
def generate(self):
self.generate_body_preamble()
for i in self.ifaces:
self.generate_interface_intro(i)
self.generate_introspection_for_interface(i)
self.generate_interface(i)
self.generate_property_accessors(i)
self.generate_signal_emitters(i)
self.generate_method_calls(i)
self.generate_method_completers(i)
self.generate_proxy(i)
self.generate_skeleton(i)
if self.generate_objmanager:
self.generate_object()
self.generate_object_manager_client()
|
frida/glib
|
gio/gdbus-2.0/codegen/codegen.py
|
Python
|
lgpl-2.1
| 230,292
|
#
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/spack/spack
# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
"""
Fetch strategies are used to download source code into a staging area
in order to build it. They need to define the following methods:
* fetch()
This should attempt to download/check out source from somewhere.
* check()
Apply a checksum to the downloaded source code, e.g. for an archive.
May not do anything if the fetch method was safe to begin with.
* expand()
Expand (e.g., an archive) downloaded file to source.
* reset()
Restore original state of downloaded code. Used by clean commands.
This may just remove the expanded source and re-expand an archive,
or it may run something like git reset --hard.
* archive()
Archive a source directory, e.g. for creating a mirror.
"""
import os
import sys
import re
import shutil
import copy
from functools import wraps
from six import string_types, with_metaclass
import llnl.util.tty as tty
from llnl.util.filesystem import working_dir, mkdirp, join_path
import spack
import spack.error
import spack.util.crypto as crypto
import spack.util.pattern as pattern
from spack.util.executable import which
from spack.util.string import comma_or
from spack.version import Version, ver
from spack.util.compression import decompressor_for, extension
#: List of all fetch strategies, created by FetchStrategy metaclass.
all_strategies = []
def _needs_stage(fun):
"""Many methods on fetch strategies require a stage to be set
using set_stage(). This decorator adds a check for self.stage."""
@wraps(fun)
def wrapper(self, *args, **kwargs):
if not self.stage:
raise NoStageError(fun)
return fun(self, *args, **kwargs)
return wrapper
class FSMeta(type):
"""This metaclass registers all fetch strategies in a list."""
def __init__(cls, name, bases, dict):
type.__init__(cls, name, bases, dict)
if cls.enabled:
all_strategies.append(cls)
class FetchStrategy(with_metaclass(FSMeta, object)):
"""Superclass of all fetch strategies."""
enabled = False # Non-abstract subclasses should be enabled.
required_attributes = None # Attributes required in version() args.
def __init__(self):
# The stage is initialized late, so that fetch strategies can be
# constructed at package construction time. This is where things
# will be fetched.
self.stage = None
def set_stage(self, stage):
"""This is called by Stage before any of the fetching
methods are called on the stage."""
self.stage = stage
# Subclasses need to implement these methods
def fetch(self):
"""Fetch source code archive or repo.
Returns:
bool: True on success, False on failure.
"""
def check(self):
"""Checksum the archive fetched by this FetchStrategy."""
def expand(self):
"""Expand the downloaded archive."""
def reset(self):
"""Revert to freshly downloaded state.
For archive files, this may just re-expand the archive.
"""
def archive(self, destination):
"""Create an archive of the downloaded data for a mirror.
For downloaded files, this should preserve the checksum of the
original file. For repositories, it should just create an
expandable tarball out of the downloaded repository.
"""
@property
def cachable(self):
"""Whether fetcher is capable of caching the resource it retrieves.
This generally is determined by whether the resource is
identifiably associated with a specific package version.
Returns:
bool: True if can cache, False otherwise.
"""
def source_id(self):
"""A unique ID for the source.
The returned value is added to the content which determines the full
hash for a package using `str()`.
"""
raise NotImplementedError
def __str__(self): # Should be human readable URL.
return "FetchStrategy.__str___"
# This method is used to match fetch strategies to version()
# arguments in packages.
@classmethod
def matches(cls, args):
return any(k in args for k in cls.required_attributes)
@pattern.composite(interface=FetchStrategy)
class FetchStrategyComposite(object):
"""Composite for a FetchStrategy object.
Implements the GoF composite pattern.
"""
matches = FetchStrategy.matches
set_stage = FetchStrategy.set_stage
def source_id(self):
component_ids = tuple(i.source_id() for i in self)
if all(component_ids):
return component_ids
class URLFetchStrategy(FetchStrategy):
"""FetchStrategy that pulls source code from a URL for an archive,
checks the archive against a checksum,and decompresses the archive.
"""
enabled = True
required_attributes = ['url']
def __init__(self, url=None, digest=None, **kwargs):
super(URLFetchStrategy, self).__init__()
# If URL or digest are provided in the kwargs, then prefer
# those values.
self.url = kwargs.get('url', None)
if not self.url:
self.url = url
self.digest = next((kwargs[h] for h in crypto.hashes if h in kwargs),
None)
if not self.digest:
self.digest = digest
self.expand_archive = kwargs.get('expand', True)
self.extra_curl_options = kwargs.get('curl_options', [])
self._curl = None
self.extension = kwargs.get('extension', None)
if not self.url:
raise ValueError("URLFetchStrategy requires a url for fetching.")
@property
def curl(self):
if not self._curl:
self._curl = which('curl', required=True)
return self._curl
def source_id(self):
return self.digest
@_needs_stage
def fetch(self):
if self.archive_file:
tty.msg("Already downloaded %s" % self.archive_file)
return
save_file = None
partial_file = None
if self.stage.save_filename:
save_file = self.stage.save_filename
partial_file = self.stage.save_filename + '.part'
tty.msg("Fetching %s" % self.url)
if partial_file:
save_args = ['-C',
'-', # continue partial downloads
'-o',
partial_file] # use a .part file
else:
save_args = ['-O']
curl_args = save_args + [
'-f', # fail on >400 errors
'-D',
'-', # print out HTML headers
'-L', # resolve 3xx redirects
self.url,
]
if spack.insecure:
curl_args.append('-k')
if sys.stdout.isatty():
curl_args.append('-#') # status bar when using a tty
else:
curl_args.append('-sS') # just errors when not.
curl_args += self.extra_curl_options
# Run curl but grab the mime type from the http headers
curl = self.curl
with working_dir(self.stage.path):
headers = curl(*curl_args, output=str, fail_on_error=False)
if curl.returncode != 0:
# clean up archive on failure.
if self.archive_file:
os.remove(self.archive_file)
if partial_file and os.path.exists(partial_file):
os.remove(partial_file)
if curl.returncode == 22:
# This is a 404. Curl will print the error.
raise FailedDownloadError(
self.url, "URL %s was not found!" % self.url)
elif curl.returncode == 60:
# This is a certificate error. Suggest spack -k
raise FailedDownloadError(
self.url,
"Curl was unable to fetch due to invalid certificate. "
"This is either an attack, or your cluster's SSL "
"configuration is bad. If you believe your SSL "
"configuration is bad, you can try running spack -k, "
"which will not check SSL certificates."
"Use this at your own risk.")
else:
# This is some other curl error. Curl will print the
# error, but print a spack message too
raise FailedDownloadError(
self.url,
"Curl failed with error %d" % curl.returncode)
# Check if we somehow got an HTML file rather than the archive we
# asked for. We only look at the last content type, to handle
# redirects properly.
content_types = re.findall(r'Content-Type:[^\r\n]+', headers,
flags=re.IGNORECASE)
if content_types and 'text/html' in content_types[-1]:
tty.warn("The contents of ",
(self.archive_file if self.archive_file is not None
else "the archive"),
" look like HTML.",
"The checksum will likely be bad. If it is, you can use",
"'spack clean <package>' to remove the bad archive, then",
"fix your internet gateway issue and install again.")
if save_file:
os.rename(partial_file, save_file)
if not self.archive_file:
raise FailedDownloadError(self.url)
@property
def archive_file(self):
"""Path to the source archive within this stage directory."""
return self.stage.archive_file
@property
def cachable(self):
return bool(self.digest)
@_needs_stage
def expand(self):
if not self.expand_archive:
tty.msg("Skipping expand step for %s" % self.archive_file)
return
tty.msg("Staging archive: %s" % self.archive_file)
if not self.archive_file:
raise NoArchiveFileError(
"Couldn't find archive file",
"Failed on expand() for URL %s" % self.url)
if not self.extension:
self.extension = extension(self.archive_file)
decompress = decompressor_for(self.archive_file, self.extension)
# Expand all tarballs in their own directory to contain
# exploding tarballs.
tarball_container = os.path.join(self.stage.path,
"spack-expanded-archive")
mkdirp(tarball_container)
with working_dir(tarball_container):
decompress(self.archive_file)
# Check for an exploding tarball, i.e. one that doesn't expand
# to a single directory. If the tarball *didn't* explode,
# move contents up & remove the container directory.
#
# NOTE: The tar program on Mac OS X will encode HFS metadata
# in hidden files, which can end up *alongside* a single
# top-level directory. We ignore hidden files to accomodate
# these "semi-exploding" tarballs.
files = os.listdir(tarball_container)
non_hidden = [f for f in files if not f.startswith('.')]
if len(non_hidden) == 1:
expanded_dir = os.path.join(tarball_container, non_hidden[0])
if os.path.isdir(expanded_dir):
for f in files:
shutil.move(os.path.join(tarball_container, f),
os.path.join(self.stage.path, f))
os.rmdir(tarball_container)
if not files:
os.rmdir(tarball_container)
def archive(self, destination):
"""Just moves this archive to the destination."""
if not self.archive_file:
raise NoArchiveFileError("Cannot call archive() before fetching.")
shutil.copyfile(self.archive_file, destination)
@_needs_stage
def check(self):
"""Check the downloaded archive against a checksum digest.
No-op if this stage checks code out of a repository."""
if not self.digest:
raise NoDigestError(
"Attempt to check URLFetchStrategy with no digest.")
checker = crypto.Checker(self.digest)
if not checker.check(self.archive_file):
raise ChecksumError(
"%s checksum failed for %s" %
(checker.hash_name, self.archive_file),
"Expected %s but got %s" % (self.digest, checker.sum))
@_needs_stage
def reset(self):
"""
Removes the source path if it exists, then re-expands the archive.
"""
if not self.archive_file:
raise NoArchiveFileError(
"Tried to reset URLFetchStrategy before fetching",
"Failed on reset() for URL %s" % self.url)
# Remove everythigng but the archive from the stage
for filename in os.listdir(self.stage.path):
abspath = os.path.join(self.stage.path, filename)
if abspath != self.archive_file:
shutil.rmtree(abspath, ignore_errors=True)
# Expand the archive again
self.expand()
def __repr__(self):
url = self.url if self.url else "no url"
return "%s<%s>" % (self.__class__.__name__, url)
def __str__(self):
if self.url:
return self.url
else:
return "[no url]"
class CacheURLFetchStrategy(URLFetchStrategy):
"""The resource associated with a cache URL may be out of date."""
def __init__(self, *args, **kwargs):
super(CacheURLFetchStrategy, self).__init__(*args, **kwargs)
@_needs_stage
def fetch(self):
path = re.sub('^file://', '', self.url)
# check whether the cache file exists.
if not os.path.isfile(path):
raise NoCacheError('No cache of %s' % path)
# remove old symlink if one is there.
filename = self.stage.save_filename
if os.path.exists(filename):
os.remove(filename)
# Symlink to local cached archive.
os.symlink(path, filename)
# Remove link if checksum fails, or subsequent fetchers
# will assume they don't need to download.
if self.digest:
try:
self.check()
except ChecksumError:
os.remove(self.archive_file)
raise
# Notify the user how we fetched.
tty.msg('Using cached archive: %s' % path)
class VCSFetchStrategy(FetchStrategy):
def __init__(self, name, *rev_types, **kwargs):
super(VCSFetchStrategy, self).__init__()
self.name = name
# Set a URL based on the type of fetch strategy.
self.url = kwargs.get(name, None)
if not self.url:
raise ValueError(
"%s requires %s argument." % (self.__class__, name))
# Ensure that there's only one of the rev_types
if sum(k in kwargs for k in rev_types) > 1:
raise ValueError(
"Supply only one of %s to fetch with %s" % (
comma_or(rev_types), name
))
# Set attributes for each rev type.
for rt in rev_types:
setattr(self, rt, kwargs.get(rt, None))
@_needs_stage
def check(self):
tty.msg("No checksum needed when fetching with %s" % self.name)
@_needs_stage
def expand(self):
tty.debug("Source fetched with %s is already expanded." % self.name)
@_needs_stage
def archive(self, destination, **kwargs):
assert (extension(destination) == 'tar.gz')
assert (self.stage.source_path.startswith(self.stage.path))
tar = which('tar', required=True)
patterns = kwargs.get('exclude', None)
if patterns is not None:
if isinstance(patterns, string_types):
patterns = [patterns]
for p in patterns:
tar.add_default_arg('--exclude=%s' % p)
with working_dir(self.stage.path):
tar('-czf', destination, os.path.basename(self.stage.source_path))
def __str__(self):
return "VCS: %s" % self.url
def __repr__(self):
return "%s<%s>" % (self.__class__, self.url)
class GoFetchStrategy(VCSFetchStrategy):
"""Fetch strategy that employs the `go get` infrastructure.
Use like this in a package:
version('name',
go='github.com/monochromegane/the_platinum_searcher/...')
Go get does not natively support versions, they can be faked with git
"""
enabled = True
required_attributes = ('go', )
def __init__(self, **kwargs):
# Discards the keywords in kwargs that may conflict with the next
# call to __init__
forwarded_args = copy.copy(kwargs)
forwarded_args.pop('name', None)
super(GoFetchStrategy, self).__init__('go', **forwarded_args)
self._go = None
@property
def go_version(self):
vstring = self.go('version', output=str).split(' ')[2]
return Version(vstring)
@property
def go(self):
if not self._go:
self._go = which('go', required=True)
return self._go
@_needs_stage
def fetch(self):
tty.msg("Trying to get go resource:", self.url)
with working_dir(self.stage.path):
try:
os.mkdir('go')
except OSError:
pass
env = dict(os.environ)
env['GOPATH'] = os.path.join(os.getcwd(), 'go')
self.go('get', '-v', '-d', self.url, env=env)
def archive(self, destination):
super(GoFetchStrategy, self).archive(destination, exclude='.git')
@_needs_stage
def reset(self):
with working_dir(self.stage.source_path):
self.go('clean')
def __str__(self):
return "[go] %s" % self.url
class GitFetchStrategy(VCSFetchStrategy):
"""
Fetch strategy that gets source code from a git repository.
Use like this in a package:
version('name', git='https://github.com/project/repo.git')
Optionally, you can provide a branch, or commit to check out, e.g.:
version('1.1', git='https://github.com/project/repo.git', tag='v1.1')
You can use these three optional attributes in addition to ``git``:
* ``branch``: Particular branch to build from (default is master)
* ``tag``: Particular tag to check out
* ``commit``: Particular commit hash in the repo
"""
enabled = True
required_attributes = ('git', )
def __init__(self, **kwargs):
# Discards the keywords in kwargs that may conflict with the next call
# to __init__
forwarded_args = copy.copy(kwargs)
forwarded_args.pop('name', None)
super(GitFetchStrategy, self).__init__(
'git', 'tag', 'branch', 'commit', **forwarded_args)
self._git = None
self.submodules = kwargs.get('submodules', False)
@property
def git_version(self):
vstring = self.git('--version', output=str).lstrip('git version ')
return Version(vstring)
@property
def git(self):
if not self._git:
self._git = which('git', required=True)
# If the user asked for insecure fetching, make that work
# with git as well.
if spack.insecure:
self._git.add_default_env('GIT_SSL_NO_VERIFY', 'true')
return self._git
@property
def cachable(self):
return bool(self.commit or self.tag)
def source_id(self):
return self.commit or self.tag
def get_source_id(self):
if not self.branch:
return
output = self.git('ls-remote', self.url, self.branch, output=str)
if output:
return output.split()[0]
def fetch(self):
if self.stage.source_path:
tty.msg("Already fetched %s" % self.stage.source_path)
return
args = ''
if self.commit:
args = 'at commit %s' % self.commit
elif self.tag:
args = 'at tag %s' % self.tag
elif self.branch:
args = 'on branch %s' % self.branch
tty.msg("Trying to clone git repository: %s %s" % (self.url, args))
git = self.git
if self.commit:
# Need to do a regular clone and check out everything if
# they asked for a particular commit.
with working_dir(self.stage.path):
if spack.debug:
git('clone', self.url)
else:
git('clone', '--quiet', self.url)
with working_dir(self.stage.source_path):
if spack.debug:
git('checkout', self.commit)
else:
git('checkout', '--quiet', self.commit)
else:
# Can be more efficient if not checking out a specific commit.
args = ['clone']
if not spack.debug:
args.append('--quiet')
# If we want a particular branch ask for it.
if self.branch:
args.extend(['--branch', self.branch])
elif self.tag and self.git_version >= ver('1.8.5.2'):
args.extend(['--branch', self.tag])
# Try to be efficient if we're using a new enough git.
# This checks out only one branch's history
if self.git_version > ver('1.7.10'):
args.append('--single-branch')
with working_dir(self.stage.path):
cloned = False
# Yet more efficiency, only download a 1-commit deep tree
if self.git_version >= ver('1.7.1'):
try:
git(*(args + ['--depth', '1', self.url]))
cloned = True
except spack.error.SpackError:
# This will fail with the dumb HTTP transport
# continue and try without depth, cleanup first
pass
if not cloned:
args.append(self.url)
git(*args)
with working_dir(self.stage.source_path):
# For tags, be conservative and check them out AFTER
# cloning. Later git versions can do this with clone
# --branch, but older ones fail.
if self.tag and self.git_version < ver('1.8.5.2'):
# pull --tags returns a "special" error code of 1 in
# older versions that we have to ignore.
# see: https://github.com/git/git/commit/19d122b
if spack.debug:
git('pull', '--tags', ignore_errors=1)
git('checkout', self.tag)
else:
git('pull', '--quiet', '--tags', ignore_errors=1)
git('checkout', '--quiet', self.tag)
with working_dir(self.stage.source_path):
# Init submodules if the user asked for them.
if self.submodules:
if spack.debug:
git('submodule', 'update', '--init', '--recursive')
else:
git('submodule', '--quiet', 'update', '--init',
'--recursive')
def archive(self, destination):
super(GitFetchStrategy, self).archive(destination, exclude='.git')
@_needs_stage
def reset(self):
with working_dir(self.stage.source_path):
if spack.debug:
self.git('checkout', '.')
self.git('clean', '-f')
else:
self.git('checkout', '--quiet', '.')
self.git('clean', '--quiet', '-f')
def __str__(self):
return "[git] %s" % self.url
class SvnFetchStrategy(VCSFetchStrategy):
"""Fetch strategy that gets source code from a subversion repository.
Use like this in a package:
version('name', svn='http://www.example.com/svn/trunk')
Optionally, you can provide a revision for the URL:
version('name', svn='http://www.example.com/svn/trunk',
revision='1641')
"""
enabled = True
required_attributes = ['svn']
def __init__(self, **kwargs):
# Discards the keywords in kwargs that may conflict with the next call
# to __init__
forwarded_args = copy.copy(kwargs)
forwarded_args.pop('name', None)
super(SvnFetchStrategy, self).__init__(
'svn', 'revision', **forwarded_args)
self._svn = None
if self.revision is not None:
self.revision = str(self.revision)
@property
def svn(self):
if not self._svn:
self._svn = which('svn', required=True)
return self._svn
@property
def cachable(self):
return bool(self.revision)
def source_id(self):
return self.revision
def get_source_id(self):
output = self.svn('info', self.url, output=str)
if not output:
return None
lines = output.split('\n')
for line in lines:
if line.startswith('Revision:'):
return line.split()[-1]
@_needs_stage
def fetch(self):
if self.stage.source_path:
tty.msg("Already fetched %s" % self.stage.source_path)
return
tty.msg("Trying to check out svn repository: %s" % self.url)
args = ['checkout', '--force', '--quiet']
if self.revision:
args += ['-r', self.revision]
args.append(self.url)
with working_dir(self.stage.path):
self.svn(*args)
def _remove_untracked_files(self):
"""Removes untracked files in an svn repository."""
with working_dir(self.stage.source_path):
status = self.svn('status', '--no-ignore', output=str)
self.svn('status', '--no-ignore')
for line in status.split('\n'):
if not re.match('^[I?]', line):
continue
path = line[8:].strip()
if os.path.isfile(path):
os.unlink(path)
elif os.path.isdir(path):
shutil.rmtree(path, ignore_errors=True)
def archive(self, destination):
super(SvnFetchStrategy, self).archive(destination, exclude='.svn')
@_needs_stage
def reset(self):
self._remove_untracked_files()
with working_dir(self.stage.source_path):
self.svn('revert', '.', '-R')
def __str__(self):
return "[svn] %s" % self.url
class HgFetchStrategy(VCSFetchStrategy):
"""
Fetch strategy that gets source code from a Mercurial repository.
Use like this in a package:
version('name', hg='https://jay.grs.rwth-aachen.de/hg/lwm2')
Optionally, you can provide a branch, or revision to check out, e.g.:
version('torus',
hg='https://jay.grs.rwth-aachen.de/hg/lwm2', branch='torus')
You can use the optional 'revision' attribute to check out a
branch, tag, or particular revision in hg. To prevent
non-reproducible builds, using a moving target like a branch is
discouraged.
* ``revision``: Particular revision, branch, or tag.
"""
enabled = True
required_attributes = ['hg']
def __init__(self, **kwargs):
# Discards the keywords in kwargs that may conflict with the next call
# to __init__
forwarded_args = copy.copy(kwargs)
forwarded_args.pop('name', None)
super(HgFetchStrategy, self).__init__(
'hg', 'revision', **forwarded_args)
self._hg = None
@property
def hg(self):
""":returns: The hg executable
:rtype: Executable
"""
if not self._hg:
self._hg = which('hg', required=True)
# When building PythonPackages, Spack automatically sets
# PYTHONPATH. This can interfere with hg, which is a Python
# script. Unset PYTHONPATH while running hg.
self._hg.add_default_env('PYTHONPATH', '')
return self._hg
@property
def cachable(self):
return bool(self.revision)
def source_id(self):
return self.revision
def get_source_id(self):
output = self.hg('id', self.url, output=str)
if output:
return output.strip()
@_needs_stage
def fetch(self):
if self.stage.source_path:
tty.msg("Already fetched %s" % self.stage.source_path)
return
args = []
if self.revision:
args.append('at revision %s' % self.revision)
tty.msg("Trying to clone Mercurial repository:", self.url, *args)
args = ['clone']
if spack.insecure:
args.append('--insecure')
args.append(self.url)
if self.revision:
args.extend(['-r', self.revision])
with working_dir(self.stage.path):
self.hg(*args)
def archive(self, destination):
super(HgFetchStrategy, self).archive(destination, exclude='.hg')
@_needs_stage
def reset(self):
with working_dir(self.stage.path):
source_path = self.stage.source_path
scrubbed = "scrubbed-source-tmp"
args = ['clone']
if self.revision:
args += ['-r', self.revision]
args += [source_path, scrubbed]
self.hg(*args)
shutil.rmtree(source_path, ignore_errors=True)
shutil.move(scrubbed, source_path)
def __str__(self):
return "[hg] %s" % self.url
def from_url(url):
"""Given a URL, find an appropriate fetch strategy for it.
Currently just gives you a URLFetchStrategy that uses curl.
TODO: make this return appropriate fetch strategies for other
types of URLs.
"""
return URLFetchStrategy(url)
def from_kwargs(**kwargs):
"""Construct an appropriate FetchStrategy from the given keyword arguments.
Args:
**kwargs: dictionary of keyword arguments, e.g. from a
``version()`` directive in a package.
Returns:
fetch_strategy: The fetch strategy that matches the args, based
on attribute names (e.g., ``git``, ``hg``, etc.)
Raises:
FetchError: If no ``fetch_strategy`` matches the args.
"""
for fetcher in all_strategies:
if fetcher.matches(kwargs):
return fetcher(**kwargs)
# Raise an error in case we can't instantiate any known strategy
message = "Cannot instantiate any FetchStrategy"
long_message = message + " from the given arguments : {arguments}".format(
arguments=kwargs)
raise FetchError(message, long_message)
def args_are_for(args, fetcher):
fetcher.matches(args)
def for_package_version(pkg, version):
"""Determine a fetch strategy based on the arguments supplied to
version() in the package description."""
# If it's not a known version, extrapolate one.
if version not in pkg.versions:
url = pkg.url_for_version(version)
if not url:
raise InvalidArgsError(pkg, version)
return URLFetchStrategy(url)
# Grab a dict of args out of the package version dict
args = pkg.versions[version]
# Test all strategies against per-version arguments.
for fetcher in all_strategies:
if fetcher.matches(args):
return fetcher(**args)
# If nothing matched for a *specific* version, test all strategies
# against
for fetcher in all_strategies:
attrs = dict((attr, getattr(pkg, attr, None))
for attr in fetcher.required_attributes)
if 'url' in attrs:
attrs['url'] = pkg.url_for_version(version)
attrs.update(args)
if fetcher.matches(attrs):
return fetcher(**attrs)
raise InvalidArgsError(pkg, version)
def from_list_url(pkg):
"""If a package provides a URL which lists URLs for resources by
version, this can can create a fetcher for a URL discovered for
the specified package's version."""
if pkg.list_url:
try:
versions = pkg.fetch_remote_versions()
try:
url_from_list = versions[pkg.version]
digest = None
if pkg.version in pkg.versions:
digest = pkg.versions[pkg.version].get('md5', None)
return URLFetchStrategy(url=url_from_list, digest=digest)
except KeyError:
tty.msg("Can not find version %s in url_list" %
pkg.version)
except BaseException:
tty.msg("Could not determine url from list_url.")
class FsCache(object):
def __init__(self, root):
self.root = os.path.abspath(root)
def store(self, fetcher, relativeDst):
# skip fetchers that aren't cachable
if not fetcher.cachable:
return
# Don't store things that are already cached.
if isinstance(fetcher, CacheURLFetchStrategy):
return
dst = join_path(self.root, relativeDst)
mkdirp(os.path.dirname(dst))
fetcher.archive(dst)
def fetcher(self, targetPath, digest, **kwargs):
path = join_path(self.root, targetPath)
return CacheURLFetchStrategy(path, digest, **kwargs)
def destroy(self):
shutil.rmtree(self.root, ignore_errors=True)
class FetchError(spack.error.SpackError):
"""Superclass fo fetcher errors."""
class NoCacheError(FetchError):
"""Raised when there is no cached archive for a package."""
class FailedDownloadError(FetchError):
"""Raised wen a download fails."""
def __init__(self, url, msg=""):
super(FailedDownloadError, self).__init__(
"Failed to fetch file from URL: %s" % url, msg)
self.url = url
class NoArchiveFileError(FetchError):
""""Raised when an archive file is expected but none exists."""
class NoDigestError(FetchError):
"""Raised after attempt to checksum when URL has no digest."""
class InvalidArgsError(FetchError):
def __init__(self, pkg, version):
msg = ("Could not construct a fetch strategy for package %s at "
"version %s")
msg %= (pkg.name, version)
super(InvalidArgsError, self).__init__(msg)
class ChecksumError(FetchError):
"""Raised when archive fails to checksum."""
class NoStageError(FetchError):
"""Raised when fetch operations are called before set_stage()."""
def __init__(self, method):
super(NoStageError, self).__init__(
"Must call FetchStrategy.set_stage() before calling %s" %
method.__name__)
|
EmreAtes/spack
|
lib/spack/spack/fetch_strategy.py
|
Python
|
lgpl-2.1
| 36,034
|
# -*- coding: utf-8 -*-
from .baseapi import BaseAPI, POST, DELETE, PUT
class Record(BaseAPI):
"""
An object representing an DigitalOcean Domain Record.
Args:
type (str): The type of the DNS record (e.g. A, CNAME, TXT).
name (str): The host name, alias, or service being defined by the
record.
data (int): Variable data depending on record type.
priority (int): The priority for SRV and MX records.
port (int): The port for SRV records.
ttl (int): The time to live for the record, in seconds.
weight (int): The weight for SRV records.
flags (int): An unsigned integer between 0-255 used for CAA records.
tags (string): The parameter tag for CAA records. Valid values are
"issue", "wildissue", or "iodef"
"""
def __init__(self, domain_name=None, *args, **kwargs):
self.domain = domain_name if domain_name else ""
self.id = None
self.type = None
self.name = None
self.data = None
self.priority = None
self.port = None
self.ttl = None
self.weight = None
self.flags = None
self.tags = None
super(Record, self).__init__(*args, **kwargs)
@classmethod
def get_object(cls, api_token, domain, record_id):
"""
Class method that will return a Record object by ID and the domain.
"""
record = cls(token=api_token, domain=domain, id=record_id)
record.load()
return record
def create(self):
"""
Creates a new record for a domain.
Args:
type (str): The type of the DNS record (e.g. A, CNAME, TXT).
name (str): The host name, alias, or service being defined by the
record.
data (int): Variable data depending on record type.
priority (int): The priority for SRV and MX records.
port (int): The port for SRV records.
ttl (int): The time to live for the record, in seconds.
weight (int): The weight for SRV records.
flags (int): An unsigned integer between 0-255 used for CAA records.
tags (string): The parameter tag for CAA records. Valid values are
"issue", "wildissue", or "iodef"
"""
input_params = {
"type": self.type,
"data": self.data,
"name": self.name,
"priority": self.priority,
"port": self.port,
"ttl": self.ttl,
"weight": self.weight,
"flags": self.flags,
"tags": self.tags
}
data = self.get_data(
"domains/%s/records" % (self.domain),
type=POST,
params=input_params,
)
if data:
self.id = data['domain_record']['id']
def destroy(self):
"""
Destroy the record
"""
return self.get_data(
"domains/%s/records/%s" % (self.domain, self.id),
type=DELETE,
)
def save(self):
"""
Save existing record
"""
data = {
"type": self.type,
"data": self.data,
"name": self.name,
"priority": self.priority,
"port": self.port,
"ttl": self.ttl,
"weight": self.weight,
"flags": self.flags,
"tags": self.tags
}
return self.get_data(
"domains/%s/records/%s" % (self.domain, self.id),
type=PUT,
params=data
)
def load(self):
url = "domains/%s/records/%s" % (self.domain, self.id)
record = self.get_data(url)
if record:
record = record[u'domain_record']
# Setting the attribute values
for attr in record.keys():
setattr(self, attr, record[attr])
def __str__(self):
return "<Record: %s %s>" % (self.id, self.domain)
|
koalalorenzo/python-digitalocean
|
digitalocean/Record.py
|
Python
|
lgpl-3.0
| 4,016
|
# -*- coding: utf8 -*-
'''
Класс указателя стека.
val -- максимальное значение регистра.
Устанавливается по количеству максимальной допустимой памяти.
min_adr -- дно стека.
'''
class ClsRegSP:
def __init__(self, val=None, min_adr=None):
self.val = val
self.min_adr = min_adr
|
prospero78/pyPC
|
pak_pc/pak_cpu/pak_reg/mod_reg_sp.py
|
Python
|
lgpl-3.0
| 410
|
# -*- coding: utf-8 -*-
"""
Functions of initialization layers
"""
from neurolab import mynp as np
def init_rand(layer, min=-0.5, max=0.5, init_prop='w'):
"""
Initialize the specified property of the layer
random numbers within specified limits
:Parameters:
layer:
Initialized layer
min: float (default -0.5)
minimum value after the initialization
max: float (default 0.5)
maximum value after the initialization
init_prop: str (default 'w')
name of initialized property, must be in layer.np
"""
if init_prop not in layer.np:
raise ValueError('Layer not have attibute "' + init_prop + '"')
layer.np[init_prop] = np.random.uniform(min, max, layer.np[init_prop].shape)
def initwb_reg(layer):
"""
Initialize weights and bias
in the range defined by the activation function (transf.inp_active)
"""
active = layer.transf.inp_active[:]
if np.isinf(active[0]):
active[0] = -100.0
if np.isinf(active[1]):
active[1] = 100.0
min = active[0] / (2 * layer.cn)
max = active[1] / (2 * layer.cn)
init_rand(layer, min, max, 'w')
if 'b' in layer.np:
init_rand(layer, min, max, 'b')
class InitRand:
"""
Initialize the specified properties of the layer
random numbers within specified limits
"""
def __init__(self, minmax, init_prop):
"""
:Parameters:
minmax: list of float
[min, max] init range
init_prop: list of dicts
names of initialized propertis. Example ['w', 'b']
"""
self.min = minmax[0]
self.max = minmax[1]
self.properties = init_prop
def __call__(self, layer):
for property in self.properties:
init_rand(layer, self.min, self.max, property)
return
def init_zeros(layer):
"""
Set all layer properties of zero
"""
for k in layer.np:
layer.np[k].fill(0.0)
return
def midpoint(layer):
"""
Sets weight to the center of the input ranges
"""
mid = layer.inp_minmax.mean(axis=1)
for i, w in enumerate(layer.np['w']):
layer.np['w'][i] = mid.copy()
return
def initnw(layer):
"""
Nguyen-Widrow initialization function
"""
ci = layer.ci
cn = layer.cn
w_fix = 0.7 * cn ** (1. / ci)
w_rand = np.random.rand(cn, ci) * 2 - 1
# Normalize
if ci == 1:
w_rand = w_rand / np.abs(w_rand)
else:
w_rand = w_rand * np.sqrt(1. / np.square(w_rand).sum(axis=1).reshape(cn, 1))
w = w_fix * w_rand
b = np.array([0]) if cn == 1 else w_fix * np.linspace(-1, 1, cn) * np.sign(w[:, 0])
# Scaleble to inp_active
amin, amax = layer.transf.inp_active
amin = -1 if amin == -np.Inf else amin
amax = 1 if amax == np.Inf else amax
x = 0.5 * (amax - amin)
y = 0.5 * (amax + amin)
w = x * w
b = x * b + y
# Scaleble to inp_minmax
minmax = layer.inp_minmax.copy()
minmax[np.isneginf(minmax)] = -1
minmax[np.isinf(minmax)] = 1
x = 2. / (minmax[:, 1] - minmax[:, 0])
y = 1. - minmax[:, 1] * x
w = w * x
b += np.dot(w, y)
layer.np['w'][:] = w
layer.np['b'][:] = b
return
|
inferrna/neurolabcl
|
neurolab/init.py
|
Python
|
lgpl-3.0
| 3,292
|
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PySide2 (Qt v5.9.3)
#
# WARNING! All changes made in this file will be lost!
from PySide2 import QtCore
qt_resource_data = b"\
\x00\x00\x07\xa0\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x6d\
\x69\x6e\x75\x73\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\
\x2e\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\
\x32\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\
\x3c\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\
\x20\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\
\x20\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\
\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\
\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\
\x6f\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\
\x78\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\
\x72\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\
\x2f\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\
\x69\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\
\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\
\x3a\x74\x69\x74\x6c\x65\x3e\x3c\x2f\x64\x63\x3a\x74\x69\x74\x6c\
\x65\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x2f\x63\x63\x3a\x57\x6f\
\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x72\x64\x66\x3a\x52\x44\
\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\x61\x64\x61\x74\x61\x3e\
\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x64\x65\x66\x73\x36\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x73\
\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\x6d\x65\x64\x76\x69\x65\
\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\x65\x63\x6f\x6c\x6f\x72\
\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\x0a\x20\x20\x20\x20\x20\
\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x36\x36\
\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\
\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x31\x22\x0a\x20\x20\x20\
\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\x6c\x65\x72\x61\x6e\x63\
\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x72\x69\x64\
\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\
\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\x6f\x6c\x65\x72\x61\x6e\
\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x6f\x70\x61\x63\x69\x74\
\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\x61\x64\x6f\x77\x3d\x22\
\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\x64\x74\x68\x3d\x22\x31\
\x38\x36\x33\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x68\x65\x69\x67\x68\x74\
\x3d\x22\x31\x30\x32\x35\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x34\x22\x0a\x20\x20\x20\
\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\x3d\x22\x66\x61\x6c\x73\
\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x37\x33\x38\x33\x30\x34\x32\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x63\x78\x3d\x22\x2d\x31\x30\x38\x2e\x32\x37\x32\x37\x37\x22\x0a\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x79\
\x3d\x22\x32\x30\x39\x2e\x34\x34\x35\x30\x34\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x79\x3d\
\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\x78\x69\x6d\x69\
\x7a\x65\x64\x3d\x22\x31\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\x74\x2d\x6c\x61\
\x79\x65\x72\x3d\x22\x67\x38\x33\x31\x22\x20\x2f\x3e\x0a\x20\x20\
\x3c\x67\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x67\x38\x33\x31\
\x22\x0a\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x73\x74\
\x72\x6f\x6b\x65\x3a\x23\x62\x33\x62\x33\x62\x33\x3b\x73\x74\x72\
\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3a\x72\x6f\x75\x6e\
\x64\x22\x3e\x0a\x20\x20\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\
\x20\x20\x20\x20\x20\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x6f\
\x64\x65\x74\x79\x70\x65\x73\x3d\x22\x63\x63\x22\x0a\x20\x20\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\
\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\
\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\
\x70\x61\x74\x68\x38\x31\x32\x2d\x33\x22\x0a\x20\x20\x20\x20\x20\
\x20\x20\x64\x3d\x22\x6d\x20\x31\x33\x34\x2e\x39\x36\x31\x34\x37\
\x2c\x39\x35\x2e\x35\x39\x34\x34\x38\x37\x20\x2d\x37\x39\x2e\x37\
\x39\x35\x31\x30\x38\x2c\x30\x2e\x30\x39\x34\x35\x22\x0a\x20\x20\
\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\
\x3a\x6e\x6f\x6e\x65\x3b\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\
\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x23\
\x62\x33\x62\x33\x62\x33\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\
\x64\x74\x68\x3a\x31\x36\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\
\x6e\x65\x63\x61\x70\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x6d\x69\x74\x65\
\x72\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\
\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x64\x61\x73\
\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x22\x20\x2f\x3e\
\x0a\x20\x20\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x08\x1f\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x65\
\x64\x69\x74\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\
\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\
\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\x3c\
\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\x20\
\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\
\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\
\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\
\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\
\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\
\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\
\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\
\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\
\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\
\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\
\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\
\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\
\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\
\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\
\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\
\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\
\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\
\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\
\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\
\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\
\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\
\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\
\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\
\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\
\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\
\x64\x74\x68\x3d\x22\x31\x38\x36\x33\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\
\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x30\x32\x35\x22\x0a\x20\x20\
\x20\x20\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\
\x34\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\
\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x32\x2e\x34\
\x35\x38\x33\x33\x33\x33\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x78\x3d\x22\x32\x35\x2e\x38\x35\x32\
\x33\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x63\x79\x3d\x22\x31\x30\x32\x2e\x30\x31\x33\x30\x31\x22\x0a\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\
\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\
\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\x78\
\x69\x6d\x69\x7a\x65\x64\x3d\x22\x31\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\x74\
\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\x20\x2f\x3e\
\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x73\x74\
\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\x39\x39\x39\x39\
\x39\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x23\x39\x39\x39\x39\x39\x39\
\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x31\x2e\
\x33\x33\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\x20\x20\x20\x64\
\x3d\x22\x4d\x20\x32\x34\x2e\x34\x30\x36\x37\x38\x2c\x31\x34\x38\
\x2e\x39\x32\x34\x37\x33\x20\x56\x20\x31\x33\x33\x2e\x39\x31\x37\
\x32\x38\x20\x4c\x20\x36\x38\x2e\x37\x35\x34\x36\x37\x32\x2c\x38\
\x39\x2e\x35\x38\x34\x32\x20\x31\x31\x33\x2e\x31\x30\x32\x35\x37\
\x2c\x34\x35\x2e\x32\x35\x31\x31\x32\x33\x20\x6c\x20\x31\x34\x2e\
\x39\x37\x38\x37\x35\x2c\x31\x35\x2e\x30\x32\x31\x33\x35\x39\x20\
\x31\x34\x2e\x39\x37\x38\x37\x34\x2c\x31\x35\x2e\x30\x32\x31\x33\
\x36\x20\x2d\x34\x34\x2e\x33\x33\x33\x39\x38\x38\x2c\x34\x34\x2e\
\x33\x31\x39\x31\x37\x38\x20\x2d\x34\x34\x2e\x33\x33\x34\x2c\x34\
\x34\x2e\x33\x31\x39\x31\x38\x20\x48\x20\x33\x39\x2e\x33\x39\x39\
\x34\x32\x32\x20\x32\x34\x2e\x34\x30\x36\x37\x38\x20\x5a\x20\x6d\
\x20\x31\x31\x32\x2e\x32\x38\x31\x38\x31\x2c\x2d\x39\x37\x2e\x33\
\x35\x36\x38\x30\x32\x20\x2d\x31\x35\x2e\x30\x35\x31\x35\x2c\x2d\
\x31\x35\x2e\x31\x31\x34\x31\x30\x35\x20\x38\x2e\x36\x30\x32\x37\
\x37\x2c\x2d\x38\x2e\x32\x36\x30\x38\x31\x31\x20\x63\x20\x35\x2e\
\x34\x30\x30\x30\x38\x2c\x2d\x35\x2e\x31\x38\x35\x34\x32\x36\x20\
\x39\x2e\x37\x33\x32\x34\x31\x2c\x2d\x38\x2e\x32\x36\x30\x38\x30\
\x39\x20\x31\x31\x2e\x36\x33\x37\x31\x31\x2c\x2d\x38\x2e\x32\x36\
\x30\x38\x30\x39\x20\x34\x2e\x32\x32\x31\x30\x32\x2c\x30\x20\x32\
\x36\x2e\x35\x32\x39\x38\x31\x2c\x32\x32\x2e\x33\x33\x34\x36\x32\
\x34\x20\x32\x36\x2e\x35\x32\x39\x38\x31\x2c\x32\x36\x2e\x35\x36\
\x30\x35\x35\x31\x20\x30\x2c\x31\x2e\x39\x35\x37\x36\x32\x31\x20\
\x2d\x33\x2e\x30\x31\x30\x39\x32\x2c\x36\x2e\x31\x35\x38\x36\x33\
\x32\x20\x2d\x38\x2e\x33\x33\x33\x33\x33\x2c\x31\x31\x2e\x36\x32\
\x37\x31\x36\x38\x20\x6c\x20\x2d\x38\x2e\x33\x33\x33\x33\x34\x2c\
\x38\x2e\x35\x36\x32\x31\x31\x32\x20\x7a\x22\x0a\x20\x20\x20\x20\
\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x38\x31\x37\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\
\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\
\x22\x30\x22\x20\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x07\xa3\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x73\
\x71\x75\x61\x72\x65\x73\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\
\x22\x30\x2e\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\
\x2c\x20\x32\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\
\x20\x20\x3c\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\
\x20\x69\x64\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\
\x0a\x20\x20\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\
\x20\x20\x20\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\
\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\
\x3d\x22\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\
\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\
\x67\x2b\x78\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\
\x70\x65\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\
\x66\x3a\x72\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\
\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\
\x63\x6d\x69\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\
\x67\x65\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\
\x64\x63\x3a\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\
\x20\x20\x3c\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\
\x20\x3c\x2f\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\
\x6d\x65\x74\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\
\x73\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\
\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\
\x3a\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\
\x70\x61\x67\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\
\x66\x66\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\
\x6f\x6c\x6f\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\
\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\
\x79\x3d\x22\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\
\x74\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\
\x20\x20\x20\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\
\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\
\x64\x65\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\
\x61\x67\x65\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\
\x65\x73\x68\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\
\x2d\x77\x69\x64\x74\x68\x3d\x22\x31\x38\x36\x33\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\
\x6f\x77\x2d\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x30\x32\x35\x22\
\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\
\x69\x65\x77\x34\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\
\x72\x69\x64\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\
\x31\x2e\x32\x32\x39\x31\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x34\x37\
\x2e\x39\x39\x39\x39\x39\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x63\x79\x3d\x22\x39\x36\x2e\x30\x30\
\x30\x30\x30\x33\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x77\x69\x6e\x64\x6f\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\
\x6f\x77\x2d\x6d\x61\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x31\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\
\x75\x72\x72\x65\x6e\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\
\x67\x32\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\
\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\
\x23\x39\x39\x39\x39\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\
\x69\x64\x74\x68\x3a\x31\x2e\x33\x33\x33\x33\x33\x33\x33\x37\x22\
\x0a\x20\x20\x20\x20\x20\x64\x3d\x22\x4d\x20\x32\x36\x2e\x34\x34\
\x30\x36\x37\x38\x2c\x39\x36\x20\x56\x20\x32\x34\x20\x68\x20\x37\
\x32\x2e\x30\x30\x30\x30\x30\x34\x20\x37\x31\x2e\x39\x39\x39\x39\
\x39\x38\x20\x76\x20\x37\x32\x20\x37\x32\x20\x48\x20\x39\x38\x2e\
\x34\x34\x30\x36\x38\x32\x20\x32\x36\x2e\x34\x34\x30\x36\x37\x38\
\x20\x5a\x20\x6d\x20\x36\x34\x2e\x30\x30\x30\x30\x30\x34\x2c\x33\
\x32\x20\x76\x20\x2d\x32\x34\x20\x68\x20\x2d\x32\x34\x2e\x30\x30\
\x30\x30\x30\x34\x20\x2d\x32\x34\x20\x76\x20\x32\x34\x20\x32\x34\
\x20\x68\x20\x32\x34\x20\x32\x34\x2e\x30\x30\x30\x30\x30\x34\x20\
\x7a\x20\x6d\x20\x36\x33\x2e\x39\x39\x39\x39\x39\x38\x2c\x30\x20\
\x76\x20\x2d\x32\x34\x20\x68\x20\x2d\x32\x34\x20\x2d\x32\x34\x20\
\x76\x20\x32\x34\x20\x32\x34\x20\x68\x20\x32\x34\x20\x32\x34\x20\
\x7a\x20\x4d\x20\x39\x30\x2e\x34\x34\x30\x36\x38\x32\x2c\x36\x34\
\x20\x56\x20\x34\x30\x20\x68\x20\x2d\x32\x34\x2e\x30\x30\x30\x30\
\x30\x34\x20\x2d\x32\x34\x20\x76\x20\x32\x34\x20\x32\x34\x20\x68\
\x20\x32\x34\x20\x32\x34\x2e\x30\x30\x30\x30\x30\x34\x20\x7a\x20\
\x6d\x20\x36\x33\x2e\x39\x39\x39\x39\x39\x38\x2c\x30\x20\x56\x20\
\x34\x30\x20\x68\x20\x2d\x32\x34\x20\x2d\x32\x34\x20\x76\x20\x32\
\x34\x20\x32\x34\x20\x68\x20\x32\x34\x20\x32\x34\x20\x7a\x22\x0a\
\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x38\x31\x37\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\
\x75\x72\x65\x3d\x22\x30\x22\x20\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\
\x3e\x0a\
\x00\x00\x05\xb8\
\x00\
\x00\x13\xd1\x78\x9c\xdd\x58\x5b\x6f\xdb\x36\x14\x7e\xef\xaf\x10\
\xd4\x97\x16\xb3\x24\x5e\x25\x52\xb5\x53\x6c\x28\x8a\x0e\x68\x5f\
\xb6\xee\xfa\xa6\x48\xb4\xa3\x46\x16\x0d\x8a\x8e\x93\xfe\xfa\x1d\
\xea\x6e\xc7\x59\xbb\x21\xed\xb0\x0a\xb0\x2d\x7e\xe7\x90\x3c\xfc\
\xce\x8d\xf0\xf2\xe5\xed\xb6\xf2\x6e\x94\x69\x4a\x5d\xaf\x7c\x1c\
\x22\xdf\x53\x75\xae\x8b\xb2\xde\xac\xfc\x5f\xde\xbf\x0e\x84\xef\
\x35\x36\xab\x8b\xac\xd2\xb5\x5a\xf9\xb5\xf6\x5f\x5e\x3c\x59\x36\
\x37\x9b\x27\x9e\xe7\xc1\xe4\xba\x49\x8b\x7c\xe5\x5f\x59\xbb\x4b\
\xa3\x68\xb7\x37\x55\xa8\xcd\x26\x2a\xf2\x48\x55\x6a\xab\x6a\xdb\
\x44\x38\xc4\x91\x3f\xa9\xe7\x93\x7a\x6e\x54\x66\xcb\x1b\x95\xeb\
\xed\x56\xd7\x4d\x3b\xb3\x6e\x9e\xce\x94\x4d\xb1\x1e\xb5\x0f\x87\
\x43\x78\xa0\xad\x12\x96\x52\x46\x88\x44\x84\x04\xa0\x11\x34\x77\
\xb5\xcd\x6e\x83\xe3\xa9\x60\xe3\xb9\xa9\x04\x21\x14\x81\x6c\xd2\
\xfc\x3c\xad\xb4\x01\x56\x76\xf0\x19\xd5\x07\x20\x6c\xf4\xde\xe4\
\x6a\x0d\xf3\x54\x58\x2b\x1b\xbd\x7a\xff\x6a\x14\x06\x28\x2c\x6c\
\x31\x5b\xa6\xac\xaf\x9b\x3c\xdb\xa9\xa3\x5d\x07\xb0\x63\x20\xdb\
\xaa\x66\x97\xe5\xaa\x89\x06\xbc\x9d\x7f\x28\x0b\x7b\xb5\xf2\x99\
\x68\x47\x57\xaa\xdc\x5c\xd9\x71\x78\x53\xaa\xc3\x0f\xfa\x76\xe5\
\x23\x0f\x79\x4c\x78\x3d\x5c\x16\x2b\x1f\x8e\x41\x3a\x9d\xc9\xcf\
\xb8\x93\xf6\xcb\xa7\xa3\x04\x85\x92\x84\xc4\x7b\xc6\x73\xaa\x04\
\x2a\x16\x1e\x41\x38\x09\x90\x08\x50\xfc\xbc\x9d\x32\x9c\x2b\x2d\
\x74\xee\x0c\x5d\xf9\x97\x55\x96\x5f\xeb\xbd\x0d\x1d\x5d\x17\xa0\
\xb3\xdc\x2a\x9b\x15\x99\xcd\x9c\x7e\x67\xc2\x80\x60\xd2\x6a\x80\
\x0e\xb8\x2d\xfd\xe9\xd5\xeb\x6e\x04\xe3\x3c\x4f\x7f\xd3\xe6\xba\
\x1f\xc2\xe3\x14\xb2\x4b\x58\x77\xe5\xfb\x17\x23\xbc\x2c\xf2\x14\
\x88\xde\x66\xf6\xa2\xdc\x66\x1b\xe5\x7c\xf4\x1d\x10\xbb\x8c\x26\
\xc1\x91\xb2\xbd\xdb\xa9\x69\xd1\x6e\x59\xa3\x3a\x8f\x9d\x0d\xdb\
\x22\xdf\x96\x6e\x52\xf4\xb3\x2d\xab\xea\x47\xb7\x89\xef\x45\x27\
\x8b\x96\xb6\x52\x13\xb8\x8c\x7a\xeb\xfb\xb3\x45\xb3\xc3\x2d\xa3\
\xe1\xec\xed\xa8\x50\xeb\x66\xa2\xc5\x8d\x30\x1a\x28\xd9\x66\xe6\
\x5a\x99\x61\xa3\xd1\x37\x8d\xd5\xf9\xb5\xd3\xfe\xde\x18\x7d\xc0\
\x6f\x21\x1d\x8d\xf5\x07\x35\x6d\x4a\x48\xb2\x95\x9f\xed\xad\x1e\
\x41\xa3\xd6\x7f\x38\x5f\xa2\x39\xf2\xfb\x31\xf2\xe0\x8a\x8d\xbd\
\xab\x80\x1a\x0d\x31\xb1\xae\xf4\x21\xbd\x29\x9b\xf2\xb2\x52\xfe\
\x3d\xc3\xca\xa6\x35\x6d\xe5\x5b\xb3\x57\xa3\x8f\x96\xbb\xcc\x5e\
\x4d\x8c\xbb\x6d\x1c\xc2\xb8\x14\xfe\x04\x03\xfa\xce\x03\x73\x16\
\xf0\xf1\xde\x7a\x1c\xde\x02\xde\xbe\x06\x98\x84\x7c\x06\x77\xe8\
\xa0\xfa\xd1\x9b\x2d\xd2\x5b\xba\x06\x3f\x05\x66\x5f\xa9\x54\xdd\
\xa8\x5a\x17\xc5\x8b\xc6\x1a\x7d\xad\xd2\xa7\xa8\x7d\xfa\x61\xd0\
\xe6\x4f\x0a\x35\x6e\x67\x67\x8b\x58\x93\xd5\x8d\x8b\x1c\x48\x94\
\x3c\xab\xd4\x33\x14\x8a\xe7\x1d\x5a\x65\x56\x3d\xeb\xcc\x79\x3e\
\xc6\x00\x38\xb4\xf5\x53\xe7\x5c\xe7\xc1\xf6\x6d\xcc\x0b\x97\x14\
\x85\xcb\xc6\x6e\x8b\x1d\xc4\x4f\xae\x2b\x6d\x56\xfe\xd3\x75\xfb\
\xf4\x7b\x5f\x6a\x53\x28\x33\x88\xe2\xf6\x39\x12\x69\x28\x01\x10\
\x89\x90\xad\x3d\xac\x2f\x3f\xa8\xdc\x5a\x5d\x29\x30\xce\x45\x2f\
\x1e\xbc\xb9\x31\x70\xb4\x73\xf8\xbe\x2c\xd4\x39\xc1\xe8\x43\x67\
\xde\xb8\xd1\x59\x69\x73\x95\x15\xfa\xb0\xf2\xc9\xa9\xf0\x50\xd6\
\x20\x08\xfa\xaa\x84\x45\x4c\x1f\xd0\x18\x2a\x15\x46\x84\xfb\x53\
\xf0\x8f\x44\x0d\x71\xd1\x5c\xe9\x83\x3b\x09\x78\x34\xab\x1a\x75\
\xba\xda\x47\xad\xc1\x47\x71\x98\xc4\x88\xe1\x38\x39\x15\xe7\x50\
\xfb\x02\xc6\xc3\x98\x52\x22\xf0\x3d\x29\x1c\x8f\x40\x28\x09\x41\
\x25\x7f\xc0\x4e\x58\x80\xdf\x5b\xb6\x97\xb9\xe9\x0f\xc9\xb6\xd9\
\x6d\xb9\x2d\x3f\xaa\x62\x72\xd5\xb4\xef\xde\x18\xc8\xcf\xa0\xca\
\xee\x14\xf8\x79\xc3\x38\x63\x7d\x28\x2d\x37\x13\x17\x1b\x86\xf9\
\x58\x07\x36\xf3\x14\xed\x66\x7c\x32\xb9\x28\xba\x97\x5c\x0b\xe4\
\xbd\x71\x9d\xe0\x57\xf7\xf5\x06\xba\xc2\x9f\x33\x95\xc9\x40\x5d\
\xd7\x10\x55\xda\x04\x60\xea\x4d\x66\xf7\x46\x4d\x81\x70\x92\x64\
\x69\x0d\x77\x80\x59\x31\x3c\xb1\xe6\x54\xf3\xc5\xc3\x89\xb9\x5e\
\xe7\xf9\xbd\xc4\xdc\xdd\x0e\x40\x55\x82\x4d\xd9\x2e\xbd\xdc\x5b\
\x3b\xc7\x3e\xe8\xb2\x4e\xa1\x3c\x2b\x33\xa0\x7d\xec\xa6\xf8\xf8\
\xf8\x5b\x8f\x86\x0c\x11\xcc\x13\xbc\xa0\x34\x44\x31\x42\x92\x7a\
\x98\x87\x82\x24\x8c\xc4\x72\x11\xd0\x90\x70\x46\xa8\xf0\x24\x04\
\x14\x49\x30\x59\x04\x2c\xc4\x0c\x27\x3c\xf6\x44\x28\x12\x8e\x25\
\x40\x49\x48\x98\x40\x09\x03\x88\x08\xca\x31\x75\x10\x46\x08\x73\
\xe6\xdf\x77\x83\xa0\xe4\x1f\x50\xfc\x38\x3c\xc6\xf1\x7f\xc0\x23\
\x0a\x29\x67\x54\x22\x39\xd2\xc1\x81\x21\x9e\x48\xca\x29\x14\x6c\
\x09\xe9\x29\x63\x57\xbd\x89\x24\x49\xbc\x08\x64\x48\xb1\x90\x1c\
\x66\xc2\xf5\x82\x48\x2e\xdc\xbc\x58\x62\x41\x29\x54\x76\x07\x30\
\x57\xfe\x63\x82\x24\xe7\xfc\x2c\xb3\xec\x2b\x33\x7b\xb6\x75\x7c\
\x79\x66\x81\x16\x44\x58\xcc\x80\xd9\x9e\x18\xcf\x35\xa0\x84\x62\
\x39\x06\x68\xe2\x25\xa1\xa3\x1f\x33\x07\x11\x21\xe3\x64\x24\x9b\
\x2f\x82\x9e\x63\x79\x96\xc6\xf8\x2b\xd3\x58\xb0\x2f\x4b\xe3\xbb\
\xf3\x34\x8a\x90\x09\x29\x05\x5f\x90\x38\xe4\x1c\xc7\x58\x78\x14\
\x87\x04\x63\x24\xd9\x02\xa4\x09\x86\x7e\xc5\x3d\x0a\xc9\x2f\x11\
\x63\xc9\x42\x86\x52\xc0\x15\x05\x9f\x67\x4d\xfc\x0b\xd6\x96\xd1\
\xe6\xb4\x9e\xcf\xae\x1a\xb3\xfb\x45\x88\x50\x9c\x40\x75\x59\x04\
\xd0\xa0\x84\x48\x88\x94\xcf\xfd\xe3\x16\x80\xc7\xa6\x71\xa6\x3d\
\xc8\xc9\xa7\xb3\x0d\xe0\x22\x6c\xca\x5b\x58\x1d\x0e\x9a\xb0\x98\
\x2c\xa0\x1f\x2c\xb0\xab\x7b\x49\x42\x11\x25\x71\x5b\xdc\x08\xbc\
\x10\x3e\x6d\x37\xdc\xfd\x46\xb2\xc7\x08\x30\x70\xd4\x89\x04\x68\
\x87\x0c\xc2\x12\xb8\x96\x73\xc6\xa0\x83\xd2\x90\x22\xa0\x71\x1e\
\x67\x43\xff\x17\x21\x26\x3c\xe1\x9c\xce\x64\xc3\xed\x01\xee\x76\
\x52\xde\xaf\xaa\x6e\x57\xc6\x84\xb8\xdf\x8f\x46\x13\xdb\xe0\x3b\
\xe9\x28\x5d\x54\x9e\x5c\xfb\x12\x4a\x10\x58\x7c\x1a\x7a\x46\xef\
\xeb\xe2\xef\x63\xaf\x1d\x54\xd0\xe3\x6d\xca\x42\x2e\xdb\x67\x90\
\x15\x19\x5c\x90\x8c\xc9\xee\x8e\xf6\x9c\xac\xdb\x65\x25\xb4\xff\
\xf6\x42\x97\x76\x17\xc7\xc6\x73\x16\x7b\x9d\xe6\x3c\xc9\x3e\x97\
\x62\xec\x42\xde\x75\xa3\xc7\xe5\x38\xa0\x9f\xc3\xf2\xac\xdf\x7c\
\xdb\x2c\x13\x0a\x70\xc2\x11\x7f\x64\x96\xe3\x4f\xb3\x7c\x54\x34\
\xbf\x6d\x96\xa1\x66\xc7\x28\x8e\x8f\xba\xd5\xa3\xb0\x1c\xf0\x4f\
\xf3\x7c\xd4\xe3\xff\x87\x3c\xf7\x2d\xa6\xfd\x59\xba\x7f\x42\x2e\
\x9e\xfc\x05\xfb\x7d\x9c\xcf\
\x00\x00\x06\xbd\
\x00\
\x00\x17\x90\x78\x9c\xcd\x58\x5b\x6f\xdb\xc8\x15\x7e\xcf\xaf\x20\
\x98\x97\x18\x15\x87\x73\xbf\x30\x92\x17\x2d\x82\xc5\x16\xd8\xbe\
\xb4\xdb\xeb\x4b\xc1\x90\x63\x99\x6b\x8a\x23\x90\x94\x65\xe7\xd7\
\xf7\x0c\x25\xde\x2c\x2a\xcd\x22\x4e\x53\x1a\xb6\x39\xe7\x9c\x99\
\x39\xf3\x9d\xeb\x70\xfd\xc3\xd3\xae\x0c\x1e\x6d\xdd\x14\xae\xda\
\x84\x04\xe1\x30\xb0\x55\xe6\xf2\xa2\xda\x6e\xc2\xbf\xfe\xf2\x63\
\xa4\xc3\xa0\x69\xd3\x2a\x4f\x4b\x57\xd9\x4d\x58\xb9\xf0\x87\xdb\
\x37\xeb\xe6\x71\xfb\x26\x08\x02\x98\x5c\x35\x49\x9e\x6d\xc2\xfb\
\xb6\xdd\x27\x71\xbc\x3f\xd4\x25\x72\xf5\x36\xce\xb3\xd8\x96\x76\
\x67\xab\xb6\x89\x09\x22\x71\x38\x8a\x67\xa3\x78\x56\xdb\xb4\x2d\
\x1e\x6d\xe6\x76\x3b\x57\x35\xdd\xcc\xaa\x79\x3b\x11\xae\xf3\xbb\
\x41\xfa\x78\x3c\xa2\x23\xeb\x84\x88\x31\x26\xc6\x34\xa6\x34\x02\
\x89\xa8\x79\xae\xda\xf4\x29\x9a\x4f\x05\x1d\x97\xa6\x52\x8c\x71\
\x0c\xbc\x51\xf2\xcb\xa4\x92\x06\x50\xd9\xc3\xef\x20\xde\x13\x50\
\xe3\x0e\x75\x66\xef\x60\x9e\x45\x95\x6d\xe3\x0f\xbf\x7c\x18\x98\
\x11\x46\x79\x9b\x4f\x96\x29\xaa\x87\x26\x4b\xf7\x76\xb6\x6b\x4f\
\x3c\x21\x90\xee\x6c\xb3\x4f\x33\xdb\xc4\x3d\xbd\x9b\x7f\x2c\xf2\
\xf6\x7e\x13\x72\xdd\x8d\xee\x6d\xb1\xbd\x6f\x87\xe1\x63\x61\x8f\
\x7f\x70\x4f\x9b\x10\x07\x38\xe0\x3a\x38\x93\x8b\x7c\x13\xc2\x31\
\xe8\x49\x66\xb4\x33\x39\x71\xcf\xcb\x27\x03\x07\x23\x43\x11\x0d\
\xde\x89\x8c\x59\x8d\xf3\x55\x40\x31\x51\x11\xd6\x11\x96\x37\xdd\
\x94\xfe\x5c\x49\xee\x32\xaf\xe8\x26\xdc\xdf\xfd\xbb\x6d\x90\xc7\
\xea\x16\x04\xd6\x3b\xdb\xa6\x79\xda\xa6\x5e\xf8\xb4\x7f\x4f\x21\
\xb4\x93\x00\x19\xb0\x59\xf2\xe7\x0f\x3f\x9e\x46\x30\xce\xb2\xe4\
\xef\xae\x7e\x38\x0f\xe1\xf1\x02\xe9\x47\x77\x80\xf3\x85\xb7\x03\
\x79\x9d\x67\x09\xa0\xbc\x4b\xdb\xdb\x62\x97\x6e\xad\x37\xd0\xef\
\x00\xd5\x75\x3c\x32\x66\xc2\xed\xf3\xde\x8e\x8b\x9e\x96\xad\xed\
\xc9\x5c\x8b\x3e\x9b\x67\xbb\xc2\x4f\x8a\xff\xd2\x16\x65\xf9\x47\
\xbf\x49\x18\xc4\x2f\x16\x2d\xda\xd2\x8e\xc4\x75\x7c\xd6\xfe\x7c\
\xb6\x78\x72\xb8\x75\xdc\x9f\xbd\x1b\xe5\xf6\xae\x19\x61\xf1\x23\
\x82\x7b\x48\x76\x69\xfd\x60\xeb\x7e\xa3\xc1\x30\x4d\xeb\xb2\x07\
\x2f\xfd\xfb\xba\x76\x47\xf2\x33\xc4\x62\xdd\x86\xbd\x98\xab\x0b\
\x88\xb0\x4d\x98\x1e\x5a\x37\x10\x6b\x7b\xf7\x4f\x6f\x48\x3c\xa5\
\xfc\x63\x4e\xb9\xba\x62\xd3\x3e\x97\x00\x8d\x03\x87\xb8\x2b\xdd\
\x31\x79\x2c\x9a\xe2\x63\x69\xc3\x0b\xc5\x8a\xa6\x53\x6d\x13\xb6\
\xf5\xc1\x0e\x36\x5a\xef\xd3\xf6\x7e\x44\xdc\x6f\xe3\x29\x5c\x18\
\x1d\x8e\x64\xa0\xfe\x29\x00\x75\x56\xf0\x1b\xfc\x1c\x08\x78\x8b\
\x44\xf7\x1a\x11\x8a\xc4\x84\x7c\xa2\xf6\xa2\x9f\x82\xc9\x22\x67\
\x4d\xef\xc0\x4e\x51\x7d\x28\x6d\x62\x1f\x6d\xe5\xf2\xfc\x7d\xd3\
\xd6\xee\xc1\x26\x6f\x71\xf7\x9c\x87\x51\x17\x3c\x09\x24\xb8\x7d\
\x3b\x59\xa4\xad\xd3\xaa\xf1\x9e\x03\x51\x92\xa5\xa5\x7d\x87\x91\
\xbe\x39\x51\xcb\xb4\xb5\xef\x4e\xea\xdc\x0c\x3e\x00\x06\xed\xec\
\x74\x32\xae\xb7\x60\xf7\x36\x04\x85\x8f\x88\xdc\x87\xe2\x69\x8b\
\x3d\xf8\x4f\xe6\x4a\x57\x6f\xc2\xb7\x77\xdd\x73\xde\xfb\xa3\xab\
\x73\x5b\xf7\x2c\xd9\x3d\x33\x96\x83\xf8\x07\x4f\x84\x50\x3d\x93\
\xdd\xc7\x5f\x6d\xd6\xb6\xae\xb4\xa0\x9c\xf7\x5e\xd2\x5b\x73\x5b\
\xc3\xd1\x96\xe8\x87\x22\xb7\x4b\x8c\xc1\x86\x5e\xbd\x61\xa3\x45\
\x6e\x73\x9f\xe6\xee\xb8\x09\xe9\x4b\xe6\xb1\xa8\x80\x11\x9d\x53\
\x12\xd1\x92\x5d\x91\xe8\xd3\x14\xc1\x54\x84\xa3\xf3\x0f\x40\xf5\
\x7e\xd1\xdc\xbb\xa3\x3f\x09\x58\x34\x2d\x1b\xfb\x72\xb5\x4f\xce\
\x81\x8d\x18\x62\x1a\x53\xac\xf9\x4b\x76\x06\x89\x2f\x22\x98\x23\
\x70\x34\x41\x2e\xb8\x70\x3c\xc5\x10\x15\x94\x60\x7d\x45\x4f\x58\
\x40\xa8\x2b\x3c\x98\x4e\xaf\xf1\x76\xe9\x53\xb1\x2b\x3e\xd9\x7c\
\x34\xd5\xb8\xef\xa1\xae\x21\x3e\xa3\x32\x7d\xb6\x60\xe7\x2d\x97\
\x44\x9c\x5d\x69\xbd\x1d\xb1\xd8\x72\x22\x86\x3c\xb0\x9d\x86\xe8\
\x96\x0b\xce\xff\x7b\x70\x31\x7c\x11\x5c\x2b\x1c\xfc\xe4\xcb\xc0\
\xdf\xfc\x9f\x9f\xa0\x24\xfc\x6b\x22\x32\x2a\xe8\xaa\x0a\xbc\xca\
\xd5\x11\xa8\xfa\x98\xb6\x87\xda\x8e\x8e\xf0\x22\xc8\x92\x0a\x1a\
\x80\x49\x32\x1c\x35\x3d\xeb\x6a\x30\x59\x8e\x2c\x48\xcb\x75\xf1\
\xf4\x0e\x62\x4f\x31\x43\x0d\x5f\x81\x76\xab\x71\x24\x0d\x32\xdc\
\x68\xaa\x57\xd4\x20\x25\x8c\x24\xea\x66\x9a\xf4\xe7\xa7\xfe\x2d\
\xda\x4f\x30\x22\x8a\xcc\x18\xbe\x2c\x05\x91\x60\x48\x81\x37\x49\
\xbd\xe2\xf0\xa2\x88\x90\x22\x20\x18\x29\x86\x61\xb4\x8a\x34\xe2\
\x4c\x53\x62\xe4\x6c\xea\x14\x93\xb7\x56\xfa\x9f\xf7\x9f\xcb\x42\
\x42\x50\x3a\xcf\x42\x90\x64\xa8\x62\x8a\x71\xb1\x7f\xea\x39\x65\
\x01\x67\x49\xf7\xc9\xc7\x43\xdb\x4e\x69\xbf\xba\xa2\x4a\xa0\x28\
\xd9\xba\xa7\x9e\x23\x36\x21\xf3\xca\xf4\x4a\x30\xb1\x25\x98\x38\
\xa2\x9c\x0b\x29\x57\x11\xe1\xc8\x80\xe2\x46\x04\x06\x31\xa1\x09\
\x36\xab\xee\x05\x83\x01\x5f\x1d\x25\x45\x8c\x60\x9a\xb1\xff\x3f\
\x94\xc4\x02\x4a\x8c\x20\xad\x30\x95\xe0\x38\x44\x21\x41\x39\xc5\
\x2a\x88\x0c\x22\x9a\x33\x45\x56\xde\xaf\x0c\xc7\xf4\x1b\xc0\x04\
\xd1\x23\xb1\xd6\xdf\x10\xa6\xb1\xc0\x39\xa8\x29\xd0\x20\x41\xd3\
\x9c\x65\xe1\x2b\x20\xa9\x16\x90\xe4\x14\x29\x4d\x25\xe3\xab\x88\
\x21\x8e\x25\x78\x17\x0f\xa0\x14\x2b\xc1\x88\x92\x1d\x92\x8c\x9a\
\x57\xc6\x91\xbc\x22\x7c\xb6\x2c\x8b\x7d\x33\x6f\x3d\x9f\x7d\xf9\
\xc2\xc2\x28\xf0\x90\x99\xea\xf5\x93\xe7\x10\xf0\x74\x45\xe7\x7e\
\xe5\xeb\x96\x44\x94\x00\x8f\xce\xd3\x57\x57\xef\x84\x40\x8c\x52\
\xcc\xd4\x15\x6c\x99\x8c\x64\xc4\x96\x60\x1a\xd4\x7e\x7f\x02\x8c\
\xa9\x4c\xab\xd3\x20\x9a\xf3\x16\xf1\xf3\x95\x60\x0e\x9e\x37\x18\
\x31\x94\x09\x76\x81\x57\xed\x0e\x55\x3f\x33\xea\xc0\x2b\xa1\x60\
\xb6\x09\xef\x69\x79\x0a\x5d\x46\x5d\xa7\xcf\xb3\x75\x7f\x1b\xb2\
\x14\xb2\x12\xd7\x84\x2d\x21\x8b\x25\x78\x92\x94\x17\xc8\x2a\xc4\
\x0d\x93\x54\xc8\x4b\x64\xa1\x10\xc1\x62\x92\x91\xeb\xc8\x92\x2f\
\xc1\x15\xe3\x34\xe5\xfc\x2b\x70\x85\x86\x87\x68\x43\x28\x55\xdf\
\x07\x57\x48\xfc\xca\x08\xc2\xf8\x05\xae\x1c\x71\x42\x88\x21\x97\
\x1e\xeb\xb3\x1f\x95\x82\x0a\x71\x09\x2c\xa3\x48\x72\x29\x14\xfd\
\x8c\xcb\x7e\x19\xb0\x39\x4f\xd3\xaf\x02\x56\x1b\x0c\xad\x86\x36\
\xdf\x07\x58\xc8\x6b\x1a\x6b\x46\xd9\x82\xc3\x0a\xad\x0c\x5b\xc2\
\x95\x23\xed\x1d\xd6\x2c\xa4\x02\x06\x01\x80\x21\x53\x5c\xc5\xf5\
\x4b\xdd\x55\xeb\xaf\x42\x95\x6b\x03\xb1\x26\xbf\x93\xbb\x82\x55\
\x31\x60\xc7\xf4\x02\xaa\x86\x0a\x82\xc9\x25\xaa\x30\x47\x0b\xa1\
\xcd\x42\x1a\xe0\x70\x1e\x81\x05\xff\x8c\xb7\xe2\xff\x49\x7a\xf5\
\x69\x80\x19\xad\x0d\xfd\x96\xb8\xae\xe3\x6d\x7f\xcb\xdd\xbe\xbc\
\x8d\x4c\xda\xf9\xc9\xed\x18\x61\x2c\x15\xd5\x6c\x15\x51\x01\x30\
\x2a\x6a\xcc\xcd\xec\x1b\x03\x5c\x6d\xe0\x02\x33\xdc\x9e\x5f\x5c\
\x6e\xe4\x24\x7b\x2c\x6e\x80\x91\x20\x94\xc3\x2d\x61\xbc\x10\xac\
\x6b\xe8\x2d\x26\x1f\x8a\xfc\x15\x19\x49\x8c\xa1\x21\x98\x86\x8c\
\x77\x06\x68\xc2\xa0\xb9\x9f\xc5\x44\xe7\x09\x8a\x31\x26\xa6\xd4\
\xfe\x8e\x2a\xe1\x0c\x58\x29\x33\xad\x22\xe7\x1b\x2e\x33\x7e\x31\
\x46\xa6\xae\xe0\x0f\xe1\xb5\xe1\x62\xe6\x3c\xb3\x56\xc4\x30\x93\
\xa7\xd9\xd0\x78\xcc\x86\x43\x03\x07\xd1\xae\x05\x96\x33\xe3\xfa\
\xfe\x63\x66\xdb\x57\xb3\xf8\xfb\x7d\x5a\xc0\xa5\xb4\xfb\xcc\x90\
\x9c\x3e\x67\x34\x81\xd7\x36\x38\x49\x4e\x3d\x62\x09\x6c\xe8\xc6\
\x0c\x23\x0b\x60\x6b\x0c\xc5\x6a\x0e\x36\x47\x18\xae\x08\x14\x8b\
\x45\xb4\x15\x93\x46\x2a\x79\x89\x36\xd4\x5f\x4a\x7c\xd7\x7c\x05\
\xed\x59\x57\x33\xc3\xfb\x5c\x18\xae\x46\x92\x6f\xc2\x25\xe5\x42\
\x89\xef\x00\x76\xe5\x3f\x51\x96\x93\x8f\x49\xdb\xd3\x77\x24\xf8\
\xb7\xf6\xdf\x32\x6f\xdf\xfc\x07\x46\x96\x9b\x79\
\x00\x00\x08\x5d\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x62\
\x61\x72\x73\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\
\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\
\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\x3c\
\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\x20\
\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\
\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\
\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\
\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\
\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\
\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\
\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\
\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\
\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\
\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\
\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\
\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\
\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\
\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\
\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\
\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\
\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\
\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\
\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\
\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\
\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\
\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\
\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\
\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\
\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\
\x64\x74\x68\x3d\x22\x37\x38\x34\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x68\
\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x34\x22\
\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\x3d\x22\
\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x32\x32\x39\
\x31\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x34\x37\x2e\x39\x39\x39\x39\
\x39\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x63\x79\x3d\x22\x39\x36\x2e\x30\x30\x30\x30\x30\x33\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\
\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\
\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\
\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\x39\x39\x39\
\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\
\x31\x2e\x33\x33\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\x20\x20\
\x20\x64\x3d\x22\x6d\x20\x33\x34\x2c\x31\x36\x37\x2e\x35\x36\x31\
\x38\x20\x63\x20\x2d\x31\x2e\x34\x36\x36\x36\x36\x37\x2c\x2d\x30\
\x2e\x36\x31\x37\x38\x20\x2d\x34\x2e\x31\x36\x36\x36\x36\x37\x2c\
\x2d\x32\x2e\x37\x33\x37\x32\x34\x20\x2d\x36\x2c\x2d\x34\x2e\x37\
\x30\x39\x38\x35\x20\x6c\x20\x2d\x33\x2e\x33\x33\x33\x33\x33\x33\
\x2c\x2d\x33\x2e\x35\x38\x36\x35\x36\x20\x56\x20\x39\x36\x2e\x37\
\x33\x31\x37\x38\x32\x20\x33\x34\x2e\x31\x39\x38\x31\x37\x35\x20\
\x4c\x20\x32\x39\x2e\x30\x32\x35\x36\x34\x31\x2c\x32\x39\x2e\x38\
\x33\x39\x32\x20\x33\x33\x2e\x33\x38\x34\x36\x31\x36\x2c\x32\x35\
\x2e\x34\x38\x30\x32\x32\x36\x20\x48\x20\x39\x36\x20\x31\x35\x38\
\x2e\x36\x31\x35\x33\x39\x20\x6c\x20\x34\x2e\x33\x35\x38\x39\x37\
\x2c\x34\x2e\x33\x35\x38\x39\x37\x34\x20\x34\x2e\x33\x35\x38\x39\
\x37\x2c\x34\x2e\x33\x35\x38\x39\x37\x35\x20\x76\x20\x36\x32\x2e\
\x36\x31\x35\x33\x38\x34\x20\x36\x32\x2e\x36\x31\x35\x33\x39\x31\
\x20\x6c\x20\x2d\x34\x2e\x33\x35\x37\x39\x38\x2c\x34\x2e\x33\x35\
\x38\x39\x37\x20\x2d\x34\x2e\x33\x35\x38\x2c\x34\x2e\x33\x35\x38\
\x39\x37\x20\x2d\x36\x30\x2e\x39\x37\x35\x33\x34\x32\x2c\x30\x2e\
\x32\x36\x39\x31\x20\x43\x20\x36\x34\x2e\x31\x30\x35\x35\x36\x39\
\x2c\x31\x36\x38\x2e\x35\x36\x33\x39\x39\x20\x33\x35\x2e\x34\x36\
\x36\x36\x36\x37\x2c\x31\x36\x38\x2e\x31\x37\x39\x36\x31\x20\x33\
\x34\x2c\x31\x36\x37\x2e\x35\x36\x31\x38\x20\x5a\x20\x4d\x20\x37\
\x32\x2c\x31\x30\x38\x2e\x38\x31\x33\x35\x36\x20\x56\x20\x38\x30\
\x2e\x38\x31\x33\x35\x35\x39\x20\x68\x20\x2d\x38\x20\x2d\x38\x20\
\x76\x20\x32\x38\x2e\x30\x30\x30\x30\x30\x31\x20\x32\x38\x20\x68\
\x20\x38\x20\x38\x20\x7a\x20\x6d\x20\x33\x32\x2c\x2d\x31\x32\x2e\
\x30\x30\x30\x30\x30\x31\x20\x76\x20\x2d\x34\x30\x20\x68\x20\x2d\
\x38\x20\x2d\x38\x20\x76\x20\x34\x30\x20\x34\x30\x2e\x30\x30\x30\
\x30\x30\x31\x20\x68\x20\x38\x20\x38\x20\x7a\x20\x6d\x20\x33\x32\
\x2c\x32\x34\x2e\x30\x30\x30\x30\x30\x31\x20\x76\x20\x2d\x31\x36\
\x20\x68\x20\x2d\x38\x20\x2d\x38\x20\x76\x20\x31\x36\x20\x31\x36\
\x20\x68\x20\x38\x20\x38\x20\x7a\x22\x0a\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x70\x61\x74\x68\x38\x31\x37\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\
\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\
\x22\x20\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x07\x2a\
\x00\
\x00\x26\x20\x78\x9c\xdd\x5a\xdd\x6f\xe3\xb8\x11\x7f\xcf\x5f\xa1\
\x6a\x5f\x76\x51\x8b\xe2\xf0\x9b\xae\x9d\x03\x7a\x8b\x03\xee\xb5\
\xbd\xc3\x3d\x16\x8a\xc4\xd8\xea\xca\x92\x21\xc9\x71\x72\x7f\x7d\
\x87\xb2\x25\x7f\x28\x2e\x1c\x20\x05\x5c\x2b\x59\x6c\xc8\x19\x52\
\x33\x3f\xce\x27\xed\xd9\x4f\xaf\xab\x22\x78\x71\x75\x93\x57\xe5\
\x3c\x04\x42\xc3\xc0\x95\x69\x95\xe5\xe5\x62\x1e\xfe\xfe\xdb\x2f\
\x91\x09\x83\xa6\x4d\xca\x2c\x29\xaa\xd2\xcd\xc3\xb2\x0a\x7f\x7a\
\x7c\x98\xfd\x25\x8a\x82\x9f\x6b\x97\xb4\x2e\x0b\xb6\x79\xbb\x0c\
\x7e\x2d\x7f\x34\x69\xb2\x76\xc1\xd7\x65\xdb\xae\xa7\x71\xbc\xdd\
\x6e\x49\xbe\x9f\x24\x55\xbd\x88\xbf\x05\x51\xf4\xf8\xf0\x30\x6b\
\x5e\x16\x0f\x41\x10\xe0\x7b\xcb\x66\x9a\xa5\xf3\x70\xbf\x60\xbd\
\xa9\x8b\x8e\x31\x4b\x63\x57\xb8\x95\x2b\xdb\x26\x06\x02\x71\x78\
\x60\x4f\x0f\xec\xa9\x7f\x7b\xfe\xe2\xd2\x6a\xb5\xaa\xca\xa6\x5b\
\x59\x36\x5f\x8e\x98\xeb\xec\x79\xe0\xf6\xd2\x6c\x79\xc7\x04\xd6\
\xda\x98\xb2\x98\xb1\x08\x39\xa2\xe6\xad\x6c\x93\xd7\xe8\x74\x29\
\xca\xf8\xde\x52\x46\x29\x8d\x91\x76\xe0\xbc\x8e\x6b\xda\x20\xa0\
\x6b\xfc\x37\xb0\xf7\x13\xa4\xa9\x36\x75\xea\x9e\x71\x9d\x23\xa5\
\x6b\xe3\xef\xbf\x7d\x1f\x88\x11\x25\x59\x9b\x1d\x6d\xd3\xe3\x79\
\xf2\xd6\x13\x90\xcb\x64\xe5\x9a\x75\x92\xba\x26\xee\xe7\xbb\xf5\
\xdb\x3c\x6b\x97\xf3\x50\x98\x6e\xb4\x74\xf9\x62\xd9\x0e\xc3\x97\
\xdc\x6d\xff\x5e\xbd\xce\x43\x1a\xd0\x40\x18\xfc\x25\xd4\x3f\xd0\
\x51\xf3\x6c\x1e\xa2\x36\x6c\xc7\x7a\xb0\x94\x3d\x75\xff\x96\xe9\
\x40\xa1\xc4\x32\xc2\x82\xaf\x32\xe5\xce\xd0\x6c\x12\x30\x0a\x3a\
\xa2\x26\xa2\xea\x5b\xb7\xa4\x57\x6f\x9a\x55\xa9\x97\x77\x1e\x26\
\x9b\xb6\x5a\xe1\x69\xa6\xff\x2a\x92\xb7\x6a\xd3\x12\x8f\xde\x23\
\xf2\xce\x32\xf7\xdc\xf8\x35\x3b\x31\xfc\x48\x84\x41\xdc\x91\x86\
\x6d\xfc\x1e\x99\xd7\xe1\xc0\xf8\x94\x34\x3b\xbd\x83\x60\x9d\x2c\
\xd0\x46\x8a\xaa\x9e\x87\x5f\x9e\xbb\x67\x4f\x78\xaa\xea\xcc\xd5\
\x3d\x49\x75\xcf\x09\xa9\x42\x1c\xf3\xf6\x6d\xe7\x15\xfb\xbd\x7b\
\x6d\xfd\xae\x03\x9d\xbe\x4f\x6f\x96\x49\x56\x6d\xe7\x21\x3b\x27\
\xfe\x59\x55\x2b\x04\x9f\x68\xa3\x84\x34\xfc\x9c\x9c\xe2\x49\x44\
\x78\x06\x96\x82\xb2\x66\x44\xc5\x17\x32\x20\x9a\x71\x26\x46\x4b\
\x11\xd1\x8d\x77\x9c\x68\x53\xe6\x2d\x1a\xe7\xfa\x75\xb4\x7c\x53\
\xd7\x9e\x01\x81\x76\xa8\xf7\x82\x0b\x01\x7b\x9e\x66\x59\x6d\x17\
\xb5\x87\xef\x39\x29\x06\xfc\x2e\xee\xb4\xcd\x4b\x54\x2f\xda\x5b\
\x16\x18\x35\x92\x66\xcf\xd1\x5b\x1b\x50\x26\x2f\xb0\xa0\xc6\x52\
\x5f\xa0\x79\x7d\x2f\xd1\x56\xc9\x6b\xbe\xca\xff\x74\x28\x33\xf4\
\x76\xb1\x72\x6d\x92\x25\x6d\x72\xb0\x86\x7e\x46\x77\x36\x85\x2c\
\xe8\xf7\xd3\x7f\x7c\xff\x65\x37\xc2\x71\x9a\x4e\xff\xa8\xea\x1f\
\xfb\x21\x3e\x9e\x21\x79\x42\x4b\x9c\x87\xe1\xe3\x30\x3d\xcb\xd2\
\x29\x7a\x2a\x5a\xea\x63\xbe\xc2\x03\xf6\x4e\xfe\x57\xf4\xcc\x59\
\x7c\x20\x9c\x30\xb7\x6f\x6b\x77\xd8\x74\xb7\x6d\xed\x76\x2e\xff\
\x6e\xdc\xcb\xd2\x55\xee\x17\xc5\xff\x6c\xf3\xa2\xf8\xd5\xbf\x64\
\xaf\xd6\xd1\xa6\x79\x5b\xb8\xc3\xe4\x2c\xde\x4b\xbf\xd7\x2d\x3e\
\x52\x6e\x16\xf7\xaa\x77\xa3\xc5\x19\x88\x45\xf2\xe4\x8a\x79\xf8\
\x73\xb2\x4e\x02\x38\x47\x78\x51\x57\x9b\xf5\xaa\xca\x50\xd0\xce\
\x56\xc2\x03\x9e\xdd\xb8\x5f\xd0\xd6\x49\xd9\x78\xe5\xe7\x61\xf7\
\x67\x81\x39\xe1\x2b\x9d\x44\x40\xa9\x20\x5c\x31\xf6\xad\x47\x7d\
\xd1\xab\xe1\xf7\x38\x36\xbc\x93\x4d\x10\xc4\x3a\x7f\xfd\x4a\x89\
\x51\x0a\x14\x97\x7c\x42\xfd\xcf\x61\xc8\x88\x92\x5a\x1b\x6d\x27\
\xc0\x35\x01\x74\x04\xf8\x36\x6c\xd4\xb4\x6f\x05\x4a\xfc\x8c\xe8\
\x4d\xf7\xee\xfe\xb7\xa6\xad\xab\x1f\x6e\xfa\x45\x64\xfe\x27\x3c\
\x9c\x7a\x5e\xa7\xc5\xd1\xf9\xd4\xde\xd3\x65\x78\x98\xf0\xae\x86\
\x6a\x18\xc2\x61\xb0\xce\x6e\x1e\xcd\x95\x09\x22\x85\xb4\xc6\x1c\
\xcd\x7b\xbd\xd6\x49\xbb\xe4\x9c\xab\xa3\xe9\xf7\x64\xf2\x83\x68\
\x1f\x40\xa6\xb0\x1b\xd6\x9b\xc2\x4d\xdd\x8b\x2b\xab\x2c\x1b\x84\
\xb6\xdd\xb3\x1f\xee\x9c\x6d\x0a\xeb\xd7\x7e\xa2\xc8\x4b\x87\xc7\
\x35\x7d\xda\xb4\xed\xf1\xdc\xbf\xab\xbc\x9c\xa2\x2d\xb9\xba\x9f\
\x1d\x5e\x76\x64\x50\xd7\x42\x00\x9c\x00\xb7\xe7\x10\x20\xfa\xd4\
\x50\x41\xd9\x05\x08\x22\x7e\x57\x20\x30\x85\xe6\x0c\xea\x0c\x04\
\xc1\x89\x15\x16\xad\xf1\x12\x08\xf7\x65\x09\xdc\x7a\xef\xe3\xe7\
\x20\x50\x22\xa8\xe0\x82\x5f\x02\x41\xdf\x15\x08\x42\x13\x4d\xcd\
\x28\x22\x18\x84\xc6\x6a\x79\xd1\x1d\xe4\x7d\x81\x20\x31\x24\x33\
\x38\x03\x01\x04\x61\x52\x51\xb8\x1c\x13\xee\x0b\x05\x2e\x09\x48\
\x90\x67\x28\x48\x42\xad\x42\x13\xb9\x94\x1c\x22\xc5\xee\x0a\x05\
\x86\x39\x59\x99\x51\x54\x20\x06\x0d\x41\x68\xb8\x84\x82\xbd\x2b\
\x10\x00\x41\xb0\xea\x3c\x3f\x00\x10\x21\x2c\xb0\x8b\xa6\x00\xf7\
\x05\x82\x25\x78\xe2\xf6\x3c\x34\x52\xc2\x94\x94\x54\x5e\x04\xe1\
\xce\x32\x04\x3a\x04\x67\xf6\x3c\x2c\x70\x40\x8f\x30\xe2\x24\x73\
\x9c\xc1\x40\xef\x0a\x06\xce\x7c\x9f\x3a\x82\x01\x1d\x05\x8b\xff\
\xcb\x1e\x71\x67\x81\x01\xeb\x64\x23\xd8\xb9\x4b\x20\xa7\x06\xa6\
\x2f\x26\x4a\xb8\xb7\xf2\xd9\x12\x8a\xa9\x72\x5c\x2f\x08\x90\x4a\
\x5d\x2c\x9f\xe1\xff\xa5\x80\xf6\x12\x1f\xe9\x30\xdc\xb7\x54\x25\
\x6e\xdb\x56\x75\x94\x6e\xea\x97\xa4\xdd\xd4\x28\x3f\x7d\x47\x5b\
\xc1\x4e\xc0\xf1\xd7\x16\x81\x22\x54\x1a\x2d\xad\x9c\x20\x7e\xd8\
\x83\x29\xc9\x02\x8d\xa1\x94\x52\x8c\xa6\x13\x49\xb8\xb6\xe6\x1a\
\x74\xae\x87\xe3\xe3\x60\x74\x83\x22\xc7\xff\xa6\xa2\x9f\xcb\x92\
\x66\x99\xd4\x75\xf2\x36\x2d\xab\xd2\xfd\xaf\x61\xe3\xe7\xb0\x01\
\xd6\x5f\xc6\x52\x26\x3c\x6c\x9a\x58\x90\x41\x1a\x50\xc2\x29\xd5\
\x20\x26\x11\x36\x2b\x8c\xa9\x40\x78\x20\x01\xd8\x24\xd2\x44\x82\
\x10\xa3\x89\x4f\x45\xd6\xdf\x8a\x1a\x83\xa2\x88\x5b\xb2\x38\x79\
\x0e\x1d\xf3\x17\x2d\x06\xab\x57\x84\x0e\x10\x3a\x8e\xb8\x70\x42\
\x19\x16\x30\x7c\x12\x61\x87\x23\xe8\x55\xc1\xf9\x03\xb8\x60\x17\
\x61\xb9\x66\xfa\x96\x70\xd1\x23\x93\xf2\x99\x8c\xa2\xa4\x93\xae\
\xd0\x63\x18\xb4\x02\xc0\x33\x15\xda\x08\x34\x29\x4e\xb0\x15\xba\
\xaa\x92\xfb\x88\xc1\x08\x65\x41\x69\x75\x4b\xc0\xd8\x71\x88\xe2\
\x68\x23\x52\x7a\x60\xb0\x19\x12\xd2\x06\xd0\x5d\x89\x70\x34\xf6\
\x09\x10\x6b\xf5\x67\x1b\x8c\x15\xfe\xe6\x0d\xf8\x0d\xe1\xa2\x46\
\xa1\x1b\x1d\x49\x6a\x6d\xb5\x77\x24\x6e\x88\x56\x42\x06\x11\xe2\
\xa3\x8c\xe1\x76\xa2\x08\x63\xf4\x73\x43\x37\x3a\x12\x5a\xa5\x65\
\x37\x65\x2f\x6a\x14\x9b\x31\x1e\x33\x90\xc6\xb2\xc9\xee\x1e\x05\
\x73\x5a\x10\x81\xff\x3c\x43\x6a\x0e\x93\x08\x88\xd2\x57\xf5\x02\
\x1f\x32\x18\x2e\x05\x03\x73\x4b\xc0\x8c\x1c\x09\xab\x44\x2d\xac\
\x06\x9f\xeb\xb1\x2a\xe2\x54\xeb\x00\x33\x3c\x67\x54\xa0\x0d\x01\
\xe1\x58\x08\x7c\x36\x2e\x00\x58\x41\xdc\x52\x09\xa4\x47\x7e\x24\
\x18\x91\x06\xe3\xcb\xa4\xbb\x80\xa5\x9a\x8b\x20\xb2\xc4\x73\x4a\
\xe6\xe3\x2e\x97\xea\xb3\xe3\xae\xb6\x54\xe0\xdb\x6e\xc9\x5c\xf4\
\x28\x51\x0b\x7f\x7c\xfe\xa6\x6d\x17\x5f\x24\xd5\x22\xc0\x1c\x65\
\x25\xef\xbc\x08\xa3\x01\x55\x9f\x1e\x60\x38\x55\x1a\xb4\xbd\x25\
\x60\xc6\x99\x1a\x83\x2c\x28\x65\xba\xc0\x4b\x09\xa0\xe3\xa3\x1f\
\x01\x00\x35\x1a\xe3\xae\x30\x9f\x0e\x8b\x16\x1c\xbb\x7a\x7a\x4b\
\x7e\x74\xd2\x16\xec\xe2\x2e\xf6\x64\x98\xa0\x59\x57\xd8\xf9\x4b\
\x7c\xa3\x03\x83\x35\xa9\x54\x7a\xc2\x08\x68\x79\x55\xb7\xf9\x11\
\x54\xb0\x4b\x91\x8c\xde\x52\x96\xd6\xa7\x3d\xf5\x2e\xec\x32\x62\
\x30\x1f\x29\x9f\x8f\x38\x10\xa1\xb1\x33\xc0\x0e\xc1\x80\xc2\xfc\
\xe4\x3b\x01\x8b\x50\x7d\x36\x34\x9c\x62\x6f\x6b\xd9\x8d\x41\x73\
\xd2\x69\xef\xc0\xb1\xd8\x08\xe9\x5d\xb2\xc6\x20\x83\x15\x1d\x46\
\x5f\x1f\x85\x95\x42\xc0\xb0\x9c\x61\x20\x6e\x1b\x9c\x59\xbc\xe8\
\x3f\xf3\x47\x24\x1e\xde\x91\xb3\xeb\x50\x4f\xee\x10\xf0\xf4\x85\
\xc5\x06\x50\xf2\xff\x2a\x2a\x27\x46\x6a\x81\xf1\x45\x8e\x84\xaa\
\xab\x4d\xd9\xeb\x79\x45\x83\x3c\x20\xe8\xcf\xc3\xcb\x29\xe0\xe8\
\x03\xe4\xfe\xab\x3b\xc2\xc7\x32\xb4\xd4\x81\x30\x7c\x8b\x67\x44\
\xf1\x17\x2b\xbe\xdf\xd4\xf4\x28\xa1\xee\x3e\xcc\xc6\xca\xd3\x1e\
\xb5\x70\x75\x37\x4b\xc0\x28\x2d\x87\x6f\x50\x78\xcc\x66\xfe\xcb\
\x0d\x8f\x0f\xff\x01\x9b\x6a\x14\x0c\
\x00\x00\x0b\xee\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\
\x6c\x6e\x73\x3a\x64\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\
\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\
\x6e\x74\x73\x2f\x31\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\
\x6e\x73\x3a\x63\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\
\x65\x61\x74\x69\x76\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\
\x67\x2f\x6e\x73\x23\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\
\x72\x64\x66\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\
\x32\x2d\x72\x64\x66\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\
\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\
\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\
\x6f\x64\x69\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\
\x70\x6f\x64\x69\x2e\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\
\x2e\x6e\x65\x74\x2f\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\
\x69\x2d\x30\x2e\x64\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\
\x73\x3a\x69\x6e\x6b\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\
\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\
\x6f\x72\x67\x2f\x6e\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x22\x0a\x20\x20\x20\x77\x69\x64\x74\
\x68\x3d\x22\x34\x38\x22\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\
\x3d\x22\x34\x38\x22\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\
\x3d\x22\x30\x20\x30\x20\x34\x38\x20\x34\x38\x22\x0a\x20\x20\x20\
\x69\x64\x3d\x22\x73\x76\x67\x32\x22\x0a\x20\x20\x20\x76\x65\x72\
\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x30\x2e\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\
\x20\x32\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x0a\x20\x20\
\x20\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\
\x65\x3d\x22\x73\x74\x6f\x63\x68\x61\x73\x74\x69\x63\x5f\x70\x6f\
\x77\x65\x72\x5f\x66\x6c\x6f\x77\x2e\x73\x76\x67\x22\x3e\x0a\x20\
\x20\x3c\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\
\x69\x64\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x31\x32\x22\x3e\
\x0a\x20\x20\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\
\x20\x20\x20\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\
\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\
\x3d\x22\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\
\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\
\x67\x2b\x78\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\
\x70\x65\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\
\x66\x3a\x72\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\
\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\
\x63\x6d\x69\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\
\x67\x65\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\
\x64\x63\x3a\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\
\x20\x20\x3c\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\
\x20\x3c\x2f\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\
\x6d\x65\x74\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\
\x73\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x31\
\x30\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\
\x69\x3a\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\
\x20\x70\x61\x67\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\
\x66\x66\x66\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\
\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\
\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\
\x74\x79\x3d\x22\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\
\x63\x74\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\
\x0a\x20\x20\x20\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\
\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\
\x69\x64\x65\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x70\x61\x67\x65\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\
\x67\x65\x73\x68\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x77\x69\x64\x74\x68\x3d\x22\x31\x38\x36\x33\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\
\x64\x6f\x77\x2d\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x30\x32\x35\
\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\
\x76\x69\x65\x77\x38\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\
\x67\x72\x69\x64\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\
\x22\x31\x33\x2e\x39\x30\x36\x34\x33\x33\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x78\x3d\x22\x34\x2e\
\x32\x39\x30\x38\x34\x33\x33\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x63\x79\x3d\x22\x32\x34\x2e\x39\x38\
\x37\x32\x31\x31\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x77\x69\x6e\x64\x6f\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\
\x6f\x77\x2d\x6d\x61\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x31\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\
\x75\x72\x72\x65\x6e\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\
\x67\x32\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\
\x20\x20\x20\x20\x64\x3d\x22\x4d\x30\x20\x30\x68\x34\x38\x76\x34\
\x38\x68\x2d\x34\x38\x7a\x22\x0a\x20\x20\x20\x20\x20\x66\x69\x6c\
\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x70\x61\x74\x68\x34\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x67\
\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x67\x34\x31\x35\x30\x22\
\x0a\x20\x20\x20\x20\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\
\x22\x6d\x61\x74\x72\x69\x78\x28\x31\x2e\x35\x34\x38\x31\x35\x37\
\x38\x2c\x30\x2c\x30\x2c\x31\x2e\x36\x34\x34\x39\x33\x35\x37\x2c\
\x2d\x32\x35\x2e\x34\x38\x33\x35\x37\x34\x2c\x2d\x32\x38\x2e\x31\
\x38\x35\x33\x39\x37\x29\x22\x3e\x0a\x20\x20\x20\x20\x3c\x67\x0a\
\x20\x20\x20\x20\x20\x20\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\
\x3d\x22\x74\x72\x61\x6e\x73\x6c\x61\x74\x65\x28\x31\x2e\x30\x30\
\x36\x37\x32\x38\x33\x2c\x2d\x32\x35\x2e\x38\x38\x37\x32\x39\x39\
\x29\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x67\x34\
\x31\x34\x34\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x3c\x67\x0a\x20\
\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x67\x34\x31\x37\x32\x22\
\x0a\x20\x20\x20\x20\x20\x20\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\
\x6d\x3d\x22\x6d\x61\x74\x72\x69\x78\x28\x30\x2e\x38\x33\x39\x39\
\x36\x34\x30\x34\x2c\x30\x2c\x30\x2c\x30\x2e\x38\x33\x39\x39\x36\
\x34\x30\x34\x2c\x35\x2e\x31\x33\x30\x36\x34\x34\x34\x2c\x35\x2e\
\x36\x38\x30\x39\x35\x32\x29\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\
\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\
\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x6f\x64\x65\x74\x79\x70\x65\
\x73\x3d\x22\x63\x73\x63\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\
\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\
\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\
\x61\x74\x68\x34\x31\x34\x30\x22\x0a\x20\x20\x20\x20\x20\x20\x20\
\x20\x20\x64\x3d\x22\x6d\x20\x31\x36\x2e\x30\x36\x37\x37\x39\x36\
\x2c\x37\x30\x2e\x38\x38\x32\x37\x33\x31\x20\x63\x20\x31\x30\x2e\
\x34\x32\x32\x32\x32\x31\x2c\x30\x20\x31\x31\x2e\x33\x32\x32\x38\
\x34\x38\x2c\x2d\x31\x36\x2e\x31\x31\x38\x35\x38\x38\x20\x31\x35\
\x2e\x32\x30\x36\x37\x34\x39\x2c\x2d\x31\x36\x2e\x31\x32\x34\x35\
\x35\x34\x20\x33\x2e\x39\x39\x34\x32\x37\x2c\x2d\x30\x2e\x30\x30\
\x36\x31\x20\x33\x2e\x39\x36\x35\x35\x34\x35\x2c\x31\x36\x2e\x30\
\x33\x35\x35\x32\x38\x20\x31\x34\x2e\x30\x39\x30\x36\x35\x35\x2c\
\x31\x36\x2e\x31\x32\x34\x35\x35\x34\x22\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\
\x23\x65\x31\x31\x65\x35\x61\x3b\x66\x69\x6c\x6c\x2d\x6f\x70\x61\
\x63\x69\x74\x79\x3a\x31\x3b\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\
\x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x3a\
\x23\x65\x31\x31\x65\x35\x61\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\
\x69\x64\x74\x68\x3a\x30\x2e\x35\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
\x6c\x69\x6e\x65\x63\x61\x70\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\
\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x6d\x69\
\x74\x65\x72\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\
\x6c\x69\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x64\
\x61\x73\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\
\x72\x6f\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x22\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x72\x61\x6e\x73\x66\x6f\
\x72\x6d\x3d\x22\x74\x72\x61\x6e\x73\x6c\x61\x74\x65\x28\x31\x2e\
\x30\x30\x36\x37\x32\x38\x33\x2c\x2d\x32\x35\x2e\x38\x38\x37\x32\
\x39\x39\x29\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x70\
\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x74\x79\
\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x66\x69\
\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\
\x73\x74\x72\x6f\x6b\x65\x3a\x23\x62\x37\x31\x38\x34\x39\x3b\x73\
\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x30\x2e\x34\x39\
\x30\x31\x30\x32\x35\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\
\x65\x63\x61\x70\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\x72\x6f\x6b\
\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x6d\x69\x74\x65\x72\
\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\
\x69\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x64\x61\x73\x68\
\x61\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\x6b\
\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x22\x0a\x20\x20\x20\
\x20\x20\x20\x20\x20\x20\x64\x3d\x22\x4d\x20\x33\x32\x2e\x33\x30\
\x35\x37\x34\x39\x2c\x32\x33\x2e\x39\x39\x30\x36\x38\x31\x20\x33\
\x32\x2e\x32\x32\x33\x36\x38\x31\x2c\x34\x34\x2e\x39\x39\x36\x32\
\x37\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\
\x70\x61\x74\x68\x34\x31\x34\x38\x22\x0a\x20\x20\x20\x20\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\
\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\
\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x6e\x6f\x64\x65\x74\x79\x70\x65\x73\x3d\
\x22\x63\x63\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x70\
\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x74\x79\
\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x66\x69\
\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\
\x73\x74\x72\x6f\x6b\x65\x3a\x23\x62\x37\x31\x38\x34\x39\x3b\x73\
\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x30\x2e\x35\x31\
\x34\x38\x39\x38\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\
\x63\x61\x70\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\x72\x6f\x6b\x65\
\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x6d\x69\x74\x65\x72\x3b\
\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\
\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x64\x61\x73\x68\x61\
\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\x6b\x65\
\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x22\x0a\x20\x20\x20\x20\
\x20\x20\x20\x20\x20\x64\x3d\x22\x6d\x20\x31\x35\x2e\x31\x36\x33\
\x32\x37\x37\x2c\x34\x35\x2e\x30\x32\x32\x38\x36\x32\x20\x33\x33\
\x2e\x37\x39\x32\x30\x39\x2c\x30\x2e\x30\x30\x35\x31\x22\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\
\x34\x31\x34\x38\x2d\x35\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\
\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\
\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x6f\x64\x69\x70\
\x6f\x64\x69\x3a\x6e\x6f\x64\x65\x74\x79\x70\x65\x73\x3d\x22\x63\
\x63\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x67\x3e\x0a\x20\
\x20\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x0d\x6f\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\
\x6c\x6e\x73\x3a\x64\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\
\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\
\x6e\x74\x73\x2f\x31\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\
\x6e\x73\x3a\x63\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\
\x65\x61\x74\x69\x76\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\
\x67\x2f\x6e\x73\x23\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\
\x72\x64\x66\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\
\x32\x2d\x72\x64\x66\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\
\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\
\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\
\x6f\x64\x69\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\
\x70\x6f\x64\x69\x2e\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\
\x2e\x6e\x65\x74\x2f\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\
\x69\x2d\x30\x2e\x64\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\
\x73\x3a\x69\x6e\x6b\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\
\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\
\x6f\x72\x67\x2f\x6e\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x22\x0a\x20\x20\x20\x77\x69\x64\x74\
\x68\x3d\x22\x34\x38\x22\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\
\x3d\x22\x34\x38\x22\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\
\x3d\x22\x30\x20\x30\x20\x34\x38\x20\x34\x38\x22\x0a\x20\x20\x20\
\x69\x64\x3d\x22\x73\x76\x67\x32\x22\x0a\x20\x20\x20\x76\x65\x72\
\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x30\x2e\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\
\x20\x32\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x0a\x20\x20\
\x20\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\
\x65\x3d\x22\x63\x6f\x6e\x74\x69\x6e\x75\x61\x74\x69\x6f\x6e\x5f\
\x70\x6f\x77\x65\x72\x5f\x66\x6c\x6f\x77\x2e\x73\x76\x67\x22\x3e\
\x0a\x20\x20\x3c\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\
\x20\x20\x69\x64\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x31\x32\
\x22\x3e\x0a\x20\x20\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\
\x0a\x20\x20\x20\x20\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\
\x75\x74\x3d\x22\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\
\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\
\x73\x76\x67\x2b\x78\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\
\x61\x74\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\
\x74\x79\x70\x65\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\
\x72\x64\x66\x3a\x72\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\
\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\
\x2f\x64\x63\x6d\x69\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\
\x6d\x61\x67\x65\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\
\x20\x3c\x64\x63\x3a\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\
\x20\x20\x20\x20\x3c\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\
\x20\x20\x20\x3c\x2f\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\
\x3c\x2f\x6d\x65\x74\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\
\x65\x66\x73\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\
\x73\x31\x30\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\
\x6f\x64\x69\x3a\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\
\x20\x20\x20\x70\x61\x67\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\
\x66\x66\x66\x66\x66\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\
\x65\x72\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\
\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\
\x63\x69\x74\x79\x3d\x22\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\
\x6a\x65\x63\x74\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\
\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\
\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\
\x67\x75\x69\x64\x65\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\
\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x70\x61\x67\x65\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x70\x61\x67\x65\x73\x68\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\
\x64\x6f\x77\x2d\x77\x69\x64\x74\x68\x3d\x22\x31\x38\x36\x33\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\
\x69\x6e\x64\x6f\x77\x2d\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x30\
\x32\x35\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x6e\x61\x6d\
\x65\x64\x76\x69\x65\x77\x38\x22\x0a\x20\x20\x20\x20\x20\x73\x68\
\x6f\x77\x67\x72\x69\x64\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x7a\x6f\x6f\
\x6d\x3d\x22\x38\x2e\x30\x30\x30\x30\x30\x30\x31\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x78\x3d\x22\
\x31\x31\x2e\x39\x38\x31\x36\x39\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x79\x3d\x22\x31\x32\x2e\x37\
\x35\x30\x32\x34\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\
\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\
\x64\x6f\x77\x2d\x6d\x61\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x31\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x63\x75\x72\x72\x65\x6e\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x67\
\x38\x32\x38\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\
\x20\x20\x20\x20\x20\x64\x3d\x22\x4d\x30\x20\x30\x68\x34\x38\x76\
\x34\x38\x68\x2d\x34\x38\x7a\x22\x0a\x20\x20\x20\x20\x20\x66\x69\
\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\x0a\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x70\x61\x74\x68\x34\x22\x20\x2f\x3e\x0a\x20\x20\x3c\
\x67\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x67\x38\x36\x38\x22\
\x0a\x20\x20\x20\x20\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\
\x22\x6d\x61\x74\x72\x69\x78\x28\x31\x2e\x32\x38\x35\x36\x34\x38\
\x2c\x30\x2c\x30\x2c\x31\x2e\x32\x38\x35\x36\x34\x38\x2c\x2d\x36\
\x2e\x39\x30\x30\x39\x39\x30\x33\x2c\x2d\x31\x31\x2e\x33\x31\x34\
\x35\x37\x38\x29\x22\x3e\x0a\x20\x20\x20\x20\x3c\x67\x0a\x20\x20\
\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x67\x38\x32\x38\x22\x3e\x0a\
\x20\x20\x20\x20\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\
\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\
\x3a\x6e\x6f\x6e\x65\x3b\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\
\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x23\
\x32\x61\x32\x61\x66\x66\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\
\x64\x74\x68\x3a\x32\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\
\x65\x63\x61\x70\x3a\x73\x71\x75\x61\x72\x65\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x62\x65\x76\x65\
\x6c\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\
\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x64\x61\x73\
\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x3b\x70\x61\x69\
\x6e\x74\x2d\x6f\x72\x64\x65\x72\x3a\x66\x69\x6c\x6c\x20\x6d\x61\
\x72\x6b\x65\x72\x73\x20\x73\x74\x72\x6f\x6b\x65\x22\x0a\x20\x20\
\x20\x20\x20\x20\x20\x20\x20\x64\x3d\x22\x4d\x20\x38\x2e\x39\x32\
\x38\x34\x35\x37\x33\x2c\x32\x31\x2e\x34\x31\x34\x33\x39\x39\x20\
\x43\x20\x32\x32\x2e\x32\x35\x34\x30\x32\x32\x2c\x32\x31\x2e\x36\
\x36\x35\x32\x37\x32\x20\x33\x38\x2e\x38\x32\x36\x32\x31\x33\x2c\
\x33\x31\x2e\x31\x36\x34\x33\x32\x37\x20\x33\x38\x2e\x38\x34\x31\
\x31\x34\x38\x2c\x33\x37\x2e\x34\x38\x35\x32\x39\x31\x22\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\
\x38\x32\x35\x2d\x33\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\
\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x6f\x64\x69\x70\x6f\
\x64\x69\x3a\x6e\x6f\x64\x65\x74\x79\x70\x65\x73\x3d\x22\x63\x63\
\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x70\x61\x74\x68\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\
\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x66\x69\x6c\x6c\x2d\
\x72\x75\x6c\x65\x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\
\x6f\x6b\x65\x3a\x23\x37\x66\x32\x61\x66\x66\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x32\x3b\x73\x74\x72\x6f\x6b\
\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3a\x73\x71\x75\x61\x72\x65\
\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\
\x3a\x62\x65\x76\x65\x6c\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\
\x74\x65\x72\x6c\x69\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\
\x65\x2d\x64\x61\x73\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\
\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\
\x31\x3b\x70\x61\x69\x6e\x74\x2d\x6f\x72\x64\x65\x72\x3a\x66\x69\
\x6c\x6c\x20\x6d\x61\x72\x6b\x65\x72\x73\x20\x73\x74\x72\x6f\x6b\
\x65\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x64\x3d\x22\x6d\
\x20\x39\x2c\x32\x34\x20\x63\x20\x31\x33\x2e\x33\x32\x35\x35\x36\
\x35\x2c\x30\x2e\x32\x35\x30\x38\x37\x34\x20\x32\x39\x2e\x38\x32\
\x36\x32\x31\x32\x2c\x37\x2e\x31\x36\x34\x33\x32\x37\x20\x32\x39\
\x2e\x38\x34\x31\x31\x34\x38\x2c\x31\x33\x2e\x34\x38\x35\x32\x39\
\x31\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\
\x70\x61\x74\x68\x38\x32\x35\x22\x0a\x20\x20\x20\x20\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\
\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\
\x30\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x6f\x64\x69\
\x70\x6f\x64\x69\x3a\x6e\x6f\x64\x65\x74\x79\x70\x65\x73\x3d\x22\
\x63\x63\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x67\x3e\x0a\
\x20\x20\x20\x20\x3c\x67\x0a\x20\x20\x20\x20\x20\x20\x20\x73\x74\
\x79\x6c\x65\x3d\x22\x73\x74\x72\x6f\x6b\x65\x3a\x23\x63\x63\x30\
\x30\x66\x66\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\
\x67\x38\x32\x38\x2d\x33\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x74\
\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x74\x72\x61\x6e\x73\x6c\
\x61\x74\x65\x28\x30\x2e\x30\x34\x30\x38\x31\x31\x2c\x32\x2e\x39\
\x39\x30\x37\x37\x39\x34\x29\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\
\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\
\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\x76\x65\x6e\x6f\x64\
\x64\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x23\x63\x63\x30\x30\x66\x66\
\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x32\x3b\
\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3a\x73\
\x71\x75\x61\x72\x65\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\
\x65\x6a\x6f\x69\x6e\x3a\x62\x65\x76\x65\x6c\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\x3a\x34\x3b\
\x73\x74\x72\x6f\x6b\x65\x2d\x64\x61\x73\x68\x61\x72\x72\x61\x79\
\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6f\x70\x61\
\x63\x69\x74\x79\x3a\x31\x3b\x70\x61\x69\x6e\x74\x2d\x6f\x72\x64\
\x65\x72\x3a\x66\x69\x6c\x6c\x20\x6d\x61\x72\x6b\x65\x72\x73\x20\
\x73\x74\x72\x6f\x6b\x65\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\
\x20\x64\x3d\x22\x6d\x20\x39\x2c\x32\x34\x20\x63\x20\x31\x33\x2e\
\x33\x32\x35\x35\x36\x35\x2c\x30\x2e\x32\x35\x30\x38\x37\x34\x20\
\x32\x39\x2e\x37\x38\x35\x34\x30\x31\x2c\x34\x2e\x31\x37\x33\x35\
\x34\x38\x20\x32\x39\x2e\x38\x30\x30\x33\x33\x37\x2c\x31\x30\x2e\
\x34\x39\x34\x35\x31\x32\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\
\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x38\x32\x35\x2d\x36\x22\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\
\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x20\
\x20\x20\x20\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x6f\x64\x65\
\x74\x79\x70\x65\x73\x3d\x22\x63\x63\x22\x20\x2f\x3e\x0a\x20\x20\
\x20\x20\x3c\x2f\x67\x3e\x0a\x20\x20\x20\x20\x3c\x70\x61\x74\x68\
\x0a\x20\x20\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\
\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x66\x69\x6c\x6c\x2d\x72\x75\
\x6c\x65\x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\
\x65\x3a\x23\x61\x62\x33\x37\x63\x38\x3b\x73\x74\x72\x6f\x6b\x65\
\x2d\x77\x69\x64\x74\x68\x3a\x32\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
\x6c\x69\x6e\x65\x63\x61\x70\x3a\x73\x71\x75\x61\x72\x65\x3b\x73\
\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x62\
\x65\x76\x65\x6c\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\
\x72\x6c\x69\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
\x64\x61\x73\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\x3b\x73\
\x74\x72\x6f\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x3b\
\x70\x61\x69\x6e\x74\x2d\x6f\x72\x64\x65\x72\x3a\x66\x69\x6c\x6c\
\x20\x6d\x61\x72\x6b\x65\x72\x73\x20\x73\x74\x72\x6f\x6b\x65\x22\
\x0a\x20\x20\x20\x20\x20\x20\x20\x64\x3d\x22\x4d\x20\x38\x2e\x39\
\x39\x36\x36\x31\x36\x38\x2c\x33\x30\x2e\x32\x31\x36\x39\x35\x34\
\x20\x43\x20\x32\x32\x2e\x32\x37\x36\x33\x37\x35\x2c\x33\x30\x2e\
\x36\x30\x35\x32\x35\x20\x33\x38\x2e\x36\x31\x33\x34\x37\x39\x2c\
\x33\x33\x2e\x31\x32\x38\x33\x35\x20\x33\x38\x2e\x38\x34\x31\x31\
\x34\x38\x2c\x33\x37\x2e\x34\x38\x35\x32\x39\x31\x22\x0a\x20\x20\
\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x38\x32\x35\
\x2d\x36\x2d\x37\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\
\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x0a\x20\x20\
\x20\x20\x20\x20\x20\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x6f\
\x64\x65\x74\x79\x70\x65\x73\x3d\x22\x63\x63\x22\x20\x2f\x3e\x0a\
\x20\x20\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x04\xb5\
\x00\
\x00\x10\xa4\x78\x9c\xdd\x97\x5d\x6f\x9c\x38\x14\x86\xef\xf3\x2b\
\x58\x72\xd3\x6a\x07\x63\x1b\x8c\x31\x1d\xa6\xd2\xb6\xaa\xd4\xdb\
\xdd\xae\xf6\x72\xe5\x80\x33\xc3\x16\x30\x02\x4f\x26\xe9\xaf\xef\
\x31\xc3\xc7\x40\x66\xa4\xde\x6e\x88\xa2\xe0\x73\xde\x63\xfb\x3c\
\x1c\x7f\x64\xfb\xf1\xb9\x2a\x9d\x27\xd5\x76\x85\xae\x53\x97\x20\
\xec\x3a\xaa\xce\x74\x5e\xd4\xfb\xd4\xfd\xfb\xdb\x17\x2f\x76\x9d\
\xce\xc8\x3a\x97\xa5\xae\x55\xea\xd6\xda\xfd\xb8\xbb\xdb\xfe\xe6\
\x79\xce\xa7\x56\x49\xa3\x72\xe7\x54\x98\x83\xf3\xb5\xfe\xde\x65\
\xb2\x51\xce\xbb\x83\x31\x4d\xe2\xfb\xa7\xd3\x09\x15\x83\x11\xe9\
\x76\xef\xbf\x77\x3c\x6f\x77\x77\xb7\xed\x9e\xf6\x77\x8e\xe3\xc0\
\xb8\x75\x97\xe4\x59\xea\x0e\x01\xcd\xb1\x2d\x7b\x61\x9e\xf9\xaa\
\x54\x95\xaa\x4d\xe7\x13\x44\x7c\x77\x96\x67\xb3\x3c\xb3\xa3\x17\
\x4f\x2a\xd3\x55\xa5\xeb\xae\x8f\xac\xbb\xfb\x0b\x71\x9b\x3f\x4e\
\x6a\x3b\x9b\x53\xd0\x8b\x88\x10\xc2\xc7\xd4\xa7\xd4\x03\x85\xd7\
\xbd\xd4\x46\x3e\x7b\xcb\x50\x98\xe3\xb5\x50\x8a\x31\xf6\xc1\x37\
\x2b\x7f\x4d\x95\x74\x00\xb4\x81\xdf\x49\x3e\x1a\x50\xa7\x8f\x6d\
\xa6\x1e\x21\x4e\xa1\x5a\x19\xff\xf3\xb7\xcf\x93\xd3\xc3\x28\x37\
\xf9\x45\x37\x23\xcf\xc5\xa8\x0b\xc8\xb5\xac\x54\xd7\xc8\x4c\x75\
\xfe\x68\xef\xe3\x4f\x45\x6e\x0e\xa9\x1b\xc6\x7d\xeb\xa0\x8a\xfd\
\xc1\x4c\xcd\xa7\x42\x9d\xfe\xd0\xcf\xa9\x8b\x1d\xec\x84\x31\xc2\
\xf6\x21\xf3\x5b\x2f\x2a\xf2\xd4\x85\xa4\xe8\x39\x62\x2e\x98\xc1\
\x3b\x0c\x96\x4c\x1e\x8c\x04\x45\xd4\x79\xc7\xb2\x40\xc5\x38\xdf\
\x38\x14\x13\xee\xe1\xd8\xc3\xd1\xfb\x3e\x64\xcc\x32\xc9\x75\x66\
\xa7\x9d\xba\xfb\xb6\xc8\xff\x2d\x32\x5d\x23\x4b\x6f\x07\xa2\x6d\
\xae\x1e\x3b\x2b\x3e\x8f\x6f\x5b\xa1\xeb\xf8\xbd\x6b\x8a\xb7\xc1\
\xb9\xcd\x61\x16\x3e\xc8\xee\x9c\xb7\xe3\x34\x72\x0f\x35\x52\xea\
\x36\x75\xef\x1f\xfb\x67\x70\x3c\xe8\x36\x57\xed\xe8\x8a\xfa\x67\
\xe1\xd2\xc0\xb1\x30\x2f\xe7\x55\x31\xf4\x3d\xa6\x69\x7b\x9d\xfc\
\xf8\xba\xbf\x3b\xc8\x5c\x9f\x52\x97\xae\x9d\x3f\xb4\xae\x52\x97\
\x23\x41\x04\x83\x9f\xb5\x3b\x83\x2f\xe1\x05\xe0\x8e\xa2\x60\xf8\
\x42\x97\xde\x7e\x40\x46\x02\x46\x49\x14\xae\xbd\xc0\xf2\x68\x57\
\x8e\x77\xac\x0b\x03\xd5\xd9\x3c\xbf\x8a\x3f\xb6\xad\x15\x94\xf2\
\x45\x41\xe2\xfd\x1f\x32\x88\xba\x83\x3e\xd9\x8f\x90\xba\x8f\xb2\
\x9c\x08\xde\xec\xea\x54\xd4\x90\xa0\x37\xd4\x16\x89\xa3\xe0\x86\
\x62\xac\x37\x82\x29\xbb\x21\x81\x9c\x19\xbf\xe1\x83\x8c\xe9\x2d\
\x5f\x25\x9f\x8b\xaa\xf8\xa1\x60\xce\x64\xac\x8c\x4a\x19\x99\x4b\
\x23\xe7\x7a\x18\x2d\xbc\xaf\x2a\x90\xc0\xca\x4f\xfe\xfc\xfc\xe5\
\xdc\x82\x76\x96\x25\xff\xe8\xf6\xfb\xd0\x84\xc7\x0a\xe4\x83\x3e\
\xc2\xac\xdd\xdd\x64\xde\xe6\x59\x02\x6b\xb5\x92\x66\x57\x54\xf0\
\x89\xed\x32\xff\x1d\xd6\xe6\xd6\x9f\x1d\x0b\xb1\x79\x69\xd4\xdc\
\xe9\xb9\xdb\x56\x9d\x17\xfd\xd5\x9d\x2f\xcf\xaa\xc2\x06\xf9\x7f\
\x99\xa2\x2c\xbf\xda\x41\x86\xb4\x2e\x3a\x2d\x4c\xa9\x66\xe3\xd6\
\x1f\x66\x3f\xe4\xe6\x5f\x24\xb7\xf5\xc7\xd4\xfb\xd6\x7e\x05\xb1\
\x94\x0f\xaa\x4c\xdd\x4f\xb2\x91\x0e\x59\x13\xde\xb7\xfa\xd8\x54\
\x3a\x57\x43\x95\xb8\x33\xcf\x45\xd5\x98\x56\xd6\x9d\x4d\x3e\x75\
\xfb\xd7\x12\x4e\x85\x77\x78\xe3\x11\x8c\x43\x14\x44\x94\xbe\x1f\
\xa9\xab\xb2\x2c\x9a\x6e\x02\xd2\x99\x97\x12\x3a\x1f\xd6\x51\x42\
\x3e\x3c\x42\xca\xc9\xbd\xe8\x9f\xbe\xe1\x2d\x7d\x5e\x7b\x2c\x55\
\xa2\x9e\x54\xad\xf3\xfc\x43\x67\x5a\xfd\x5d\x25\x35\x9c\x4b\xc3\
\xfb\xb9\x14\x13\x36\x36\xcb\xa2\x56\xff\xe9\xa2\x4e\x20\x93\x7a\
\x0c\xf0\x00\xb0\x6a\x4b\xa8\x1a\x93\x84\xa3\x2d\x97\xb0\x5a\xdb\
\x56\xbe\x2c\xba\x9b\x46\x77\xc7\x29\xdb\xe4\x1b\x69\x0e\x21\x09\
\xa2\xc9\x68\x17\x6c\x8c\x18\xc3\x01\x8b\xe3\xd9\x6a\x77\x0e\x4c\
\x02\xc4\x82\x90\x4d\xd6\xd6\x16\x3a\x22\x21\xc1\x22\xe0\xb3\x15\
\xb4\x21\x12\x31\x8f\x68\x3c\x7d\xee\x37\x86\xcb\x23\x0b\x60\x81\
\x40\x11\x13\x84\xd3\x15\xb0\x90\x20\x86\x29\x5d\x00\x0b\x51\x04\
\x5b\x25\x66\xe1\x0a\x58\x18\x93\x08\x38\xbe\x59\x62\xd1\x9a\x18\
\x11\x54\x30\xb2\x2e\x31\x8a\xe2\x20\x08\x57\x25\x16\x45\x31\x03\
\x9a\x0b\x62\x0c\x85\x42\x04\x18\xb3\x37\x4b\x8c\x2e\x88\x71\x14\
\x85\x11\xe6\x54\xac\x6b\x8c\xda\x03\x34\x58\x10\x8b\x10\xe3\x94\
\x0b\x42\x16\xc4\x22\x14\xf0\x88\xc5\x5c\xbc\x59\x62\x78\x41\x8c\
\x42\x89\x04\x98\xad\x81\xd1\x18\xf1\x50\xc4\xab\x12\x13\x14\xee\
\x74\x82\xad\x4a\x8c\x87\x8c\x86\x34\x9a\x81\xd9\xa1\x56\xb4\x5e\
\x33\xba\x06\x65\x14\x2c\xb8\x90\xe6\xf9\x92\x0c\x9c\x54\xc9\xc3\
\xd1\x98\x57\xb4\x7a\x40\xb7\x19\xd8\x4b\x81\x23\x50\x1c\xc6\xb0\
\xeb\x06\x1b\xa8\x09\x0c\x8b\x83\x0a\xc7\x6e\xd8\x04\x73\x81\xf9\
\xc6\x13\x28\xe4\x98\x5e\xe1\xc6\x2f\x60\x4e\x17\x2b\x5d\xc3\x74\
\x8c\x6e\x3d\xb8\x62\x3d\x49\x73\x6c\x21\x51\xfc\x7f\xc0\x40\xe0\
\x16\x4f\x48\xc4\x63\xc0\x40\xe0\x70\x22\x34\xb6\x18\x60\x9f\xe0\
\x24\xdc\x0c\x6f\xd7\x28\x04\x6f\x89\x42\x00\x35\x6e\xb7\x8b\x70\
\xd3\x9f\xda\x94\xc4\xb1\xe3\xc1\xde\x4a\xe1\x94\xd9\x10\xb8\xc9\
\x88\xf0\x2a\x04\xf6\x96\x20\xd0\x08\x20\x08\xd8\x20\x01\x42\x40\
\x10\xe5\x8c\x3a\xc0\x80\xb3\x80\xf0\x08\x6c\x88\x07\x17\xbb\xe9\
\x05\x05\xfe\xcb\x14\xa6\xc4\xa7\xff\xdf\xe0\x8a\x69\xaf\xbc\xf0\
\x3f\x46\x96\x8d\x77\x78\x7f\xbf\xbb\xdb\xda\xeb\xf5\xee\xee\x27\
\xd7\x10\xf2\x93\
\x00\x00\x07\x7b\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x6c\
\x6f\x61\x64\x63\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\
\x2e\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\
\x32\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\
\x3c\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\
\x20\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\
\x20\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\
\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\
\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\
\x6f\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\
\x78\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\
\x72\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\
\x2f\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\
\x69\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\
\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\
\x3a\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\
\x3c\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\
\x2f\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\
\x74\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\
\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\
\x2f\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\
\x61\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\
\x67\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\
\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\
\x6f\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\
\x20\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\
\x22\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\
\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\
\x20\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\
\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\
\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\
\x65\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\
\x68\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\
\x69\x64\x74\x68\x3d\x22\x31\x35\x32\x35\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\
\x2d\x68\x65\x69\x67\x68\x74\x3d\x22\x36\x38\x34\x22\x0a\x20\x20\
\x20\x20\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\
\x34\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\
\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x32\
\x32\x39\x31\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x31\x39\x32\x22\x0a\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x79\
\x3d\x22\x39\x36\x2e\x30\x30\x30\x30\x30\x36\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x79\x3d\
\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\x78\x69\x6d\x69\
\x7a\x65\x64\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\x74\x2d\x6c\x61\
\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\x20\x2f\x3e\x0a\x20\x20\
\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\
\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x33\x37\x63\x38\x61\x62\x3b\x73\
\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x31\x2e\x33\x33\
\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\x20\x20\x20\x64\x3d\x22\
\x6d\x20\x33\x37\x2e\x35\x35\x39\x33\x32\x32\x2c\x31\x35\x34\x2e\
\x34\x34\x30\x36\x38\x20\x76\x20\x2d\x38\x20\x68\x20\x35\x36\x2e\
\x30\x30\x30\x30\x30\x34\x20\x35\x36\x2e\x30\x30\x30\x30\x30\x34\
\x20\x76\x20\x38\x20\x38\x20\x48\x20\x39\x33\x2e\x35\x35\x39\x33\
\x32\x36\x20\x33\x37\x2e\x35\x35\x39\x33\x32\x32\x20\x5a\x20\x6d\
\x20\x33\x32\x2c\x2d\x34\x38\x20\x56\x20\x38\x32\x2e\x34\x34\x30\
\x36\x37\x38\x20\x48\x20\x35\x33\x2e\x38\x39\x36\x36\x37\x31\x20\
\x33\x38\x2e\x32\x33\x34\x30\x32\x31\x20\x6c\x20\x32\x37\x2e\x36\
\x36\x32\x36\x35\x2c\x2d\x32\x37\x2e\x36\x36\x32\x36\x35\x31\x20\
\x32\x37\x2e\x36\x36\x32\x36\x35\x35\x2c\x2d\x32\x37\x2e\x36\x36\
\x32\x36\x35\x20\x32\x37\x2e\x36\x36\x32\x36\x35\x34\x2c\x32\x37\
\x2e\x36\x36\x32\x36\x35\x20\x32\x37\x2e\x36\x36\x32\x36\x36\x2c\
\x32\x37\x2e\x36\x36\x32\x36\x35\x31\x20\x68\x20\x2d\x31\x35\x2e\
\x36\x36\x32\x36\x36\x20\x2d\x31\x35\x2e\x36\x36\x32\x36\x35\x20\
\x76\x20\x32\x34\x2e\x30\x30\x30\x30\x30\x32\x20\x32\x34\x20\x48\
\x20\x39\x33\x2e\x35\x35\x39\x33\x32\x36\x20\x36\x39\x2e\x35\x35\
\x39\x33\x32\x32\x20\x5a\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x70\x61\x74\x68\x38\x31\x37\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\
\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x20\
\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x07\x7f\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x6c\
\x6f\x61\x64\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\
\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\
\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\x3c\
\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\x20\
\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\
\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\
\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\
\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\
\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\
\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\
\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\
\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\
\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\
\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\
\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\
\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\
\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\
\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\
\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\
\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\
\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\
\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\
\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\
\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\
\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\
\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\
\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\
\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\
\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\
\x64\x74\x68\x3d\x22\x37\x38\x34\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x68\
\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x34\x22\
\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\x3d\x22\
\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x32\x32\x39\
\x31\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x34\x37\x2e\x39\x39\x39\x39\
\x39\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x63\x79\x3d\x22\x39\x36\x2e\x30\x30\x30\x30\x30\x33\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\
\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\
\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\
\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\x39\x39\x39\
\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\
\x31\x2e\x33\x33\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\x20\x20\
\x20\x64\x3d\x22\x6d\x20\x33\x37\x2e\x35\x35\x39\x33\x32\x32\x2c\
\x31\x35\x34\x2e\x34\x34\x30\x36\x38\x20\x76\x20\x2d\x38\x20\x68\
\x20\x35\x36\x2e\x30\x30\x30\x30\x30\x34\x20\x35\x36\x2e\x30\x30\
\x30\x30\x30\x34\x20\x76\x20\x38\x20\x38\x20\x48\x20\x39\x33\x2e\
\x35\x35\x39\x33\x32\x36\x20\x33\x37\x2e\x35\x35\x39\x33\x32\x32\
\x20\x5a\x20\x6d\x20\x33\x32\x2c\x2d\x34\x38\x20\x56\x20\x38\x32\
\x2e\x34\x34\x30\x36\x37\x38\x20\x48\x20\x35\x33\x2e\x38\x39\x36\
\x36\x37\x31\x20\x33\x38\x2e\x32\x33\x34\x30\x32\x31\x20\x6c\x20\
\x32\x37\x2e\x36\x36\x32\x36\x35\x2c\x2d\x32\x37\x2e\x36\x36\x32\
\x36\x35\x31\x20\x32\x37\x2e\x36\x36\x32\x36\x35\x35\x2c\x2d\x32\
\x37\x2e\x36\x36\x32\x36\x35\x20\x32\x37\x2e\x36\x36\x32\x36\x35\
\x34\x2c\x32\x37\x2e\x36\x36\x32\x36\x35\x20\x32\x37\x2e\x36\x36\
\x32\x36\x36\x2c\x32\x37\x2e\x36\x36\x32\x36\x35\x31\x20\x68\x20\
\x2d\x31\x35\x2e\x36\x36\x32\x36\x36\x20\x2d\x31\x35\x2e\x36\x36\
\x32\x36\x35\x20\x76\x20\x32\x34\x2e\x30\x30\x30\x30\x30\x32\x20\
\x32\x34\x20\x48\x20\x39\x33\x2e\x35\x35\x39\x33\x32\x36\x20\x36\
\x39\x2e\x35\x35\x39\x33\x32\x32\x20\x5a\x22\x0a\x20\x20\x20\x20\
\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x38\x31\x37\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\
\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\
\x22\x30\x22\x20\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x07\xa8\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x73\
\x61\x76\x65\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\
\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\
\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\x3c\
\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\x20\
\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\
\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\
\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\
\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\
\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\
\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\
\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\
\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\
\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\
\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\
\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\
\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\
\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\
\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\
\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\
\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\
\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\
\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\
\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\
\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\
\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\
\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\
\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\
\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\
\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\
\x64\x74\x68\x3d\x22\x37\x38\x34\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x68\
\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x34\x22\
\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\x3d\x22\
\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x32\x32\x39\
\x31\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x34\x37\x2e\x39\x39\x39\x39\
\x39\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x63\x79\x3d\x22\x39\x36\x2e\x30\x30\x30\x30\x30\x33\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\
\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\
\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\
\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\x39\x39\x39\
\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\
\x31\x2e\x33\x33\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\x20\x20\
\x20\x64\x3d\x22\x6d\x20\x33\x37\x2e\x35\x35\x39\x33\x32\x32\x2c\
\x31\x35\x33\x2e\x36\x32\x37\x31\x32\x20\x76\x20\x2d\x38\x20\x68\
\x20\x35\x36\x20\x35\x35\x2e\x39\x39\x39\x39\x39\x38\x20\x76\x20\
\x38\x20\x38\x20\x68\x20\x2d\x35\x35\x2e\x39\x39\x39\x39\x39\x38\
\x20\x2d\x35\x36\x20\x7a\x20\x6d\x20\x32\x38\x2c\x2d\x35\x32\x2e\
\x36\x36\x36\x36\x37\x20\x2d\x32\x37\x2e\x33\x30\x38\x39\x34\x2c\
\x2d\x32\x37\x2e\x33\x33\x33\x33\x33\x31\x20\x68\x20\x31\x35\x2e\
\x36\x35\x34\x34\x37\x31\x20\x31\x35\x2e\x36\x35\x34\x34\x36\x39\
\x20\x76\x20\x2d\x32\x34\x20\x2d\x32\x34\x20\x68\x20\x32\x34\x20\
\x32\x33\x2e\x39\x39\x39\x39\x39\x38\x20\x76\x20\x32\x34\x20\x32\
\x34\x20\x68\x20\x31\x35\x2e\x36\x35\x34\x34\x37\x20\x31\x35\x2e\
\x36\x35\x34\x34\x36\x20\x6c\x20\x2d\x32\x37\x2e\x33\x30\x38\x39\
\x33\x2c\x32\x37\x2e\x33\x33\x33\x33\x33\x31\x20\x63\x20\x2d\x31\
\x35\x2e\x30\x31\x39\x39\x32\x2c\x31\x35\x2e\x30\x33\x33\x33\x34\
\x20\x2d\x32\x37\x2e\x36\x31\x39\x39\x31\x38\x2c\x32\x37\x2e\x33\
\x33\x33\x33\x34\x20\x2d\x32\x37\x2e\x39\x39\x39\x39\x39\x38\x2c\
\x32\x37\x2e\x33\x33\x33\x33\x34\x20\x2d\x30\x2e\x33\x38\x30\x30\
\x38\x2c\x30\x20\x2d\x31\x32\x2e\x39\x38\x30\x30\x38\x2c\x2d\x31\
\x32\x2e\x33\x20\x2d\x32\x38\x2c\x2d\x32\x37\x2e\x33\x33\x33\x33\
\x34\x20\x7a\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\
\x74\x68\x38\x31\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\
\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x20\x2f\x3e\x0a\
\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x05\xfc\
\x00\
\x00\x14\x76\x78\x9c\xcd\x58\x6d\x6f\xdb\x36\x10\xfe\xde\x5f\x21\
\xa8\x5f\x1a\xcc\xa2\xf8\x2a\x92\xaa\x9d\x61\x43\x31\x74\x40\xf7\
\x65\xeb\x5e\xbf\x29\x12\xed\xa8\x91\x45\x83\x92\xe3\xa4\xbf\x7e\
\x47\xd9\xb2\xac\x58\xe9\x52\x34\x45\xa7\x20\x81\x78\x77\x24\x8f\
\xcf\x3d\x77\x47\x65\xfe\xfd\xdd\xba\x0a\x6e\x8d\x6b\x4a\x5b\x2f\
\x42\x82\x70\x18\x98\x3a\xb7\x45\x59\xaf\x16\xe1\xef\xef\x7f\x8a\
\x54\x18\x34\x6d\x56\x17\x59\x65\x6b\xb3\x08\x6b\x1b\x7e\x7f\xf9\
\x62\xde\xdc\xae\x5e\x04\x41\x00\x93\xeb\x26\x2d\xf2\x45\x78\xdd\
\xb6\x9b\x34\x8e\x37\x5b\x57\x21\xeb\x56\x71\x91\xc7\xa6\x32\x6b\
\x53\xb7\x4d\x4c\x10\x89\xc3\xc1\x3c\x1f\xcc\x73\x67\xb2\xb6\xbc\
\x35\xb9\x5d\xaf\x6d\xdd\x74\x33\xeb\xe6\xe5\x89\xb1\x2b\x96\x47\
\xeb\xdd\x6e\x87\x76\xac\x33\x22\x5a\xeb\x18\xd3\x98\xd2\x08\x2c\
\xa2\xe6\xbe\x6e\xb3\xbb\x68\x3c\x15\x7c\x9c\x9a\x4a\x31\xc6\x31\
\xe8\x06\xcb\xa7\x59\xa5\x0d\xa0\xb2\x81\xdf\xa3\x79\x2f\x40\x8d\
\xdd\xba\xdc\x2c\x61\x9e\x41\xb5\x69\xe3\x37\xef\xdf\x1c\x95\x11\
\x46\x45\x5b\x9c\x2c\x53\xd6\x37\x4d\x9e\x6d\xcc\x68\xd7\x5e\xb8\
\x47\x20\x5b\x9b\x66\x93\xe5\xa6\x89\x7b\x79\x37\x7f\x57\x16\xed\
\xf5\x22\xe4\xaa\x1b\x5d\x9b\x72\x75\xdd\x1e\x87\xb7\xa5\xd9\xfd\
\x68\xef\x16\x21\x0e\x70\xc0\x55\x70\x10\x97\xc5\x22\x84\x63\xd0\
\xbd\xcd\x10\x67\xb2\xd7\x1e\x96\x4f\x8f\x1a\x8c\x34\x45\x34\x78\
\x25\x72\x66\x14\x2e\x66\x01\xc5\x44\x46\x58\x45\x38\xb9\xe8\xa6\
\xf4\xe7\x4a\x0b\x9b\x7b\x47\x17\x61\x91\xdb\xcd\x12\x79\xac\x2e\
\xc1\x60\xbe\x36\x6d\x56\x64\x6d\xe6\x8d\xf7\xfb\xf7\x12\x42\x3b\
\x0b\xb0\x81\x98\xa5\xbf\xbe\xf9\x69\x3f\x82\x71\x9e\xa7\x7f\x5a\
\x77\x73\x18\xc2\xe3\x0d\xb2\x2b\xbb\x85\xf3\x85\x97\x47\xf1\xbc\
\xc8\x53\x40\x79\x9d\xb5\x97\xe5\x3a\x5b\x19\x1f\xa0\xef\x00\xd5\
\x79\x3c\x28\x46\xc6\xed\xfd\xc6\x0c\x8b\xee\x97\x75\x66\x1f\xae\
\x49\xce\x16\xf9\xba\xf4\x93\xe2\xdf\xda\xb2\xaa\x7e\xf6\x9b\x84\
\x41\xfc\x60\xd1\xb2\xad\xcc\x20\x9c\xc7\x07\xef\x0f\x67\x8b\x4f\
\x0e\x37\x8f\xfb\xb3\x77\xa3\xc2\x2c\x9b\x01\x16\x3f\x22\xb8\x87\
\x64\x9d\xb9\x1b\xe3\xfa\x8d\x8e\x81\x69\x5a\x9b\xdf\x78\xeb\x1f\
\x9c\xb3\x3b\xf2\x0e\x72\xd1\xb5\x61\x6f\x66\x5d\x09\x19\xb6\x08\
\xb3\x6d\x6b\x8f\x42\x67\x96\x7f\xfb\x40\xe2\x53\xc9\x5f\x63\xc9\
\xa3\x2b\x36\xed\x7d\x05\xd0\x58\x20\xc4\xb2\xb2\xbb\xf4\xb6\x6c\
\xca\xab\xca\x84\x67\x8e\x95\x4d\xe7\xda\x22\x6c\xdd\xd6\x1c\x63\
\x34\xdf\x64\xed\xf5\x80\xb8\xdf\xc6\x4b\xb8\xd0\x2a\x1c\xc4\x20\
\xfd\x25\x00\x77\x66\xf0\x1b\xbc\x0b\x04\xbc\x45\xa2\x7b\x8d\x08\
\x45\xe2\x44\xbc\x97\xf6\xa6\x1f\x83\x93\x45\x0e\x9e\x2e\x21\x4e\
\x91\xdb\x56\x26\x35\xb7\xa6\xb6\x45\xf1\xba\x69\x9d\xbd\x31\xe9\
\x4b\xdc\x3d\x87\x61\xd4\x25\x4f\x0a\x05\x6e\xd3\x9e\x2c\xd2\xba\
\xac\x6e\x3c\x73\x20\x4b\xf2\xac\x32\xaf\x30\x52\x17\x7b\x69\x95\
\xb5\xe6\xd5\xde\x9d\x8b\x23\x07\x20\xa0\x5d\x9c\xf6\xc1\xf5\x11\
\xec\xde\x8e\x49\xe1\x33\xa2\xf0\xa9\xb8\xdf\x62\x03\xfc\xc9\x6d\
\x65\xdd\x22\x7c\xb9\xec\x9e\xc3\xde\x57\xd6\x15\xc6\xf5\xaa\xa4\
\x7b\x46\x2a\x0b\xf9\x0f\x4c\x84\x54\x3d\x88\xed\xd5\x07\x93\xb7\
\xad\xad\x0c\x38\xe7\xd9\x4b\xfa\x68\xae\x1c\x1c\x6d\x4a\xbe\x2d\
\x0b\x33\xa5\x38\xc6\xd0\xbb\x77\xdc\x68\x52\xdb\x5c\x67\x85\xdd\
\x2d\x42\xfa\x50\xb9\x2b\x6b\x50\x44\x87\x92\x44\x54\xc2\x1e\xb1\
\xe8\xcb\x14\xc1\x54\x84\x03\xf9\x8f\x40\xf5\xbc\x68\xae\xed\xce\
\x9f\x04\x22\x9a\x55\x8d\x79\xb8\xda\x47\x6b\x21\x46\x09\x92\x09\
\xe6\x44\x3e\xd4\xe6\x50\xf7\x28\x43\x9a\x51\x81\xc5\x99\x12\x0e\
\xc7\x04\x92\x22\x11\xec\x4c\x79\xf0\x12\xe6\x8b\xb3\x55\x0f\x3a\
\x98\x4e\x1f\xd3\xad\xb3\xbb\x72\x5d\x7e\x34\xc5\x10\xa8\x61\xdf\
\xad\x73\x90\x9d\x51\x95\xdd\x1b\x88\xf2\x8a\x0b\xce\x0f\x44\x9a\
\xaf\x06\x24\x56\x9c\x88\x63\x15\x58\x9d\x26\xe8\x7e\xc6\x7f\xa6\
\x16\xc3\x67\xa9\x35\xc3\xc1\x5b\xdf\x04\xfe\xf0\x7f\xde\x42\x43\
\xf8\xe7\xc4\x64\x70\xd0\xd6\x35\x70\xca\xba\x08\x5c\xbd\xcd\xda\
\xad\x33\x03\x0d\x1e\xa4\x58\x5a\x43\xfb\x3f\x29\x85\x83\xa7\x07\
\x5f\x35\x26\xd3\x79\x05\x45\xd9\x95\x77\xaf\x20\xf3\x24\xd3\x54\
\xf3\x19\x78\x37\x1b\x46\x12\x32\x4e\xc3\x41\xc9\x8c\x61\x24\x19\
\xd5\x98\x5d\x9c\x96\xfc\xf1\xa9\x3f\xc7\xfb\x13\x8c\x88\x24\x23\
\x85\x6f\x4a\x41\x24\x18\x92\x58\xf1\x44\xcd\x38\xbc\x48\x02\x04\
\x09\x88\x77\x02\xc3\x68\x16\x29\xc4\x99\xa2\x44\x27\xa3\xa9\xa7\
\x98\xbc\x34\x89\xff\x79\xfd\x78\x0d\xa2\xb9\xc8\xb2\x07\x35\x08\
\x0e\x4c\x25\x93\x8c\x8b\xcd\x5d\xaf\xa9\x4a\x38\x4b\xb6\x49\xaf\
\xb6\x6d\x7b\x2a\xfb\x60\xcb\x3a\x85\x96\x64\x5c\x2f\x3d\xe4\x6b\
\x4a\xc6\x7d\xe9\x99\x60\x62\x53\x30\x71\x44\x39\x17\x49\x32\x8b\
\x08\x47\x1a\x1c\xd7\x22\xd0\x88\x09\x45\xb0\x9e\x75\x2f\x58\x2b\
\xfa\xec\x28\x49\xa2\x05\x53\x8c\xfd\xff\x50\x12\x13\x28\x31\x82\
\x94\xc4\x34\x01\xe2\x10\x89\x04\xe5\x14\xcb\x20\xd2\x88\x28\xce\
\x24\x99\x79\x5e\x69\x8e\xe9\x57\x80\x89\x6b\x95\x60\xa5\xbe\x22\
\x4c\x43\x7b\xb3\xd0\x51\xe0\x7a\x04\x57\xe6\x3c\x0f\x9f\x01\x49\
\x39\x81\x24\xa7\x48\x2a\x9a\x30\x3e\x8b\x18\xe2\x38\x01\x76\xf1\
\x00\x1a\xb1\x14\x8c\xc8\xa4\x43\x12\xca\xc4\x33\xe3\x48\x9e\x11\
\x3e\x53\x55\xe5\xa6\x19\x5f\x3c\x7d\x0f\x42\x58\x68\x09\x0c\x19\
\xb9\xee\xee\xbc\x86\x00\xd3\x25\x1d\xf3\xca\xf7\xad\x04\x51\x02\
\x3a\x3a\x2e\x5f\xbe\xdd\x45\x42\x20\x46\x29\x66\xf2\x11\x6c\x59\
\x12\x25\x11\x9b\x82\xe9\xe8\xf6\xeb\x3d\x60\x02\x9e\xe5\x72\x0f\
\xd8\x58\x37\x89\x9f\xef\x04\x63\xf0\x7c\xc0\x88\xa6\x4c\xb0\x33\
\xbc\x9c\xdd\xd6\xfd\xcc\xa8\x03\xaf\x82\x86\xd9\xa6\xbc\x97\x15\
\x19\xdc\x31\x9c\xcb\xee\x47\xeb\x7e\x1e\xb2\x14\xaa\x12\x57\x84\
\x4d\x21\x8b\x13\x60\x52\x92\x9c\x21\x2b\x11\xd7\x2c\xa1\x22\x39\
\x47\x96\x6a\x04\x8b\x25\x8c\x3c\x8e\x2c\x79\x12\xae\x4b\x55\x14\
\xec\x0b\x70\x65\x88\x11\xa5\x09\xa5\xf2\xdb\xe0\x0a\x85\x5f\x6a\
\x41\x18\x3f\xc3\x95\x23\x4e\x08\xd1\xe4\x9c\xb1\xbe\xfa\xd1\x44\
\x50\x21\xce\x81\x65\x14\x25\x3c\x11\x92\x7e\x82\xb2\x4f\x23\xac\
\xd6\x5f\x44\x58\x06\x77\x0e\xac\x13\x00\xf7\xdb\x00\x0b\x75\x4d\
\x61\xc5\x28\x9b\x20\xac\x50\x52\xb3\x29\x5c\xbb\xde\xab\xf5\x04\
\x61\xfd\x45\x26\x61\x09\x79\x9c\xb0\x4f\x41\x95\xc9\xec\x2a\x57\
\x5f\x84\x2a\x87\xab\x1c\x7c\xc9\x7c\x23\xba\x42\x54\x31\x60\xc7\
\xd4\x04\xaa\x9a\x0a\x82\xc9\x39\xaa\x30\x47\x09\xa1\xa6\x50\xe5\
\x70\x1e\xf8\x9c\xe0\x9f\x60\x2b\x7e\x0a\xae\x34\x93\xcb\x2f\x64\
\x2b\x23\x4c\x2b\xa5\xe9\xd7\xc4\x75\x1e\xaf\xfa\x6f\xdc\xd5\xc3\
\xaf\x91\x93\xeb\xfc\xc9\xb7\x31\xc2\x38\x91\x54\xb1\x59\x44\x05\
\xc0\x28\xa9\xd6\x17\xa3\xff\x30\xc0\xa7\xcd\xf0\xc9\xe3\x57\x9d\
\xfb\xff\xd8\x5c\xbe\xf8\x17\xf9\x6e\xc1\x71\
\x00\x00\x0a\x42\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x34\x38\
\x22\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x34\x38\x2e\x30\x30\x30\x30\x30\x31\x20\x34\x38\x2e\x30\x30\
\x30\x30\x30\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\
\x32\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\
\x2e\x31\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\x39\x32\x2e\x32\x20\
\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\x30\x31\x37\x2d\x30\
\x38\x2d\x30\x36\x29\x22\x0a\x20\x20\x20\x73\x6f\x64\x69\x70\x6f\
\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x64\x65\x74\x65\
\x63\x74\x5f\x74\x72\x2e\x73\x76\x67\x22\x3e\x0a\x20\x20\x3c\x64\
\x65\x66\x73\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\
\x73\x34\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\
\x64\x69\x3a\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\
\x20\x20\x69\x64\x3d\x22\x62\x61\x73\x65\x22\x0a\x20\x20\x20\x20\
\x20\x70\x61\x67\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\
\x66\x66\x66\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\
\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\
\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\
\x74\x79\x3d\x22\x31\x2e\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x6f\x70\x61\x63\x69\
\x74\x79\x3d\x22\x30\x2e\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\x61\x64\x6f\
\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x37\x2e\x39\x31\x39\x35\
\x39\x35\x39\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x63\x78\x3d\x22\x31\x2e\x30\x34\x31\x37\x36\x36\x32\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x63\x79\x3d\x22\x33\x31\x2e\x35\x32\x33\x39\x38\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x64\x6f\x63\x75\
\x6d\x65\x6e\x74\x2d\x75\x6e\x69\x74\x73\x3d\x22\x70\x78\x22\x0a\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\
\x72\x72\x65\x6e\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x6c\x61\x79\
\x65\x72\x31\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\
\x69\x64\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\
\x75\x6e\x69\x74\x73\x3d\x22\x70\x78\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\
\x77\x69\x64\x74\x68\x3d\x22\x31\x38\x35\x39\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x30\x32\x35\x22\x0a\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\
\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x36\x31\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\
\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\x78\
\x69\x6d\x69\x7a\x65\x64\x3d\x22\x31\x22\x20\x2f\x3e\x0a\x20\x20\
\x3c\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x37\x22\x3e\x0a\x20\
\x20\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\
\x20\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\
\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\
\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\
\x6f\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\
\x78\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\
\x72\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\
\x2f\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\
\x69\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\
\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\
\x3a\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\
\x3c\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\
\x2f\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\
\x74\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x67\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x6c\x61\x62\x65\x6c\
\x3d\x22\x43\x61\x70\x61\x20\x31\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x67\x72\x6f\x75\x70\x6d\x6f\x64\
\x65\x3d\x22\x6c\x61\x79\x65\x72\x22\x0a\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x6c\x61\x79\x65\x72\x31\x22\x0a\x20\x20\x20\x20\x20\
\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x74\x72\x61\x6e\x73\
\x6c\x61\x74\x65\x28\x30\x2c\x2d\x31\x30\x30\x34\x2e\x33\x36\x32\
\x32\x29\x22\x3e\x0a\x20\x20\x20\x20\x3c\x65\x6c\x6c\x69\x70\x73\
\x65\x0a\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\
\x68\x31\x32\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x63\x78\x3d\x22\
\x31\x37\x2e\x34\x33\x36\x34\x35\x35\x22\x0a\x20\x20\x20\x20\x20\
\x20\x20\x63\x79\x3d\x22\x31\x30\x32\x39\x2e\x33\x31\x38\x35\x22\
\x0a\x20\x20\x20\x20\x20\x20\x20\x72\x78\x3d\x22\x31\x34\x2e\x33\
\x37\x36\x36\x38\x35\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x72\x79\
\x3d\x22\x31\x33\x2e\x37\x39\x36\x35\x31\x33\x22\x0a\x20\x20\x20\
\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\
\x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x23\x39\x39\x39\
\x39\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\
\x3a\x33\x2e\x33\x31\x31\x31\x36\x32\x39\x35\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\x3a\x34\x3b\
\x73\x74\x72\x6f\x6b\x65\x2d\x64\x61\x73\x68\x61\x72\x72\x61\x79\
\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6f\x70\x61\
\x63\x69\x74\x79\x3a\x31\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x3c\
\x65\x6c\x6c\x69\x70\x73\x65\x0a\x20\x20\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x70\x61\x74\x68\x31\x32\x2d\x33\x22\x0a\x20\x20\x20\
\x20\x20\x20\x20\x63\x78\x3d\x22\x33\x30\x2e\x36\x35\x34\x32\x30\
\x35\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x63\x79\x3d\x22\x31\x30\
\x32\x39\x2e\x33\x31\x38\x35\x22\x0a\x20\x20\x20\x20\x20\x20\x20\
\x72\x78\x3d\x22\x31\x34\x2e\x33\x37\x36\x36\x38\x35\x22\x0a\x20\
\x20\x20\x20\x20\x20\x20\x72\x79\x3d\x22\x31\x33\x2e\x37\x39\x36\
\x35\x31\x33\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x73\x74\x79\x6c\
\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\
\x6f\x6b\x65\x3a\x23\x39\x39\x39\x39\x39\x39\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x33\x2e\x33\x31\x31\x31\x36\
\x32\x39\x35\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\
\x6c\x69\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x64\
\x61\x73\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\
\x72\x6f\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x22\x20\
\x2f\x3e\x0a\x20\x20\x20\x20\x3c\x74\x65\x78\x74\x0a\x20\x20\x20\
\x20\x20\x20\x20\x78\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\
\x72\x65\x73\x65\x72\x76\x65\x22\x0a\x20\x20\x20\x20\x20\x20\x20\
\x73\x74\x79\x6c\x65\x3d\x22\x66\x6f\x6e\x74\x2d\x73\x74\x79\x6c\
\x65\x3a\x6e\x6f\x72\x6d\x61\x6c\x3b\x66\x6f\x6e\x74\x2d\x77\x65\
\x69\x67\x68\x74\x3a\x6e\x6f\x72\x6d\x61\x6c\x3b\x66\x6f\x6e\x74\
\x2d\x73\x69\x7a\x65\x3a\x31\x38\x2e\x33\x36\x34\x32\x33\x38\x37\
\x34\x70\x78\x3b\x6c\x69\x6e\x65\x2d\x68\x65\x69\x67\x68\x74\x3a\
\x31\x2e\x32\x35\x3b\x66\x6f\x6e\x74\x2d\x66\x61\x6d\x69\x6c\x79\
\x3a\x73\x61\x6e\x73\x2d\x73\x65\x72\x69\x66\x3b\x6c\x65\x74\x74\
\x65\x72\x2d\x73\x70\x61\x63\x69\x6e\x67\x3a\x30\x70\x78\x3b\x77\
\x6f\x72\x64\x2d\x73\x70\x61\x63\x69\x6e\x67\x3a\x30\x70\x78\x3b\
\x66\x69\x6c\x6c\x3a\x23\x39\x39\x39\x39\x39\x39\x3b\x66\x69\x6c\
\x6c\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x3b\x73\x74\x72\x6f\
\x6b\x65\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\
\x69\x64\x74\x68\x3a\x30\x2e\x34\x35\x39\x31\x30\x35\x39\x37\x22\
\x0a\x20\x20\x20\x20\x20\x20\x20\x78\x3d\x22\x31\x39\x2e\x34\x30\
\x34\x35\x36\x34\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x79\x3d\x22\
\x31\x30\x33\x36\x2e\x39\x33\x39\x32\x22\x0a\x20\x20\x20\x20\x20\
\x20\x20\x69\x64\x3d\x22\x74\x65\x78\x74\x38\x33\x39\x22\x3e\x3c\
\x74\x73\x70\x61\x6e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\
\x6f\x64\x69\x70\x6f\x64\x69\x3a\x72\x6f\x6c\x65\x3d\x22\x6c\x69\
\x6e\x65\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x74\x73\x70\x61\x6e\x38\x33\x37\x22\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x78\x3d\x22\x31\x39\x2e\x34\x30\x34\x35\x36\x34\
\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x79\x3d\x22\x31\x30\
\x33\x36\x2e\x39\x33\x39\x32\x22\x0a\x20\x20\x20\x20\x20\x20\x20\
\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x73\x74\x72\x6f\x6b\x65\x2d\
\x77\x69\x64\x74\x68\x3a\x30\x2e\x34\x35\x39\x31\x30\x35\x39\x37\
\x22\x3e\x3f\x3c\x2f\x74\x73\x70\x61\x6e\x3e\x3c\x2f\x74\x65\x78\
\x74\x3e\x0a\x20\x20\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\
\x0a\
\x00\x00\x08\xe2\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x34\x38\
\x22\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x34\x38\x2e\x30\x30\x30\x30\x30\x31\x20\x34\x38\x2e\x30\x30\
\x30\x30\x30\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\
\x32\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\
\x2e\x31\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\x39\x32\x2e\x32\x20\
\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\x30\x31\x37\x2d\x30\
\x38\x2d\x30\x36\x29\x22\x0a\x20\x20\x20\x73\x6f\x64\x69\x70\x6f\
\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x63\x6f\x6e\x73\
\x6f\x6c\x65\x2e\x73\x76\x67\x22\x3e\x0a\x20\x20\x3c\x64\x65\x66\
\x73\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x34\
\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\
\x3a\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\
\x69\x64\x3d\x22\x62\x61\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x70\
\x61\x67\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\
\x66\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\
\x6c\x6f\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\
\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\
\x3d\x22\x31\x2e\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x6f\x70\x61\x63\x69\x74\x79\
\x3d\x22\x30\x2e\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\x61\x64\x6f\x77\x3d\
\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x37\x2e\x39\x31\x39\x35\x39\x35\
\x39\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x63\x78\x3d\x22\x31\x2e\x32\x33\x31\x31\x36\x39\x38\x22\x0a\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x79\
\x3d\x22\x33\x31\x2e\x35\x32\x33\x39\x38\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x64\x6f\x63\x75\x6d\x65\
\x6e\x74\x2d\x75\x6e\x69\x74\x73\x3d\x22\x70\x78\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\
\x65\x6e\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x6c\x61\x79\x65\x72\
\x31\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\
\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x75\x6e\
\x69\x74\x73\x3d\x22\x70\x78\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\
\x64\x74\x68\x3d\x22\x31\x38\x36\x33\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\
\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x30\x32\x35\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\
\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x79\
\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\x78\x69\x6d\
\x69\x7a\x65\x64\x3d\x22\x31\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x6d\
\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x37\x22\x3e\x0a\x20\x20\x20\
\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\x20\
\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\x20\
\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\x3e\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\x72\
\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\x6d\
\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\x20\
\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\x65\
\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\
\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\x74\
\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\x20\
\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\
\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x2f\
\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x72\
\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\x61\
\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x67\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x6c\x61\x62\x65\x6c\x3d\x22\
\x43\x61\x70\x61\x20\x31\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x67\x72\x6f\x75\x70\x6d\x6f\x64\x65\x3d\
\x22\x6c\x61\x79\x65\x72\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x6c\x61\x79\x65\x72\x31\x22\x0a\x20\x20\x20\x20\x20\x74\x72\
\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x74\x72\x61\x6e\x73\x6c\x61\
\x74\x65\x28\x30\x2c\x2d\x31\x30\x30\x34\x2e\x33\x36\x32\x32\x29\
\x22\x3e\x0a\x20\x20\x20\x20\x3c\x72\x65\x63\x74\x0a\x20\x20\x20\
\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\
\x6e\x6f\x6e\x65\x3b\x66\x69\x6c\x6c\x2d\x6f\x70\x61\x63\x69\x74\
\x79\x3a\x30\x2e\x38\x34\x39\x35\x31\x34\x35\x33\x3b\x73\x74\x72\
\x6f\x6b\x65\x3a\x23\x39\x39\x39\x39\x39\x39\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x33\x2e\x38\x35\x37\x34\x31\
\x34\x32\x35\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\
\x6f\x69\x6e\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\x72\x6f\x6b\x65\
\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\x3a\x34\x3b\x73\x74\
\x72\x6f\x6b\x65\x2d\x64\x61\x73\x68\x61\x72\x72\x61\x79\x3a\x6e\
\x6f\x6e\x65\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\
\x72\x65\x63\x74\x34\x31\x33\x36\x22\x0a\x20\x20\x20\x20\x20\x20\
\x20\x77\x69\x64\x74\x68\x3d\x22\x34\x34\x2e\x31\x34\x32\x35\x38\
\x36\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x68\x65\x69\x67\x68\x74\
\x3d\x22\x34\x34\x2e\x31\x34\x32\x35\x38\x36\x22\x0a\x20\x20\x20\
\x20\x20\x20\x20\x78\x3d\x22\x31\x2e\x39\x32\x38\x37\x30\x37\x31\
\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x79\x3d\x22\x31\x30\x30\x36\
\x2e\x32\x39\x30\x39\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x72\x79\
\x3d\x22\x31\x30\x2e\x31\x38\x36\x37\x35\x31\x22\x20\x2f\x3e\x0a\
\x20\x20\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x20\
\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\
\x65\x3b\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\x76\x65\x6e\
\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x23\x39\x39\x39\x39\
\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\
\x33\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\
\x3a\x62\x75\x74\x74\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\
\x65\x6a\x6f\x69\x6e\x3a\x6d\x69\x74\x65\x72\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\x3a\x34\x3b\
\x73\x74\x72\x6f\x6b\x65\x2d\x64\x61\x73\x68\x61\x72\x72\x61\x79\
\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6f\x70\x61\
\x63\x69\x74\x79\x3a\x31\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x64\
\x3d\x22\x4d\x20\x38\x2e\x30\x38\x31\x32\x32\x30\x38\x2c\x31\x30\
\x34\x30\x2e\x36\x31\x39\x32\x20\x48\x20\x32\x32\x2e\x32\x32\x33\
\x33\x35\x36\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\
\x70\x61\x74\x68\x38\x31\x37\x22\x0a\x20\x20\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\
\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\
\x0a\x20\x20\x20\x20\x20\x20\x20\x73\x6f\x64\x69\x70\x6f\x64\x69\
\x3a\x6e\x6f\x64\x65\x74\x79\x70\x65\x73\x3d\x22\x63\x63\x22\x20\
\x2f\x3e\x0a\x20\x20\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\
\x0a\
\x00\x00\x09\x04\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x6e\
\x65\x77\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\x39\
\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\x30\
\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\x3c\x6d\
\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\x20\x20\
\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\x20\
\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\x20\
\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\x3e\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\x72\
\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\x6d\
\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\x20\
\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\x65\
\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\
\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\x74\
\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\x20\
\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\
\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x2f\
\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x72\
\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\x61\
\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\x20\
\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\x2f\x3e\
\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\x6d\
\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\x65\
\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\x0a\
\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\x72\
\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\x20\
\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x31\
\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\x6c\
\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\
\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\
\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\x6f\
\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x6f\
\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\x61\
\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\x64\
\x74\x68\x3d\x22\x31\x38\x36\x33\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x68\
\x65\x69\x67\x68\x74\x3d\x22\x31\x30\x32\x35\x22\x0a\x20\x20\x20\
\x20\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x34\
\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\x3d\
\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x32\x32\
\x39\x31\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x34\x37\x2e\x39\x39\x39\
\x39\x39\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x63\x79\x3d\x22\x39\x36\x2e\x30\x30\x30\x30\x30\x33\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x77\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\
\x6f\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\
\x61\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x31\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\
\x6e\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\x20\
\x2f\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\
\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\x39\x39\
\x39\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\
\x3a\x31\x2e\x33\x33\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\x20\
\x20\x20\x64\x3d\x22\x6d\x20\x34\x32\x2e\x38\x31\x33\x35\x35\x38\
\x2c\x31\x37\x36\x2e\x33\x37\x37\x39\x36\x20\x63\x20\x2d\x31\x2e\
\x34\x36\x36\x36\x37\x2c\x2d\x30\x2e\x36\x31\x39\x32\x34\x20\x2d\
\x34\x2e\x31\x36\x36\x36\x37\x2c\x2d\x32\x2e\x37\x33\x39\x38\x34\
\x20\x2d\x36\x2c\x2d\x34\x2e\x37\x31\x32\x34\x35\x20\x6c\x20\x2d\
\x33\x2e\x33\x33\x33\x33\x33\x2c\x2d\x33\x2e\x35\x38\x36\x35\x36\
\x20\x56\x20\x39\x37\x2e\x35\x34\x35\x33\x34\x32\x20\x32\x37\x2e\
\x30\x31\x31\x37\x33\x35\x20\x6c\x20\x34\x2e\x33\x35\x36\x37\x36\
\x2c\x2d\x34\x2e\x33\x35\x38\x39\x37\x35\x20\x34\x2e\x33\x35\x36\
\x37\x36\x2c\x2d\x34\x2e\x33\x35\x38\x39\x37\x34\x20\x33\x34\x2e\
\x39\x37\x36\x35\x37\x2c\x2d\x30\x2e\x33\x37\x38\x30\x37\x36\x20\
\x33\x34\x2e\x39\x37\x36\x35\x37\x32\x2c\x2d\x30\x2e\x33\x37\x38\
\x30\x37\x36\x20\x32\x34\x2e\x33\x37\x39\x39\x35\x2c\x32\x34\x2e\
\x34\x33\x37\x39\x30\x34\x20\x32\x34\x2e\x33\x37\x39\x39\x35\x2c\
\x32\x34\x2e\x34\x33\x37\x39\x30\x35\x20\x2d\x30\x2e\x33\x37\x39\
\x39\x35\x2c\x35\x30\x2e\x39\x31\x35\x38\x35\x37\x20\x2d\x30\x2e\
\x33\x37\x39\x39\x35\x2c\x35\x30\x2e\x39\x31\x35\x38\x36\x20\x2d\
\x34\x2e\x33\x35\x37\x37\x34\x2c\x34\x2e\x33\x35\x37\x36\x34\x20\
\x2d\x34\x2e\x33\x35\x37\x37\x35\x2c\x34\x2e\x33\x35\x37\x36\x35\
\x20\x2d\x35\x32\x2e\x39\x37\x35\x35\x39\x32\x2c\x30\x2e\x32\x37\
\x31\x37\x20\x63\x20\x2d\x32\x39\x2e\x31\x33\x36\x35\x37\x2c\x30\
\x2e\x31\x34\x39\x34\x34\x20\x2d\x35\x34\x2e\x31\x37\x35\x35\x38\
\x2c\x2d\x30\x2e\x32\x33\x34\x39\x35\x20\x2d\x35\x35\x2e\x36\x34\
\x32\x32\x35\x2c\x2d\x30\x2e\x38\x35\x34\x31\x39\x20\x7a\x20\x6d\
\x20\x38\x36\x2e\x30\x30\x30\x30\x30\x32\x2c\x2d\x33\x38\x2e\x37\
\x35\x30\x38\x34\x20\x76\x20\x2d\x38\x20\x68\x20\x2d\x33\x32\x2e\
\x30\x30\x30\x30\x30\x32\x20\x2d\x33\x32\x20\x76\x20\x38\x20\x38\
\x20\x68\x20\x33\x32\x20\x33\x32\x2e\x30\x30\x30\x30\x30\x32\x20\
\x7a\x20\x6d\x20\x30\x2c\x2d\x33\x32\x20\x76\x20\x2d\x38\x2e\x30\
\x30\x30\x30\x30\x31\x20\x68\x20\x2d\x33\x32\x2e\x30\x30\x30\x30\
\x30\x32\x20\x2d\x33\x32\x20\x76\x20\x38\x2e\x30\x30\x30\x30\x30\
\x31\x20\x38\x20\x68\x20\x33\x32\x20\x33\x32\x2e\x30\x30\x30\x30\
\x30\x32\x20\x7a\x20\x6d\x20\x32\x30\x2c\x2d\x33\x32\x2e\x33\x34\
\x38\x34\x38\x39\x20\x63\x20\x30\x2c\x2d\x30\x2e\x31\x39\x31\x36\
\x36\x39\x20\x2d\x39\x2e\x39\x2c\x2d\x31\x30\x2e\x32\x33\x34\x38\
\x34\x39\x20\x2d\x32\x32\x2c\x2d\x32\x32\x2e\x33\x31\x38\x31\x37\
\x39\x20\x6c\x20\x2d\x32\x32\x2c\x2d\x32\x31\x2e\x39\x36\x39\x36\
\x39\x20\x56\x20\x35\x31\x2e\x33\x30\x38\x39\x34\x20\x37\x33\x2e\
\x36\x32\x37\x31\x31\x39\x20\x68\x20\x32\x32\x20\x63\x20\x31\x32\
\x2e\x31\x2c\x30\x20\x32\x32\x2c\x2d\x30\x2e\x31\x35\x36\x38\x32\
\x20\x32\x32\x2c\x2d\x30\x2e\x33\x34\x38\x34\x38\x38\x20\x7a\x22\
\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x38\x31\
\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\
\x74\x75\x72\x65\x3d\x22\x30\x22\x20\x2f\x3e\x0a\x3c\x2f\x73\x76\
\x67\x3e\x0a\
\x00\x00\x09\xb4\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\
\x6c\x6e\x73\x3a\x64\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\
\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\
\x6e\x74\x73\x2f\x31\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\
\x6e\x73\x3a\x63\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\
\x65\x61\x74\x69\x76\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\
\x67\x2f\x6e\x73\x23\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\
\x72\x64\x66\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\
\x32\x2d\x72\x64\x66\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\
\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\
\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\
\x6f\x64\x69\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\
\x70\x6f\x64\x69\x2e\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\
\x2e\x6e\x65\x74\x2f\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\
\x69\x2d\x30\x2e\x64\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\
\x73\x3a\x69\x6e\x6b\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\
\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\
\x6f\x72\x67\x2f\x6e\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x22\x0a\x20\x20\x20\x77\x69\x64\x74\
\x68\x3d\x22\x34\x38\x22\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\
\x3d\x22\x34\x38\x22\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\
\x3d\x22\x30\x20\x30\x20\x34\x38\x20\x34\x38\x22\x0a\x20\x20\x20\
\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x0a\x20\x20\
\x20\x69\x64\x3d\x22\x73\x76\x67\x36\x22\x0a\x20\x20\x20\x73\x6f\
\x64\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\
\x72\x75\x6e\x5f\x63\x61\x73\x63\x61\x64\x65\x2e\x73\x76\x67\x22\
\x0a\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x76\x65\x72\
\x73\x69\x6f\x6e\x3d\x22\x30\x2e\x39\x32\x2e\x32\x20\x28\x35\x63\
\x33\x65\x38\x30\x64\x2c\x20\x32\x30\x31\x37\x2d\x30\x38\x2d\x30\
\x36\x29\x22\x3e\x0a\x20\x20\x3c\x6d\x65\x74\x61\x64\x61\x74\x61\
\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x6d\x65\x74\x61\x64\x61\
\x74\x61\x31\x32\x22\x3e\x0a\x20\x20\x20\x20\x3c\x72\x64\x66\x3a\
\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x63\x63\x3a\x57\
\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\
\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\x3e\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x69\x6d\
\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\x6d\x6c\x3c\x2f\x64\x63\x3a\
\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\
\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\x20\x20\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x72\x64\x66\x3a\x72\x65\x73\x6f\x75\x72\x63\x65\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\x72\
\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\x74\x79\x70\x65\x2f\x53\x74\
\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\x20\x2f\x3e\x0a\x20\x20\x20\
\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x69\x74\x6c\x65\x20\x2f\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x2f\x63\x63\x3a\x57\x6f\x72\
\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x72\x64\x66\x3a\x52\x44\x46\
\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\x61\x64\x61\x74\x61\x3e\x0a\
\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x64\x65\x66\x73\x31\x30\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x73\
\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\x6d\x65\x64\x76\x69\x65\
\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\x65\x63\x6f\x6c\x6f\x72\
\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\x0a\x20\x20\x20\x20\x20\
\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x36\x36\
\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\
\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x31\x22\x0a\x20\x20\x20\
\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\x6c\x65\x72\x61\x6e\x63\
\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x72\x69\x64\
\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\
\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\x6f\x6c\x65\x72\x61\x6e\
\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x6f\x70\x61\x63\x69\x74\
\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\x61\x64\x6f\x77\x3d\x22\
\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\x64\x74\x68\x3d\x22\x31\
\x38\x36\x33\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x68\x65\x69\x67\x68\x74\
\x3d\x22\x31\x30\x32\x35\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x38\x22\x0a\x20\x20\x20\
\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\x3d\x22\x66\x61\x6c\x73\
\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x7a\x6f\x6f\x6d\x3d\x22\x34\x2e\x39\x31\x36\x36\x36\x36\x37\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x63\x78\x3d\x22\x2d\x34\x38\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x63\x79\x3d\x22\x32\x34\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\
\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\
\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\x78\x69\
\x6d\x69\x7a\x65\x64\x3d\x22\x31\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\x74\x2d\
\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x36\x22\x20\x2f\x3e\x0a\
\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x73\x74\x79\
\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\x39\x39\x39\x39\x39\
\x3b\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\x76\x65\x6e\x6f\
\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x23\x39\x39\x39\x39\x39\
\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x32\
\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3a\
\x62\x75\x74\x74\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\
\x6a\x6f\x69\x6e\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\x72\x6f\x6b\
\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\x3a\x34\x3b\
\x73\x74\x72\x6f\x6b\x65\x2d\x64\x61\x73\x68\x61\x72\x72\x61\x79\
\x3a\x6e\x6f\x6e\x65\x22\x0a\x20\x20\x20\x20\x20\x64\x3d\x22\x6d\
\x20\x32\x35\x2e\x32\x34\x30\x35\x34\x34\x2c\x31\x32\x2e\x35\x39\
\x32\x34\x32\x31\x20\x2d\x30\x2e\x32\x30\x33\x33\x39\x2c\x32\x32\
\x2e\x33\x37\x32\x38\x38\x33\x20\x31\x39\x2e\x37\x32\x38\x38\x31\
\x34\x2c\x2d\x31\x31\x2e\x35\x39\x33\x32\x32\x20\x7a\x22\x0a\x20\
\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x34\x34\x38\x39\
\x2d\x33\x2d\x36\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\
\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x20\x2f\x3e\x0a\x20\
\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x64\x3d\x22\x4d\
\x30\x20\x30\x68\x34\x38\x76\x34\x38\x68\x2d\x34\x38\x7a\x22\x0a\
\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x32\x22\x0a\
\x20\x20\x20\x20\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\
\x20\x2f\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\
\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x36\x36\
\x36\x36\x36\x36\x3b\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\
\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x23\x36\
\x36\x36\x36\x36\x36\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\
\x74\x68\x3a\x32\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\
\x63\x61\x70\x3a\x62\x75\x74\x74\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x72\x6f\x75\x6e\x64\x3b\x73\
\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\
\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x64\x61\x73\x68\x61\x72\
\x72\x61\x79\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x22\x0a\x20\x20\x20\x20\x20\
\x64\x3d\x22\x4d\x20\x31\x35\x2e\x37\x35\x35\x38\x36\x36\x2c\x31\
\x32\x2e\x35\x39\x32\x34\x32\x31\x20\x31\x35\x2e\x35\x35\x32\x34\
\x37\x36\x2c\x33\x34\x2e\x39\x36\x35\x33\x30\x33\x20\x33\x35\x2e\
\x32\x38\x31\x32\x39\x2c\x32\x33\x2e\x33\x37\x32\x30\x38\x33\x20\
\x5a\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\
\x34\x34\x38\x39\x2d\x33\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\
\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x20\x2f\x3e\
\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x73\x74\
\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x33\x33\x33\x33\x33\
\x33\x3b\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\x76\x65\x6e\
\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x23\x33\x33\x33\x33\
\x33\x33\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\
\x32\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\
\x3a\x62\x75\x74\x74\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\
\x65\x6a\x6f\x69\x6e\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x3b\x73\x74\x72\
\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\x3a\x34\
\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x64\x61\x73\x68\x61\x72\x72\x61\
\x79\x3a\x6e\x6f\x6e\x65\x22\x0a\x20\x20\x20\x20\x20\x64\x3d\x22\
\x4d\x20\x36\x2e\x32\x37\x31\x31\x38\x36\x34\x2c\x31\x32\x2e\x35\
\x39\x32\x34\x32\x31\x20\x36\x2e\x30\x36\x37\x37\x39\x36\x36\x2c\
\x33\x34\x2e\x39\x36\x35\x33\x30\x33\x20\x32\x35\x2e\x37\x39\x36\
\x36\x31\x2c\x32\x33\x2e\x33\x37\x32\x30\x38\x33\x20\x5a\x22\x0a\
\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x34\x34\x38\
\x39\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\
\x74\x75\x72\x65\x3d\x22\x30\x22\x20\x2f\x3e\x0a\x3c\x2f\x73\x76\
\x67\x3e\x0a\
\x00\x00\x08\x4b\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x64\
\x65\x6c\x65\x74\x65\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x30\x2e\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\
\x20\x32\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\
\x20\x3c\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\
\x69\x64\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\
\x20\x20\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\
\x20\x20\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\
\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\
\x22\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\
\x66\x6f\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\
\x2b\x78\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\
\x65\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\
\x3a\x72\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\
\x6d\x69\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\
\x65\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\
\x63\x3a\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\
\x20\x3c\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\
\x3c\x2f\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\
\x65\x74\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\
\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\
\x20\x2f\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\
\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\
\x61\x67\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\
\x66\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\
\x6c\x6f\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\
\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\
\x3d\x22\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\
\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\
\x20\x20\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\
\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\
\x65\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\
\x67\x65\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\
\x73\x68\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\
\x77\x69\x64\x74\x68\x3d\x22\x37\x38\x34\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\
\x2d\x68\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x30\x22\x0a\x20\x20\
\x20\x20\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\
\x34\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\
\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x32\
\x32\x39\x31\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x34\x37\x2e\x39\x39\
\x39\x39\x39\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x63\x79\x3d\x22\x39\x36\x2e\x30\x30\x30\x30\x30\
\x33\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\
\x64\x6f\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\
\x6d\x61\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x30\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\
\x65\x6e\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\
\x20\x2f\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\
\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\x39\
\x39\x39\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\
\x68\x3a\x31\x2e\x33\x33\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\
\x20\x20\x20\x64\x3d\x22\x4d\x20\x34\x34\x2e\x30\x31\x39\x39\x34\
\x2c\x31\x34\x37\x2e\x31\x36\x36\x35\x20\x33\x38\x2e\x33\x36\x37\
\x35\x37\x32\x2c\x31\x34\x31\x2e\x35\x31\x34\x31\x32\x20\x36\x30\
\x2e\x36\x38\x38\x38\x35\x2c\x31\x31\x39\x2e\x31\x36\x33\x38\x34\
\x20\x38\x33\x2e\x30\x31\x30\x31\x32\x39\x2c\x39\x36\x2e\x38\x31\
\x33\x35\x35\x39\x20\x36\x30\x2e\x36\x38\x38\x38\x35\x2c\x37\x34\
\x2e\x34\x36\x33\x32\x37\x32\x20\x33\x38\x2e\x33\x36\x37\x35\x37\
\x32\x2c\x35\x32\x2e\x31\x31\x32\x39\x38\x36\x20\x34\x34\x2e\x30\
\x31\x39\x39\x34\x2c\x34\x36\x2e\x34\x36\x30\x36\x31\x38\x20\x34\
\x39\x2e\x36\x37\x32\x33\x30\x38\x2c\x34\x30\x2e\x38\x30\x38\x32\
\x35\x20\x37\x32\x2e\x30\x32\x32\x35\x39\x34\x2c\x36\x33\x2e\x31\
\x32\x39\x35\x32\x38\x20\x39\x34\x2e\x33\x37\x32\x38\x38\x35\x2c\
\x38\x35\x2e\x34\x35\x30\x38\x30\x37\x20\x31\x31\x36\x2e\x37\x32\
\x33\x31\x38\x2c\x36\x33\x2e\x31\x32\x39\x35\x32\x38\x20\x31\x33\
\x39\x2e\x30\x37\x33\x34\x36\x2c\x34\x30\x2e\x38\x30\x38\x32\x35\
\x20\x6c\x20\x35\x2e\x36\x35\x32\x33\x38\x2c\x35\x2e\x36\x35\x32\
\x33\x36\x38\x20\x35\x2e\x36\x35\x32\x33\x36\x2c\x35\x2e\x36\x35\
\x32\x33\x36\x38\x20\x2d\x32\x32\x2e\x33\x32\x31\x32\x38\x2c\x32\
\x32\x2e\x33\x35\x30\x32\x38\x36\x20\x2d\x32\x32\x2e\x33\x32\x31\
\x32\x38\x2c\x32\x32\x2e\x33\x35\x30\x32\x38\x37\x20\x32\x32\x2e\
\x33\x32\x31\x32\x38\x2c\x32\x32\x2e\x33\x35\x30\x32\x38\x31\x20\
\x32\x32\x2e\x33\x32\x31\x32\x38\x2c\x32\x32\x2e\x33\x35\x30\x32\
\x38\x20\x2d\x35\x2e\x36\x35\x32\x33\x36\x2c\x35\x2e\x36\x35\x32\
\x33\x38\x20\x2d\x35\x2e\x36\x35\x32\x33\x38\x2c\x35\x2e\x36\x35\
\x32\x33\x36\x20\x2d\x32\x32\x2e\x33\x35\x30\x32\x38\x2c\x2d\x32\
\x32\x2e\x33\x32\x31\x32\x38\x20\x2d\x32\x32\x2e\x33\x35\x30\x32\
\x39\x35\x2c\x2d\x32\x32\x2e\x33\x32\x31\x32\x37\x20\x2d\x32\x32\
\x2e\x33\x35\x30\x32\x39\x31\x2c\x32\x32\x2e\x33\x32\x31\x32\x37\
\x20\x2d\x32\x32\x2e\x33\x35\x30\x32\x38\x36\x2c\x32\x32\x2e\x33\
\x32\x31\x32\x38\x20\x7a\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x70\x61\x74\x68\x38\x31\x37\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\
\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x20\
\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x0c\x2f\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x34\x38\
\x22\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x34\x38\x2e\x30\x30\x30\x30\x30\x31\x20\x34\x38\x2e\x30\x30\
\x30\x30\x30\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\
\x32\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\
\x2e\x31\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\x39\x32\x2e\x32\x20\
\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\x30\x31\x37\x2d\x30\
\x38\x2d\x30\x36\x29\x22\x0a\x20\x20\x20\x73\x6f\x64\x69\x70\x6f\
\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x72\x65\x73\x69\
\x7a\x65\x2e\x73\x76\x67\x22\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\
\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x34\x22\
\x20\x2f\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\
\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x62\x61\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x70\x61\
\x67\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\
\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\
\x6f\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\
\x20\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\
\x22\x31\x2e\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x70\x61\x67\x65\x6f\x70\x61\x63\x69\x74\x79\x3d\
\x22\x30\x2e\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\x61\x64\x6f\x77\x3d\x22\
\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x7a\x6f\x6f\x6d\x3d\x22\x37\x2e\x39\x31\x39\x35\x39\x35\x39\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x63\x78\x3d\x22\x32\x33\x2e\x35\x38\x30\x37\x39\x35\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x79\x3d\
\x22\x33\x31\x2e\x35\x32\x33\x39\x38\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x64\x6f\x63\x75\x6d\x65\x6e\
\x74\x2d\x75\x6e\x69\x74\x73\x3d\x22\x70\x78\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\
\x6e\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x6c\x61\x79\x65\x72\x31\
\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\x3d\
\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x75\x6e\x69\
\x74\x73\x3d\x22\x70\x78\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\x64\
\x74\x68\x3d\x22\x31\x38\x36\x33\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x68\
\x65\x69\x67\x68\x74\x3d\x22\x31\x30\x32\x35\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x79\x3d\
\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\x78\x69\x6d\x69\
\x7a\x65\x64\x3d\x22\x31\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x6d\x65\
\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\
\x6d\x65\x74\x61\x64\x61\x74\x61\x37\x22\x3e\x0a\x20\x20\x20\x20\
\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\x20\x20\
\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\x20\x20\
\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\x3e\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\x72\x6d\
\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\x6d\x6c\
\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\x20\x20\
\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\x20\x20\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\x65\x73\
\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\
\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\x74\x79\
\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\x20\x2f\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x69\
\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x2f\x63\
\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x72\x64\
\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\x61\x64\
\x61\x74\x61\x3e\x0a\x20\x20\x3c\x67\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x6c\x61\x62\x65\x6c\x3d\x22\x43\
\x61\x70\x61\x20\x31\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x67\x72\x6f\x75\x70\x6d\x6f\x64\x65\x3d\x22\
\x6c\x61\x79\x65\x72\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\
\x6c\x61\x79\x65\x72\x31\x22\x0a\x20\x20\x20\x20\x20\x74\x72\x61\
\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x74\x72\x61\x6e\x73\x6c\x61\x74\
\x65\x28\x30\x2c\x2d\x31\x30\x30\x34\x2e\x33\x36\x32\x32\x29\x22\
\x3e\x0a\x20\x20\x20\x20\x3c\x72\x65\x63\x74\x0a\x20\x20\x20\x20\
\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x6e\
\x6f\x6e\x65\x3b\x66\x69\x6c\x6c\x2d\x6f\x70\x61\x63\x69\x74\x79\
\x3a\x30\x2e\x38\x34\x39\x35\x31\x34\x35\x33\x3b\x73\x74\x72\x6f\
\x6b\x65\x3a\x23\x39\x39\x39\x39\x39\x39\x3b\x73\x74\x72\x6f\x6b\
\x65\x2d\x77\x69\x64\x74\x68\x3a\x33\x2e\x38\x35\x37\x34\x31\x34\
\x32\x35\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\
\x69\x6e\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\
\x6f\x6b\x65\x2d\x64\x61\x73\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\
\x6e\x65\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x72\
\x65\x63\x74\x34\x31\x33\x36\x22\x0a\x20\x20\x20\x20\x20\x20\x20\
\x77\x69\x64\x74\x68\x3d\x22\x34\x34\x2e\x31\x34\x32\x35\x38\x36\
\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\
\x22\x34\x34\x2e\x31\x34\x32\x35\x38\x36\x22\x0a\x20\x20\x20\x20\
\x20\x20\x20\x78\x3d\x22\x31\x2e\x39\x32\x38\x37\x30\x37\x31\x22\
\x0a\x20\x20\x20\x20\x20\x20\x20\x79\x3d\x22\x31\x30\x30\x36\x2e\
\x32\x39\x30\x39\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x72\x79\x3d\
\x22\x31\x30\x2e\x31\x38\x36\x37\x35\x31\x22\x20\x2f\x3e\x0a\x20\
\x20\x20\x20\x3c\x67\x0a\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x67\x34\x31\x35\x37\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x74\
\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\x69\x78\
\x28\x30\x2e\x38\x34\x36\x30\x33\x30\x39\x34\x2c\x30\x2c\x30\x2c\
\x30\x2e\x37\x38\x38\x35\x37\x39\x37\x35\x2c\x35\x2e\x30\x34\x33\
\x34\x38\x37\x32\x2c\x32\x31\x37\x2e\x30\x39\x30\x33\x29\x22\x0a\
\x20\x20\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x73\x74\
\x72\x6f\x6b\x65\x3a\x23\x39\x39\x39\x39\x39\x39\x3b\x66\x69\x6c\
\x6c\x3a\x23\x39\x39\x39\x39\x39\x39\x22\x3e\x0a\x20\x20\x20\x20\
\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x20\x20\x20\
\x20\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x6f\x64\x65\x74\x79\
\x70\x65\x73\x3d\x22\x63\x63\x63\x22\x0a\x20\x20\x20\x20\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\
\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\
\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x70\x61\x74\x68\x34\x31\x33\x38\x22\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x64\x3d\x22\x6d\x20\x39\x2e\x31\x38\x38\x32\x34\
\x39\x33\x2c\x31\x30\x34\x33\x2e\x31\x32\x35\x39\x20\x32\x38\x2e\
\x31\x37\x38\x38\x37\x35\x37\x2c\x2d\x32\x38\x2e\x39\x31\x38\x34\
\x20\x30\x2c\x30\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\x39\x39\x39\
\x39\x39\x3b\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\x76\x65\
\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x23\x39\x39\x39\
\x39\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\
\x3a\x34\x2e\x37\x34\x36\x31\x37\x39\x35\x38\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3a\x62\x75\x74\x74\x3b\
\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\
\x6d\x69\x74\x65\x72\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\
\x65\x72\x6c\x69\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\
\x2d\x64\x61\x73\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\x3b\
\x73\x74\x72\x6f\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\
\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x70\x61\x74\x68\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x6f\x64\x69\x70\x6f\
\x64\x69\x3a\x6e\x6f\x64\x65\x74\x79\x70\x65\x73\x3d\x22\x63\x63\
\x63\x63\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\
\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x0a\x20\x20\
\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x34\
\x31\x34\x30\x2d\x33\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\
\x64\x3d\x22\x6d\x20\x33\x38\x2e\x38\x37\x31\x32\x38\x33\x2c\x31\
\x30\x31\x39\x2e\x35\x35\x34\x39\x20\x2d\x36\x2e\x35\x36\x33\x31\
\x37\x39\x2c\x2d\x37\x2e\x32\x39\x37\x38\x20\x38\x2e\x32\x39\x37\
\x34\x34\x38\x2c\x2d\x31\x2e\x38\x30\x38\x33\x20\x7a\x22\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\
\x69\x6c\x6c\x3a\x23\x39\x39\x39\x39\x39\x39\x3b\x66\x69\x6c\x6c\
\x2d\x72\x75\x6c\x65\x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\
\x72\x6f\x6b\x65\x3a\x23\x39\x39\x39\x39\x39\x39\x3b\x73\x74\x72\
\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x31\x70\x78\x3b\x73\x74\
\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3a\x62\x75\x74\
\x74\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\
\x6e\x3a\x6d\x69\x74\x65\x72\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6f\
\x70\x61\x63\x69\x74\x79\x3a\x31\x22\x20\x2f\x3e\x0a\x20\x20\x20\
\x20\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x20\x20\
\x20\x20\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x6f\x64\x65\x74\
\x79\x70\x65\x73\x3d\x22\x63\x63\x63\x63\x22\x0a\x20\x20\x20\x20\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\
\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\
\x65\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x70\x61\x74\x68\x34\x31\x34\x30\x2d\x33\x2d\x36\x22\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x64\x3d\x22\x6d\x20\x36\
\x2e\x38\x36\x39\x33\x30\x36\x38\x2c\x31\x30\x33\x38\x2e\x34\x32\
\x35\x38\x20\x36\x2e\x35\x36\x33\x32\x31\x39\x32\x2c\x37\x2e\x32\
\x39\x37\x39\x20\x2d\x38\x2e\x32\x39\x37\x34\x35\x30\x32\x2c\x31\
\x2e\x38\x30\x38\x33\x20\x7a\x22\x0a\x20\x20\x20\x20\x20\x20\x20\
\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\
\x39\x39\x39\x39\x39\x3b\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\
\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x23\
\x39\x39\x39\x39\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\
\x64\x74\x68\x3a\x31\x70\x78\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\
\x69\x6e\x65\x63\x61\x70\x3a\x62\x75\x74\x74\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x6d\x69\x74\x65\
\x72\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\
\x3a\x31\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x67\x3e\x0a\
\x20\x20\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x06\xc4\
\x00\
\x00\x17\x93\x78\x9c\xcd\x58\x59\x6f\xe3\x46\x12\x7e\x9f\x5f\x41\
\x70\x5e\xc6\x58\xb1\xd9\xf7\xc1\x91\x1c\xec\x62\x10\x24\x40\xf6\
\x65\x37\xc9\x1e\x2f\x0b\x9a\x6c\xc9\x8c\x29\x52\x20\x29\xcb\x9e\
\x5f\xbf\xd5\xa4\x78\x59\x54\xd6\xc1\x78\x30\x4b\xc3\x36\xbb\xaa\
\xba\xbb\xfa\xab\xb3\xb9\xfe\xee\x69\x9f\x7b\x8f\xb6\xaa\xb3\xb2\
\xd8\xf8\x04\x61\xdf\xb3\x45\x52\xa6\x59\xb1\xdb\xf8\xbf\xfc\xfc\
\x7d\xa0\x7d\xaf\x6e\xe2\x22\x8d\xf3\xb2\xb0\x1b\xbf\x28\xfd\xef\
\x6e\xdf\xad\xeb\xc7\xdd\x3b\xcf\xf3\x60\x72\x51\x47\x69\xb2\xf1\
\xef\x9b\xe6\x10\x85\xe1\xe1\x58\xe5\xa8\xac\x76\x61\x9a\x84\x36\
\xb7\x7b\x5b\x34\x75\x48\x10\x09\xfd\x51\x3c\x19\xc5\x93\xca\xc6\
\x4d\xf6\x68\x93\x72\xbf\x2f\x8b\xba\x9d\x59\xd4\xef\x27\xc2\x55\
\xba\x1d\xa4\x4f\xa7\x13\x3a\xb1\x56\x88\x18\x63\x42\x4c\x43\x4a\
\x03\x90\x08\xea\xe7\xa2\x89\x9f\x82\xf9\x54\xd0\x71\x69\x2a\xc5\
\x18\x87\xc0\x1b\x25\x5f\x27\x15\xd5\x80\xca\x01\x7e\x07\xf1\x9e\
\x80\xea\xf2\x58\x25\x76\x0b\xf3\x2c\x2a\x6c\x13\x7e\xfa\xf9\xd3\
\xc0\x0c\x30\x4a\x9b\x74\xb2\x4c\x56\x3c\xd4\x49\x7c\xb0\xb3\x5d\
\x7b\x62\x87\x40\xbc\xb7\xf5\x21\x4e\x6c\x1d\xf6\xf4\x76\xfe\x29\
\x4b\x9b\xfb\x8d\xcf\x75\x3b\xba\xb7\xd9\xee\xbe\x19\x86\x8f\x99\
\x3d\xfd\xa5\x7c\xda\xf8\xd8\xc3\x1e\xd7\xde\x99\x9c\xa5\x1b\x1f\
\x8e\x41\x3b\x99\xd1\xce\xa4\xe3\x9e\x97\x8f\x06\x0e\x46\x86\x22\
\xea\x7d\x10\x09\xb3\x1a\xa7\x2b\x8f\x62\xa2\x02\xac\x03\x2c\x6f\
\xda\x29\xfd\xb9\xa2\xb4\x4c\x9c\xa2\x1b\x3f\x4d\xca\xc3\xf6\x3f\
\x4d\x8d\x1c\x5c\xb7\x20\xb3\xde\xdb\x26\x4e\xe3\x26\x76\xf2\x9d\
\x0a\x3d\x85\xd0\x56\x02\x64\xc0\x6c\xd1\xdf\x3e\x7d\xdf\x8d\x60\
\x9c\x24\xd1\x3f\xca\xea\xe1\x3c\x84\xc7\x09\xc4\x77\xe5\x11\x8e\
\xe8\xdf\x0e\xe4\x75\x9a\x44\x00\xf4\x3e\x6e\x6e\xb3\x7d\xbc\xb3\
\xce\x46\x7f\x02\x60\xd7\xe1\xc8\x98\x09\x37\xcf\x07\x3b\x2e\xda\
\x2d\x5b\xd9\xce\x62\x8b\x6e\x9b\x26\xfb\xcc\x4d\x0a\xff\xde\x64\
\x79\xfe\xa3\xdb\xc4\xf7\xc2\x17\x8b\x66\x4d\x6e\x47\xe2\x3a\x3c\
\x6b\x7f\x3e\x5b\x38\x39\xdc\x3a\xec\xcf\xde\x8e\x52\xbb\xad\x47\
\x58\xdc\x88\xe0\x1e\x92\x7d\x5c\x3d\xd8\xaa\xdf\x68\xb0\x4d\xdd\
\x94\xc9\x83\x93\xfe\x73\x55\x95\x27\xf2\x13\x84\x63\xd5\xf8\xbd\
\x58\x59\x65\x10\x64\x1b\x3f\x3e\x36\xe5\x40\xac\xec\xf6\x5f\xce\
\x96\x78\x4a\xf9\xe7\x9c\x72\x75\xc5\xba\x79\xce\x01\x9a\x12\x7c\
\x62\x9b\x97\xa7\xe8\x31\xab\xb3\xbb\xdc\xfa\x17\x8a\x65\x75\xab\
\xda\xc6\x6f\xaa\xa3\x1d\x6c\xb4\x3e\xc4\xcd\xfd\x88\xb8\xdb\xc6\
\x51\xb8\x30\xda\x1f\xc9\x40\xfd\xab\x07\xea\xac\xe0\xd7\xfb\xc9\
\x13\xf0\x16\x88\xf6\x35\x20\x14\x89\x09\xb9\xa3\xf6\xa2\x9f\xbd\
\xc9\x22\x67\x4d\xb7\x60\xa7\xa0\x3a\xe6\x36\xb2\x8f\xb6\x28\xd3\
\xf4\x63\xdd\x54\xe5\x83\x8d\xde\xe3\xf6\x39\x0f\x83\x36\x7e\x22\
\xc8\x71\x87\x66\xb2\x48\x53\xc5\x45\xed\x3c\x07\x02\x25\x89\x73\
\xfb\x01\x23\x7d\xd3\x51\xf3\xb8\xb1\x1f\x3a\x75\x6e\x06\x1f\x00\
\x83\xb6\x76\xea\x8c\xeb\x2c\xd8\xbe\x0d\x71\xe1\x82\x22\x75\xd1\
\xd8\x6d\x71\x00\xff\x49\xca\xbc\xac\x36\xfe\xfb\x6d\xfb\x9c\xf7\
\xbe\x2b\xab\xd4\x56\x3d\x4b\xb6\xcf\x8c\x55\x42\x0a\x00\x4f\x84\
\x68\x3d\x93\xcb\xbb\xdf\x6c\xd2\x34\x65\x6e\x41\x39\xe7\xbd\xa4\
\xb7\xe6\xae\x82\xa3\x2d\xd1\x8f\x59\x6a\x97\x18\x83\x0d\x9d\x7a\
\xc3\x46\x8b\xdc\xfa\x3e\x4e\xcb\xd3\xc6\xa7\x2f\x99\xa7\xac\x00\
\x46\x70\xce\x4a\x44\x4b\x76\x45\xa2\xcf\x54\x04\x53\xe1\x8f\xce\
\x3f\x00\xd5\xfb\x45\x7d\x5f\x9e\xdc\x49\xc0\xa2\x71\x5e\xdb\x97\
\xab\x7d\x2e\x4b\xb0\x91\x44\x4a\x62\x4e\xa4\x7a\xc9\x4e\x20\xf7\
\x05\x82\x23\xaa\xb5\x22\xe2\x82\x0b\xc7\x63\x60\x7a\x8d\xb9\x36\
\x57\xf4\x84\x05\xc4\xc5\xb2\x67\x1e\x4c\xa7\xd7\x78\xfb\xf8\x29\
\xdb\x67\x9f\x6d\x3a\x9a\x6a\xdc\xf7\x58\x55\x10\x9f\x41\x1e\x3f\
\x5b\xb0\xf3\x8e\x0b\xce\xcf\xae\xb4\xde\x8d\x58\xec\x38\x11\x43\
\x1e\xd8\x4d\x43\xb4\x9b\xf1\x3f\x83\x8b\xe1\x8b\xe0\x5a\x61\xef\
\x07\x57\x09\x7e\x75\x7f\x7e\x80\xaa\xf0\xef\x89\xc8\xa8\x60\x59\
\x14\xe0\x55\x65\x15\x80\xaa\x8f\x71\x73\xac\xec\xe8\x08\x2f\x82\
\x2c\x2a\xa0\x07\x98\x24\xc3\x51\xd3\xb3\xae\x06\x93\xe5\xc8\x82\
\xb4\x5c\x65\x4f\x1f\xc0\x00\x8a\x19\x6a\xf8\x0a\xb4\x5b\x8d\x23\
\x45\x90\x32\x42\x71\xb1\xa2\x06\x81\x6d\x0d\x53\x37\xd3\xa4\x3f\
\x3f\xf5\x1f\xd1\x7e\x82\x11\x51\x64\xc6\x70\x65\xc9\x0b\x04\x43\
\x0a\x6b\x2e\xf5\x8a\xc3\x0b\x78\x8e\x14\x1e\xc1\x48\x31\x0c\xa3\
\x55\xa0\x11\x67\x9a\x12\x23\x67\x53\xa7\x98\xbc\xb7\xd2\xfd\x7c\
\xbc\x9e\x85\x68\x22\xe2\xf8\x45\x16\x82\x24\x43\x15\x53\x8c\x8b\
\xc3\x53\xcf\xc9\x33\x38\x4b\x7c\x88\xee\x8e\x4d\x33\xa5\xfd\x56\
\x66\x45\x04\x45\xc9\x56\x3d\xf5\x1c\xb1\x11\x99\x57\xa6\x37\x82\
\x89\x2d\xc1\x04\x81\xc5\xb9\x90\x72\x15\x10\x8e\x0c\x28\x6e\x84\
\x67\x10\x13\x9a\x60\xb3\x6a\x5f\xb0\xd1\xf4\xcd\x51\x52\xc4\x08\
\xa6\x19\xfb\xff\x43\x49\x2c\xa0\x04\x19\x46\x2b\x4c\x25\x38\x0e\
\x51\x48\x50\x4e\xb1\xf2\x02\x70\x69\xcd\x99\x22\x2b\xe7\x57\x86\
\x63\xfa\x15\x60\xe2\x46\x4b\xac\xf5\x57\x84\x69\x2c\x70\x25\xd4\
\x14\x68\x90\xa0\x6f\x4e\x12\xff\x0d\x90\x54\x0b\x48\x72\x8a\x94\
\xa6\x92\xf1\x55\xc0\x10\xc7\x12\xbc\x8b\x7b\x50\x8a\x95\x60\x44\
\xc9\x16\x49\x46\xcd\x1b\xe3\x48\xde\x10\x3e\x9b\xe7\xd9\xa1\x9e\
\xb7\x9e\xae\x06\x21\x2c\x8c\xa2\x72\x7e\xe6\xea\xc9\x71\x08\x78\
\xba\xa2\x73\xbf\x72\x75\x4b\x22\x4a\x80\x47\xe7\xe9\xab\xab\x77\
\x02\x31\x4a\x31\x53\x57\xb0\x65\x32\x90\x01\x5b\x82\x69\x50\xfb\
\x63\x07\x98\x80\x67\xbb\xed\x00\x9b\xf3\x16\xf1\x73\x95\x60\x0e\
\x9e\x33\x18\x31\x94\x09\x76\x81\x57\x55\x1e\x8b\x7e\x66\xd0\x82\
\x97\x43\xc1\x6c\x22\xde\xd3\xd2\x18\xba\x8c\xaa\x8a\x9f\x67\xeb\
\xfe\x31\x64\x29\x64\x25\xae\x09\x5b\x42\x16\x4b\xf0\x24\x29\x2f\
\x90\x55\x88\x1b\x26\xa9\x90\x97\xc8\x42\x21\x82\xc5\x24\x23\xd7\
\x91\x25\xaf\xc2\x75\xab\xd3\x94\x7d\x01\xae\x0c\x31\xa2\x0d\xa1\
\x54\x7d\x1b\x5c\x21\xf1\x43\x6d\x26\x8c\x5f\xe0\xca\x11\x27\x84\
\x18\x72\xe9\xb1\x2e\xfb\x51\x29\xa8\x10\x97\xc0\x32\x8a\x24\x97\
\x42\xd1\xdf\x71\xd9\xd7\x39\xac\x31\x5f\xe4\xb0\x0c\x69\x83\x8d\
\x04\x70\xbf\x0d\xb0\x90\xd7\x34\xd6\x8c\xb2\x05\x87\x15\x1a\x7a\
\xa0\x25\x5c\xdb\xda\x6b\xcc\x82\xc3\xba\x46\x46\x32\x49\xae\x3b\
\xec\x6b\x50\x65\x2a\xbe\x4b\xf4\x17\xa1\x0a\x0d\x36\xc4\x9a\xfc\
\x46\xee\x0a\x56\xc5\x80\x1d\xd3\x0b\xa8\x1a\x2a\x08\x26\x97\xa8\
\xc2\x1c\x2d\x84\x5e\x42\x95\xc3\x79\x04\x16\xfc\x77\xbc\x15\xbf\
\x06\x57\x1a\xab\xed\x17\x7a\x2b\x23\xcc\x68\x6d\xe8\xd7\xc4\x75\
\x1d\xee\xfa\x5b\xee\xee\xe5\x6d\x64\xd2\xce\x4f\x6e\xc7\x08\x63\
\xa9\xa8\x66\xab\x80\x0a\x80\x51\x51\x63\x6e\x66\xdf\x18\xe0\x6a\
\x33\x5c\x79\x2e\x2f\x37\x72\x92\x3d\x16\x37\xc0\x48\x10\xca\xe1\
\x96\x30\x5e\x08\xd6\x15\xf4\x16\x93\x0f\x45\xee\x8a\x8c\x24\xc6\
\xd0\x10\x4c\x43\xc6\x39\x03\x34\x61\xd0\xdc\xcf\x62\xa2\xf5\x04\
\xc5\x18\x13\x53\x6a\x7f\x47\x95\x70\x06\xac\x94\x99\x56\x91\xf3\
\x0d\x97\x19\xb7\x18\x23\x53\x57\x70\x87\x70\xda\x70\x31\x73\x9e\
\x59\x2b\x62\x98\x49\xe3\x64\x68\x3c\x66\xc3\xa1\x81\x83\x68\xd7\
\x02\xcb\x99\x71\x5d\xff\x31\xb3\xed\x9b\x59\xfc\xe3\x21\xce\xe0\
\x52\xda\x7e\x66\x88\xba\xcf\x19\xb5\xe7\xb4\xf5\x3a\xc9\xa9\x47\
\x2c\x81\x0d\xdd\x98\x61\x64\x01\x6c\x8d\xa1\x58\xcd\xc1\xe6\x08\
\xc3\x15\x81\x62\xb1\x88\xb6\x62\xd2\x48\x25\x2f\xd1\x86\xfa\x4b\
\x89\xeb\x9a\xaf\xa0\x3d\xeb\x6a\x66\x78\x83\x43\x4a\x08\xb5\xab\
\x91\xe4\x9a\x70\x49\xb9\x50\xe2\x1b\x80\x5d\xb8\x4f\x94\xf9\xe4\
\x63\xd2\xae\xfb\x8e\x04\xff\xd6\xee\x5b\xe6\xed\xbb\xff\x02\xc5\
\xcb\xa0\x07\
\x00\x00\x08\x76\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x6e\
\x65\x77\x32\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\
\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\
\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\x3c\
\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\x20\
\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\
\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\
\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\
\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\
\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\
\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\
\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\
\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\
\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\
\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\
\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\
\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\
\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\
\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\
\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\
\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\
\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\
\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\
\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\
\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\
\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\
\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\
\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\
\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\
\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\
\x64\x74\x68\x3d\x22\x37\x38\x34\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x68\
\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x34\x22\
\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\x3d\x22\
\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x32\x32\x39\
\x31\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x34\x37\x2e\x39\x39\x39\x39\
\x39\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x63\x79\x3d\x22\x39\x36\x2e\x30\x30\x30\x30\x30\x33\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\
\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\
\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\
\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\x39\x39\x39\
\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\
\x31\x2e\x33\x33\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\x20\x20\
\x20\x64\x3d\x22\x6d\x20\x34\x32\x2c\x31\x37\x32\x2e\x33\x31\x30\
\x31\x36\x20\x63\x20\x2d\x31\x2e\x34\x36\x36\x36\x36\x37\x2c\x2d\
\x30\x2e\x36\x31\x39\x32\x34\x20\x2d\x34\x2e\x31\x36\x36\x36\x36\
\x37\x2c\x2d\x32\x2e\x37\x33\x39\x38\x34\x20\x2d\x36\x2c\x2d\x34\
\x2e\x37\x31\x32\x34\x35\x20\x6c\x20\x2d\x33\x2e\x33\x33\x33\x33\
\x33\x33\x2c\x2d\x33\x2e\x35\x38\x36\x35\x36\x20\x56\x20\x39\x33\
\x2e\x34\x37\x37\x35\x34\x35\x20\x32\x32\x2e\x39\x34\x33\x39\x33\
\x38\x20\x6c\x20\x34\x2e\x33\x35\x36\x37\x36\x2c\x2d\x34\x2e\x33\
\x35\x38\x39\x37\x35\x20\x34\x2e\x33\x35\x36\x37\x36\x31\x2c\x2d\
\x34\x2e\x33\x35\x38\x39\x37\x34\x20\x33\x34\x2e\x39\x37\x36\x35\
\x37\x32\x2c\x2d\x30\x2e\x33\x37\x38\x30\x37\x36\x20\x33\x34\x2e\
\x39\x37\x36\x35\x37\x2c\x2d\x30\x2e\x33\x37\x38\x30\x37\x36\x20\
\x32\x34\x2e\x33\x37\x39\x39\x35\x2c\x32\x34\x2e\x34\x33\x37\x39\
\x30\x34\x20\x32\x34\x2e\x33\x37\x39\x39\x35\x2c\x32\x34\x2e\x34\
\x33\x37\x39\x30\x35\x20\x2d\x30\x2e\x33\x37\x39\x39\x35\x2c\x35\
\x30\x2e\x39\x31\x35\x38\x35\x34\x20\x2d\x30\x2e\x33\x37\x39\x39\
\x35\x2c\x35\x30\x2e\x39\x31\x35\x38\x36\x20\x2d\x34\x2e\x33\x35\
\x37\x37\x34\x2c\x34\x2e\x33\x35\x37\x36\x34\x20\x2d\x34\x2e\x33\
\x35\x37\x37\x35\x2c\x34\x2e\x33\x35\x37\x36\x35\x20\x2d\x35\x32\
\x2e\x39\x37\x35\x35\x38\x38\x2c\x30\x2e\x32\x37\x31\x37\x20\x43\
\x20\x36\x38\x2e\x35\x30\x35\x36\x38\x2c\x31\x37\x33\x2e\x33\x31\
\x33\x37\x39\x20\x34\x33\x2e\x34\x36\x36\x36\x36\x37\x2c\x31\x37\
\x32\x2e\x39\x32\x39\x34\x20\x34\x32\x2c\x31\x37\x32\x2e\x33\x31\
\x30\x31\x36\x20\x5a\x20\x4d\x20\x31\x34\x38\x2c\x36\x39\x2e\x32\
\x31\x30\x38\x33\x34\x20\x63\x20\x30\x2c\x2d\x30\x2e\x31\x39\x31\
\x36\x36\x39\x20\x2d\x39\x2e\x39\x2c\x2d\x31\x30\x2e\x32\x33\x34\
\x38\x34\x39\x20\x2d\x32\x32\x2c\x2d\x32\x32\x2e\x33\x31\x38\x31\
\x37\x39\x20\x6c\x20\x2d\x32\x32\x2c\x2d\x32\x31\x2e\x39\x36\x39\
\x36\x39\x20\x76\x20\x32\x32\x2e\x33\x31\x38\x31\x37\x38\x20\x32\
\x32\x2e\x33\x31\x38\x31\x37\x39\x20\x68\x20\x32\x32\x20\x63\x20\
\x31\x32\x2e\x31\x2c\x30\x20\x32\x32\x2c\x2d\x30\x2e\x31\x35\x36\
\x38\x32\x20\x32\x32\x2c\x2d\x30\x2e\x33\x34\x38\x34\x38\x38\x20\
\x7a\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\
\x38\x31\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\
\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x20\x2f\x3e\x0a\x3c\x2f\
\x73\x76\x67\x3e\x0a\
\x00\x00\x08\x72\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x6e\
\x65\x77\x32\x63\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\
\x2e\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\
\x32\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\
\x3c\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\
\x20\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\
\x20\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\
\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\
\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\
\x6f\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\
\x78\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\
\x72\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\
\x2f\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\
\x69\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\
\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\
\x3a\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\
\x3c\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\
\x2f\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\
\x74\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\
\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\
\x2f\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\
\x61\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\
\x67\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\
\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\
\x6f\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\
\x20\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\
\x22\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\
\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\
\x20\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\
\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\
\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\
\x65\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\
\x68\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\
\x69\x64\x74\x68\x3d\x22\x31\x36\x31\x37\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\
\x2d\x68\x65\x69\x67\x68\x74\x3d\x22\x36\x32\x38\x22\x0a\x20\x20\
\x20\x20\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\
\x34\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\
\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x32\
\x32\x39\x31\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x31\x39\x32\x22\x0a\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x79\
\x3d\x22\x39\x36\x2e\x30\x30\x30\x30\x30\x36\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x79\x3d\
\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\x78\x69\x6d\x69\
\x7a\x65\x64\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\x74\x2d\x6c\x61\
\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\x20\x2f\x3e\x0a\x20\x20\
\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\
\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x36\x66\x37\x63\x39\x31\x3b\x73\
\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x31\x2e\x33\x33\
\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\x20\x20\x20\x64\x3d\x22\
\x6d\x20\x34\x32\x2c\x31\x37\x32\x2e\x33\x31\x30\x31\x36\x20\x63\
\x20\x2d\x31\x2e\x34\x36\x36\x36\x36\x37\x2c\x2d\x30\x2e\x36\x31\
\x39\x32\x34\x20\x2d\x34\x2e\x31\x36\x36\x36\x36\x37\x2c\x2d\x32\
\x2e\x37\x33\x39\x38\x34\x20\x2d\x36\x2c\x2d\x34\x2e\x37\x31\x32\
\x34\x35\x20\x6c\x20\x2d\x33\x2e\x33\x33\x33\x33\x33\x33\x2c\x2d\
\x33\x2e\x35\x38\x36\x35\x36\x20\x56\x20\x39\x33\x2e\x34\x37\x37\
\x35\x34\x35\x20\x32\x32\x2e\x39\x34\x33\x39\x33\x38\x20\x6c\x20\
\x34\x2e\x33\x35\x36\x37\x36\x2c\x2d\x34\x2e\x33\x35\x38\x39\x37\
\x35\x20\x34\x2e\x33\x35\x36\x37\x36\x31\x2c\x2d\x34\x2e\x33\x35\
\x38\x39\x37\x34\x20\x33\x34\x2e\x39\x37\x36\x35\x37\x32\x2c\x2d\
\x30\x2e\x33\x37\x38\x30\x37\x36\x20\x33\x34\x2e\x39\x37\x36\x35\
\x37\x2c\x2d\x30\x2e\x33\x37\x38\x30\x37\x36\x20\x32\x34\x2e\x33\
\x37\x39\x39\x35\x2c\x32\x34\x2e\x34\x33\x37\x39\x30\x34\x20\x32\
\x34\x2e\x33\x37\x39\x39\x35\x2c\x32\x34\x2e\x34\x33\x37\x39\x30\
\x35\x20\x2d\x30\x2e\x33\x37\x39\x39\x35\x2c\x35\x30\x2e\x39\x31\
\x35\x38\x35\x34\x20\x2d\x30\x2e\x33\x37\x39\x39\x35\x2c\x35\x30\
\x2e\x39\x31\x35\x38\x36\x20\x2d\x34\x2e\x33\x35\x37\x37\x34\x2c\
\x34\x2e\x33\x35\x37\x36\x34\x20\x2d\x34\x2e\x33\x35\x37\x37\x35\
\x2c\x34\x2e\x33\x35\x37\x36\x35\x20\x2d\x35\x32\x2e\x39\x37\x35\
\x35\x38\x38\x2c\x30\x2e\x32\x37\x31\x37\x20\x43\x20\x36\x38\x2e\
\x35\x30\x35\x36\x38\x2c\x31\x37\x33\x2e\x33\x31\x33\x37\x39\x20\
\x34\x33\x2e\x34\x36\x36\x36\x36\x37\x2c\x31\x37\x32\x2e\x39\x32\
\x39\x34\x20\x34\x32\x2c\x31\x37\x32\x2e\x33\x31\x30\x31\x36\x20\
\x5a\x20\x4d\x20\x31\x34\x38\x2c\x36\x39\x2e\x32\x31\x30\x38\x33\
\x34\x20\x63\x20\x30\x2c\x2d\x30\x2e\x31\x39\x31\x36\x36\x39\x20\
\x2d\x39\x2e\x39\x2c\x2d\x31\x30\x2e\x32\x33\x34\x38\x34\x39\x20\
\x2d\x32\x32\x2c\x2d\x32\x32\x2e\x33\x31\x38\x31\x37\x39\x20\x6c\
\x20\x2d\x32\x32\x2c\x2d\x32\x31\x2e\x39\x36\x39\x36\x39\x20\x76\
\x20\x32\x32\x2e\x33\x31\x38\x31\x37\x38\x20\x32\x32\x2e\x33\x31\
\x38\x31\x37\x39\x20\x68\x20\x32\x32\x20\x63\x20\x31\x32\x2e\x31\
\x2c\x30\x20\x32\x32\x2c\x2d\x30\x2e\x31\x35\x36\x38\x32\x20\x32\
\x32\x2c\x2d\x30\x2e\x33\x34\x38\x34\x38\x38\x20\x7a\x22\x0a\x20\
\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x38\x31\x37\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\
\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\
\x72\x65\x3d\x22\x30\x22\x20\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\
\x0a\
\x00\x00\x08\x8d\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\
\x6c\x6e\x73\x3a\x64\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\
\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\
\x6e\x74\x73\x2f\x31\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\
\x6e\x73\x3a\x63\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\
\x65\x61\x74\x69\x76\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\
\x67\x2f\x6e\x73\x23\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\
\x72\x64\x66\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\
\x32\x2d\x72\x64\x66\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\
\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\
\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\
\x6f\x64\x69\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\
\x70\x6f\x64\x69\x2e\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\
\x2e\x6e\x65\x74\x2f\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\
\x69\x2d\x30\x2e\x64\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\
\x73\x3a\x69\x6e\x6b\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\
\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\
\x6f\x72\x67\x2f\x6e\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x22\x0a\x20\x20\x20\x77\x69\x64\x74\
\x68\x3d\x22\x34\x38\x22\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\
\x3d\x22\x34\x38\x22\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\
\x3d\x22\x30\x20\x30\x20\x34\x38\x20\x34\x38\x22\x0a\x20\x20\x20\
\x69\x64\x3d\x22\x73\x76\x67\x32\x22\x0a\x20\x20\x20\x76\x65\x72\
\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x30\x2e\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\
\x20\x32\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x0a\x20\x20\
\x20\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\
\x65\x3d\x22\x73\x68\x6f\x72\x74\x5f\x63\x69\x72\x63\x75\x69\x74\
\x2e\x73\x76\x67\x22\x3e\x0a\x20\x20\x3c\x6d\x65\x74\x61\x64\x61\
\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x6d\x65\x74\x61\
\x64\x61\x74\x61\x31\x32\x22\x3e\x0a\x20\x20\x20\x20\x3c\x72\x64\
\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x63\x63\
\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\
\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\x3e\x0a\x20\x20\x20\
\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\
\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\x6d\x6c\x3c\x2f\x64\
\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\x20\x20\x20\x20\x20\
\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\x65\x73\x6f\x75\x72\
\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\
\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\x74\x79\x70\x65\x2f\
\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\x20\x2f\x3e\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x69\x74\x6c\x65\
\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x2f\x63\x63\x3a\x57\
\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x72\x64\x66\x3a\x52\
\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\x61\x64\x61\x74\x61\
\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x64\x65\x66\x73\x31\x30\x22\x20\x2f\x3e\x0a\x20\x20\
\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\x6d\x65\x64\x76\
\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\x65\x63\x6f\x6c\
\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\x0a\x20\x20\x20\
\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\x72\x3d\x22\x23\
\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\
\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x31\x22\x0a\x20\
\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\x6c\x65\x72\x61\
\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x72\
\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\
\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\x6f\x6c\x65\x72\
\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x6f\x70\x61\x63\
\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\x61\x64\x6f\x77\
\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\x64\x74\x68\x3d\
\x22\x31\x38\x36\x33\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x68\x65\x69\x67\
\x68\x74\x3d\x22\x31\x30\x32\x35\x22\x0a\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x38\x22\x0a\x20\
\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\x3d\x22\x66\x61\
\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x36\x2e\x39\x35\x33\x32\x31\
\x36\x39\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x63\x78\x3d\x22\x31\x34\x2e\x36\x33\x33\x31\x37\x33\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\
\x79\x3d\x22\x31\x2e\x39\x31\x31\x32\x36\x32\x31\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\
\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x79\
\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\x78\x69\x6d\
\x69\x7a\x65\x64\x3d\x22\x31\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\x74\x2d\x6c\
\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\x20\x2f\x3e\x0a\x20\
\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x64\x3d\x22\x4d\
\x30\x20\x30\x68\x34\x38\x76\x34\x38\x68\x2d\x34\x38\x7a\x22\x0a\
\x20\x20\x20\x20\x20\x66\x69\x6c\x6c\x3d\x22\x6e\x6f\x6e\x65\x22\
\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x34\x22\
\x20\x2f\x3e\x0a\x20\x20\x3c\x67\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x67\x34\x31\x35\x30\x22\x0a\x20\x20\x20\x20\x20\x74\x72\
\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\x69\x78\x28\
\x31\x2e\x33\x38\x36\x37\x36\x36\x35\x2c\x30\x2c\x30\x2c\x31\x2e\
\x34\x33\x34\x38\x38\x30\x38\x2c\x2d\x31\x35\x2e\x37\x37\x33\x37\
\x30\x35\x2c\x2d\x31\x35\x2e\x31\x32\x31\x34\x30\x35\x29\x22\x3e\
\x0a\x20\x20\x20\x20\x3c\x67\x0a\x20\x20\x20\x20\x20\x20\x20\x74\
\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x74\x72\x61\x6e\x73\x6c\
\x61\x74\x65\x28\x31\x2e\x30\x30\x36\x37\x32\x38\x33\x2c\x2d\x32\
\x35\x2e\x38\x38\x37\x32\x39\x39\x29\x22\x0a\x20\x20\x20\x20\x20\
\x20\x20\x69\x64\x3d\x22\x67\x34\x31\x34\x34\x22\x20\x2f\x3e\x0a\
\x20\x20\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x20\
\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x66\x66\
\x63\x63\x30\x30\x3b\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\
\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x23\x64\
\x34\x61\x61\x30\x30\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\
\x74\x68\x3a\x31\x2e\x30\x37\x32\x33\x30\x32\x32\x32\x3b\x73\x74\
\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3a\x72\x6f\x75\
\x6e\x64\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\
\x69\x6e\x3a\x62\x65\x76\x65\x6c\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\
\x6f\x6b\x65\x2d\x64\x61\x73\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\
\x6e\x65\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\
\x79\x3a\x31\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x64\x3d\x22\x6d\
\x20\x32\x31\x2e\x37\x38\x34\x34\x39\x37\x2c\x31\x38\x2e\x34\x37\
\x30\x30\x33\x38\x20\x31\x33\x2e\x35\x36\x39\x37\x35\x35\x2c\x2d\
\x30\x2e\x30\x30\x35\x34\x20\x2d\x35\x2e\x30\x38\x38\x36\x35\x38\
\x2c\x38\x2e\x31\x37\x32\x36\x39\x35\x20\x34\x2e\x36\x32\x36\x30\
\x35\x33\x2c\x2d\x30\x2e\x31\x35\x34\x32\x30\x33\x20\x2d\x31\x31\
\x2e\x34\x31\x30\x39\x33\x2c\x31\x35\x2e\x32\x36\x35\x39\x37\x35\
\x20\x34\x2e\x34\x37\x31\x38\x35\x32\x2c\x2d\x31\x31\x2e\x35\x36\
\x35\x31\x33\x32\x20\x68\x20\x2d\x34\x2e\x33\x31\x37\x36\x35\x31\
\x20\x6c\x20\x33\x2e\x33\x39\x32\x34\x34\x2c\x2d\x37\x2e\x34\x30\
\x31\x36\x38\x35\x20\x7a\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x70\x61\x74\x68\x33\x33\x35\x39\x22\x0a\x20\x20\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\
\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\
\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x73\x6f\x64\x69\
\x70\x6f\x64\x69\x3a\x6e\x6f\x64\x65\x74\x79\x70\x65\x73\x3d\x22\
\x63\x63\x63\x63\x63\x63\x63\x63\x63\x22\x20\x2f\x3e\x0a\x20\x20\
\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x06\x02\
\x00\
\x00\x14\xb7\x78\x9c\xcd\x58\x6d\x6f\xdb\x36\x10\xfe\xde\x5f\x21\
\x28\x5f\x1a\xcc\xa2\xf8\x2a\x91\xaa\x9d\x62\x43\x31\x74\x40\xf7\
\x65\xeb\x5e\xbf\x29\x12\xe3\xa8\x91\x45\x83\x92\xe3\xa4\xbf\x7e\
\x47\xd9\x7a\x8b\x95\x2e\x45\xd3\x75\x0e\x1c\x88\x77\x47\xf2\xf8\
\xdc\x73\x77\xa2\x97\xaf\xef\x36\xa5\x77\xab\x6d\x5d\x98\x6a\xe5\
\x13\x84\x7d\x4f\x57\x99\xc9\x8b\x6a\xbd\xf2\x7f\x7b\xff\x63\x20\
\x7d\xaf\x6e\xd2\x2a\x4f\x4b\x53\xe9\x95\x5f\x19\xff\xf5\xc5\x8b\
\x65\x7d\xbb\x7e\xe1\x79\x1e\x4c\xae\xea\x24\xcf\x56\xfe\x75\xd3\
\x6c\x93\x30\xdc\xee\x6c\x89\x8c\x5d\x87\x79\x16\xea\x52\x6f\x74\
\xd5\xd4\x21\x41\x24\xf4\x07\xf3\x6c\x30\xcf\xac\x4e\x9b\xe2\x56\
\x67\x66\xb3\x31\x55\xdd\xce\xac\xea\xb3\x91\xb1\xcd\xaf\x7a\xeb\
\xfd\x7e\x8f\xf6\xac\x35\x22\x4a\xa9\x10\xd3\x90\xd2\x00\x2c\x82\
\xfa\xbe\x6a\xd2\xbb\x60\x3a\x15\x7c\x9c\x9b\x4a\x31\xc6\x21\xe8\
\x06\xcb\xa7\x59\x25\x35\xa0\xb2\x85\x6f\x6f\xde\x09\x50\x6d\x76\
\x36\xd3\x57\x30\x4f\xa3\x4a\x37\xe1\x9b\xf7\x6f\x7a\x65\x80\x51\
\xde\xe4\xa3\x65\x8a\xea\xa6\xce\xd2\xad\x9e\xec\xda\x09\x0f\x08\
\xa4\x1b\x5d\x6f\xd3\x4c\xd7\x61\x27\x6f\xe7\xef\x8b\xbc\xb9\x5e\
\xf9\x5c\xb6\xa3\x6b\x5d\xac\xaf\x9b\x7e\x78\x5b\xe8\xfd\x0f\xe6\
\x6e\xe5\x63\x0f\x7b\x5c\x7a\x47\x71\x91\xaf\x7c\x38\x06\x3d\xd8\
\x0c\x71\x26\x07\xed\x71\xf9\xa4\xd7\x60\xa4\x28\xa2\xde\x4b\x91\
\x31\x2d\x71\xbe\xf0\x28\x26\x71\x80\x65\x80\xa3\xf3\x76\x4a\x77\
\xae\x24\x37\x99\x73\x74\xe5\x6f\xaf\x90\x03\xea\x02\xb4\xcb\x8d\
\x6e\xd2\x3c\x6d\x52\x67\x79\xd8\xbc\x93\x10\xda\x5a\x80\x0d\x04\
\x2c\xf9\xe5\xcd\x8f\x87\x11\x8c\xb3\x2c\xf9\xc3\xd8\x9b\xe3\x10\
\x3e\xce\x20\xbd\x34\x3b\x38\x9c\x7f\xd1\x8b\x97\x79\x96\x00\xc4\
\x9b\xb4\xb9\x28\x36\xe9\x5a\xbb\xe8\x7c\x07\x90\x2e\xc3\x41\x31\
\x31\x6e\xee\xb7\x7a\x58\xf4\xb0\xac\xd5\x87\x58\xcd\x12\x36\xcf\
\x36\x85\x9b\x14\xfe\xda\x14\x65\xf9\x93\xdb\xc4\xf7\xc2\x07\x8b\
\x16\x4d\xa9\x07\xe1\x32\x3c\x7a\x7f\x3c\x5b\x38\x3a\xdc\x32\xec\
\xce\xde\x8e\x72\x7d\x55\x0f\xb0\xb8\x11\xc1\x1d\x24\x9b\xd4\xde\
\x68\xdb\x6d\xd4\x47\xa5\x6e\x4c\x76\xe3\xac\xbf\xb7\xd6\xec\xc9\
\x3b\x48\x44\xdb\xf8\x9d\x99\xb1\x05\xa4\xd7\xca\x4f\x77\x8d\xe9\
\x85\x56\x5f\xfd\xe5\xa2\x88\xc7\x92\x3f\xa7\x92\x47\x57\xac\x9b\
\xfb\x12\xa0\x31\xc0\x86\xab\xd2\xec\x93\xdb\xa2\x2e\x2e\x4b\xed\
\x9f\x38\x56\xd4\xad\x6b\x2b\xbf\xb1\x3b\xdd\xc7\x68\xb9\x4d\x9b\
\xeb\x01\x71\xb7\x8d\x93\x70\xa1\xa4\x3f\x88\x41\xfa\xb3\x07\xee\
\x2c\xe0\xeb\xbd\xf3\x04\x3c\x05\xa2\x7d\x0c\x08\x45\x62\x24\x3e\
\x48\x3b\xd3\x8f\xde\x68\x91\xa3\xa7\x57\x10\xa7\xc0\xee\x4a\x9d\
\xe8\x5b\x5d\x99\x3c\x7f\x55\x37\xd6\xdc\xe8\xe4\x0c\xb7\x9f\xe3\
\x30\x68\x33\x27\x81\xea\xb6\x6d\x46\x8b\x34\x36\xad\x6a\xc7\x1c\
\x48\x91\x2c\x2d\xf5\x4b\x8c\xe4\xf9\x41\x5a\xa6\x8d\x7e\x79\x70\
\xe7\xbc\xe7\x00\x04\xb4\x8d\xd3\x21\xb8\x2e\x82\xed\x53\x9f\x11\
\x2e\x1d\x72\x97\x87\x87\x2d\xb6\xc0\x9f\xcc\x94\xc6\xae\xfc\xb3\
\xab\xf6\x73\xdc\xfb\xd2\xd8\x5c\xdb\x4e\x15\xb5\x9f\x89\xca\x40\
\xf2\x03\x13\x21\x4f\x8f\x62\x73\xf9\x41\x67\x4d\x63\x4a\x0d\xce\
\x39\xf6\x92\x2e\x9a\x6b\x0b\x47\x9b\x93\xef\x8a\x5c\xcf\x29\xfa\
\x18\x3a\xf7\xfa\x8d\x66\xb5\xf5\x75\x9a\x9b\xfd\xca\xa7\x0f\x95\
\xfb\xa2\x02\x45\x70\xac\x47\x44\x46\xec\x11\x8b\xae\x46\x11\x4c\
\x85\x3f\x90\xbf\x07\xaa\xe3\x45\x7d\x6d\xf6\xee\x24\x10\xd1\xb4\
\xac\xf5\xc3\xd5\x3e\x1a\x03\x31\x22\x0c\x09\x8a\x25\x3b\xd9\x2c\
\x83\xaa\x47\x63\x44\x18\x51\x38\x3e\x51\xc2\xe9\x28\x46\x84\x70\
\x7a\xa2\x3b\x7a\x09\xd3\xc5\x63\x3a\x37\xfb\x31\xdd\x26\xbd\x2b\
\x36\xc5\x47\x9d\x0f\x81\x1a\xb6\xdd\x59\x0b\xd9\x19\x94\xe9\xbd\
\x86\x28\xaf\xb9\xe0\xfc\x48\xa4\xe5\x7a\x40\x62\xcd\x89\xe8\xab\
\xc0\x7a\x9c\xa0\x87\x19\xff\x9a\x5a\x0c\x9f\xa4\xd6\x02\x7b\x6f\
\x5d\x07\xf8\xdd\xfd\x7b\x0b\xdd\xe0\xef\x91\xc9\xe0\xa0\xa9\x2a\
\xe0\x94\xb1\x01\xb8\x7a\x9b\x36\x3b\xab\x07\x1a\x3c\x48\xb1\xa4\
\x82\xde\x3f\x2a\x85\x83\xa7\x47\x5f\x15\x26\xf3\x79\x05\x45\xd9\
\x16\x77\x2f\x21\xf3\x62\xa6\xa8\xe2\x0b\xf0\x6e\x31\x8c\x22\x85\
\xa0\x91\x0b\x22\x16\x2e\x7e\x92\x2a\x46\xce\xc7\x25\x7f\x7a\xea\
\xcf\xf1\x7e\x84\x11\x89\xc9\x44\xe1\x9a\x92\x17\x08\x86\x62\x2c\
\x79\x24\x17\x1c\x1e\x62\x22\x22\xe1\x11\x8c\x62\x86\x61\xb4\x08\
\x24\xe2\x4c\x52\xa2\xa2\xc9\xd4\x31\x26\x67\x3a\x72\x7f\xaf\x3e\
\x55\x83\x84\xa0\x74\x5a\x83\xa0\xc4\xd0\x98\xc5\x8c\x8b\xed\x5d\
\xa7\x29\x0b\x38\x4b\xba\x4d\x2e\x77\x4d\x33\x96\x7d\x30\x45\x95\
\x40\x4b\xd2\xb6\x93\x1e\xf3\x35\x21\xd3\xbe\xf4\x4c\x30\xb1\x39\
\x98\x38\xa2\x9c\x8b\x28\x5a\x04\x84\x23\x05\x8e\x2b\xe1\x29\xc4\
\x84\x24\x58\x2d\xda\x07\xac\x24\x7d\x76\x94\x62\xa2\x04\x83\x5c\
\xff\xff\xa1\x24\x66\x50\x62\x04\xc9\x18\xd3\x08\x88\x43\x62\xa8\
\x52\x9c\xe2\xd8\x0b\x14\x50\x9a\xb3\x98\x2c\x1c\xaf\x14\xc7\xf4\
\x2b\xc0\xc4\x95\x8c\xb0\x94\x5f\x11\xa6\xa1\xbd\x19\xe8\x28\xf0\
\x7a\x04\xef\xcb\x59\xe6\x3f\x03\x92\xf1\x0c\x92\x9c\xa2\x58\xd2\
\x88\xf1\x45\xc0\x10\xc7\x11\xb0\x8b\x7b\xd0\x88\x63\xc1\x48\x1c\
\xb5\x48\x32\xaa\x9e\x19\x47\xf2\x8c\xf0\xe9\xb2\x2c\xb6\xf5\xf4\
\xc5\x13\x9a\x08\x43\x58\xa8\x18\x18\x32\x71\xdd\xde\x39\x0d\x01\
\xa6\xc7\x74\xca\x2b\xd7\xb6\x22\x44\x09\xe8\xe8\xb4\x7c\xb9\x6e\
\x17\x08\x81\x18\xa5\x98\xc5\x8f\x60\xcb\xa2\x20\x0a\xd8\x1c\x4c\
\xbd\xdb\xaf\x0e\x80\xb1\x38\x93\xf1\x61\x10\x4c\x75\xb3\xf8\xb9\
\x4e\x30\x05\xcf\x05\x8c\x28\xca\x04\x3b\xc1\xcb\x9a\x5d\xd5\xcd\
\x0c\x5a\xf0\x4a\x68\x98\x4d\xc2\x3b\x59\x9e\xc2\x3b\x86\xb5\xe9\
\xfd\x64\xdd\xcf\x43\x96\x42\x55\xe2\x92\xb0\x39\x64\x71\x04\x4c\
\x8a\xa2\x13\x64\x63\xc4\x15\x8b\xa8\x88\x4e\x91\xa5\x0a\xc1\x62\
\x11\x23\x8f\x23\x4b\x9e\x82\x2b\xc6\x69\xca\xf9\x17\xe0\xca\x10\
\x23\x52\x11\x4a\xe3\x6f\x83\x2b\x14\xfe\x18\x5a\x33\xe3\x27\xb8\
\x72\xc4\x09\x21\x8a\x9c\x32\xd6\x55\x3f\x1a\x09\x2a\xc4\x29\xb0\
\x8c\xa2\x88\x47\x22\xa6\x9f\xa0\xec\xd3\x80\xcd\x79\x9a\x7e\x11\
\xb0\x52\x61\x15\x01\xb8\xdf\x06\x58\xa8\x6b\x12\x5e\x63\x29\x9b\
\x21\xac\x90\xb1\x62\x73\xb8\x72\x24\x1d\x61\xd5\x4c\x29\x60\x90\
\x00\x18\x2a\xc5\xa3\xb8\x3e\x95\xae\x52\x7e\x11\xaa\x5c\x2a\xc8\
\xb5\xe8\x1b\xd1\x15\xa2\x8a\x01\x3b\x26\x67\x50\x55\x54\x10\x4c\
\x4e\x51\x85\x39\x52\x08\xa9\x66\xca\x00\x87\xf3\x08\x2c\xf8\x27\
\xd8\x8a\xff\x93\xf2\xea\xca\x00\x53\x52\x2a\xfa\x35\x71\x5d\x86\
\xeb\xee\x8e\xbb\x7e\x78\x1b\x19\xbd\xce\x8f\xee\xc6\x08\xe3\x28\
\xa6\x92\x2d\x02\x2a\x00\xc6\x98\x2a\x75\x3e\xf9\x85\x01\xae\x36\
\xfd\x95\xe7\xf4\x72\x13\x8d\xaa\xc7\xec\x06\x18\x09\x42\x39\xdc\
\x12\xba\xfb\x77\xeb\xd9\xd2\xfd\xea\x73\xf1\xe2\x1f\x45\xdc\xcd\
\x22\
\x00\x00\x07\xa4\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x73\
\x61\x76\x65\x63\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\
\x2e\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\
\x32\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\
\x3c\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\
\x20\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\
\x20\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\
\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\
\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\
\x6f\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\
\x78\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\
\x72\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\
\x2f\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\
\x69\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\
\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\
\x3a\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\
\x3c\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\
\x2f\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\
\x74\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\
\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\
\x2f\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\
\x61\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\
\x67\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\
\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\
\x6f\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\
\x20\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\
\x22\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\
\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\
\x20\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\
\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\
\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\
\x65\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\
\x68\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\
\x69\x64\x74\x68\x3d\x22\x31\x35\x30\x33\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\
\x2d\x68\x65\x69\x67\x68\x74\x3d\x22\x36\x31\x36\x22\x0a\x20\x20\
\x20\x20\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\
\x34\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\
\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x32\
\x32\x39\x31\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x31\x39\x32\x22\x0a\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x79\
\x3d\x22\x39\x36\x2e\x30\x30\x30\x30\x30\x36\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x79\x3d\
\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\x78\x69\x6d\x69\
\x7a\x65\x64\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\x74\x2d\x6c\x61\
\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\x20\x2f\x3e\x0a\x20\x20\
\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\
\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x35\x35\x35\x35\x66\x66\x3b\x73\
\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x31\x2e\x33\x33\
\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\x20\x20\x20\x64\x3d\x22\
\x6d\x20\x33\x37\x2e\x35\x35\x39\x33\x32\x32\x2c\x31\x35\x33\x2e\
\x36\x32\x37\x31\x32\x20\x76\x20\x2d\x38\x20\x68\x20\x35\x36\x20\
\x35\x35\x2e\x39\x39\x39\x39\x39\x38\x20\x76\x20\x38\x20\x38\x20\
\x68\x20\x2d\x35\x35\x2e\x39\x39\x39\x39\x39\x38\x20\x2d\x35\x36\
\x20\x7a\x20\x6d\x20\x32\x38\x2c\x2d\x35\x32\x2e\x36\x36\x36\x36\
\x37\x20\x2d\x32\x37\x2e\x33\x30\x38\x39\x34\x2c\x2d\x32\x37\x2e\
\x33\x33\x33\x33\x33\x31\x20\x68\x20\x31\x35\x2e\x36\x35\x34\x34\
\x37\x31\x20\x31\x35\x2e\x36\x35\x34\x34\x36\x39\x20\x76\x20\x2d\
\x32\x34\x20\x2d\x32\x34\x20\x68\x20\x32\x34\x20\x32\x33\x2e\x39\
\x39\x39\x39\x39\x38\x20\x76\x20\x32\x34\x20\x32\x34\x20\x68\x20\
\x31\x35\x2e\x36\x35\x34\x34\x37\x20\x31\x35\x2e\x36\x35\x34\x34\
\x36\x20\x6c\x20\x2d\x32\x37\x2e\x33\x30\x38\x39\x33\x2c\x32\x37\
\x2e\x33\x33\x33\x33\x33\x31\x20\x63\x20\x2d\x31\x35\x2e\x30\x31\
\x39\x39\x32\x2c\x31\x35\x2e\x30\x33\x33\x33\x34\x20\x2d\x32\x37\
\x2e\x36\x31\x39\x39\x31\x38\x2c\x32\x37\x2e\x33\x33\x33\x33\x34\
\x20\x2d\x32\x37\x2e\x39\x39\x39\x39\x39\x38\x2c\x32\x37\x2e\x33\
\x33\x33\x33\x34\x20\x2d\x30\x2e\x33\x38\x30\x30\x38\x2c\x30\x20\
\x2d\x31\x32\x2e\x39\x38\x30\x30\x38\x2c\x2d\x31\x32\x2e\x33\x20\
\x2d\x32\x38\x2c\x2d\x32\x37\x2e\x33\x33\x33\x33\x34\x20\x7a\x22\
\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x38\x31\
\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\
\x74\x75\x72\x65\x3d\x22\x30\x22\x20\x2f\x3e\x0a\x3c\x2f\x73\x76\
\x67\x3e\x0a\
\x00\x00\x06\xac\
\x00\
\x00\x1e\xf2\x78\x9c\xed\x59\x4b\x6f\xdb\x46\x10\xbe\xe7\x57\x10\
\xf4\x25\x41\x45\x72\xdf\xbb\x64\x24\x07\x28\x82\xa0\x3d\xf4\xd2\
\xa6\x2d\xd0\x4b\x40\x93\x2b\x99\x31\x45\x0a\x24\x65\xd9\xfe\xf5\
\x9d\x5d\x92\x22\xa9\x87\x93\x34\x01\x52\xb4\x12\xfc\xe0\xcc\xce\
\xec\xce\x7e\xf3\xed\x70\xd6\x9e\xbf\x79\x58\xe7\xce\xbd\xae\xea\
\xac\x2c\x16\x2e\xf6\x91\xeb\xe8\x22\x29\xd3\xac\x58\x2d\xdc\xdf\
\xdf\xbf\xf3\x94\xeb\xd4\x4d\x5c\xa4\x71\x5e\x16\x7a\xe1\x16\xa5\
\xfb\xe6\xfa\xc5\xbc\xbe\x5f\xbd\x70\x1c\x07\x9c\x8b\x3a\x4a\x93\
\x85\x7b\xdb\x34\x9b\x28\x08\x36\xdb\x2a\xf7\xcb\x6a\x15\xa4\x49\
\xa0\x73\xbd\xd6\x45\x53\x07\xd8\xc7\x81\x3b\x98\x27\x83\x79\x52\
\xe9\xb8\xc9\xee\x75\x52\xae\xd7\x65\x51\x5b\xcf\xa2\xbe\x1a\x19\
\x57\xe9\x72\x6f\xbd\xdb\xed\xfc\x1d\xb5\x46\x38\x0c\xc3\x00\x91\
\x80\x10\x0f\x2c\xbc\xfa\xb1\x68\xe2\x07\x6f\xea\x0a\x31\x9e\x72\
\x25\x08\xa1\x00\xc6\x06\xcb\xcf\xb3\x8a\x6a\x40\x65\x03\xdf\x7b\
\xf3\x5e\xe1\xd7\xe5\xb6\x4a\xf4\x12\xfc\xb4\x5f\xe8\x26\x78\xfb\
\xfe\xed\x7e\xd0\x43\x7e\xda\xa4\xa3\x69\xb2\xe2\xae\x4e\xe2\x8d\
\x9e\xac\xda\x2b\x5b\x04\xe2\xb5\xae\x37\x71\xa2\xeb\xa0\xd7\x5b\
\xff\x5d\x96\x36\xb7\x0b\x97\x63\xdf\x44\x87\xb0\x55\xde\xea\x6c\
\x75\xdb\x1c\x6a\xef\x33\xbd\xfb\xb1\x7c\x58\xb8\xc8\x41\x0e\x53\
\xf0\x65\xd5\x59\xba\x70\x61\x53\xa4\xb5\x19\xb2\xde\x3a\xf5\x8b\
\x45\xfb\x11\xe4\x87\xc4\x27\xce\x4b\x9e\x50\xad\x50\x3a\x73\x08\
\xc2\xd2\x43\xca\x43\xe2\x95\x75\xe9\x77\x19\xa5\x65\x62\xc2\x5e\
\xb8\x39\x24\xb4\xf8\x70\xfb\xb8\xd1\x55\xb2\xbd\xd1\xc4\x37\x20\
\x5e\x83\xed\x7c\xad\x9b\x38\x8d\x9b\xd8\xf8\xb5\xa1\xf4\x1a\x4c\
\xac\x05\xd8\x40\x32\xa3\x5f\xdf\xbe\x6b\x25\x90\x93\x24\xfa\xb3\
\xac\xee\x3a\x11\x3e\xc6\x20\xbe\x29\xb7\xb0\x63\xf7\x7a\xaf\x9e\
\xa7\x49\x04\xf0\xaf\xe3\xe6\x3a\x5b\xc7\x2b\x6d\x32\xf7\x03\xc0\
\x3d\x0f\x86\x81\x89\x71\x03\xf1\x0d\x93\xb6\xd3\x56\xba\xcd\xe3\
\x49\x32\xa7\xc9\x3a\x33\x4e\xc1\x6f\x4d\x96\xe7\x3f\x9b\x45\x5c\
\x27\x38\x98\x34\x6b\x72\x3d\x28\xe7\x41\x17\x7d\xb7\xb7\x60\xb4\
\xb9\x79\xd0\xef\xdd\x4a\xa9\x5e\xd6\x03\x2c\x46\xc2\xa8\x87\x64\
\x9f\x15\x40\xb4\xde\xe8\xc4\x9c\x97\x7e\xd9\x3d\xfc\x26\xb4\x85\
\x3b\x35\xa5\x2d\xeb\x9c\x49\x66\x37\x1f\x80\x14\x9c\xfa\x82\x48\
\x1a\x52\x27\x72\x30\xe4\x98\x4a\x22\xa5\x79\x3e\xe9\xf0\x68\x58\
\x14\x39\x5c\x20\x9f\x61\xc4\x8c\x13\x3a\x69\xf8\xb4\x70\x19\xf5\
\x99\x10\x18\x99\xd9\x88\xf2\x25\xa7\x82\xb0\xd3\x33\x77\x31\x7a\
\x65\x95\xad\x32\xe0\x9a\xa0\x3e\x57\x9c\x60\x05\xe6\xc2\x57\x0c\
\x09\xc5\xa7\x9e\x00\xcd\x08\x03\x08\x1a\x77\x29\x80\x34\x03\x64\
\xf6\x69\x8f\x88\x61\x63\x6a\x8e\x41\xeb\xbe\x81\x84\x25\x65\x5e\
\x56\x0b\xf7\x6a\x69\x3f\xdd\xbc\x37\x65\x95\x02\x55\xbb\x21\x61\
\x3f\x93\xa1\x12\x4e\x22\xa4\x1e\x8e\x49\xa7\x2e\x6f\x3e\x42\x04\
\x4d\x99\xeb\x2a\x2e\x0c\x5d\x70\x0f\xc7\xaa\x82\x13\x7a\x4a\xbf\
\xcd\x52\x7d\x6a\x60\x00\x03\xc2\xdb\x2f\x74\x72\xb4\xbe\x8d\xd3\
\x72\xb7\x70\xc9\xe1\xe0\x2e\x2b\x60\xc0\xeb\x8a\x03\x56\x82\x9e\
\xb1\xe8\x2b\x05\x46\x84\xbb\x03\xdb\xf6\x40\xa9\x4e\x59\xdf\x96\
\x3b\xb3\x93\x85\xbb\x8c\xf3\x5a\x1f\xce\xf6\x54\x96\x6b\x98\x44\
\xfa\x8a\x63\x2e\x8e\xc2\x49\x80\x5f\x21\x10\x45\x32\xc6\x8f\xc6\
\x0c\x8a\xca\x17\x21\x96\x44\x9d\x89\xd2\xd0\x53\x9e\x19\x03\x77\
\x72\x6e\x6c\x1d\x3f\x64\xeb\xec\x49\xa7\x43\xa2\x86\x75\xb7\x55\
\x05\x6f\x22\x2f\x8f\x1f\x75\xd5\x55\xc0\x8e\x39\x9b\xb8\xb9\x6d\
\xad\xc1\xf1\x17\x07\xcd\x90\xf3\x93\x29\x98\x7f\x98\x1f\x3f\x41\
\xf1\xfc\x6b\x04\x95\x31\x66\x47\x93\x97\x45\x01\x7c\x28\x2b\x0f\
\x96\xb9\x8f\x9b\x6d\xa5\x87\x14\xd6\xcd\x63\x0e\xe2\x12\x6a\x46\
\x54\xc0\x0b\xb4\x5f\x76\x35\x4c\xba\x62\x98\x1f\x98\xd7\x4d\x55\
\xde\xe9\xe8\x0a\x21\x72\x83\xfb\xdd\x34\x40\x9e\xda\xd4\x32\xa8\
\x9b\x71\x53\x65\x0f\x2f\xa1\x6e\x87\x2a\x94\x8a\xcd\x20\xec\x19\
\xd4\x7f\x86\x08\x68\x66\x1e\xe6\x3e\x52\x42\x70\x78\x22\xbe\x54\
\x38\x14\xf4\x55\x5f\x4e\x56\xfd\x71\x1a\xcd\x67\x1f\xa1\x70\x6b\
\x98\x12\x21\x01\xc9\xa1\x33\x8f\x70\x5f\x29\x49\xc2\xf0\xd5\xe4\
\x04\x42\xb8\x8c\xed\x35\xa7\x03\xee\x6b\xe0\x08\xdd\x29\x14\x57\
\x24\x4e\xd9\x72\xf9\xda\x08\x5e\xc7\xfb\x08\xb7\x62\xb5\xcd\x75\
\xa4\xef\x75\x51\xa6\xe9\xeb\xe9\xc4\x9d\xd8\x72\x3d\x42\x3e\x66\
\x54\x61\x45\x69\xaf\xcf\x33\xc8\x44\xbc\x89\xaa\x72\x5b\xa4\x63\
\xe5\xc7\x32\x2b\xa6\x5a\xa8\xe6\xba\xca\x81\x31\x4d\x84\x51\xaf\
\x4c\x63\x38\x65\x55\x15\x3f\xda\x5c\x8d\xb5\xe5\x72\x59\xeb\x26\
\xda\x5b\xee\x63\xde\x23\x01\xd0\x4c\x2b\x15\x6c\x9d\xca\x90\x1e\
\x17\xbe\x33\x84\xf9\x34\x68\x4a\x26\x69\xaa\xbf\x16\x34\x84\x80\
\x11\x84\xff\x6b\x31\x53\x28\xbc\x60\xf6\xa5\x98\xe1\x13\x2f\xd8\
\x0b\x66\x9f\xc0\x4c\x7e\x39\x66\xab\x69\x29\x84\x9e\xe8\xb0\x14\
\xb6\x10\xca\x25\x89\xa1\xbe\x1d\xd4\xc5\x7d\x67\x38\x86\xfe\x73\
\x5f\x25\x07\x87\x84\x8f\xd4\xa6\x95\x76\x28\xbc\x75\x15\xe1\x88\
\xcc\x08\xf6\x85\x84\xd6\x8b\x3b\x90\x05\x4c\x14\x9e\xc1\x25\x04\
\x11\x22\xac\x02\x5e\x12\x7c\x66\xd3\x83\x9d\xc4\xb1\x03\x98\x59\
\x05\x55\x76\x3c\x24\xd8\x8a\xa1\x15\x05\xc2\x62\xd6\xce\x23\xed\
\x7c\x8a\x28\x3b\xcc\xa9\x15\x85\x90\xad\x18\x3a\x66\x15\xb8\x98\
\x59\x11\xd6\x32\x22\x95\x9c\xcc\x84\x4f\x88\xf6\x98\x55\x08\x82\
\x89\x35\x60\xad\x1c\x12\x6b\x8f\x19\x77\xf2\x76\x02\xda\x85\xc7\
\xe8\x71\xf8\x4f\xa3\x4d\x77\x78\xf7\xd9\x46\xbe\x22\xd4\x5c\x80\
\xc8\xeb\x49\x0a\xbe\x96\xc5\x18\x43\x43\x2b\xd9\xf7\xa4\xf1\xe8\
\x4a\xf1\x0d\x88\x23\x8f\x88\x83\x7c\xce\x24\x0f\xa5\x21\x0e\xb4\
\xee\x94\x13\x43\x0c\x8b\x3a\x92\x36\xe9\x14\x12\x64\x65\x01\xdd\
\x81\x55\x70\x29\x5b\x05\x91\x96\x26\x40\x9e\xd6\x01\x33\x4b\x22\
\xd2\xb2\x42\x85\x46\x52\x82\xd9\x2c\x13\x22\x43\x48\x33\x3c\xc9\
\x50\x58\x1a\x10\x0e\xa4\x33\x7e\x12\xa3\x70\x06\x97\x07\xc3\x93\
\xc4\x6a\xa0\x85\x54\x33\x02\x09\xe8\xa9\x03\x2f\xfa\x96\x5b\x54\
\x1a\x19\x03\x43\x79\xcb\x54\xd5\x1a\x60\xc1\x26\xdc\x22\xa1\x12\
\x3d\xd3\x27\x32\x70\xf5\x7f\xcf\xa4\x0a\xf8\x72\x04\x41\xbb\x5f\
\x2a\x13\x25\xf1\xb3\xdb\x31\x44\x41\xc0\x25\x24\x9f\xdd\xce\x28\
\x70\xf6\x7c\xdc\x03\xae\x9b\x38\x83\x56\xdd\x5e\xbd\xa2\x75\x5c\
\xdd\xc1\x8d\xcf\x31\x71\x39\xad\xe5\x28\x6f\xe6\x3a\xc0\xa0\x49\
\x85\x1e\x70\x4c\x6a\xb8\x41\x10\x62\xae\xaa\x42\x86\x23\x75\x7f\
\xfd\x21\x86\x6d\x02\x93\xd1\x50\x77\x77\x02\xfa\xc3\xad\x45\x71\
\x75\x70\x70\x0c\x54\x54\x52\x39\x86\x4f\xe7\x79\xb6\xa9\x47\x7f\
\x43\xa8\xcc\xdd\xc6\x67\x54\x0a\xa4\xc6\x73\x57\x0f\x56\x0f\x4d\
\x33\xf4\xd5\x23\xbd\xb9\x0b\x41\x8b\x4d\x04\x1a\xae\x63\x56\xdf\
\x86\x2f\x25\xa3\x9c\x9e\x38\xc1\x8c\x4f\xd4\x07\xdc\xc5\x1d\x65\
\xf9\x32\xa5\xea\x79\x46\x7e\xc7\x14\x7e\x73\x1c\x99\x1f\x62\x44\
\xa9\x3c\xc0\x91\x51\x3f\x0c\x31\x15\x67\x60\xf4\x2e\x40\x9e\x02\
\x52\x88\x23\x20\x29\x54\x66\x0e\x15\x91\x9f\x43\x52\x90\x0b\x94\
\x53\x28\x29\x54\x26\x24\x28\xc7\xc7\x67\x5b\x08\x06\xd7\xf4\xb3\
\xa4\x14\x17\x28\x8f\xa0\x84\x4e\x5b\x88\x43\x28\xe1\x78\x43\xed\
\x87\x8e\xf3\x2c\x94\x9e\xbc\x60\x79\x8c\xa5\x20\xa1\xa0\xc7\x27\
\x1c\xda\x2b\xc5\xce\xd2\x52\x10\x8f\x5f\xc0\x9c\x82\xc9\xb8\x0f\
\xcd\x32\x38\x7c\xf9\x19\xbf\xbc\x7b\x4e\x80\x09\x3b\x0c\xf1\x21\
\x98\xed\x29\x27\xe8\x5c\x33\x64\x4e\xf9\x85\x9a\x27\xd1\x0c\x09\
\xf9\x27\xc7\xdc\xfb\xcf\xbc\x81\xe6\xc1\xaa\xfd\xff\x10\xfc\x9a\
\x9b\x7f\x0a\x5e\xbf\xf8\x1b\x79\x87\xee\x02\
\x00\x00\x09\x6e\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x34\x38\
\x22\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x34\x38\x2e\x30\x30\x30\x30\x30\x31\x20\x34\x38\x2e\x30\x30\
\x30\x30\x30\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\
\x32\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\
\x2e\x31\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\x39\x32\x2e\x32\x20\
\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\x30\x31\x37\x2d\x30\
\x38\x2d\x30\x36\x29\x22\x0a\x20\x20\x20\x73\x6f\x64\x69\x70\x6f\
\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x72\x61\x74\x65\
\x5f\x62\x72\x2e\x73\x76\x67\x22\x3e\x0a\x20\x20\x3c\x64\x65\x66\
\x73\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x34\
\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\
\x3a\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\
\x69\x64\x3d\x22\x62\x61\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x70\
\x61\x67\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\
\x66\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\
\x6c\x6f\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\
\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\
\x3d\x22\x31\x2e\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x6f\x70\x61\x63\x69\x74\x79\
\x3d\x22\x30\x2e\x30\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\x61\x64\x6f\x77\x3d\
\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x37\x2e\x39\x31\x39\x35\x39\x35\
\x39\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x63\x78\x3d\x22\x31\x2e\x30\x34\x31\x37\x36\x36\x32\x22\x0a\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x79\
\x3d\x22\x33\x31\x2e\x35\x32\x33\x39\x38\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x64\x6f\x63\x75\x6d\x65\
\x6e\x74\x2d\x75\x6e\x69\x74\x73\x3d\x22\x70\x78\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\
\x65\x6e\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x6c\x61\x79\x65\x72\
\x31\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\
\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x75\x6e\
\x69\x74\x73\x3d\x22\x70\x78\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\
\x64\x74\x68\x3d\x22\x31\x38\x35\x39\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\
\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x30\x32\x35\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\
\x6f\x77\x2d\x78\x3d\x22\x36\x31\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x79\
\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\x78\x69\x6d\
\x69\x7a\x65\x64\x3d\x22\x31\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x6d\
\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x37\x22\x3e\x0a\x20\x20\x20\
\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\x20\
\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\x20\
\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\x3e\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\x72\
\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\x6d\
\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\x20\
\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\x65\
\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\
\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\x74\
\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\x20\
\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\
\x69\x74\x6c\x65\x3e\x3c\x2f\x64\x63\x3a\x74\x69\x74\x6c\x65\x3e\
\x0a\x20\x20\x20\x20\x20\x20\x3c\x2f\x63\x63\x3a\x57\x6f\x72\x6b\
\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x72\x64\x66\x3a\x52\x44\x46\x3e\
\x0a\x20\x20\x3c\x2f\x6d\x65\x74\x61\x64\x61\x74\x61\x3e\x0a\x20\
\x20\x3c\x67\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x6c\x61\x62\x65\x6c\x3d\x22\x43\x61\x70\x61\x20\x31\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x67\
\x72\x6f\x75\x70\x6d\x6f\x64\x65\x3d\x22\x6c\x61\x79\x65\x72\x22\
\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x6c\x61\x79\x65\x72\x31\
\x22\x0a\x20\x20\x20\x20\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\
\x3d\x22\x74\x72\x61\x6e\x73\x6c\x61\x74\x65\x28\x30\x2c\x2d\x31\
\x30\x30\x34\x2e\x33\x36\x32\x32\x29\x22\x3e\x0a\x20\x20\x20\x20\
\x3c\x74\x65\x78\x74\x0a\x20\x20\x20\x20\x20\x20\x20\x78\x6d\x6c\
\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\x76\x65\
\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\
\x66\x6f\x6e\x74\x2d\x73\x74\x79\x6c\x65\x3a\x6e\x6f\x72\x6d\x61\
\x6c\x3b\x66\x6f\x6e\x74\x2d\x77\x65\x69\x67\x68\x74\x3a\x6e\x6f\
\x72\x6d\x61\x6c\x3b\x66\x6f\x6e\x74\x2d\x73\x69\x7a\x65\x3a\x31\
\x38\x2e\x33\x36\x34\x32\x33\x38\x37\x34\x70\x78\x3b\x6c\x69\x6e\
\x65\x2d\x68\x65\x69\x67\x68\x74\x3a\x31\x2e\x32\x35\x3b\x66\x6f\
\x6e\x74\x2d\x66\x61\x6d\x69\x6c\x79\x3a\x73\x61\x6e\x73\x2d\x73\
\x65\x72\x69\x66\x3b\x6c\x65\x74\x74\x65\x72\x2d\x73\x70\x61\x63\
\x69\x6e\x67\x3a\x30\x70\x78\x3b\x77\x6f\x72\x64\x2d\x73\x70\x61\
\x63\x69\x6e\x67\x3a\x30\x70\x78\x3b\x66\x69\x6c\x6c\x3a\x23\x39\
\x39\x39\x39\x39\x39\x3b\x66\x69\x6c\x6c\x2d\x6f\x70\x61\x63\x69\
\x74\x79\x3a\x31\x3b\x73\x74\x72\x6f\x6b\x65\x3a\x6e\x6f\x6e\x65\
\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x30\x2e\
\x34\x35\x39\x31\x30\x35\x39\x37\x22\x0a\x20\x20\x20\x20\x20\x20\
\x20\x78\x3d\x22\x31\x39\x2e\x31\x35\x32\x30\x32\x35\x22\x0a\x20\
\x20\x20\x20\x20\x20\x20\x79\x3d\x22\x31\x30\x33\x30\x2e\x37\x35\
\x32\x31\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x74\
\x65\x78\x74\x38\x33\x39\x22\x3e\x3c\x74\x73\x70\x61\x6e\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x20\x73\x6f\x64\x69\x70\x6f\x64\x69\
\x3a\x72\x6f\x6c\x65\x3d\x22\x6c\x69\x6e\x65\x22\x0a\x20\x20\x20\
\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x74\x73\x70\x61\x6e\x38\
\x33\x37\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x78\x3d\x22\
\x31\x39\x2e\x31\x35\x32\x30\x32\x35\x22\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x79\x3d\x22\x31\x30\x33\x30\x2e\x37\x35\x32\x31\
\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\
\x3d\x22\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x30\
\x2e\x34\x35\x39\x31\x30\x35\x39\x37\x22\x3e\x3f\x3c\x2f\x74\x73\
\x70\x61\x6e\x3e\x3c\x2f\x74\x65\x78\x74\x3e\x0a\x20\x20\x20\x20\
\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x20\x20\x73\x74\x79\
\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\
\x72\x6f\x6b\x65\x3a\x23\x39\x39\x39\x39\x39\x39\x3b\x73\x74\x72\
\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x34\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3a\x72\x6f\x75\x6e\x64\
\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\
\x3a\x6d\x69\x74\x65\x72\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\
\x74\x65\x72\x6c\x69\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\
\x65\x2d\x64\x61\x73\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\
\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\
\x31\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x64\x3d\x22\x4d\x20\x35\
\x2e\x34\x32\x39\x35\x36\x39\x38\x2c\x31\x30\x33\x35\x2e\x30\x36\
\x33\x33\x20\x48\x20\x34\x32\x2e\x33\x30\x30\x31\x33\x38\x22\x0a\
\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x38\
\x37\x30\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\
\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x20\x2f\x3e\x0a\x20\
\x20\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x08\xe1\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x70\
\x6c\x75\x73\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\
\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\
\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\x3c\
\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\x20\
\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\
\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\
\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\
\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\
\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\
\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\
\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\
\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\
\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\
\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\
\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\
\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\
\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\
\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\
\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\
\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\
\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\
\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\
\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\
\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\
\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\
\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\
\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\
\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\
\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\
\x64\x74\x68\x3d\x22\x31\x38\x36\x33\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\
\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x30\x32\x35\x22\x0a\x20\x20\
\x20\x20\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\
\x34\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\
\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x37\
\x33\x38\x33\x30\x34\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x31\x30\x38\x2e\x32\
\x37\x32\x37\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x63\x79\x3d\x22\x32\x30\x39\x2e\x34\x34\x35\x30\
\x34\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\
\x64\x6f\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\
\x6d\x61\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x31\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\
\x65\x6e\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\
\x20\x2f\x3e\x0a\x20\x20\x3c\x67\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x67\x38\x33\x31\x22\x0a\x20\x20\x20\x20\x20\x73\x74\x79\
\x6c\x65\x3d\x22\x73\x74\x72\x6f\x6b\x65\x3a\x23\x62\x33\x62\x33\
\x62\x33\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\
\x70\x3a\x72\x6f\x75\x6e\x64\x22\x3e\x0a\x20\x20\x20\x20\x3c\x70\
\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x20\x20\x73\x6f\x64\x69\x70\
\x6f\x64\x69\x3a\x6e\x6f\x64\x65\x74\x79\x70\x65\x73\x3d\x22\x63\
\x63\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\
\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\
\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\x38\x31\x32\x22\x0a\x20\
\x20\x20\x20\x20\x20\x20\x64\x3d\x22\x6d\x20\x39\x35\x2e\x30\x39\
\x31\x39\x37\x33\x2c\x35\x36\x2e\x31\x37\x32\x32\x34\x33\x20\x30\
\x2e\x30\x39\x34\x34\x37\x2c\x37\x39\x2e\x37\x39\x35\x30\x39\x37\
\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\
\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x66\x69\x6c\x6c\x2d\x72\
\x75\x6c\x65\x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\
\x6b\x65\x3a\x23\x62\x33\x62\x33\x62\x33\x3b\x73\x74\x72\x6f\x6b\
\x65\x2d\x77\x69\x64\x74\x68\x3a\x31\x36\x3b\x73\x74\x72\x6f\x6b\
\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3a\x72\x6f\x75\x6e\x64\x3b\
\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\
\x6d\x69\x74\x65\x72\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\
\x65\x72\x6c\x69\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\
\x2d\x64\x61\x73\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\x3b\
\x73\x74\x72\x6f\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\
\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\
\x20\x20\x20\x20\x20\x20\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\
\x6f\x64\x65\x74\x79\x70\x65\x73\x3d\x22\x63\x63\x22\x0a\x20\x20\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\
\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\
\x65\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x70\x61\x74\x68\x38\x31\x32\x2d\x33\x22\x0a\x20\x20\x20\x20\
\x20\x20\x20\x64\x3d\x22\x6d\x20\x31\x33\x34\x2e\x39\x36\x31\x34\
\x37\x2c\x39\x35\x2e\x35\x39\x34\x34\x38\x37\x20\x2d\x37\x39\x2e\
\x37\x39\x35\x31\x30\x38\x2c\x30\x2e\x30\x39\x34\x35\x22\x0a\x20\
\x20\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\
\x6c\x3a\x6e\x6f\x6e\x65\x3b\x66\x69\x6c\x6c\x2d\x72\x75\x6c\x65\
\x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\x6f\x6b\x65\x3a\
\x23\x62\x33\x62\x33\x62\x33\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\
\x69\x64\x74\x68\x3a\x31\x36\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\
\x69\x6e\x65\x63\x61\x70\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\x72\
\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x6d\x69\x74\
\x65\x72\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\
\x69\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x64\x61\
\x73\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\
\x6f\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\
\x00\x00\x0d\x5a\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x67\
\x65\x61\x72\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\
\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\
\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\x3c\
\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\x20\
\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\
\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\
\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\
\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\
\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\
\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\
\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\
\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\
\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\
\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\
\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\
\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\
\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\
\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\
\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\
\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\
\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\
\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\
\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\
\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\
\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\
\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\
\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\
\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\
\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\
\x64\x74\x68\x3d\x22\x37\x38\x34\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x68\
\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x34\x22\
\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\x3d\x22\
\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x32\x32\x39\
\x31\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x34\x37\x2e\x39\x39\x39\x39\
\x39\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x63\x79\x3d\x22\x39\x36\x2e\x30\x30\x30\x30\x30\x33\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\
\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\
\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\
\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\x39\x39\x39\
\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\
\x31\x2e\x33\x33\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\x20\x20\
\x20\x64\x3d\x22\x6d\x20\x37\x37\x2e\x36\x38\x35\x32\x31\x32\x2c\
\x31\x37\x36\x2e\x36\x32\x35\x34\x36\x20\x63\x20\x2d\x30\x2e\x33\
\x36\x34\x39\x35\x2c\x2d\x30\x2e\x35\x39\x30\x35\x31\x20\x2d\x31\
\x2e\x33\x35\x39\x33\x37\x38\x2c\x2d\x36\x2e\x31\x35\x35\x37\x31\
\x20\x2d\x32\x2e\x32\x30\x39\x38\x34\x2c\x2d\x31\x32\x2e\x33\x36\
\x37\x31\x32\x20\x2d\x30\x2e\x38\x35\x30\x34\x36\x2c\x2d\x36\x2e\
\x32\x31\x31\x34\x32\x20\x2d\x31\x2e\x36\x34\x37\x32\x38\x34\x2c\
\x2d\x31\x31\x2e\x32\x39\x34\x34\x38\x20\x2d\x31\x2e\x37\x37\x30\
\x37\x32\x2c\x2d\x31\x31\x2e\x32\x39\x35\x37\x20\x2d\x30\x2e\x32\
\x39\x32\x38\x37\x36\x2c\x2d\x30\x2e\x30\x30\x33\x20\x2d\x38\x2e\
\x39\x32\x38\x39\x35\x38\x2c\x2d\x34\x2e\x37\x35\x37\x35\x20\x2d\
\x31\x31\x2e\x37\x33\x37\x31\x34\x32\x2c\x2d\x36\x2e\x34\x36\x31\
\x39\x33\x20\x2d\x31\x2e\x36\x30\x35\x34\x37\x34\x2c\x2d\x30\x2e\
\x39\x37\x34\x34\x34\x20\x2d\x35\x2e\x30\x33\x33\x32\x36\x37\x2c\
\x2d\x30\x2e\x31\x34\x34\x34\x38\x20\x2d\x31\x33\x2e\x30\x31\x36\
\x38\x30\x32\x2c\x33\x2e\x31\x35\x31\x36\x38\x20\x2d\x36\x2e\x36\
\x39\x31\x34\x37\x33\x2c\x32\x2e\x37\x36\x32\x37\x31\x20\x2d\x31\
\x31\x2e\x33\x30\x30\x36\x38\x31\x2c\x33\x2e\x39\x39\x36\x33\x31\
\x20\x2d\x31\x32\x2e\x30\x34\x38\x33\x38\x31\x2c\x33\x2e\x32\x32\
\x34\x35\x39\x20\x2d\x32\x2e\x36\x33\x38\x36\x30\x31\x2c\x2d\x32\
\x2e\x37\x32\x33\x33\x36\x20\x2d\x31\x37\x2e\x34\x32\x32\x31\x30\
\x31\x2c\x2d\x32\x39\x2e\x33\x37\x31\x35\x33\x20\x2d\x31\x37\x2e\
\x34\x32\x32\x31\x30\x31\x2c\x2d\x33\x31\x2e\x34\x30\x34\x34\x20\
\x30\x2c\x2d\x31\x2e\x31\x39\x32\x32\x33\x20\x33\x2e\x38\x38\x35\
\x30\x35\x37\x2c\x2d\x35\x2e\x30\x39\x35\x31\x38\x20\x38\x2e\x36\
\x33\x33\x34\x36\x2c\x2d\x38\x2e\x36\x37\x33\x32\x34\x20\x6c\x20\
\x38\x2e\x36\x33\x33\x34\x36\x2c\x2d\x36\x2e\x35\x30\x35\x35\x35\
\x20\x76\x20\x2d\x38\x2e\x36\x36\x36\x36\x37\x31\x20\x2d\x38\x2e\
\x36\x36\x36\x36\x36\x37\x20\x6c\x20\x2d\x38\x2e\x36\x33\x33\x34\
\x36\x2c\x2d\x36\x2e\x35\x30\x35\x35\x35\x36\x20\x63\x20\x2d\x34\
\x2e\x37\x34\x38\x34\x30\x33\x2c\x2d\x33\x2e\x35\x37\x38\x30\x35\
\x36\x20\x2d\x38\x2e\x36\x33\x33\x34\x36\x2c\x2d\x37\x2e\x34\x38\
\x31\x30\x31\x36\x20\x2d\x38\x2e\x36\x33\x33\x34\x36\x2c\x2d\x38\
\x2e\x36\x37\x33\x32\x34\x32\x20\x30\x2c\x2d\x32\x2e\x30\x33\x39\
\x32\x35\x32\x20\x31\x34\x2e\x37\x38\x37\x39\x38\x2c\x2d\x32\x38\
\x2e\x36\x38\x36\x31\x37\x31\x20\x31\x37\x2e\x34\x33\x35\x37\x38\
\x39\x2c\x2d\x33\x31\x2e\x34\x31\x38\x30\x39\x20\x30\x2e\x37\x36\
\x35\x38\x30\x37\x2c\x2d\x30\x2e\x37\x39\x30\x31\x33\x32\x20\x35\
\x2e\x32\x36\x36\x32\x35\x36\x2c\x30\x2e\x33\x38\x38\x39\x31\x32\
\x20\x31\x32\x2e\x30\x31\x31\x36\x32\x31\x2c\x33\x2e\x31\x34\x36\
\x38\x35\x31\x20\x31\x30\x2e\x37\x33\x35\x36\x33\x32\x2c\x34\x2e\
\x33\x38\x39\x34\x31\x35\x20\x31\x30\x2e\x38\x30\x38\x30\x38\x32\
\x2c\x34\x2e\x33\x39\x39\x30\x33\x33\x20\x31\x35\x2e\x32\x32\x33\
\x33\x39\x34\x2c\x32\x2e\x30\x32\x31\x32\x33\x32\x20\x39\x2e\x32\
\x32\x36\x31\x31\x38\x2c\x2d\x34\x2e\x39\x36\x38\x35\x39\x33\x20\
\x39\x2e\x38\x35\x34\x32\x39\x33\x2c\x2d\x35\x2e\x39\x31\x38\x31\
\x37\x36\x20\x31\x31\x2e\x34\x30\x33\x33\x31\x2c\x2d\x31\x37\x2e\
\x32\x33\x37\x38\x36\x31\x20\x30\x2e\x38\x30\x32\x38\x31\x32\x2c\
\x2d\x35\x2e\x38\x36\x36\x36\x36\x37\x20\x31\x2e\x39\x31\x32\x31\
\x35\x38\x2c\x2d\x31\x31\x2e\x31\x33\x34\x32\x36\x36\x20\x32\x2e\
\x34\x36\x35\x32\x31\x32\x2c\x2d\x31\x31\x2e\x37\x30\x35\x37\x37\
\x35\x20\x30\x2e\x35\x35\x33\x30\x35\x36\x2c\x2d\x30\x2e\x35\x37\
\x31\x35\x30\x39\x20\x39\x2e\x33\x35\x37\x39\x35\x38\x2c\x2d\x30\
\x2e\x38\x37\x31\x35\x30\x39\x20\x31\x39\x2e\x35\x36\x36\x34\x35\
\x32\x2c\x2d\x30\x2e\x36\x36\x36\x36\x36\x37\x20\x6c\x20\x31\x38\
\x2e\x35\x36\x30\x38\x38\x36\x2c\x30\x2e\x33\x37\x32\x34\x34\x32\
\x20\x32\x2c\x31\x31\x2e\x37\x34\x31\x34\x31\x36\x20\x32\x2c\x31\
\x31\x2e\x37\x34\x31\x34\x31\x36\x20\x36\x2e\x33\x32\x39\x34\x2c\
\x33\x2e\x39\x32\x35\x32\x35\x20\x63\x20\x33\x2e\x34\x38\x31\x31\
\x37\x2c\x32\x2e\x31\x35\x38\x38\x38\x38\x20\x36\x2e\x37\x39\x32\
\x35\x33\x2c\x33\x2e\x39\x32\x35\x32\x35\x31\x20\x37\x2e\x33\x35\
\x38\x35\x38\x2c\x33\x2e\x39\x32\x35\x32\x35\x31\x20\x30\x2e\x35\
\x36\x36\x30\x35\x2c\x30\x20\x35\x2e\x34\x31\x39\x31\x38\x2c\x2d\
\x31\x2e\x38\x34\x34\x34\x38\x33\x20\x31\x30\x2e\x37\x38\x34\x37\
\x34\x2c\x2d\x34\x2e\x30\x39\x38\x38\x35\x31\x20\x35\x2e\x33\x36\
\x35\x35\x36\x2c\x2d\x32\x2e\x32\x35\x34\x33\x36\x39\x20\x31\x30\
\x2e\x34\x35\x39\x32\x36\x2c\x2d\x33\x2e\x38\x32\x38\x38\x31\x38\
\x20\x31\x31\x2e\x33\x31\x39\x33\x34\x2c\x2d\x33\x2e\x34\x39\x38\
\x37\x37\x37\x20\x32\x2e\x30\x33\x33\x32\x34\x2c\x30\x2e\x37\x38\
\x30\x32\x32\x38\x20\x31\x38\x2e\x32\x30\x37\x39\x34\x2c\x32\x39\
\x2e\x30\x32\x38\x36\x39\x35\x20\x31\x38\x2e\x32\x30\x37\x39\x34\
\x2c\x33\x31\x2e\x37\x39\x39\x34\x34\x35\x20\x30\x2c\x31\x2e\x31\
\x36\x36\x32\x32\x32\x20\x2d\x33\x2e\x38\x38\x35\x30\x35\x2c\x35\
\x2e\x30\x34\x37\x39\x30\x34\x20\x2d\x38\x2e\x36\x33\x33\x34\x35\
\x2c\x38\x2e\x36\x32\x35\x39\x36\x20\x6c\x20\x2d\x38\x2e\x36\x33\
\x33\x34\x37\x2c\x36\x2e\x35\x30\x35\x35\x35\x36\x20\x76\x20\x38\
\x2e\x36\x36\x36\x36\x36\x37\x20\x38\x2e\x36\x36\x36\x36\x37\x31\
\x20\x6c\x20\x38\x2e\x36\x33\x33\x34\x37\x2c\x36\x2e\x35\x30\x35\
\x35\x35\x20\x63\x20\x34\x2e\x37\x34\x38\x34\x2c\x33\x2e\x35\x37\
\x38\x30\x36\x20\x38\x2e\x36\x33\x33\x34\x35\x2c\x37\x2e\x34\x38\
\x31\x30\x31\x20\x38\x2e\x36\x33\x33\x34\x35\x2c\x38\x2e\x36\x37\
\x33\x32\x34\x20\x30\x2c\x32\x2e\x30\x33\x32\x38\x37\x20\x2d\x31\
\x34\x2e\x37\x38\x33\x35\x2c\x32\x38\x2e\x36\x38\x31\x30\x34\x20\
\x2d\x31\x37\x2e\x34\x32\x32\x31\x2c\x33\x31\x2e\x34\x30\x34\x34\
\x20\x2d\x30\x2e\x37\x34\x37\x37\x32\x2c\x30\x2e\x37\x37\x31\x37\
\x34\x20\x2d\x35\x2e\x32\x39\x38\x37\x32\x2c\x2d\x30\x2e\x34\x33\
\x37\x38\x36\x20\x2d\x31\x31\x2e\x38\x39\x37\x30\x33\x2c\x2d\x33\
\x2e\x31\x36\x32\x31\x20\x6c\x20\x2d\x31\x30\x2e\x36\x38\x36\x30\
\x36\x2c\x2d\x34\x2e\x34\x31\x31\x39\x37\x20\x2d\x37\x2e\x32\x31\
\x38\x36\x32\x2c\x33\x2e\x37\x37\x39\x34\x34\x20\x2d\x37\x2e\x32\
\x31\x38\x36\x31\x2c\x33\x2e\x37\x37\x39\x34\x33\x20\x2d\x31\x2e\
\x37\x37\x38\x37\x39\x2c\x31\x32\x2e\x30\x34\x39\x33\x33\x20\x2d\
\x31\x2e\x37\x37\x38\x37\x39\x2c\x31\x32\x2e\x30\x34\x39\x33\x33\
\x20\x2d\x31\x38\x2e\x38\x39\x39\x30\x36\x36\x2c\x30\x2e\x33\x36\
\x39\x33\x32\x20\x63\x20\x2d\x31\x30\x2e\x33\x39\x34\x34\x38\x34\
\x2c\x30\x2e\x32\x30\x33\x31\x34\x20\x2d\x31\x39\x2e\x31\x39\x37\
\x36\x36\x2c\x2d\x30\x2e\x31\x31\x33\x38\x36\x20\x2d\x31\x39\x2e\
\x35\x36\x32\x36\x31\x32\x2c\x2d\x30\x2e\x37\x30\x34\x33\x20\x7a\
\x20\x6d\x20\x32\x39\x2e\x35\x30\x34\x35\x30\x38\x2c\x2d\x35\x33\
\x2e\x30\x36\x39\x30\x38\x20\x63\x20\x31\x34\x2e\x36\x32\x35\x32\
\x31\x2c\x2d\x36\x2e\x31\x30\x39\x32\x39\x20\x32\x31\x2e\x35\x37\
\x36\x30\x32\x2c\x2d\x32\x33\x2e\x32\x36\x36\x34\x36\x20\x31\x35\
\x2e\x30\x39\x36\x30\x32\x2c\x2d\x33\x37\x2e\x32\x36\x32\x35\x39\
\x34\x20\x2d\x31\x30\x2e\x32\x30\x32\x31\x37\x2c\x2d\x32\x32\x2e\
\x30\x33\x35\x36\x35\x20\x2d\x34\x30\x2e\x37\x34\x32\x31\x39\x2c\
\x2d\x32\x32\x2e\x30\x33\x35\x36\x35\x20\x2d\x35\x30\x2e\x39\x34\
\x34\x33\x36\x34\x2c\x30\x20\x2d\x31\x30\x2e\x33\x32\x39\x36\x34\
\x31\x2c\x32\x32\x2e\x33\x31\x30\x39\x37\x34\x20\x31\x33\x2e\x31\
\x36\x38\x37\x35\x34\x2c\x34\x36\x2e\x37\x33\x36\x33\x39\x34\x20\
\x33\x35\x2e\x38\x34\x38\x33\x34\x34\x2c\x33\x37\x2e\x32\x36\x32\
\x35\x39\x34\x20\x7a\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\
\x70\x61\x74\x68\x38\x31\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\
\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x20\x2f\
\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x08\xe8\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x63\
\x6f\x70\x79\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\
\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\
\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\x3c\
\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\x20\
\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\
\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\
\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\
\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\
\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\
\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\
\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\
\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\
\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\
\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\
\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\
\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\
\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\
\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\
\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\
\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\
\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\
\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\
\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\
\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\
\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\
\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\
\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\
\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\
\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\
\x64\x74\x68\x3d\x22\x31\x38\x36\x33\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\
\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x30\x32\x35\x22\x0a\x20\x20\
\x20\x20\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\
\x34\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\
\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x32\
\x32\x39\x31\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x34\x37\x2e\x39\x39\
\x39\x39\x39\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x63\x79\x3d\x22\x39\x36\x2e\x30\x30\x30\x30\x30\
\x33\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\
\x64\x6f\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\
\x6d\x61\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x31\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\
\x65\x6e\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\
\x20\x2f\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\
\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\x39\
\x39\x39\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\
\x68\x3a\x31\x2e\x33\x33\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\
\x20\x20\x20\x64\x3d\x22\x6d\x20\x35\x39\x2e\x36\x32\x37\x31\x31\
\x36\x2c\x31\x38\x30\x2e\x33\x31\x31\x37\x32\x20\x63\x20\x2d\x31\
\x2e\x34\x36\x36\x36\x36\x2c\x2d\x30\x2e\x36\x32\x30\x30\x39\x20\
\x2d\x34\x2e\x31\x36\x36\x36\x36\x2c\x2d\x32\x2e\x37\x34\x31\x34\
\x20\x2d\x36\x2c\x2d\x34\x2e\x37\x31\x34\x30\x31\x20\x6c\x20\x2d\
\x33\x2e\x33\x33\x33\x33\x33\x2c\x2d\x33\x2e\x35\x38\x36\x35\x36\
\x20\x56\x20\x31\x30\x39\x2e\x34\x37\x37\x35\x34\x20\x34\x36\x2e\
\x39\x34\x33\x39\x33\x38\x20\x6c\x20\x34\x2e\x33\x35\x38\x39\x37\
\x2c\x2d\x34\x2e\x33\x35\x38\x39\x37\x35\x20\x34\x2e\x33\x35\x38\
\x39\x38\x2c\x2d\x34\x2e\x33\x35\x38\x39\x37\x34\x20\x68\x20\x35\
\x30\x2e\x36\x31\x35\x33\x38\x34\x20\x35\x30\x2e\x36\x31\x35\x33\
\x39\x20\x6c\x20\x34\x2e\x33\x35\x38\x39\x37\x2c\x34\x2e\x33\x35\
\x38\x39\x37\x34\x20\x34\x2e\x33\x35\x38\x39\x37\x2c\x34\x2e\x33\
\x35\x38\x39\x37\x35\x20\x76\x20\x36\x32\x2e\x36\x31\x35\x33\x38\
\x32\x20\x36\x32\x2e\x36\x31\x35\x33\x39\x20\x6c\x20\x2d\x34\x2e\
\x33\x35\x37\x35\x38\x2c\x34\x2e\x33\x35\x38\x39\x37\x20\x2d\x34\
\x2e\x33\x35\x37\x36\x2c\x34\x2e\x33\x35\x38\x39\x37\x20\x2d\x34\
\x38\x2e\x39\x37\x35\x37\x34\x2c\x30\x2e\x32\x37\x33\x32\x37\x20\
\x63\x20\x2d\x32\x36\x2e\x39\x33\x36\x36\x36\x34\x2c\x30\x2e\x31\
\x35\x30\x32\x39\x20\x2d\x35\x30\x2e\x31\x37\x35\x37\x34\x34\x2c\
\x2d\x30\x2e\x32\x33\x34\x30\x39\x20\x2d\x35\x31\x2e\x36\x34\x32\
\x34\x31\x34\x2c\x2d\x30\x2e\x38\x35\x34\x32\x20\x7a\x20\x6d\x20\
\x39\x34\x2e\x30\x30\x30\x30\x30\x34\x2c\x2d\x37\x30\x2e\x37\x35\
\x32\x34\x20\x56\x20\x35\x33\x2e\x35\x35\x39\x33\x32\x32\x20\x68\
\x20\x2d\x34\x34\x20\x2d\x34\x34\x2e\x30\x30\x30\x30\x30\x34\x20\
\x76\x20\x35\x35\x2e\x39\x39\x39\x39\x39\x38\x20\x35\x36\x20\x68\
\x20\x34\x34\x2e\x30\x30\x30\x30\x30\x34\x20\x34\x34\x20\x7a\x20\
\x4d\x20\x31\x37\x2e\x39\x32\x30\x35\x33\x36\x2c\x37\x34\x2e\x32\
\x35\x30\x35\x39\x34\x20\x6c\x20\x30\x2e\x33\x37\x33\x32\x35\x2c\
\x2d\x35\x39\x2e\x33\x30\x38\x37\x32\x38\x20\x34\x2e\x33\x35\x37\
\x36\x37\x2c\x2d\x34\x2e\x33\x35\x37\x39\x33\x39\x20\x34\x2e\x33\
\x35\x37\x36\x38\x2c\x2d\x34\x2e\x33\x35\x37\x39\x33\x38\x33\x20\
\x35\x31\x2e\x33\x30\x38\x39\x39\x2c\x2d\x30\x2e\x33\x37\x38\x36\
\x36\x35\x32\x20\x35\x31\x2e\x33\x30\x38\x39\x39\x34\x2c\x2d\x30\
\x2e\x33\x37\x38\x36\x36\x35\x34\x20\x76\x20\x38\x2e\x30\x34\x35\
\x33\x33\x31\x39\x20\x38\x2e\x30\x34\x35\x33\x33\x32\x20\x68\x20\
\x2d\x34\x38\x2e\x30\x30\x30\x30\x30\x34\x20\x2d\x34\x38\x20\x76\
\x20\x35\x36\x20\x35\x35\x2e\x39\x39\x39\x39\x39\x38\x20\x68\x20\
\x2d\x38\x2e\x30\x33\x39\x39\x32\x20\x2d\x38\x2e\x30\x33\x39\x39\
\x31\x20\x7a\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\
\x74\x68\x38\x31\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\
\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x20\x2f\x3e\x0a\
\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x07\x3d\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\
\x6c\x6e\x73\x3a\x64\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\
\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\
\x6e\x74\x73\x2f\x31\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\
\x6e\x73\x3a\x63\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\
\x65\x61\x74\x69\x76\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\
\x67\x2f\x6e\x73\x23\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\
\x72\x64\x66\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\
\x32\x2d\x72\x64\x66\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\
\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\
\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\
\x6f\x64\x69\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\
\x70\x6f\x64\x69\x2e\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\
\x2e\x6e\x65\x74\x2f\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\
\x69\x2d\x30\x2e\x64\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\
\x73\x3a\x69\x6e\x6b\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\
\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\
\x6f\x72\x67\x2f\x6e\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x22\x0a\x20\x20\x20\x77\x69\x64\x74\
\x68\x3d\x22\x34\x38\x22\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\
\x3d\x22\x34\x38\x22\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\
\x3d\x22\x30\x20\x30\x20\x34\x38\x20\x34\x38\x22\x0a\x20\x20\x20\
\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x0a\x20\x20\
\x20\x69\x64\x3d\x22\x73\x76\x67\x36\x22\x0a\x20\x20\x20\x73\x6f\
\x64\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\
\x72\x75\x6e\x5f\x63\x61\x73\x63\x61\x64\x65\x5f\x73\x74\x65\x70\
\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\x39\x32\x2e\
\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\x30\x31\x37\
\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\x3c\x6d\x65\x74\
\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x6d\
\x65\x74\x61\x64\x61\x74\x61\x31\x32\x22\x3e\x0a\x20\x20\x20\x20\
\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\x20\x20\
\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\x20\x20\
\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\x3e\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\x72\x6d\
\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\x6d\x6c\
\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\x20\x20\
\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\x20\x20\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\x65\x73\
\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\
\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\x74\x79\
\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\x20\x2f\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x69\
\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x2f\x63\
\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x72\x64\
\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\x61\x64\
\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\x20\x20\
\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x31\x30\x22\x20\x2f\x3e\
\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\x6d\
\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\x65\
\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\x0a\
\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\x72\
\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\x20\
\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x31\
\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\x6c\
\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\
\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\
\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\x6f\
\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x6f\
\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\x61\
\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\x64\
\x74\x68\x3d\x22\x31\x38\x36\x33\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x68\
\x65\x69\x67\x68\x74\x3d\x22\x31\x30\x32\x35\x22\x0a\x20\x20\x20\
\x20\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x38\
\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\x3d\
\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x34\x2e\x39\x31\
\x36\x36\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x34\x38\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x79\x3d\x22\
\x32\x34\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\
\x6e\x64\x6f\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\
\x2d\x6d\x61\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x31\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\
\x72\x65\x6e\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x36\
\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\
\x20\x20\x64\x3d\x22\x4d\x30\x20\x30\x68\x34\x38\x76\x34\x38\x68\
\x2d\x34\x38\x7a\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\
\x61\x74\x68\x32\x22\x0a\x20\x20\x20\x20\x20\x66\x69\x6c\x6c\x3d\
\x22\x6e\x6f\x6e\x65\x22\x20\x2f\x3e\x0a\x20\x20\x3c\x70\x61\x74\
\x68\x0a\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x69\
\x6c\x6c\x3a\x23\x39\x39\x39\x39\x39\x39\x3b\x66\x69\x6c\x6c\x2d\
\x72\x75\x6c\x65\x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\x73\x74\x72\
\x6f\x6b\x65\x3a\x23\x39\x39\x39\x39\x39\x39\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x32\x3b\x73\x74\x72\x6f\x6b\
\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3a\x62\x75\x74\x74\x3b\x73\
\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x72\
\x6f\x75\x6e\x64\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\
\x72\x6c\x69\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
\x64\x61\x73\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\x3b\x73\
\x74\x72\x6f\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x22\
\x0a\x20\x20\x20\x20\x20\x64\x3d\x22\x6d\x20\x31\x34\x2e\x33\x33\
\x39\x30\x33\x33\x2c\x31\x32\x2e\x38\x31\x33\x35\x36\x33\x20\x2d\
\x30\x2e\x32\x30\x33\x33\x39\x2c\x32\x32\x2e\x33\x37\x32\x38\x38\
\x32\x20\x31\x39\x2e\x37\x32\x38\x38\x31\x34\x2c\x2d\x31\x31\x2e\
\x35\x39\x33\x32\x32\x20\x7a\x22\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x70\x61\x74\x68\x34\x34\x38\x39\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\
\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\
\x22\x20\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x09\x76\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x70\
\x69\x63\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\x39\
\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\x30\
\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\x3c\x6d\
\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\x20\x20\
\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\x20\
\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\x20\
\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\x3e\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\x72\
\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\x6d\
\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\x20\
\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\x65\
\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\
\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\x74\
\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\x20\
\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\
\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x2f\
\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x72\
\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\x61\
\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\x20\
\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\x2f\x3e\
\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\x6d\
\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\x65\
\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\x0a\
\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\x72\
\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\x20\
\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x31\
\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\x6c\
\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\x20\
\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\
\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\x6f\
\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x6f\
\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\x61\
\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\x64\
\x74\x68\x3d\x22\x37\x38\x34\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x68\x65\
\x69\x67\x68\x74\x3d\x22\x34\x38\x30\x22\x0a\x20\x20\x20\x20\x20\
\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x34\x22\x0a\
\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\x3d\x22\x66\
\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x32\x32\x39\x31\
\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x63\x78\x3d\x22\x2d\x34\x37\x2e\x39\x39\x39\x39\x39\
\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\
\x3a\x63\x79\x3d\x22\x39\x36\x2e\x30\x30\x30\x30\x30\x33\x22\x0a\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\
\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\
\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\x78\
\x69\x6d\x69\x7a\x65\x64\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\x74\
\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\x20\x2f\x3e\
\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x73\x74\
\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\x39\x39\x39\x39\
\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x31\
\x2e\x33\x33\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\x20\x20\x20\
\x64\x3d\x22\x6d\x20\x33\x34\x2c\x31\x37\x30\x2e\x30\x30\x32\x34\
\x37\x20\x63\x20\x2d\x31\x2e\x34\x36\x36\x36\x36\x37\x2c\x2d\x30\
\x2e\x36\x31\x37\x38\x20\x2d\x34\x2e\x31\x36\x36\x36\x36\x37\x2c\
\x2d\x32\x2e\x37\x33\x37\x32\x34\x20\x2d\x36\x2c\x2d\x34\x2e\x37\
\x30\x39\x38\x35\x20\x6c\x20\x2d\x33\x2e\x33\x33\x33\x33\x33\x33\
\x2c\x2d\x33\x2e\x35\x38\x36\x35\x36\x20\x56\x20\x39\x39\x2e\x31\
\x37\x32\x34\x36\x20\x33\x36\x2e\x36\x33\x38\x38\x35\x33\x20\x6c\
\x20\x34\x2e\x33\x35\x38\x39\x37\x34\x2c\x2d\x34\x2e\x33\x35\x38\
\x39\x37\x35\x20\x34\x2e\x33\x35\x38\x39\x37\x35\x2c\x2d\x34\x2e\
\x33\x35\x38\x39\x37\x34\x20\x48\x20\x39\x36\x20\x31\x35\x38\x2e\
\x36\x31\x35\x33\x39\x20\x6c\x20\x34\x2e\x33\x35\x38\x39\x37\x2c\
\x34\x2e\x33\x35\x38\x39\x37\x34\x20\x34\x2e\x33\x35\x38\x39\x37\
\x2c\x34\x2e\x33\x35\x38\x39\x37\x35\x20\x76\x20\x36\x32\x2e\x36\
\x31\x35\x33\x38\x34\x20\x36\x32\x2e\x36\x31\x35\x33\x38\x33\x20\
\x6c\x20\x2d\x34\x2e\x33\x35\x37\x39\x38\x2c\x34\x2e\x33\x35\x38\
\x39\x37\x20\x2d\x34\x2e\x33\x35\x38\x2c\x34\x2e\x33\x35\x38\x39\
\x37\x20\x2d\x36\x30\x2e\x39\x37\x35\x33\x34\x32\x2c\x30\x2e\x32\
\x36\x39\x31\x20\x43\x20\x36\x34\x2e\x31\x30\x35\x35\x36\x39\x2c\
\x31\x37\x31\x2e\x30\x30\x34\x36\x36\x20\x33\x35\x2e\x34\x36\x36\
\x36\x36\x37\x2c\x31\x37\x30\x2e\x36\x32\x30\x32\x38\x20\x33\x34\
\x2c\x31\x37\x30\x2e\x30\x30\x32\x34\x37\x20\x5a\x20\x4d\x20\x31\
\x33\x34\x2e\x35\x31\x36\x30\x39\x2c\x31\x32\x33\x2e\x39\x32\x30\
\x39\x20\x63\x20\x2d\x39\x2e\x36\x33\x31\x31\x37\x2c\x2d\x31\x32\
\x2e\x38\x33\x33\x33\x33\x20\x2d\x31\x37\x2e\x39\x39\x35\x34\x35\
\x2c\x2d\x32\x33\x2e\x33\x33\x33\x33\x33\x20\x2d\x31\x38\x2e\x35\
\x38\x37\x33\x2c\x2d\x32\x33\x2e\x33\x33\x33\x33\x33\x20\x2d\x30\
\x2e\x35\x39\x31\x38\x34\x2c\x30\x20\x2d\x36\x2e\x38\x39\x35\x33\
\x32\x2c\x37\x2e\x35\x20\x2d\x31\x34\x2e\x30\x30\x37\x37\x32\x2c\
\x31\x36\x2e\x36\x36\x36\x36\x37\x20\x2d\x37\x2e\x31\x31\x32\x33\
\x39\x39\x2c\x39\x2e\x31\x36\x36\x36\x36\x20\x2d\x31\x33\x2e\x34\
\x30\x32\x34\x38\x36\x2c\x31\x36\x2e\x36\x36\x36\x36\x36\x20\x2d\
\x31\x33\x2e\x39\x37\x37\x39\x36\x39\x2c\x31\x36\x2e\x36\x36\x36\
\x36\x36\x20\x2d\x30\x2e\x35\x37\x35\x34\x38\x32\x2c\x30\x20\x2d\
\x35\x2e\x30\x34\x39\x38\x37\x37\x2c\x2d\x34\x2e\x38\x20\x2d\x39\
\x2e\x39\x34\x33\x31\x30\x31\x2c\x2d\x31\x30\x2e\x36\x36\x36\x36\
\x37\x20\x2d\x34\x2e\x38\x39\x33\x32\x32\x34\x2c\x2d\x35\x2e\x38\
\x36\x36\x36\x36\x20\x2d\x39\x2e\x33\x39\x35\x31\x39\x35\x2c\x2d\
\x31\x30\x2e\x36\x36\x36\x36\x36\x20\x2d\x31\x30\x2e\x30\x30\x34\
\x33\x38\x31\x2c\x2d\x31\x30\x2e\x36\x36\x36\x36\x36\x20\x2d\x30\
\x2e\x36\x30\x39\x31\x38\x36\x2c\x30\x20\x2d\x35\x2e\x31\x37\x34\
\x32\x36\x33\x2c\x35\x2e\x32\x35\x20\x2d\x31\x30\x2e\x31\x34\x34\
\x36\x31\x35\x2c\x31\x31\x2e\x36\x36\x36\x36\x36\x20\x2d\x34\x2e\
\x39\x37\x30\x33\x35\x32\x2c\x36\x2e\x34\x31\x36\x36\x37\x20\x2d\
\x31\x31\x2e\x30\x39\x32\x34\x33\x31\x2c\x31\x34\x2e\x32\x31\x36\
\x36\x37\x20\x2d\x31\x33\x2e\x36\x30\x34\x36\x32\x2c\x31\x37\x2e\
\x33\x33\x33\x33\x33\x20\x6c\x20\x2d\x34\x2e\x35\x36\x37\x36\x31\
\x36\x2c\x35\x2e\x36\x36\x36\x36\x37\x20\x68\x20\x35\x36\x2e\x31\
\x37\x34\x32\x36\x38\x20\x35\x36\x2e\x31\x37\x34\x32\x37\x34\x20\
\x7a\x22\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x70\x61\x74\x68\
\x38\x31\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\
\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x20\x2f\x3e\x0a\x3c\x2f\
\x73\x76\x67\x3e\x0a\
\x00\x00\x0b\x0c\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\
\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x64\x3d\x22\x73\x76\x67\x32\
\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x39\x32\x22\
\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
\x20\x31\x39\x32\x20\x31\x39\x32\x22\x0a\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x63\
\x68\x69\x70\x2e\x73\x76\x67\x22\x0a\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\
\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\x32\
\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x3e\x0a\x20\x20\x3c\
\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x38\x22\x3e\x0a\x20\x20\
\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x20\x20\
\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\x20\x20\
\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\x22\x22\
\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x66\x6f\
\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\x2b\x78\
\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\x0a\x20\
\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\x65\x0a\
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x72\
\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\
\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\x6d\x69\
\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\x65\x22\
\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\
\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\
\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\x3c\x2f\
\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\x65\x74\
\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\
\x20\x20\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x36\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\
\x6d\x65\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x70\x61\x67\
\x65\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\
\x0a\x20\x20\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\
\x72\x3d\x22\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\
\x20\x62\x6f\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\
\x31\x22\x0a\x20\x20\x20\x20\x20\x6f\x62\x6a\x65\x63\x74\x74\x6f\
\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\x20\
\x20\x20\x67\x72\x69\x64\x74\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\
\x22\x31\x30\x22\x0a\x20\x20\x20\x20\x20\x67\x75\x69\x64\x65\x74\
\x6f\x6c\x65\x72\x61\x6e\x63\x65\x3d\x22\x31\x30\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\
\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x70\x61\x67\x65\x73\x68\
\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x77\x69\
\x64\x74\x68\x3d\x22\x37\x38\x34\x22\x0a\x20\x20\x20\x20\x20\x69\
\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x68\
\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x64\x3d\x22\x6e\x61\x6d\x65\x64\x76\x69\x65\x77\x34\x22\
\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\x72\x69\x64\x3d\x22\
\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\
\x63\x61\x70\x65\x3a\x7a\x6f\x6f\x6d\x3d\x22\x31\x2e\x32\x32\x39\
\x31\x36\x36\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x63\x78\x3d\x22\x2d\x34\x37\x2e\x39\x39\x39\x39\
\x39\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\
\x65\x3a\x63\x79\x3d\x22\x39\x36\x2e\x30\x30\x30\x30\x30\x33\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\
\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x35\x37\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\
\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x75\x72\x72\x65\x6e\
\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x73\x76\x67\x32\x22\x20\x2f\
\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x23\x39\x39\x39\x39\
\x39\x39\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\
\x31\x2e\x33\x33\x33\x33\x33\x33\x33\x37\x22\x0a\x20\x20\x20\x20\
\x20\x64\x3d\x22\x6d\x20\x36\x39\x2e\x35\x35\x39\x33\x32\x32\x2c\
\x31\x36\x31\x2e\x37\x36\x33\x39\x35\x20\x76\x20\x2d\x37\x2e\x38\
\x36\x33\x31\x39\x20\x6c\x20\x2d\x31\x31\x2e\x33\x30\x38\x31\x36\
\x34\x2c\x2d\x30\x2e\x34\x37\x30\x31\x35\x20\x63\x20\x2d\x31\x30\
\x2e\x37\x31\x36\x33\x33\x36\x2c\x2d\x30\x2e\x34\x34\x35\x35\x36\
\x20\x2d\x31\x31\x2e\x35\x33\x36\x32\x37\x32\x2c\x2d\x30\x2e\x36\
\x39\x38\x32\x36\x20\x2d\x31\x35\x2e\x36\x36\x36\x36\x36\x37\x2c\
\x2d\x34\x2e\x38\x32\x38\x36\x36\x20\x2d\x34\x2e\x31\x33\x30\x33\
\x39\x34\x2c\x2d\x34\x2e\x31\x33\x30\x33\x39\x20\x2d\x34\x2e\x33\
\x38\x33\x31\x30\x39\x2c\x2d\x34\x2e\x39\x35\x30\x33\x32\x20\x2d\
\x34\x2e\x38\x32\x38\x36\x35\x37\x2c\x2d\x31\x35\x2e\x36\x36\x36\
\x36\x37\x20\x6c\x20\x2d\x30\x2e\x34\x37\x30\x31\x35\x35\x2c\x2d\
\x31\x31\x2e\x33\x30\x38\x31\x36\x20\x68\x20\x2d\x37\x2e\x38\x36\
\x33\x31\x37\x38\x20\x2d\x37\x2e\x38\x36\x33\x31\x37\x39\x20\x76\
\x20\x2d\x38\x20\x2d\x38\x20\x68\x20\x38\x20\x38\x20\x76\x20\x2d\
\x38\x2e\x30\x30\x30\x30\x30\x32\x20\x2d\x38\x20\x68\x20\x2d\x38\
\x20\x2d\x38\x20\x76\x20\x2d\x38\x20\x2d\x38\x20\x68\x20\x37\x2e\
\x38\x36\x33\x31\x37\x39\x20\x37\x2e\x38\x36\x33\x31\x37\x38\x20\
\x6c\x20\x30\x2e\x34\x37\x30\x31\x35\x35\x2c\x2d\x31\x31\x2e\x33\
\x30\x38\x31\x36\x34\x20\x63\x20\x30\x2e\x34\x34\x35\x35\x34\x38\
\x2c\x2d\x31\x30\x2e\x37\x31\x36\x33\x33\x36\x20\x30\x2e\x36\x39\
\x38\x32\x36\x33\x2c\x2d\x31\x31\x2e\x35\x33\x36\x32\x37\x32\x20\
\x34\x2e\x38\x32\x38\x36\x35\x37\x2c\x2d\x31\x35\x2e\x36\x36\x36\
\x36\x36\x37\x20\x34\x2e\x31\x33\x30\x33\x39\x35\x2c\x2d\x34\x2e\
\x31\x33\x30\x33\x39\x34\x20\x34\x2e\x39\x35\x30\x33\x33\x31\x2c\
\x2d\x34\x2e\x33\x38\x33\x31\x30\x39\x20\x31\x35\x2e\x36\x36\x36\
\x36\x36\x37\x2c\x2d\x34\x2e\x38\x32\x38\x36\x35\x37\x20\x6c\x20\
\x31\x31\x2e\x33\x30\x38\x31\x36\x34\x2c\x2d\x30\x2e\x34\x37\x30\
\x31\x35\x35\x20\x76\x20\x2d\x37\x2e\x38\x36\x33\x31\x37\x38\x20\
\x2d\x37\x2e\x38\x36\x33\x31\x37\x39\x20\x68\x20\x38\x20\x38\x20\
\x76\x20\x38\x20\x38\x20\x68\x20\x38\x20\x37\x2e\x39\x39\x39\x39\
\x39\x38\x20\x76\x20\x2d\x38\x20\x2d\x38\x20\x68\x20\x38\x20\x38\
\x20\x76\x20\x37\x2e\x38\x36\x33\x31\x37\x39\x20\x37\x2e\x38\x36\
\x33\x31\x37\x38\x20\x6c\x20\x31\x31\x2e\x33\x30\x38\x31\x36\x2c\
\x30\x2e\x34\x37\x30\x31\x35\x35\x20\x63\x20\x31\x30\x2e\x37\x31\
\x36\x33\x35\x2c\x30\x2e\x34\x34\x35\x35\x34\x38\x20\x31\x31\x2e\
\x35\x33\x36\x32\x38\x2c\x30\x2e\x36\x39\x38\x32\x36\x33\x20\x31\
\x35\x2e\x36\x36\x36\x36\x37\x2c\x34\x2e\x38\x32\x38\x36\x35\x37\
\x20\x34\x2e\x31\x33\x30\x34\x2c\x34\x2e\x31\x33\x30\x33\x39\x35\
\x20\x34\x2e\x33\x38\x33\x31\x2c\x34\x2e\x39\x35\x30\x33\x33\x31\
\x20\x34\x2e\x38\x32\x38\x36\x36\x2c\x31\x35\x2e\x36\x36\x36\x36\
\x36\x37\x20\x6c\x20\x30\x2e\x34\x37\x30\x31\x35\x2c\x31\x31\x2e\
\x33\x30\x38\x31\x36\x34\x20\x68\x20\x37\x2e\x38\x36\x33\x31\x39\
\x20\x37\x2e\x38\x36\x33\x31\x37\x20\x76\x20\x38\x20\x38\x20\x68\
\x20\x2d\x38\x20\x2d\x38\x20\x76\x20\x38\x20\x38\x2e\x30\x30\x30\
\x30\x30\x32\x20\x68\x20\x38\x20\x38\x20\x76\x20\x38\x20\x38\x20\
\x68\x20\x2d\x37\x2e\x38\x36\x33\x31\x37\x20\x2d\x37\x2e\x38\x36\
\x33\x31\x39\x20\x6c\x20\x2d\x30\x2e\x34\x37\x30\x31\x35\x2c\x31\
\x31\x2e\x33\x30\x38\x31\x36\x20\x63\x20\x2d\x30\x2e\x34\x34\x35\
\x35\x36\x2c\x31\x30\x2e\x37\x31\x36\x33\x35\x20\x2d\x30\x2e\x36\
\x39\x38\x32\x36\x2c\x31\x31\x2e\x35\x33\x36\x32\x38\x20\x2d\x34\
\x2e\x38\x32\x38\x36\x36\x2c\x31\x35\x2e\x36\x36\x36\x36\x37\x20\
\x2d\x34\x2e\x31\x33\x30\x33\x39\x2c\x34\x2e\x31\x33\x30\x34\x20\
\x2d\x34\x2e\x39\x35\x30\x33\x32\x2c\x34\x2e\x33\x38\x33\x31\x20\
\x2d\x31\x35\x2e\x36\x36\x36\x36\x37\x2c\x34\x2e\x38\x32\x38\x36\
\x36\x20\x6c\x20\x2d\x31\x31\x2e\x33\x30\x38\x31\x36\x2c\x30\x2e\
\x34\x37\x30\x31\x35\x20\x76\x20\x37\x2e\x38\x36\x33\x31\x39\x20\
\x37\x2e\x38\x36\x33\x31\x37\x20\x68\x20\x2d\x38\x20\x2d\x38\x20\
\x76\x20\x2d\x38\x20\x2d\x38\x20\x68\x20\x2d\x37\x2e\x39\x39\x39\
\x39\x39\x38\x20\x2d\x38\x20\x76\x20\x38\x20\x38\x20\x68\x20\x2d\
\x38\x20\x2d\x38\x20\x7a\x20\x4d\x20\x31\x33\x33\x2e\x35\x35\x39\
\x33\x32\x2c\x39\x37\x2e\x36\x32\x37\x31\x31\x38\x20\x76\x20\x2d\
\x34\x30\x20\x68\x20\x2d\x33\x39\x2e\x39\x39\x39\x39\x39\x38\x20\
\x2d\x34\x30\x20\x76\x20\x34\x30\x20\x34\x30\x2e\x30\x30\x30\x30\
\x30\x32\x20\x68\x20\x34\x30\x20\x33\x39\x2e\x39\x39\x39\x39\x39\
\x38\x20\x7a\x20\x6d\x20\x2d\x36\x33\x2e\x39\x39\x39\x39\x39\x38\
\x2c\x30\x20\x76\x20\x2d\x32\x34\x20\x68\x20\x32\x34\x20\x32\x33\
\x2e\x39\x39\x39\x39\x39\x38\x20\x76\x20\x32\x34\x20\x32\x34\x2e\
\x30\x30\x30\x30\x30\x32\x20\x68\x20\x2d\x32\x33\x2e\x39\x39\x39\
\x39\x39\x38\x20\x2d\x32\x34\x20\x7a\x20\x6d\x20\x33\x31\x2e\x39\
\x39\x39\x39\x39\x38\x2c\x30\x20\x76\x20\x2d\x38\x20\x68\x20\x2d\
\x37\x2e\x39\x39\x39\x39\x39\x38\x20\x2d\x38\x20\x76\x20\x38\x20\
\x38\x2e\x30\x30\x30\x30\x30\x32\x20\x68\x20\x38\x20\x37\x2e\x39\
\x39\x39\x39\x39\x38\x20\x7a\x22\x0a\x20\x20\x20\x20\x20\x69\x64\
\x3d\x22\x70\x61\x74\x68\x38\x31\x37\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\
\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\
\x20\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
\x00\x00\x0d\x9e\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x55\x54\x46\
\x2d\x38\x22\x20\x73\x74\x61\x6e\x64\x61\x6c\x6f\x6e\x65\x3d\x22\
\x6e\x6f\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x43\x72\x65\x61\x74\
\x65\x64\x20\x77\x69\x74\x68\x20\x49\x6e\x6b\x73\x63\x61\x70\x65\
\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x29\x20\x2d\x2d\x3e\x0a\
\x0a\x3c\x73\x76\x67\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x64\
\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\
\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\x73\x2f\x31\
\x2e\x31\x2f\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\
\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\
\x65\x63\x6f\x6d\x6d\x6f\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\
\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3d\
\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x0a\x20\x20\x20\
\x78\x6d\x6c\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\
\x68\x74\x74\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\
\x73\x6f\x75\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\
\x44\x54\x44\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\
\x74\x64\x22\x0a\x20\x20\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\x6e\
\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x22\x0a\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x32\
\x38\x22\x0a\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x32\
\x38\x22\x0a\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\
\x20\x30\x20\x31\x32\x38\x20\x31\x32\x38\x22\x0a\x20\x20\x20\x69\
\x64\x3d\x22\x73\x76\x67\x32\x22\x0a\x20\x20\x20\x76\x65\x72\x73\
\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x0a\x20\x20\x20\x69\x6e\x6b\
\x73\x63\x61\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\
\x2e\x39\x32\x2e\x32\x20\x28\x35\x63\x33\x65\x38\x30\x64\x2c\x20\
\x32\x30\x31\x37\x2d\x30\x38\x2d\x30\x36\x29\x22\x0a\x20\x20\x20\
\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x64\x6f\x63\x6e\x61\x6d\x65\
\x3d\x22\x47\x72\x69\x64\x43\x61\x6c\x5f\x69\x63\x6f\x6e\x2e\x73\
\x76\x67\x22\x3e\x0a\x20\x20\x3c\x64\x65\x66\x73\x0a\x20\x20\x20\
\x20\x20\x69\x64\x3d\x22\x64\x65\x66\x73\x34\x22\x3e\x0a\x20\x20\
\x20\x20\x3c\x66\x69\x6c\x74\x65\x72\x0a\x20\x20\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\x6c\x6c\x65\x63\
\x74\x3d\x22\x61\x6c\x77\x61\x79\x73\x22\x0a\x20\x20\x20\x20\x20\
\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x2d\x69\
\x6e\x74\x65\x72\x70\x6f\x6c\x61\x74\x69\x6f\x6e\x2d\x66\x69\x6c\
\x74\x65\x72\x73\x3a\x73\x52\x47\x42\x22\x0a\x20\x20\x20\x20\x20\
\x20\x20\x69\x64\x3d\x22\x66\x69\x6c\x74\x65\x72\x34\x38\x33\x38\
\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x78\x3d\x22\x2d\x30\x2e\x30\
\x30\x34\x35\x33\x39\x34\x32\x31\x33\x22\x0a\x20\x20\x20\x20\x20\
\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x2e\x30\x30\x39\x30\x37\
\x38\x38\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x79\x3d\x22\x2d\x30\
\x2e\x30\x30\x38\x38\x34\x36\x33\x35\x32\x37\x22\x0a\x20\x20\x20\
\x20\x20\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x2e\x30\x31\
\x37\x36\x39\x32\x37\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x3c\x66\
\x65\x47\x61\x75\x73\x73\x69\x61\x6e\x42\x6c\x75\x72\x0a\x20\x20\
\x20\x20\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x63\x6f\x6c\x6c\x65\x63\x74\x3d\x22\x61\x6c\x77\x61\x79\x73\x22\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x74\x64\x44\x65\x76\
\x69\x61\x74\x69\x6f\x6e\x3d\x22\x30\x2e\x32\x33\x34\x38\x32\x38\
\x34\x35\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x64\x3d\
\x22\x66\x65\x47\x61\x75\x73\x73\x69\x61\x6e\x42\x6c\x75\x72\x34\
\x38\x34\x30\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x66\x69\
\x6c\x74\x65\x72\x3e\x0a\x20\x20\x3c\x2f\x64\x65\x66\x73\x3e\x0a\
\x20\x20\x3c\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\x6e\x61\x6d\x65\
\x64\x76\x69\x65\x77\x0a\x20\x20\x20\x20\x20\x69\x64\x3d\x22\x62\
\x61\x73\x65\x22\x0a\x20\x20\x20\x20\x20\x70\x61\x67\x65\x63\x6f\
\x6c\x6f\x72\x3d\x22\x23\x66\x66\x66\x66\x66\x66\x22\x0a\x20\x20\
\x20\x20\x20\x62\x6f\x72\x64\x65\x72\x63\x6f\x6c\x6f\x72\x3d\x22\
\x23\x36\x36\x36\x36\x36\x36\x22\x0a\x20\x20\x20\x20\x20\x62\x6f\
\x72\x64\x65\x72\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x31\x2e\x30\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x70\x61\x67\x65\x6f\x70\x61\x63\x69\x74\x79\x3d\x22\x30\x2e\x30\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x70\x61\x67\x65\x73\x68\x61\x64\x6f\x77\x3d\x22\x32\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x7a\x6f\x6f\
\x6d\x3d\x22\x32\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\
\x61\x70\x65\x3a\x63\x78\x3d\x22\x33\x32\x2e\x31\x35\x33\x33\x32\
\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\
\x63\x79\x3d\x22\x2d\x31\x36\x2e\x35\x31\x36\x31\x35\x22\x0a\x20\
\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x64\x6f\x63\
\x75\x6d\x65\x6e\x74\x2d\x75\x6e\x69\x74\x73\x3d\x22\x70\x78\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\
\x75\x72\x72\x65\x6e\x74\x2d\x6c\x61\x79\x65\x72\x3d\x22\x6c\x61\
\x79\x65\x72\x31\x22\x0a\x20\x20\x20\x20\x20\x73\x68\x6f\x77\x67\
\x72\x69\x64\x3d\x22\x66\x61\x6c\x73\x65\x22\x0a\x20\x20\x20\x20\
\x20\x75\x6e\x69\x74\x73\x3d\x22\x70\x78\x22\x0a\x20\x20\x20\x20\
\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\
\x2d\x77\x69\x64\x74\x68\x3d\x22\x31\x38\x35\x39\x22\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\
\x6f\x77\x2d\x68\x65\x69\x67\x68\x74\x3d\x22\x31\x30\x32\x35\x22\
\x0a\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\
\x69\x6e\x64\x6f\x77\x2d\x78\x3d\x22\x36\x31\x22\x0a\x20\x20\x20\
\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\
\x77\x2d\x79\x3d\x22\x32\x37\x22\x0a\x20\x20\x20\x20\x20\x69\x6e\
\x6b\x73\x63\x61\x70\x65\x3a\x77\x69\x6e\x64\x6f\x77\x2d\x6d\x61\
\x78\x69\x6d\x69\x7a\x65\x64\x3d\x22\x31\x22\x20\x2f\x3e\x0a\x20\
\x20\x3c\x6d\x65\x74\x61\x64\x61\x74\x61\x0a\x20\x20\x20\x20\x20\
\x69\x64\x3d\x22\x6d\x65\x74\x61\x64\x61\x74\x61\x37\x22\x3e\x0a\
\x20\x20\x20\x20\x3c\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\
\x20\x20\x20\x20\x3c\x63\x63\x3a\x57\x6f\x72\x6b\x0a\x20\x20\x20\
\x20\x20\x20\x20\x20\x20\x72\x64\x66\x3a\x61\x62\x6f\x75\x74\x3d\
\x22\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\
\x66\x6f\x72\x6d\x61\x74\x3e\x69\x6d\x61\x67\x65\x2f\x73\x76\x67\
\x2b\x78\x6d\x6c\x3c\x2f\x64\x63\x3a\x66\x6f\x72\x6d\x61\x74\x3e\
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x63\x3a\x74\x79\x70\
\x65\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x64\x66\
\x3a\x72\x65\x73\x6f\x75\x72\x63\x65\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x70\x75\x72\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x64\x63\
\x6d\x69\x74\x79\x70\x65\x2f\x53\x74\x69\x6c\x6c\x49\x6d\x61\x67\
\x65\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\
\x63\x3a\x74\x69\x74\x6c\x65\x20\x2f\x3e\x0a\x20\x20\x20\x20\x20\
\x20\x3c\x2f\x63\x63\x3a\x57\x6f\x72\x6b\x3e\x0a\x20\x20\x20\x20\
\x3c\x2f\x72\x64\x66\x3a\x52\x44\x46\x3e\x0a\x20\x20\x3c\x2f\x6d\
\x65\x74\x61\x64\x61\x74\x61\x3e\x0a\x20\x20\x3c\x67\x0a\x20\x20\
\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x6c\x61\x62\x65\
\x6c\x3d\x22\x43\x61\x70\x61\x20\x31\x22\x0a\x20\x20\x20\x20\x20\
\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x67\x72\x6f\x75\x70\x6d\x6f\
\x64\x65\x3d\x22\x6c\x61\x79\x65\x72\x22\x0a\x20\x20\x20\x20\x20\
\x69\x64\x3d\x22\x6c\x61\x79\x65\x72\x31\x22\x0a\x20\x20\x20\x20\
\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x22\x74\x72\x61\x6e\
\x73\x6c\x61\x74\x65\x28\x30\x2c\x2d\x39\x32\x34\x2e\x33\x36\x32\
\x31\x36\x29\x22\x3e\x0a\x20\x20\x20\x20\x3c\x72\x65\x63\x74\x0a\
\x20\x20\x20\x20\x20\x20\x20\x73\x74\x79\x6c\x65\x3d\x22\x6f\x70\
\x61\x63\x69\x74\x79\x3a\x31\x3b\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\
\x65\x3b\x66\x69\x6c\x6c\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x30\
\x2e\x39\x30\x35\x36\x36\x30\x34\x31\x3b\x73\x74\x72\x6f\x6b\x65\
\x3a\x23\x30\x30\x61\x61\x38\x38\x3b\x73\x74\x72\x6f\x6b\x65\x2d\
\x77\x69\x64\x74\x68\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\
\x69\x6e\x65\x63\x61\x70\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\x72\
\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\x3a\x34\
\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x64\x61\x73\x68\x61\x72\x72\x61\
\x79\x3a\x6e\x6f\x6e\x65\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x69\
\x64\x3d\x22\x72\x65\x63\x74\x34\x38\x36\x32\x22\x0a\x20\x20\x20\
\x20\x20\x20\x20\x77\x69\x64\x74\x68\x3d\x22\x31\x32\x36\x2e\x30\
\x33\x30\x35\x36\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x68\x65\x69\
\x67\x68\x74\x3d\x22\x31\x32\x37\x2e\x30\x37\x35\x22\x0a\x20\x20\
\x20\x20\x20\x20\x20\x78\x3d\x22\x30\x2e\x39\x38\x34\x37\x31\x38\
\x39\x32\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x79\x3d\x22\x39\x32\
\x34\x2e\x33\x30\x32\x34\x33\x22\x20\x2f\x3e\x0a\x20\x20\x20\x20\
\x3c\x70\x61\x74\x68\x0a\x20\x20\x20\x20\x20\x20\x20\x73\x74\x79\
\x6c\x65\x3d\x22\x66\x69\x6c\x6c\x3a\x6e\x6f\x6e\x65\x3b\x66\x69\
\x6c\x6c\x2d\x72\x75\x6c\x65\x3a\x65\x76\x65\x6e\x6f\x64\x64\x3b\
\x73\x74\x72\x6f\x6b\x65\x3a\x23\x30\x30\x61\x61\x38\x38\x3b\x73\
\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3a\x32\x2e\x39\x32\
\x37\x33\x31\x38\x39\x33\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\
\x6e\x65\x63\x61\x70\x3a\x72\x6f\x75\x6e\x64\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3a\x6d\x69\x74\x65\
\x72\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\
\x6d\x69\x74\x3a\x34\x3b\x73\x74\x72\x6f\x6b\x65\x2d\x64\x61\x73\
\x68\x61\x72\x72\x61\x79\x3a\x6e\x6f\x6e\x65\x3b\x73\x74\x72\x6f\
\x6b\x65\x2d\x6f\x70\x61\x63\x69\x74\x79\x3a\x31\x3b\x66\x69\x6c\
\x74\x65\x72\x3a\x75\x72\x6c\x28\x23\x66\x69\x6c\x74\x65\x72\x34\
\x38\x33\x38\x29\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x64\x3d\x22\
\x6d\x20\x34\x2e\x30\x32\x33\x31\x36\x35\x38\x2c\x31\x30\x30\x38\
\x2e\x30\x34\x35\x34\x20\x63\x20\x30\x2c\x30\x20\x32\x2e\x36\x34\
\x31\x32\x33\x39\x34\x2c\x2d\x35\x32\x2e\x37\x31\x32\x37\x32\x20\
\x37\x2e\x34\x34\x36\x33\x33\x36\x32\x2c\x2d\x35\x32\x2e\x37\x39\
\x30\x34\x37\x20\x34\x2e\x39\x37\x33\x37\x34\x35\x2c\x2d\x30\x2e\
\x30\x38\x30\x36\x20\x34\x2e\x30\x30\x30\x34\x38\x38\x2c\x36\x32\
\x2e\x39\x34\x37\x36\x37\x20\x39\x2e\x32\x38\x31\x36\x33\x35\x2c\
\x36\x32\x2e\x39\x35\x38\x34\x37\x20\x33\x2e\x39\x31\x32\x38\x37\
\x2c\x30\x2e\x30\x31\x20\x34\x2e\x33\x38\x39\x36\x38\x39\x2c\x2d\
\x34\x39\x2e\x38\x37\x35\x35\x38\x20\x38\x2e\x36\x31\x32\x35\x36\
\x39\x2c\x2d\x35\x30\x2e\x30\x30\x36\x39\x35\x20\x32\x2e\x39\x37\
\x33\x38\x34\x37\x2c\x2d\x30\x2e\x30\x39\x32\x34\x20\x34\x2e\x38\
\x33\x33\x30\x36\x36\x2c\x34\x30\x2e\x35\x33\x32\x32\x35\x20\x38\
\x2e\x38\x31\x31\x33\x37\x38\x2c\x34\x30\x2e\x34\x35\x39\x30\x35\
\x20\x32\x2e\x37\x39\x36\x30\x38\x39\x2c\x2d\x30\x2e\x30\x35\x31\
\x20\x35\x2e\x34\x39\x31\x35\x38\x38\x2c\x2d\x33\x32\x2e\x31\x38\
\x32\x31\x37\x20\x39\x2e\x36\x39\x32\x38\x38\x34\x2c\x2d\x33\x32\
\x2e\x32\x33\x32\x31\x34\x20\x33\x2e\x30\x31\x35\x36\x30\x37\x2c\
\x2d\x30\x2e\x30\x33\x35\x39\x20\x35\x2e\x32\x31\x38\x38\x38\x36\
\x2c\x32\x39\x2e\x31\x36\x32\x37\x34\x20\x39\x2e\x30\x34\x33\x37\
\x33\x38\x2c\x32\x39\x2e\x30\x37\x35\x31\x34\x20\x33\x2e\x32\x31\
\x31\x35\x39\x37\x2c\x2d\x30\x2e\x30\x37\x34\x20\x36\x2e\x36\x30\
\x33\x37\x34\x32\x2c\x2d\x32\x33\x2e\x39\x39\x30\x36\x39\x20\x39\
\x2e\x38\x31\x35\x30\x34\x36\x2c\x2d\x32\x33\x2e\x38\x38\x34\x39\
\x35\x20\x32\x2e\x37\x39\x31\x32\x2c\x30\x2e\x30\x39\x31\x39\x20\
\x34\x2e\x30\x39\x32\x35\x37\x38\x2c\x31\x39\x2e\x32\x31\x37\x37\
\x35\x20\x37\x2e\x35\x33\x32\x32\x35\x35\x2c\x31\x39\x2e\x32\x34\
\x32\x37\x35\x20\x32\x2e\x36\x33\x32\x30\x33\x35\x2c\x30\x2e\x30\
\x31\x39\x20\x35\x2e\x32\x35\x31\x33\x36\x37\x2c\x2d\x31\x35\x2e\
\x33\x30\x34\x39\x39\x20\x38\x2e\x35\x35\x31\x34\x38\x37\x2c\x2d\
\x31\x35\x2e\x33\x39\x32\x38\x31\x20\x32\x2e\x33\x38\x32\x35\x37\
\x37\x2c\x2d\x30\x2e\x30\x36\x33\x36\x20\x33\x2e\x32\x38\x37\x39\
\x36\x38\x2c\x31\x30\x2e\x36\x38\x37\x33\x38\x20\x35\x2e\x38\x30\
\x32\x37\x38\x39\x2c\x31\x30\x2e\x36\x32\x38\x33\x33\x20\x31\x2e\
\x37\x36\x31\x39\x38\x38\x2c\x2d\x30\x2e\x30\x34\x30\x39\x20\x33\
\x2e\x32\x38\x38\x36\x37\x2c\x2d\x36\x2e\x38\x31\x36\x39\x33\x20\
\x35\x2e\x39\x32\x34\x39\x36\x34\x2c\x2d\x36\x2e\x37\x31\x39\x31\
\x20\x31\x2e\x38\x35\x37\x36\x37\x38\x2c\x30\x2e\x30\x36\x39\x31\
\x20\x33\x2e\x30\x35\x38\x36\x30\x35\x2c\x32\x2e\x36\x35\x35\x20\
\x34\x2e\x38\x38\x36\x35\x36\x34\x2c\x32\x2e\x36\x38\x37\x37\x20\
\x32\x2e\x33\x38\x33\x37\x39\x39\x2c\x30\x2e\x30\x34\x33\x31\x20\
\x34\x2e\x37\x30\x32\x39\x35\x39\x2c\x2d\x30\x2e\x38\x38\x38\x33\
\x38\x20\x37\x2e\x30\x38\x35\x34\x39\x39\x2c\x2d\x30\x2e\x39\x37\
\x37\x33\x39\x20\x32\x2e\x36\x30\x39\x34\x34\x2c\x2d\x30\x2e\x30\
\x39\x37\x31\x20\x35\x2e\x32\x30\x38\x35\x32\x2c\x30\x2e\x34\x30\
\x37\x31\x38\x20\x37\x2e\x38\x31\x38\x35\x2c\x30\x2e\x34\x38\x38\
\x36\x34\x20\x32\x2e\x31\x31\x36\x34\x37\x2c\x30\x2e\x30\x36\x35\
\x38\x20\x36\x2e\x33\x35\x32\x35\x33\x2c\x30\x20\x36\x2e\x33\x35\
\x32\x35\x33\x2c\x30\x20\x6c\x20\x36\x2e\x39\x30\x32\x32\x39\x2c\
\x2d\x30\x2e\x30\x36\x31\x35\x22\x0a\x20\x20\x20\x20\x20\x20\x20\
\x69\x64\x3d\x22\x70\x61\x74\x68\x34\x31\x36\x36\x22\x0a\x20\x20\
\x20\x20\x20\x20\x20\x69\x6e\x6b\x73\x63\x61\x70\x65\x3a\x63\x6f\
\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\x75\x72\x76\x61\x74\x75\x72\
\x65\x3d\x22\x30\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x73\x6f\x64\
\x69\x70\x6f\x64\x69\x3a\x6e\x6f\x64\x65\x74\x79\x70\x65\x73\x3d\
\x22\x63\x73\x73\x73\x73\x73\x73\x73\x73\x73\x73\x73\x73\x61\x61\
\x63\x63\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x74\x72\x61\x6e\x73\
\x66\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\x69\x78\x28\x31\x2e\x30\
\x32\x33\x38\x31\x33\x31\x2c\x30\x2c\x30\x2c\x31\x2e\x30\x32\x35\
\x38\x34\x35\x2c\x2d\x33\x2e\x33\x30\x32\x30\x37\x34\x33\x2c\x2d\
\x32\x34\x2e\x33\x39\x36\x33\x34\x32\x29\x22\x20\x2f\x3e\x0a\x20\
\x20\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
"
qt_resource_name = b"\
\x00\x0c\
\x0d\x04\x47\x5e\
\x00\x50\
\x00\x72\x00\x6f\x00\x67\x00\x72\x00\x61\x00\x6d\x00\x20\x00\x69\x00\x63\x00\x6f\x00\x6e\
\x00\x05\
\x00\x4f\xa6\x53\
\x00\x49\
\x00\x63\x00\x6f\x00\x6e\x00\x73\
\x00\x0b\
\x0b\xa4\x87\x13\
\x00\x77\
\x00\x68\x00\x69\x00\x74\x00\x65\x00\x5f\x00\x69\x00\x63\x00\x6f\x00\x6e\x00\x73\
\x00\x09\
\x05\xc6\xb2\xc7\
\x00\x6d\
\x00\x69\x00\x6e\x00\x75\x00\x73\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x08\
\x0b\x07\x57\xa7\
\x00\x65\
\x00\x64\x00\x69\x00\x74\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x0b\
\x08\x33\x4d\xc7\
\x00\x73\
\x00\x71\x00\x75\x00\x61\x00\x72\x00\x65\x00\x73\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x0c\
\x0b\xe3\xae\x87\
\x00\x62\
\x00\x6c\x00\x61\x00\x63\x00\x6b\x00\x6f\x00\x75\x00\x74\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x09\
\x06\xb6\xb7\x47\
\x00\x70\
\x00\x66\x00\x5f\x00\x74\x00\x73\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x08\
\x08\x96\x57\xc7\
\x00\x62\
\x00\x61\x00\x72\x00\x73\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x14\
\x0b\x33\xdd\x87\
\x00\x61\
\x00\x75\x00\x74\x00\x6f\x00\x6d\x00\x61\x00\x74\x00\x69\x00\x63\x00\x5f\x00\x6c\x00\x61\x00\x79\x00\x6f\x00\x75\x00\x74\x00\x2e\
\x00\x73\x00\x76\x00\x67\
\x00\x19\
\x01\xc4\xfb\x47\
\x00\x73\
\x00\x74\x00\x6f\x00\x63\x00\x68\x00\x61\x00\x73\x00\x74\x00\x69\x00\x63\x00\x5f\x00\x70\x00\x6f\x00\x77\x00\x65\x00\x72\x00\x5f\
\x00\x66\x00\x6c\x00\x6f\x00\x77\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x1b\
\x08\x4f\xb2\xa7\
\x00\x63\
\x00\x6f\x00\x6e\x00\x74\x00\x69\x00\x6e\x00\x75\x00\x61\x00\x74\x00\x69\x00\x6f\x00\x6e\x00\x5f\x00\x70\x00\x6f\x00\x77\x00\x65\
\x00\x72\x00\x5f\x00\x66\x00\x6c\x00\x6f\x00\x77\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x0d\
\x07\x7e\x10\x87\
\x00\x67\
\x00\x72\x00\x69\x00\x64\x00\x5f\x00\x69\x00\x63\x00\x6f\x00\x6e\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x09\
\x07\xa6\xbc\x67\
\x00\x6c\
\x00\x6f\x00\x61\x00\x64\x00\x63\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x08\
\x05\x77\x54\xa7\
\x00\x6c\
\x00\x6f\x00\x61\x00\x64\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x08\
\x08\xc8\x55\xe7\
\x00\x73\
\x00\x61\x00\x76\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x09\
\x06\x69\x8f\x87\
\x00\x64\
\x00\x63\x00\x6f\x00\x70\x00\x66\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x0d\
\x03\x20\x2e\x27\
\x00\x64\
\x00\x65\x00\x74\x00\x65\x00\x63\x00\x74\x00\x5f\x00\x74\x00\x72\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x0b\
\x06\xf4\x91\x87\
\x00\x63\
\x00\x6f\x00\x6e\x00\x73\x00\x6f\x00\x6c\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x07\
\x04\xca\x5a\x27\
\x00\x6e\
\x00\x65\x00\x77\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x0f\
\x0f\x16\xae\xe7\
\x00\x72\
\x00\x75\x00\x6e\x00\x5f\x00\x63\x00\x61\x00\x73\x00\x63\x00\x61\x00\x64\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x0a\
\x0c\xad\x02\x87\
\x00\x64\
\x00\x65\x00\x6c\x00\x65\x00\x74\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x0a\
\x01\x0b\x43\x87\
\x00\x72\
\x00\x65\x00\x73\x00\x69\x00\x7a\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x0c\
\x0b\xe2\x97\x47\
\x00\x64\
\x00\x63\x00\x6f\x00\x70\x00\x66\x00\x5f\x00\x74\x00\x73\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x08\
\x0c\xa5\x54\x47\
\x00\x6e\
\x00\x65\x00\x77\x00\x32\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x09\
\x0a\x86\xb3\x47\
\x00\x6e\
\x00\x65\x00\x77\x00\x32\x00\x63\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x11\
\x01\x5c\x91\x87\
\x00\x73\
\x00\x68\x00\x6f\x00\x72\x00\x74\x00\x5f\x00\x63\x00\x69\x00\x72\x00\x63\x00\x75\x00\x69\x00\x74\x00\x2e\x00\x73\x00\x76\x00\x67\
\
\x00\x06\
\x07\x69\x5a\xc7\
\x00\x70\
\x00\x66\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x09\
\x0c\xb6\xa9\xc7\
\x00\x73\
\x00\x61\x00\x76\x00\x65\x00\x63\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x14\
\x0a\x9d\x60\xe7\
\x00\x6c\
\x00\x61\x00\x74\x00\x69\x00\x6e\x00\x5f\x00\x68\x00\x79\x00\x70\x00\x65\x00\x72\x00\x63\x00\x75\x00\x62\x00\x65\x00\x32\x00\x2e\
\x00\x73\x00\x76\x00\x67\
\x00\x0b\
\x05\x64\x4f\xa7\
\x00\x72\
\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x62\x00\x72\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x08\
\x03\xc6\x54\x27\
\x00\x70\
\x00\x6c\x00\x75\x00\x73\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x08\
\x0b\x85\x57\x67\
\x00\x67\
\x00\x65\x00\x61\x00\x72\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x08\
\x06\x7c\x57\x87\
\x00\x63\
\x00\x6f\x00\x70\x00\x79\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x14\
\x09\x20\x69\x07\
\x00\x72\
\x00\x75\x00\x6e\x00\x5f\x00\x63\x00\x61\x00\x73\x00\x63\x00\x61\x00\x64\x00\x65\x00\x5f\x00\x73\x00\x74\x00\x65\x00\x70\x00\x2e\
\x00\x73\x00\x76\x00\x67\
\x00\x07\
\x06\xf6\x5a\x27\
\x00\x70\
\x00\x69\x00\x63\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x08\
\x0f\x03\x57\xe7\
\x00\x63\
\x00\x68\x00\x69\x00\x70\x00\x2e\x00\x73\x00\x76\x00\x67\
\x00\x10\
\x0b\x22\xb2\xc7\
\x00\x47\
\x00\x72\x00\x69\x00\x64\x00\x43\x00\x61\x00\x6c\x00\x5f\x00\x69\x00\x63\x00\x6f\x00\x6e\x00\x2e\x00\x73\x00\x76\x00\x67\
"
qt_resource_struct_v1 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\
\x00\x00\x00\x1e\x00\x02\x00\x00\x00\x01\x00\x00\x00\x04\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\
\x00\x00\x04\x28\x00\x00\x00\x00\x00\x01\x00\x01\x21\xc7\
\x00\x00\x00\x2e\x00\x02\x00\x00\x00\x22\x00\x00\x00\x05\
\x00\x00\x02\x8c\x00\x00\x00\x00\x00\x01\x00\x00\x9c\x81\
\x00\x00\x02\xf2\x00\x00\x00\x00\x00\x01\x00\x00\xc0\x6c\
\x00\x00\x01\x0e\x00\x00\x00\x00\x00\x01\x00\x00\x33\x7a\
\x00\x00\x01\xfe\x00\x00\x00\x00\x00\x01\x00\x00\x6e\x46\
\x00\x00\x03\x8e\x00\x00\x00\x00\x00\x01\x00\x00\xe6\xcd\
\x00\x00\x02\x3a\x00\x00\x00\x00\x00\x01\x00\x00\x81\x72\
\x00\x00\x03\x72\x00\x00\x00\x00\x00\x01\x00\x00\xdd\x5b\
\x00\x00\x01\xba\x00\x00\x00\x00\x00\x01\x00\x00\x59\x17\
\x00\x00\x00\x4a\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\xe6\x00\x01\x00\x00\x00\x01\x00\x00\x68\x46\
\x00\x00\x03\xba\x00\x00\x00\x00\x00\x01\x00\x00\xfd\x10\
\x00\x00\x00\xb2\x00\x01\x00\x00\x00\x01\x00\x00\x1d\x2a\
\x00\x00\x02\x1e\x00\x00\x00\x00\x00\x01\x00\x00\x78\x8c\
\x00\x00\x03\xfe\x00\x00\x00\x00\x00\x01\x00\x01\x0d\x3d\
\x00\x00\x03\x1a\x00\x01\x00\x00\x00\x01\x00\x00\xc8\xfd\
\x00\x00\x01\x82\x00\x01\x00\x00\x00\x01\x00\x00\x4c\xdf\
\x00\x00\x01\xa2\x00\x00\x00\x00\x00\x01\x00\x00\x51\x98\
\x00\x00\x00\x78\x00\x00\x00\x00\x00\x01\x00\x00\x0f\xc7\
\x00\x00\x01\x46\x00\x00\x00\x00\x00\x01\x00\x00\x3f\x6c\
\x00\x00\x00\xca\x00\x00\x00\x00\x00\x01\x00\x00\x23\xeb\
\x00\x00\x01\xd0\x00\x00\x00\x00\x00\x01\x00\x00\x60\x9a\
\x00\x00\x03\xd0\x00\x00\x00\x00\x00\x01\x00\x01\x05\xfc\
\x00\x00\x02\xda\x00\x00\x00\x00\x00\x01\x00\x00\xb7\xf6\
\x00\x00\x03\x44\x00\x01\x00\x00\x00\x01\x00\x00\xd6\xab\
\x00\x00\x00\x62\x00\x00\x00\x00\x00\x01\x00\x00\x07\xa4\
\x00\x00\x00\xe0\x00\x01\x00\x00\x00\x01\x00\x00\x2c\x4c\
\x00\x00\x03\xa4\x00\x00\x00\x00\x00\x01\x00\x00\xef\xb2\
\x00\x00\x02\xa6\x00\x01\x00\x00\x00\x01\x00\x00\xa8\xb4\
\x00\x00\x00\x94\x00\x01\x00\x00\x00\x01\x00\x00\x17\x6e\
\x00\x00\x02\xc4\x00\x00\x00\x00\x00\x01\x00\x00\xaf\x7c\
\x00\x00\x02\x72\x00\x00\x00\x00\x00\x01\x00\x00\x94\x32\
\x00\x00\x03\x2c\x00\x00\x00\x00\x00\x01\x00\x00\xcf\x03\
\x00\x00\x04\x12\x00\x00\x00\x00\x00\x01\x00\x01\x16\xb7\
\x00\x00\x02\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x8a\x7a\
"
qt_resource_struct_v2 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x1e\x00\x02\x00\x00\x00\x01\x00\x00\x00\x04\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x04\x28\x00\x00\x00\x00\x00\x01\x00\x01\x21\xc7\
\x00\x00\x01\x60\xd1\xcb\x73\xda\
\x00\x00\x00\x2e\x00\x02\x00\x00\x00\x22\x00\x00\x00\x05\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x02\x8c\x00\x00\x00\x00\x00\x01\x00\x00\x9c\x81\
\x00\x00\x01\x60\x40\xab\x4b\x02\
\x00\x00\x02\xf2\x00\x00\x00\x00\x00\x01\x00\x00\xc0\x6c\
\x00\x00\x01\x60\x40\x55\x5e\xd3\
\x00\x00\x01\x0e\x00\x00\x00\x00\x00\x01\x00\x00\x33\x7a\
\x00\x00\x01\x60\x40\x55\x0a\x0b\
\x00\x00\x01\xfe\x00\x00\x00\x00\x00\x01\x00\x00\x6e\x46\
\x00\x00\x01\x60\xd1\xcb\x73\xda\
\x00\x00\x03\x8e\x00\x00\x00\x00\x00\x01\x00\x00\xe6\xcd\
\x00\x00\x01\x60\x40\xac\xca\x8d\
\x00\x00\x02\x3a\x00\x00\x00\x00\x00\x01\x00\x00\x81\x72\
\x00\x00\x01\x60\x40\xad\xfc\xc8\
\x00\x00\x03\x72\x00\x00\x00\x00\x00\x01\x00\x00\xdd\x5b\
\x00\x00\x01\x60\xd1\xcb\x73\xda\
\x00\x00\x01\xba\x00\x00\x00\x00\x00\x01\x00\x00\x59\x17\
\x00\x00\x01\x60\x40\xae\x23\xac\
\x00\x00\x00\x4a\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x60\x40\xad\x0f\xd9\
\x00\x00\x01\xe6\x00\x01\x00\x00\x00\x01\x00\x00\x68\x46\
\x00\x00\x01\x60\x40\xb4\xbb\x7a\
\x00\x00\x03\xba\x00\x00\x00\x00\x00\x01\x00\x00\xfd\x10\
\x00\x00\x01\x60\x40\xaf\x7d\x8f\
\x00\x00\x00\xb2\x00\x01\x00\x00\x00\x01\x00\x00\x1d\x2a\
\x00\x00\x01\x60\x40\xb3\xba\x7a\
\x00\x00\x02\x1e\x00\x00\x00\x00\x00\x01\x00\x00\x78\x8c\
\x00\x00\x01\x60\x40\xc7\x85\x44\
\x00\x00\x03\xfe\x00\x00\x00\x00\x00\x01\x00\x01\x0d\x3d\
\x00\x00\x01\x60\x40\xad\xb6\xa1\
\x00\x00\x03\x1a\x00\x01\x00\x00\x00\x01\x00\x00\xc8\xfd\
\x00\x00\x01\x60\x40\xb3\x00\x96\
\x00\x00\x01\x82\x00\x01\x00\x00\x00\x01\x00\x00\x4c\xdf\
\x00\x00\x01\x60\x40\xae\xc9\xcc\
\x00\x00\x01\xa2\x00\x00\x00\x00\x00\x01\x00\x00\x51\x98\
\x00\x00\x01\x60\x40\xec\x58\x47\
\x00\x00\x00\x78\x00\x00\x00\x00\x00\x01\x00\x00\x0f\xc7\
\x00\x00\x01\x60\x40\xaa\x11\x33\
\x00\x00\x01\x46\x00\x00\x00\x00\x00\x01\x00\x00\x3f\x6c\
\x00\x00\x01\x60\x40\x57\x6d\x02\
\x00\x00\x00\xca\x00\x00\x00\x00\x00\x01\x00\x00\x23\xeb\
\x00\x00\x01\x60\x40\xaf\xc6\xe7\
\x00\x00\x01\xd0\x00\x00\x00\x00\x00\x01\x00\x00\x60\x9a\
\x00\x00\x01\x60\x40\xaa\x46\x1f\
\x00\x00\x03\xd0\x00\x00\x00\x00\x00\x01\x00\x01\x05\xfc\
\x00\x00\x01\x60\x40\xaa\x8d\x37\
\x00\x00\x02\xda\x00\x00\x00\x00\x00\x01\x00\x00\xb7\xf6\
\x00\x00\x01\x60\x40\xec\xf5\x9e\
\x00\x00\x03\x44\x00\x01\x00\x00\x00\x01\x00\x00\xd6\xab\
\x00\x00\x01\x60\x40\x56\x56\xb3\
\x00\x00\x00\x62\x00\x00\x00\x00\x00\x01\x00\x00\x07\xa4\
\x00\x00\x01\x60\x40\xaf\x2e\xb3\
\x00\x00\x00\xe0\x00\x01\x00\x00\x00\x01\x00\x00\x2c\x4c\
\x00\x00\x01\x60\x40\xb0\x04\x8f\
\x00\x00\x03\xa4\x00\x00\x00\x00\x00\x01\x00\x00\xef\xb2\
\x00\x00\x01\x60\x40\xae\xed\x5c\
\x00\x00\x02\xa6\x00\x01\x00\x00\x00\x01\x00\x00\xa8\xb4\
\x00\x00\x01\x60\x40\xb4\xfd\xff\
\x00\x00\x00\x94\x00\x01\x00\x00\x00\x01\x00\x00\x17\x6e\
\x00\x00\x01\x60\x40\x6a\x53\x3f\
\x00\x00\x02\xc4\x00\x00\x00\x00\x00\x01\x00\x00\xaf\x7c\
\x00\x00\x01\x60\x40\xad\xd9\x48\
\x00\x00\x02\x72\x00\x00\x00\x00\x00\x01\x00\x00\x94\x32\
\x00\x00\x01\x60\x40\xaf\x5a\x87\
\x00\x00\x03\x2c\x00\x00\x00\x00\x00\x01\x00\x00\xcf\x03\
\x00\x00\x01\x60\x40\xec\x0b\x94\
\x00\x00\x04\x12\x00\x00\x00\x00\x00\x01\x00\x01\x16\xb7\
\x00\x00\x01\x60\x40\xaf\xa3\x07\
\x00\x00\x02\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x8a\x7a\
\x00\x00\x01\x60\x40\xaa\xf9\xeb\
"
qt_version = QtCore.qVersion().split('.')
if qt_version < ['5', '8', '0']:
rcc_version = 1
qt_resource_struct = qt_resource_struct_v1
else:
rcc_version = 2
qt_resource_struct = qt_resource_struct_v2
def qInitResources():
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()
|
SanPen/GridCal
|
src/api_rest/Gui/Main/icons_rc.py
|
Python
|
lgpl-3.0
| 331,926
|
"""This module contains my common ultilities functions
1 create win32 mouse cursor event
2 config for progressbar, logging
3 Class: MyTimer
"""
__author__ = 'Weichao Xu'
__version__ = "0.0.1"
__status__ = "Dev"
# ########## imports ##########
import sys, os, re, string, time, logging
import math, numpy, random
import win32api, win32con, win32gui
import progressbar as pb
from ftplib import FTP
import pprint
import psutil
import subprocess
mypbwidgets = ['GLobal: ', pb.Percentage(), pb.Bar(marker=pb.RotatingMarker()), ' ', pb.ETA()]
loggingfmt = '%(name)-10s|%(asctime)s|%(levelname)8s| %(message)s'
logging.basicConfig(level=logging.NOTSET, stream=sys.stdout, \
format=loggingfmt,
datefmt='%m%d-%M%M%S')
l = logging.getLogger(__name__)
# # WIN32API Mouse Click
def click(x, y):
""" click(x, y): click at (x,y) """
xx, yy = win32api.GetCursorPos()
win32api.SetCursorPos((x, y))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y, 0, 0)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y, 0, 0)
l.info("(%4d, %4d) --> (%4d, %4d) clicked" % (xx, yy, x, y))
def get_cursor_xy():
xx, yy = win32api.GetCursorPos()
l.info("(%5d, %4d)" % (xx, yy))
return xx, yy
def clickandreturn(x, y):
""" clickandreturn(x, y)
move the mouse, click and return to previous position"""
xx, yy = win32api.GetCursorPos()
win32api.SetCursorPos((x, y))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y, 0, 0)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y, 0, 0)
win32api.SetCursorPos((xx, yy))
# ########## file operation ##########
def get_num_line_in_file(thefilepath):
"""Count number of lines in a file by number of \n"""
count, thefile = 0, open(thefilepath, 'rb')
while 1:
mybuffer = thefile.read(512 * 1024)
if not mybuffer: break
count += mybuffer.count('\n')
thefile.close()
return count
def download_files_ftp(IPaddr='131.101.199.181', username="vsa",
password="service", remotedir='./userdir',
DeleteAfterTransfer=False):
""" Download all files in a FTP directory
"""
myftp = FTP(IPaddr) # connect to host, default port
myftp.login(user=username, passwd=password) # user anonymous, passwd anonymous@
myftp.cwd(remotedir) # Change to
print "Remote work dir: ", myftp.pwd()
TransferFileDir = r"FTP_Transfer" # dir name
if not os.path.exists(TransferFileDir):
os.makedirs(TransferFileDir)
print TransferFileDir, " created"
namelist = myftp.nlst()
print namelist
for idx, fname in enumerate(namelist):
fnlocal = r'%s\z%s_' % (TransferFileDir, time.strftime("%m%d%H%M%S")) + fname # add timestamp
print idx, "Local file location:", os.path.join(os.getcwdu(), fnlocal)
try:
myftp.retrbinary("RETR " + fname, open(fnlocal, 'wb').write)
except Exception, e:
print "ERROR %s" % e
if DeleteAfterTransfer: myftp.delete(fname)
print idx + 1, "files transferred to\n%s" % (os.path.dirname(os.path.abspath(fnlocal)))
myftp.close()
# ########## file generation ##########
def generate_random_int_array(numrow=100, numcol=100, minval=0, maxval=2 ** 32 - 1):
fnout = 'randintarr%dx%d.txt' % (numrow, numcol)
fhout = open(fnout, 'w')
for ct in xrange(numrow):
d = [str(random.randint(minval, maxval)) for _ in xrange(numcol)]
fhout.write(' '.join(d))
fhout.write('\n')
fhout.close()
def existDir(dirpath):
"""Check whether a directory exists. Create a new if not"""
if not os.path.exists(dirpath):
os.makedirs(dirpath)
return False
else:
return True
# ########## importinfo ##########
def importinfo():
print [key for key in locals().keys() if isinstance(locals()[key], type(sys)) and not key.startswith('__')]
print sys.modules.keys()
# ########## Process Management ##########
def repeatexecute(consolecmd,waittimesec=60):
l.debug(consolecmd)
while True:
tloop0=time.time()
try:
subprocess.Popen(consolecmd)
except:
pass
texe=time.time()-tloop0
timetowait=max(waittimesec-texe,0)
pbar=pb.ProgressBar(widgets=mypbwidgets,maxval=int(math.floor(timetowait)))
pbar.start()
for ct in xrange(int(math.floor(timetowait))):
pbar.update(ct)
time.sleep(1)
pbar.finish()
class MyTimer:
'My time to get '
def __init__(self):
self.time0 = time.time()
self.timelast, self.timenow = self.time0, self.time0
def updatenow(self):
self.timelast = self.timenow
self.timenow = time.time()
return self.timenow
def updatelast(self):
return self.timelast
def getlast(self):
return self.timelast
def getnow(self):
return self.timenow
def diff_last_now(self):
return self.timenow - self.timelast
def diff_now(self):
return self.timenow - self.time0
def get_all(self):
return self.time0, self.timelast, self.timenow
def __del__(self):
return self.time0, self.timelast, self.timenow
def __repr__(self, t=None):
if t is None:
return time.localtime(self.time0)
else:
return time.localtime(t)
def __str__(self):
return time.strftime("%m%d-%H%M%S", self.timenow)
def main():
repeatexecute(r"C:\Program Files (x86)\Mozilla Firefox\firefox.exe",3)
if __name__ == "__main__":
main()
else:
print "%10s: %s" % ("CWD", os.getcwdu())
print "%10s: %s" % ("Imported", __file__)
print "\n"
|
WDavidX/pyutil
|
wxu.py
|
Python
|
lgpl-3.0
| 5,763
|
#!/usr/bin/env python3
# Copyright (c) 2016 The crimson Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import crimsonTestFramework
from test_framework.util import *
import re
import time
from test_framework.blocktools import create_block, create_coinbase
'''
Test version bits' warning system.
Generate chains with block versions that appear to be signalling unknown
soft-forks, and test that warning alerts are generated.
'''
VB_PERIOD = 144 # versionbits period length for regtest
VB_THRESHOLD = 108 # versionbits activation threshold for regtest
VB_TOP_BITS = 0x20000000
VB_UNKNOWN_BIT = 27 # Choose a bit unassigned to any deployment
WARN_UNKNOWN_RULES_MINED = "Unknown block versions being mined! It's possible unknown rules are in effect"
WARN_UNKNOWN_RULES_ACTIVE = "unknown new rules activated (versionbit {})".format(VB_UNKNOWN_BIT)
VB_PATTERN = re.compile("^Warning.*versionbit")
# TestNode: bare-bones "peer". Used mostly as a conduit for a test to sending
# p2p messages to a node, generating the messages in the main testing logic.
class TestNode(NodeConnCB):
def __init__(self):
NodeConnCB.__init__(self)
self.connection = None
self.ping_counter = 1
self.last_pong = msg_pong()
def add_connection(self, conn):
self.connection = conn
def on_inv(self, conn, message):
pass
# Wrapper for the NodeConn's send_message function
def send_message(self, message):
self.connection.send_message(message)
def on_pong(self, conn, message):
self.last_pong = message
# Sync up with the node after delivery of a block
def sync_with_ping(self, timeout=30):
self.connection.send_message(msg_ping(nonce=self.ping_counter))
received_pong = False
sleep_time = 0.05
while not received_pong and timeout > 0:
time.sleep(sleep_time)
timeout -= sleep_time
with mininode_lock:
if self.last_pong.nonce == self.ping_counter:
received_pong = True
self.ping_counter += 1
return received_pong
class VersionBitsWarningTest(crimsonTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.num_nodes = 1
def setup_network(self):
self.alert_filename = os.path.join(self.options.tmpdir, "alert.txt")
# Open and close to create zero-length file
with open(self.alert_filename, 'w', encoding='utf8') as _:
pass
self.extra_args = [["-debug", "-logtimemicros=1", "-alertnotify=echo %s >> \"" + self.alert_filename + "\""]]
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, self.extra_args)
# Send numblocks blocks via peer with nVersionToUse set.
def send_blocks_with_version(self, peer, numblocks, nVersionToUse):
tip = self.nodes[0].getbestblockhash()
height = self.nodes[0].getblockcount()
block_time = self.nodes[0].getblockheader(tip)["time"]+1
tip = int(tip, 16)
for _ in range(numblocks):
block = create_block(tip, create_coinbase(height+1), block_time)
block.nVersion = nVersionToUse
block.solve()
peer.send_message(msg_block(block))
block_time += 1
height += 1
tip = block.sha256
peer.sync_with_ping()
def test_versionbits_in_alert_file(self):
with open(self.alert_filename, 'r', encoding='utf8') as f:
alert_text = f.read()
assert(VB_PATTERN.match(alert_text))
def run_test(self):
# Setup the p2p connection and start up the network thread.
test_node = TestNode()
connections = []
connections.append(NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], test_node))
test_node.add_connection(connections[0])
NetworkThread().start() # Start up network handling in another thread
# Test logic begins here
test_node.wait_for_verack()
# 1. Have the node mine one period worth of blocks
self.nodes[0].generate(VB_PERIOD)
# 2. Now build one period of blocks on the tip, with < VB_THRESHOLD
# blocks signaling some unknown bit.
nVersion = VB_TOP_BITS | (1<<VB_UNKNOWN_BIT)
self.send_blocks_with_version(test_node, VB_THRESHOLD-1, nVersion)
# Fill rest of period with regular version blocks
self.nodes[0].generate(VB_PERIOD - VB_THRESHOLD + 1)
# Check that we're not getting any versionbit-related errors in
# get*info()
assert(not VB_PATTERN.match(self.nodes[0].getinfo()["errors"]))
assert(not VB_PATTERN.match(self.nodes[0].getmininginfo()["errors"]))
assert(not VB_PATTERN.match(self.nodes[0].getnetworkinfo()["warnings"]))
# 3. Now build one period of blocks with >= VB_THRESHOLD blocks signaling
# some unknown bit
self.send_blocks_with_version(test_node, VB_THRESHOLD, nVersion)
self.nodes[0].generate(VB_PERIOD - VB_THRESHOLD)
# Might not get a versionbits-related alert yet, as we should
# have gotten a different alert due to more than 51/100 blocks
# being of unexpected version.
# Check that get*info() shows some kind of error.
assert(WARN_UNKNOWN_RULES_MINED in self.nodes[0].getinfo()["errors"])
assert(WARN_UNKNOWN_RULES_MINED in self.nodes[0].getmininginfo()["errors"])
assert(WARN_UNKNOWN_RULES_MINED in self.nodes[0].getnetworkinfo()["warnings"])
# Mine a period worth of expected blocks so the generic block-version warning
# is cleared, and restart the node. This should move the versionbit state
# to ACTIVE.
self.nodes[0].generate(VB_PERIOD)
stop_nodes(self.nodes)
# Empty out the alert file
with open(self.alert_filename, 'w', encoding='utf8') as _:
pass
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, self.extra_args)
# Connecting one block should be enough to generate an error.
self.nodes[0].generate(1)
assert(WARN_UNKNOWN_RULES_ACTIVE in self.nodes[0].getinfo()["errors"])
assert(WARN_UNKNOWN_RULES_ACTIVE in self.nodes[0].getmininginfo()["errors"])
assert(WARN_UNKNOWN_RULES_ACTIVE in self.nodes[0].getnetworkinfo()["warnings"])
stop_nodes(self.nodes)
self.test_versionbits_in_alert_file()
# Test framework expects the node to still be running...
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, self.extra_args)
if __name__ == '__main__':
VersionBitsWarningTest().main()
|
CrimsonDev14/crimsoncoin
|
qa/rpc-tests/p2p-versionbits-warning.py
|
Python
|
lgpl-3.0
| 6,836
|
from mpi4py import MPI
import numpy
import unittest
from floatpy.parallel import t3dmod
import floatpy.utilities.reduction as red
class TestReduction(unittest.TestCase):
def setUp(self):
self.nx, self.ny, self.nz = 64, 32, 16
self.omega_x, self.omega_y, self.omega_z = 1., 2., 3.
self.comm = MPI.COMM_WORLD
self.fcomm = self.comm.py2f()
self.periodic = numpy.array([True, True, True])
self.dx, self.dy, self.dz = 2.*numpy.pi / self.nx, 2.*numpy.pi / self.ny, 2.*numpy.pi / self.nz
self.grid_partition = t3dmod.t3d(self.fcomm, self.nx, self.ny, self.nz, self.periodic )
self.chunk_3d_size = numpy.zeros(3, dtype=numpy.int32, order='F')
self.chunk_3d_lo = numpy.zeros(3, dtype=numpy.int32, order='F')
self.chunk_3d_hi = numpy.zeros(3, dtype=numpy.int32, order='F')
self.grid_partition.get_sz3d(self.chunk_3d_size)
self.grid_partition.get_st3d(self.chunk_3d_lo)
self.grid_partition.get_en3d(self.chunk_3d_hi)
self.chunk_3d_lo = self.chunk_3d_lo - 1 # Convert to 0 based indexing
self.chunk_3d_hi = self.chunk_3d_hi - 1 # Convert to 0 based indexing
self.x = numpy.linspace(0., 2.*numpy.pi, num=self.nx+1)[self.chunk_3d_lo[0]:self.chunk_3d_hi[0]+1]
self.y = numpy.linspace(0., 2.*numpy.pi, num=self.ny+1)[self.chunk_3d_lo[1]:self.chunk_3d_hi[1]+1]
self.z = numpy.linspace(0., 2.*numpy.pi, num=self.nz+1)[self.chunk_3d_lo[2]:self.chunk_3d_hi[2]+1]
self.x, self.y, self.z = numpy.meshgrid(self.x, self.y, self.z, indexing='ij')
self.x = numpy.asfortranarray(self.x)
self.y = numpy.asfortranarray(self.y)
self.z = numpy.asfortranarray(self.z)
self.f = numpy.sin(self.omega_x*self.x) * numpy.cos(self.omega_y*self.y) * numpy.cos(self.omega_z*self.z)
self.avg_x = red.Reduction(self.grid_partition, ( True, False, False))
self.avg_y = red.Reduction(self.grid_partition, (False, True, False))
self.avg_z = red.Reduction(self.grid_partition, (False, False, True))
self.avg_xy = red.Reduction(self.grid_partition, ( True, True, False))
self.avg_yz = red.Reduction(self.grid_partition, (False, True, True))
self.avg_xz = red.Reduction(self.grid_partition, ( True, False, True))
self.avg_xyz = red.Reduction(self.grid_partition, ( True, True, True))
def testAverageX(self):
"""
Test the averaging in the X direction.
"""
avg = self.avg_x.average(self.f)
myerror = numpy.array([ numpy.absolute(avg).max() ])
error = numpy.array([ myerror[0] ])
self.comm.Allreduce(myerror, error, op=MPI.MAX)
# print "avg_x error = %g" %error[0]
self.assertLess(error[0], 5.0e-14, "Incorrect average in X!")
avg[:,:,:] = self.f[8:9,:,:]
avg_full = self.avg_x.allgather(avg)
error = avg_full[0:1, self.chunk_3d_lo[1]:self.chunk_3d_hi[1]+1, self.chunk_3d_lo[2]:self.chunk_3d_hi[2]+1] \
- avg
error = numpy.absolute(error).max()
print "allgather X error: ", error
self.assertLess(error, 5.0e-14, "Incorrect allgather in X!")
def testAverageY(self):
"""
Test the averaging in the Y direction.
"""
avg = self.avg_y.average(self.f)
myerror = numpy.array([ numpy.absolute(avg).max() ])
error = numpy.array([ myerror[0] ])
self.comm.Allreduce(myerror, error, op=MPI.MAX)
# print "avg_y error = %g" %error[0]
self.assertLess(error[0], 5.0e-14, "Incorrect average in Y!")
avg[:,:,:] = self.f[:,0:1,:]
avg_full = self.avg_y.allgather(avg)
error = avg_full[self.chunk_3d_lo[0]:self.chunk_3d_hi[0]+1, 0:1, self.chunk_3d_lo[2]:self.chunk_3d_hi[2]+1] \
- avg
error = numpy.absolute(error).max()
print "allgather Y error: ", error
self.assertLess(error, 5.0e-14, "Incorrect allgather in Y!")
def testAverageZ(self):
"""
Test the averaging in the Z direction.
"""
avg = self.avg_z.average(self.f)
myerror = numpy.array([ numpy.absolute(avg).max() ])
error = numpy.array([ myerror[0] ])
self.comm.Allreduce(myerror, error, op=MPI.MAX)
print "avg_z error = %g" %error[0]
self.assertLess(error[0], 5.0e-14, "Incorrect average in Z!")
avg[:,:,:] = self.f[:,:,0:1]
avg_full = self.avg_z.allgather(avg)
error = avg_full[self.chunk_3d_lo[0]:self.chunk_3d_hi[0]+1, self.chunk_3d_lo[1]:self.chunk_3d_hi[1]+1, 0:1] \
- avg
error = numpy.absolute(error).max()
print "allgather Z error: ", error
self.assertLess(error, 5.0e-14, "Incorrect allgather in Z!")
def testAverageXY(self):
"""
Test the averaging in the X-Y directions.
"""
avg = self.avg_xy.average(self.f)
myerror = numpy.array([ numpy.absolute(avg).max() ])
error = numpy.array([ myerror[0] ])
self.comm.Allreduce(myerror, error, op=MPI.MAX)
# print "avg_xy error = %g" %error[0]
self.assertLess(error[0], 5.0e-14, "Incorrect average in X-Y!")
def testAverageYZ(self):
"""
Test the averaging in the Y-Z directions.
"""
avg = self.avg_yz.average(self.f)
myerror = numpy.array([ numpy.absolute(avg).max() ])
error = numpy.array([ myerror[0] ])
self.comm.Allreduce(myerror, error, op=MPI.MAX)
# print "avg_yz error = %g" %error[0]
self.assertLess(error[0], 5.0e-14, "Incorrect average in Y-Z!")
def testAverageXZ(self):
"""
Test the averaging in the X-Z directions.
"""
avg = self.avg_xz.average(self.f)
myerror = numpy.array([ numpy.absolute(avg).max() ])
error = numpy.array([ myerror[0] ])
self.comm.Allreduce(myerror, error, op=MPI.MAX)
# print "avg_xz error = %g" %error[0]
self.assertLess(error[0], 5.0e-14, "Incorrect average in X-Z!")
def testAverageXYZ(self):
"""
Test the averaging in the X-Y-Z directions.
"""
avg = self.avg_xyz.average(self.f)
myerror = numpy.array([ numpy.absolute(avg).max() ])
error = numpy.array([ myerror[0] ])
self.comm.Allreduce(myerror, error, op=MPI.MAX)
# print "avg_xyz error = %g" %error[0]
self.assertLess(error[0], 5.0e-14, "Incorrect average in X-Y-Z!")
if __name__ == '__main__':
unittest.main()
|
FPAL-Stanford-University/FloATPy
|
floatpy/tests/mpitest_reduction.py
|
Python
|
lgpl-3.0
| 6,586
|
from . import BackupHandler
from ..result import CommandExecutionResult
from ..exceptions import ReadWriteException
from ..entity.definition import CommandOutputDefinition
class CommandOutputBackup(BackupHandler):
def _get_definition(self) -> CommandOutputDefinition:
return self._definition
def _validate(self):
pass
def _read(self) -> CommandExecutionResult:
return self._execute_command(
self._pipe_factory.create_backup_command(
self._get_definition().get_command(),
self._get_definition()
)
)
def _write(self, stream) -> CommandExecutionResult:
definition = self._get_definition()
if not definition.get_restore_command():
raise ReadWriteException('Restore command not defined, cannot restore')
return self._execute_command(
self._pipe_factory.create_restore_command(definition.get_restore_command(), definition),
stdin=stream
)
|
Wolnosciowiec/file-repository
|
client/bahub/bahubapp/handler/commandoutputbackup.py
|
Python
|
lgpl-3.0
| 1,014
|
"""
This file defines:
-quad_area_centroid (method)
- CHEXA8 (class)
- f1
- f2
"""
from __future__ import print_function
from six.moves import zip, range
from numpy import arange, cross, abs, searchsorted, array, ones, eye
from numpy.linalg import norm
from pyNastran.bdf.field_writer_8 import print_card_8
from pyNastran.bdf.bdf_interface.assign_type import integer
from pyNastran.bdf.dev_vectorized.cards.elements.solid.solid_element import SolidElement
def quad_area_centroid(n1, n2, n3, n4):
"""
Gets the area, :math:`A`, and centroid of a quad.::
1-----2
| / |
| / |
4-----3
"""
a = n1 - n2
b = n2 - n4
area1 = 0.5 * norm(cross(a, b), axis=1)
c1 = (n1 + n2 + n4) / 3.
a = n2 - n4
b = n2 - n3
area2 = 0.5 * norm(cross(a, b), axis=1)
#area2.reshape(
c2 = (n2 + n3 + n4) / 3.
area = area1 + area2
try:
#centroid = (c1 * area1 + c2 * area2) / area
centroid = ((c1.T * area1 + c2.T * area2) / area).T
except FloatingPointError:
msg = '\nc1=%r\narea1=%r\n' % (c1, area1)
msg += 'c2=%r\narea2=%r' % (c2, area2)
raise FloatingPointError(msg)
except ValueError:
msg = 'c1 = %s\n' % str(c1.shape)
msg += 'c2 = %s\n' % str(c2.shape)
msg += 'area1 = %s\n' % str(area1.shape)
msg += 'area2 = %s\n' % str(area2.shape)
msg += 'area = %s' % str(area.shape)
print(msg)
#dot(c1.T, area1)
raise
n = len(n1)
assert area.shape == (n, ), area.shape
assert centroid.shape == (n, 3), centroid.shape
return(area, centroid)
class CHEXA8(SolidElement):
type = 'CHEXA8'
nnodes = 8
def __init__(self, model):
"""
Defines the CHEXA object.
Parameters
----------
model : BDF
the BDF object
"""
SolidElement.__init__(self, model)
def add_card(self, card, comment=''):
#self.model.log.debug('chexa8-add')
i = self.i
#comment = self._comments[i]
eid = integer(card, 1, 'element_id')
if comment:
self.set_comment(eid, comment)
#: Element ID
self.element_id[i] = eid
#: Property ID
self.property_id[i] = integer(card, 2, 'property_id')
#: Node IDs
nids = array([
integer(card, 3, 'node_id_1'),
integer(card, 4, 'node_id_2'),
integer(card, 5, 'node_id_3'),
integer(card, 6, 'node_id_4'),
integer(card, 7, 'node_id_5'),
integer(card, 8, 'node_id_6'),
integer(card, 9, 'node_id_7'),
integer(card, 10, 'node_id_8')
], dtype='int32')
assert 0 not in nids, '%s\n%s' % (nids, card)
self.node_ids[i, :] = nids
assert len(card) == 11, 'len(CHEXA8 card) = %i\ncard=%s' % (len(card), card)
self.i += 1
def update(self, maps):
"""
maps = {
'node_id' : nid_map,
'property' : pid_map,
}
"""
if self.n:
eid_map = maps['element']
nid_map = maps['node']
pid_map = maps['property']
for i, (eid, pid, nids) in enumerate(zip(self.element_id, self.property_id, self.node_ids)):
print(self.print_card(i))
self.element_id[i] = eid_map[eid]
self.property_id[i] = pid_map[pid]
self.node_ids[i, 0] = nid_map[nids[0]]
self.node_ids[i, 1] = nid_map[nids[1]]
self.node_ids[i, 2] = nid_map[nids[2]]
self.node_ids[i, 3] = nid_map[nids[3]]
self.node_ids[i, 4] = nid_map[nids[4]]
self.node_ids[i, 5] = nid_map[nids[5]]
self.node_ids[i, 6] = nid_map[nids[6]]
self.node_ids[i, 7] = nid_map[nids[7]]
def get_mass_matrix(self, i, model, positions, index0s, is_lumped=True):
nnodes = 8
ndof = 3 * nnodes
pid = self.property_id[i]
rho = self.model.elements.properties_solid.psolid.get_density_by_property_id(pid)[0]
n0, n1, n2, n3, n4, n5, n6, n7 = self.node_ids[i, :]
V = volume8(positions[self.node_ids[i, 0]],
positions[self.node_ids[i, 1]],
positions[self.node_ids[i, 2]],
positions[self.node_ids[i, 3]],
positions[self.node_ids[i, 4]],
positions[self.node_ids[i, 5]],
positions[self.node_ids[i, 6]],
positions[self.node_ids[i, 7]],
)
mass = rho * V
if is_lumped:
mi = mass / 4.
nnodes = 4
M = eye(ndof, dtype='float32')
else:
mi = mass / 20.
M = ones((ndof, ndof), dtype='float32')
for i in range(nnodes):
j = i * 3
M[j:j+3, j:j+3] = 2.
M *= mi
dofs, nijv = self.get_dofs_nijv(index0s, n0, n1, n2, n3, n4, n5, n6, n7)
return M, dofs, nijv
def get_stiffness_matrix(self, i, model, positions, index0s):
return K, dofs, nijv
def get_dofs_nijv(self, index0s, n0, n1, n2, n3, n4, n5, n6, n7):
pid = self.property_id[i]
prop = self.model.elements.properties_solid.psolid
rho = prop.get_density_by_property_id(pid)[0]
n0, n1, n2, n3 = self.node_ids[i, :]
xyz1 = positions[self.node_ids[i, 0]]
xyz2 = positions[self.node_ids[i, 1]]
xyz3 = positions[self.node_ids[i, 2]]
xyz4 = positions[self.node_ids[i, 3]]
vol = volume4(xyz1, xyz2, xyz3, xyz4)
#stiffness = rho * vol
#ki = stiffness / 4.
nnodes = 8
ndof = nnodes * 3
K = np.zeros((ndof, ndof), dtype='float32')
mid1 = prop.material_id[0]
mat = self.model.materials.get_solid_material(mid1)
print(mat)
E = mat.E[0]
nu = mat.nu[0]
G = mat.G[0]
i0 = index0s[n0]
i1 = index0s[n1]
i2 = index0s[n2]
i3 = index0s[n3]
i4 = index0s[n4]
i5 = index0s[n5]
i6 = index0s[n6]
i7 = index0s[n7]
dofs = array([
i0, i0+1, i0+2,
i1, i1+1, i1+2,
i2, i2+1, i2+2,
i3, i3+1, i3+2,
i4, i4+1, i4+2,
i5, i5+1, i5+2,
i6, i6+1, i6+2,
i7, i7+1, i7+2,
], 'int32')
nijv = [
# translation
(n0, 1), (n0, 2), (n0, 3),
(n1, 1), (n1, 2), (n1, 3),
(n2, 1), (n2, 2), (n2, 3),
(n3, 1), (n3, 2), (n3, 3),
(n4, 1), (n4, 2), (n4, 3),
(n5, 1), (n5, 2), (n5, 3),
(n6, 1), (n6, 2), (n6, 3),
(n7, 1), (n7, 2), (n7, 3),
]
uvw = np.array([
[-1, -1, 1,],
[1, -1, -1,],
[1, 1, -1],
[-1, 1, -1],
[-1, -1,1,],
[1, -1, 1,],
[1, 1, 1],
[-1, 1, 1],
])
#n1 = 0.125 * (1 - u) * (1 - v) * (1 - w)
#n2 = 0.125 * (1 + u) * (1 - v) * (1 - w)
#n3 = 0.125 * (1 + u) * (1 + v) * (1 - w)
#n4 = 0.125 * (1 - u) * (1 + v) * (1 - w)
#n5 = 0.125 * (1 - u) * (1 - v) * (1 + w)
#n6 = 0.125 * (1 + u) * (1 - v) * (1 + w)
#n7 = 0.125 * (1 + u) * (1 + v) * (1 + w)
#n8 = 0.125 * (1 - u) * (1 + v) * (1 + w)
n1u = 0.125 * (1 - v) * (1 - w) * -1
n2u = 0.125 * (1 - v) * (1 - w) * 1
n3u = 0.125 * (1 + v) * (1 - w) * 1
n4u = 0.125 * (1 + v) * (1 - w) * -1
n5u = 0.125 * (1 - v) * (1 + w) * -1
n6u = 0.125 * (1 - v) * (1 + w) * 1
n7u = 0.125 * (1 + v) * (1 + w) * 1
n8u = 0.125 * (1 + v) * (1 + w) * -1
n1v = 0.125 * (1 - u) * (1 - v) * -1
n2v = 0.125 * (1 + u) * (1 - v) * -1
n3v = 0.125 * (1 + u) * (1 + v) * 1
n4v = 0.125 * (1 - u) * (1 + v) * 1
n5v = 0.125 * (1 - u) * (1 - v) * -1
n6v = 0.125 * (1 + u) * (1 - v) * -1
n7v = 0.125 * (1 + u) * (1 + v) * 1
n8v = 0.125 * (1 - u) * (1 + v) * 1
n1w = 0.125 * (1 - u) * (1 - v) * -1
n2w = 0.125 * (1 + u) * (1 - v) * -1
n3w = 0.125 * (1 + u) * (1 + v) * -1
n4w = 0.125 * (1 - u) * (1 + v) * -1
n5w = 0.125 * (1 - u) * (1 - v) * 1
n6w = 0.125 * (1 + u) * (1 - v) * 1
n7w = 0.125 * (1 + u) * (1 + v) * 1
n8w = 0.125 * (1 - u) * (1 + v) * 1
Dcoeff = E / ((1. + nu) * (1. - 2. *nu))
D = Dcoeff * np.array([
[(1. - nu), nu, nu, 0, 0, 0],
[nu, (1. - nu), nu, 0, 0, 0],
[nu, nu, (1. - nu), 0, 0, 0],
[0, 0, 0, ((1 - 2 * nu)/2.), 0, 0],
[0, 0, 0, 0, ((1 - 2 * nu)/2.), 0],
[0, 0, 0, 0, 0, ((1 - 2 * nu)/2.)],
], dtype='float32')
integration = 'complete'
if integration == 'complete':
locations = np.array([
[-0.577350269189626, -0.577350269189626, -0.577350269189626],
[0.577350269189626, -0.577350269189626, -0.577350269189626],
[0.577350269189626, 0.577350269189626, -0.577350269189626],
[-0.577350269189626, 0.577350269189626, -0.577350269189626],
[-0.577350269189626, -0.577350269189626, 0.577350269189626],
[0.577350269189626, -0.577350269189626, 0.577350269189626],
[0.577350269189626, 0.577350269189626, 0.577350269189626],
[-0.577350269189626, 0.577350269189626, 0.577350269189626],
], dtype='float32')
weights = np.array([1, 1, 1, 1, 1, 1, 1, 1], dtype='float32')
jacobian_matrix = natural_derivatives * global_coord
inv_jacobian = np.linalg.inv(jacobian_matrix)
xy_derivatives = inv_jacobian * natural_derivatives
B = array([
#[a1, 0., 0., a2, 0., 0., a3, 0., 0., a4, 0., 0.],
#[0., b1, 0., 0., b2, 0., 0., b3, 0., 0., b4, 0.],
#[0., 0., c1, 0., 0., c2, 0., 0., c3, 0., 0., c4],
#[b1, a1, 0., b2, a2, 0., b3, a3, 0., b4, a4, 0.],
#[0., c1, b1, 0., c2, b2, 0., c3, b3, 0., c4, b4],
#[c1, 0., a1, c2, 0., a2, c3, 0., a3, c4, 0., a4],
]) / (6 * vol)
elif integration == 'reduced':
locations = np.array([0, 0], dtype='float32')
weights = np.array([4])
return dofs, nijv
def _verify(self, xref=True):
eid = self.eid
pid = self.Pid()
nids = self.node_ids
assert isinstance(eid, int)
assert isinstance(pid, int)
for i, nid in enumerate(nids):
assert isinstance(nid, int), 'nid%i is not an integer; nid=%s' %(i, nid)
if xref:
c = self.centroid()
v = self.volume()
assert isinstance(v, float)
for i in range(3):
assert isinstance(c[i], float)
def get_node_indicies(self, i=None):
if i is None:
i1 = self.model.grid.get_node_index_by_node_id(self.node_ids[:, 0])
i2 = self.model.grid.get_node_index_by_node_id(self.node_ids[:, 1])
i3 = self.model.grid.get_node_index_by_node_id(self.node_ids[:, 2])
i4 = self.model.grid.get_node_index_by_node_id(self.node_ids[:, 3])
i5 = self.model.grid.get_node_index_by_node_id(self.node_ids[:, 4])
i6 = self.model.grid.get_node_index_by_node_id(self.node_ids[:, 5])
i7 = self.model.grid.get_node_index_by_node_id(self.node_ids[:, 6])
i8 = self.model.grid.get_node_index_by_node_id(self.node_ids[:, 7])
else:
i1 = self.model.grid.get_node_index_by_node_id(self.node_ids[i, 0])
i2 = self.model.grid.get_node_index_by_node_id(self.node_ids[i, 1])
i3 = self.model.grid.get_node_index_by_node_id(self.node_ids[i, 2])
i4 = self.model.grid.get_node_index_by_node_id(self.node_ids[i, 3])
i5 = self.model.grid.get_node_index_by_node_id(self.node_ids[i, 4])
i6 = self.model.grid.get_node_index_by_node_id(self.node_ids[i, 5])
i7 = self.model.grid.get_node_index_by_node_id(self.node_ids[i, 6])
i8 = self.model.grid.get_node_index_by_node_id(self.node_ids[i, 7])
return i1, i2, i3, i4, i5, i6, i7, i8
def _get_node_locations_by_index(self, i, xyz_cid0):
"""
Parameters
----------
i : (nnodes, ) int ndarray; None -> all
node IDs
xyz_cid0 : (nnodes, 3) float ndarray; default=None -> calculate
the GRIDs in CORD2R=0
"""
grid = self.model.grid
get_node_index_by_node_id = self.model.grid.get_node_index_by_node_id
node_ids = self.node_ids
msg = ', which is required by %s' % self.type
i1, i2, i3, i4, i5, i6, i7, i8 = self.get_node_indicies(i)
n1 = xyz_cid0[i1, :]
n2 = xyz_cid0[i2, :]
n3 = xyz_cid0[i3, :]
n4 = xyz_cid0[i4, :]
n5 = xyz_cid0[i5, :]
n6 = xyz_cid0[i6, :]
n7 = xyz_cid0[i7, :]
n8 = xyz_cid0[i8, :]
return n1, n2, n3, n4, n5, n6, n7, n8
def get_volume_by_element_id(self, element_id=None, xyz_cid0=None, total=False):
"""
Gets the volume for one or more elements.
Parameters
----------
element_id : (nelements, ) int ndarray; default=None
the elements to consider
xyz_cid0 : (nnodes, 3) float ndarray; default=None -> calculate
the GRIDs in CORD2R=0
total : bool; default=False
should the volume be summed
.. note:: Volume for a CHEXA is the average area of two opposing faces
times the length between the centroids of those points
"""
n1, n2, n3, n4, n5, n6, n7, n8 = self._get_node_locations_by_element_id(element_id, xyz_cid0)
volume = volume8(n1, n2, n3, n4, n5, n6, n7, n8)
if total:
volume = abs(volume).sum()
else:
volume = abs(volume)
return volume
def get_mass_by_element_id(self, element_id=None, xyz_cid0=None, total=False):
"""
Gets the mass for one or more CTETRA elements.
Parameters
----------
element_id : (nelements, ) int ndarray; default=None
the elements to consider
xyz_cid0 : (nnodes, 3) float ndarray; default=None -> calculate
the GRIDs in CORD2R=0
total : bool; default=False
should the centroid be summed
"""
if element_id is None:
element_id = self.element_id
if xyz_cid0 is None:
xyz_cid0 = self.model.grid.get_position_by_node_index()
n = len(element_id)
V = self.get_volume_by_element_id(element_id, xyz_cid0)
mid = self.model.properties_solid.get_material_id_by_property_id(self.property_id)
assert mid.shape == (n,), 'mid.shape=%s; n=%s' % (str(mid.shape), n)
rho = self.model.materials.get_density_by_material_id(mid)
assert V.shape == (n,), 'V.shape=%s; n=%s' % (str(V.shape), n)
assert rho.shape == (n,), 'rho.shape=%s; n=%s' % (str(rho.shape), n)
mass = V * rho
if total:
mass = mass.sum()
return mass
def get_centroid_volume_by_element_id(self, element_id=None, xyz_cid0=None, total=False):
"""
Gets the centroid and volume for one or more elements.
Parameters
----------
element_id : (nelements, ) int ndarray; default=None
the elements to consider
xyz_cid0 : (nnodes, 3) float ndarray; default=None -> calculate
the GRIDs in CORD2R=0
total : bool; default=False
should the volume be summed; centroid be averaged
..see:: CHEXA8.get_volume_by_element_id() and CHEXA8.get_centroid_by_element_id() for more information.
"""
n1, n2, n3, n4, n5, n6, n7, n8 = self._get_node_locations_by_element_id(element_id, xyz_cid0)
(A1, c1) = quad_area_centroid(n1, n2, n3, n4)
(A2, c2) = quad_area_centroid(n5, n6, n7, n8)
centroid = (c1 * A1 + c2 * A2) / (A1 + A2)
volume = (A1 + A2) / 2. * norm(c1 - c2, axis=1)
if total:
centroid = centroid.mean()
volume = abs(volume).sum()
else:
volume = abs(volume)
assert volume.min() > 0.0, 'volume.min() = %f' % volume.min()
return centroid, volume
def get_centroid_by_element_id(self, element_id=None, xyz_cid0=None, total=False):
"""
Gets the centroid for one or more elements.
Parameters
----------
element_id : (nelements, ) int ndarray; default=None
the elements to consider
xyz_cid0 : (nnodes, 3) float ndarray; default=None -> calculate
the GRIDs in CORD2R=0
total : bool; default=False
should the centroid be averaged
"""
n1, n2, n3, n4, n5, n6, n7, n8 = self._get_node_locations_by_element_id(element_id, xyz_cid0)
(A1, c1) = quad_area_centroid(n1, n2, n3, n4)
(A2, c2) = quad_area_centroid(n5, n6, n7, n8)
centroid = (c1 * A1 + c2 * A2) / (A1 + A2)
if total:
centroid = centroid.mean(axis=0)
return centroid
def get_face_nodes(self, nid, nid_opposite):
raise NotImplementedError()
#nids = self.node_ids[:8]
#indx = nids.index(nid_opposite)
#nids.pop(indx)
#return nids
def write_card(self, bdf_file, size=8, element_id=None):
if self.n:
if element_id is None:
i = arange(self.n)
else:
i = searchsorted(self.element_id, element_id)
for (eid, pid, n) in zip(self.element_id[i], self.property_id[i], self.node_ids[i]):
if eid in self._comments:
bdf_file.write(self._comments[eid])
card = ['CHEXA', eid, pid, n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7]]
bdf_file.write(print_card_8(card))
def volume8(n1, n2, n3, n4, n5, n6, n7, n8):
(A1, c1) = quad_area_centroid(n1, n2, n3, n4)
(A2, c2) = quad_area_centroid(n5, n6, n7, n8)
volume = (A1 + A2) / 2. * norm(c1 - c2, axis=1)
return volume
|
saullocastro/pyNastran
|
pyNastran/bdf/dev_vectorized/cards/elements/solid/chexa8.py
|
Python
|
lgpl-3.0
| 18,501
|
"""
Copyright (c) 2015-2019 Nitrokey UG
This file is part of libnitrokey.
libnitrokey is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
libnitrokey is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with libnitrokey. If not, see <http://www.gnu.org/licenses/>.
SPDX-License-Identifier: LGPL-3.0
"""
import pytest
import os, sys
from misc import ffi, gs
device_type = None
from logging import getLogger, basicConfig, DEBUG
basicConfig(format='* %(relativeCreated)6d %(filename)s:%(lineno)d %(message)s',level=DEBUG)
log = getLogger('conftest')
print = log.debug
def get_device_type():
return device_type
def skip_if_device_version_lower_than(allowed_devices):
global device_type
model, version = device_type
infinite_version_number = 999
if allowed_devices.get(model, infinite_version_number) > version:
pytest.skip('This device model is not applicable to run this test')
class AtrrCallProx(object):
def __init__(self, C, name):
self.C = C
self.name = name
def __call__(self, *args, **kwargs):
print('Calling {}{}'.format(self.name, args))
res = self.C(*args, **kwargs)
res_s = res
try:
res_s = '{} => '.format(res) + '{}'.format(gs(res))
except Exception as e:
pass
print('Result of {}: {}'.format(self.name, res_s))
return res
class AttrProxy(object):
def __init__(self, C, name):
self.C = C
self.name = name
def __getattr__(self, attr):
return AtrrCallProx(getattr(self.C, attr), attr)
@pytest.fixture(scope="module")
def C_offline(request=None):
print("Getting library without initializing connection")
return get_library(request, allow_offline=True)
@pytest.fixture(scope="session")
def C(request=None):
import platform
print(f"Python version: {platform.python_version()}")
print(f"OS: {platform.system()} {platform.release()} {platform.version()}")
print("Getting library with connection initialized")
return get_library(request)
def get_library(request, allow_offline=False):
library_read_declarations()
C = library_open_lib()
C.NK_set_debug_level(int(os.environ.get('LIBNK_DEBUG', 2)))
nk_login = C.NK_login_auto()
if nk_login != 1:
print('No devices detected!')
if not allow_offline:
assert nk_login != 0 # returns 0 if not connected or wrong model or 1 when connected
global device_type
firmware_version = C.NK_get_minor_firmware_version()
model = C.NK_get_device_model()
model = 'P' if model == 1 else 'S' if model == 2 else 'U'
device_type = (model, firmware_version)
print('Connected library: {}'.format(gs(C.NK_get_library_version())))
print('Connected device: {} {}'.format(model, firmware_version))
# assert C.NK_first_authenticate(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK
# assert C.NK_user_authenticate(DefaultPasswords.USER, DefaultPasswords.USER_TEMP) == DeviceErrorCode.STATUS_OK
# C.NK_status()
def fin():
print('\nFinishing connection to device')
C.NK_logout()
print('Finished')
if request:
request.addfinalizer(fin)
# C.NK_set_debug(True)
C.NK_set_debug_level(int(os.environ.get('LIBNK_DEBUG', 3)))
return AttrProxy(C, "libnitrokey C")
def library_open_lib():
C = None
path_build = os.path.join("..", "build")
paths = [
os.environ.get('LIBNK_PATH', None),
os.path.join(path_build, "libnitrokey.so"),
os.path.join(path_build, "libnitrokey.dylib"),
os.path.join(path_build, "libnitrokey.dll"),
os.path.join(path_build, "nitrokey.dll"),
]
for p in paths:
if not p: continue
print("Trying " + p)
p = os.path.abspath(p)
if os.path.exists(p):
print("Found: " + p)
C = ffi.dlopen(p)
break
else:
print("File does not exist: " + p)
if not C:
print("No library file found")
sys.exit(1)
return C
def library_read_declarations():
fp = '../NK_C_API.h'
declarations = []
with open(fp, 'r') as f:
declarations = f.readlines()
cnt = 0
a = iter(declarations)
for declaration in a:
if declaration.strip().startswith('NK_C_API') \
or declaration.strip().startswith('struct'):
declaration = declaration.replace('NK_C_API', '').strip()
while ');' not in declaration and '};' not in declaration:
declaration += (next(a)).strip() + '\n'
ffi.cdef(declaration, override=True)
cnt += 1
print('Imported {} declarations'.format(cnt))
def pytest_addoption(parser):
parser.addoption(
"--runslow", action="store_true", default=False, help="run slow tests"
)
parser.addoption("--run-skipped", action="store_true",
help="run the tests skipped by default, e.g. adding side effects")
def pytest_runtest_setup(item):
if 'skip_by_default' in item.keywords and not item.config.getoption("--run-skipped"):
pytest.skip("need --run-skipped option to run this test")
def pytest_configure(config):
config.addinivalue_line("markers", "slow: mark test as slow to run")
def library_device_reconnect(C):
C.NK_logout()
C = library_open_lib()
C.NK_logout()
assert C.NK_login_auto() == 1, 'Device not found'
return C
|
Nitrokey/libnitrokey
|
unittest/conftest.py
|
Python
|
lgpl-3.0
| 5,914
|
# Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from rbnics.shape_parametrization.problems.affine_shape_parametrization import AffineShapeParametrization
from rbnics.shape_parametrization.problems.affine_shape_parametrization_decorated_problem import (
AffineShapeParametrizationDecoratedProblem)
from rbnics.shape_parametrization.problems.affine_shape_parametrization_decorated_reduced_problem import (
AffineShapeParametrizationDecoratedReducedProblem)
from rbnics.shape_parametrization.problems.shape_parametrization import ShapeParametrization
from rbnics.shape_parametrization.problems.shape_parametrization_decorated_problem import (
ShapeParametrizationDecoratedProblem)
from rbnics.shape_parametrization.problems.shape_parametrization_decorated_reduced_problem import (
ShapeParametrizationDecoratedReducedProblem)
__all__ = [
"AffineShapeParametrization",
"AffineShapeParametrizationDecoratedProblem",
"AffineShapeParametrizationDecoratedReducedProblem",
"ShapeParametrization",
"ShapeParametrizationDecoratedProblem",
"ShapeParametrizationDecoratedReducedProblem"
]
|
mathLab/RBniCS
|
rbnics/shape_parametrization/problems/__init__.py
|
Python
|
lgpl-3.0
| 1,198
|
#!/usr/bin/python
#-*- coding: utf-8 -*-
"""
.. currentmodule:: pylayers.measures.mesuwb
RAW_DATA Class
==============
.. autosummary::
:toctree: generated/
RAW_DATA.__init__
CAL_DATA Class
==============
.. autosummary::
:toctree: generated/
CAL_DATA.__init__
CAL_DATA.plot
CAL_DATA.getwave
Fdd Class
=========
.. autosummary::
:toctree: generated/
Fdd.__init__
Fdd.plot
Tdd Class
=========
.. autosummary::
:toctree: generated/
Tdd.__init__
Tdd.PL
Tdd.show
Tdd.show_span
Tdd.box
Tdd.plot
TFP Class
=========
.. autosummary::
:toctree: generated/
TFP.__init__
TFP.append
FP Class
========
.. autosummary::
:toctree: generated/
FP.__init__
UWBMeasure
==========
.. autosummary::
:toctree: generated/
UWBMeasure.__init__
UWBMeasure.info
UWBMeasure.show
UWBMeasure.Epercent
UWBMeasure.toa_max2
UWBMeasure.tau_Emax
UWBMeasure.tau_moy
UWBMeasure.tau_rms
UWBMeasure.toa_new
UWBMeasure.toa_win
UWBMeasure.toa_max
UWBMeasure.toa_th
UWBMeasure.toa_cum
UWBMeasure.taumax
UWBMeasure.Emax
UWBMeasure.Etot
UWBMeasure.Efirst
UWBMeasure.Etau0
UWBMeasure.ecdf
UWBMeasure.tdelay
UWBMeasure.fp
UWBMeasure.outlatex
Utility Functions
=================
.. autosummary::
:toctree:
mesname
ptw1
visibility
trait
"""
import pdb
import doctest
import os.path
import numpy as np
import scipy as sp
import matplotlib.pylab as plt
import pylayers.util.pyutil as pyu
import pylayers.util.geomutil as geu
import pylayers.signal.bsignal as bs
import pylayers.antprop.channel as ch
from pylayers.util.project import *
from scipy import io
from scipy import signal, linspace, polyval, polyfit, stats
#from pylayers.Simul import SimulEM
#
# Utility functions
#
def mesname(n, dirname, h=1):
""" get the measurement data filename
Parameters
----------
n
Tx point number
dirname
PATH to measurements directory
h
height index 1|2
Notes
-----
This function handle filename from WHERE1 M1 measurement campaign
"""
if (h == 1):
mesdir = os.path.join(dirname,'h1')
if n > 279:
prefix = 'SIRADEL_08-08-01_P'
else:
prefix = 'SIRADEL_08-07-31_P'
else:
mesdir = os.path.join(dirname,'h2')
prefix = 'SIRADEL_08-08-02_P'
stn = str(n)
if (len(stn) == 1):
stn = '00' + stn
if (len(stn) == 2):
stn = '0' + stn
filename = os.path.join(mesdir, prefix + stn + '.mat')
return(filename)
def ptw1():
""" return W1 Tx and Rx points
"""
p0 = np.array([298626.5107, 2354073.213])
Rx = np.zeros((5, 2))
Rx[1, :] = np.array([298614.2383, 2354080.9762])
Rx[2, :] = np.array([298607.736, 2354088.391])
Rx[3, :] = np.array([298622.3689, 2354082.0733])
Rx[4, :] = np.array([298617.4193, 2354088.4029])
Rx[1, :] = Rx[1, :] - p0
Rx[2, :] = Rx[2, :] - p0
Rx[3, :] = Rx[3, :] - p0
Rx[4, :] = Rx[4, :] - p0
height = 1.2 * np.ones((5, 1))
Rx = np.hstack((Rx, height))
Tx = np.zeros((377, 2))
Tx[1, :] = np.array([298599.1538, 2354087.9963]) - p0
Tx[2, :] = np.array([298599.1662, 2354086.9940]) - p0
Tx[3, :] = np.array([298599.1544, 2354085.9948]) - p0
Tx[4, :] = np.array([298599.1397, 2354085.4917]) - p0
Tx[5, :] = np.array([298599.6551, 2354085.4952]) - p0
Tx[6, :] = np.array([298599.6567, 2354085.9977]) - p0
Tx[7, :] = np.array([298600.1580, 2354086.0006]) - p0
Tx[8, :] = np.array([298600.1656, 2354085.4991]) - p0
Tx[9, :] = np.array([298600.6429, 2354085.5026]) - p0
Tx[10, :] = np.array([298601.1453, 2354085.5170]) - p0
Tx[11, :] = np.array([298601.6437, 2354085.5227]) - p0
Tx[12, :] = np.array([298602.1446, 2354085.5180]) - p0
Tx[13, :] = np.array([298602.6474, 2354085.5145]) - p0
Tx[14, :] = np.array([298602.6432, 2354085.0153]) - p0
Tx[15, :] = np.array([298602.1375, 2354085.0208]) - p0
Tx[16, :] = np.array([298601.6324, 2354085.0098]) - p0
Tx[17, :] = np.array([298601.1347, 2354084.9793]) - p0
Tx[18, :] = np.array([298601.1560, 2354084.4782]) - p0
Tx[19, :] = np.array([298601.6638, 2354084.5002]) - p0
Tx[20, :] = np.array([298602.1413, 2354084.5114]) - p0
Tx[21, :] = np.array([298602.6510, 2354084.5142]) - p0
Tx[22, :] = np.array([298602.6596, 2354084.0093]) - p0
Tx[23, :] = np.array([298602.1531, 2354083.9971]) - p0
Tx[24, :] = np.array([298601.6619, 2354083.9895]) - p0
Tx[25, :] = np.array([298601.1702, 2354083.9752]) - p0
Tx[26, :] = np.array([298601.1892, 2354083.4697]) - p0
Tx[27, :] = np.array([298601.6879, 2354083.4708]) - p0
Tx[28, :] = np.array([298602.1734, 2354083.4953]) - p0
Tx[29, :] = np.array([298602.1796, 2354083.0027]) - p0
Tx[30, :] = np.array([298601.6950, 2354082.9746]) - p0
Tx[31, :] = np.array([298601.1908, 2354082.9642]) - p0
Tx[32, :] = np.array([298601.6730, 2354082.4642]) - p0
Tx[33, :] = np.array([298602.1897, 2354082.5089]) - p0
Tx[34, :] = np.array([298602.6956, 2354082.5094]) - p0
Tx[35, :] = np.array([298602.6820, 2354083.0076]) - p0
Tx[36, :] = np.array([298602.6668, 2354083.5180]) - p0
Tx[37, :] = np.array([298603.1766, 2354083.5187]) - p0
Tx[38, :] = np.array([298603.1619, 2354084.0124]) - p0
Tx[39, :] = np.array([298603.1435, 2354084.5246]) - p0
Tx[40, :] = np.array([298603.6412, 2354084.5477]) - p0
Tx[41, :] = np.array([298603.6539, 2354084.0204]) - p0
Tx[42, :] = np.array([298603.6735, 2354083.5422]) - p0
Tx[43, :] = np.array([298604.1769, 2354083.5510]) - p0
Tx[44, :] = np.array([298604.1560, 2354084.0272]) - p0
Tx[45, :] = np.array([298604.1398, 2354084.5635]) - p0
Tx[46, :] = np.array([298604.6394, 2354084.5710]) - p0
Tx[47, :] = np.array([298604.6531, 2354084.0357]) - p0
Tx[48, :] = np.array([298604.6723, 2354083.5647]) - p0
Tx[49, :] = np.array([298605.1724, 2354083.5727]) - p0
Tx[50, :] = np.array([298605.1552, 2354084.0452]) - p0
Tx[51, :] = np.array([298605.1411, 2354084.5744]) - p0
Tx[52, :] = np.array([298605.6407, 2354084.5896]) - p0
Tx[53, :] = np.array([298605.6564, 2354084.0518]) - p0
Tx[54, :] = np.array([298605.6725, 2354083.5854]) - p0
Tx[55, :] = np.array([298606.1697, 2354083.5946]) - p0
Tx[56, :] = np.array([298606.1504, 2354084.0704]) - p0
Tx[57, :] = np.array([298606.1394, 2354084.5736]) - p0
Tx[58, :] = np.array([298606.6116, 2354084.5855]) - p0
Tx[59, :] = np.array([298606.6557, 2354084.0949]) - p0
Tx[60, :] = np.array([298606.6505, 2354083.6042]) - p0
Tx[61, :] = np.array([298607.1728, 2354083.6169]) - p0
Tx[62, :] = np.array([298607.1490, 2354084.1052]) - p0
Tx[63, :] = np.array([298607.1420, 2354084.5882]) - p0
Tx[64, :] = np.array([298607.6405, 2354084.6156]) - p0
Tx[65, :] = np.array([298607.6537, 2354084.1195]) - p0
Tx[66, :] = np.array([298607.6718, 2354083.6162]) - p0
Tx[67, :] = np.array([298608.1705, 2354083.6262]) - p0
Tx[68, :] = np.array([298608.1498, 2354084.1300]) - p0
Tx[69, :] = np.array([298608.1434, 2354084.6169]) - p0
Tx[70, :] = np.array([298608.6389, 2354084.6207]) - p0
Tx[71, :] = np.array([298608.6529, 2354084.1442]) - p0
Tx[72, :] = np.array([298608.6908, 2354083.6284]) - p0
Tx[73, :] = np.array([298609.1579, 2354083.6149]) - p0
Tx[74, :] = np.array([298609.1469, 2354084.1487]) - p0
Tx[75, :] = np.array([298609.1397, 2354084.6209]) - p0
Tx[76, :] = np.array([298609.6398, 2354084.6236]) - p0
Tx[77, :] = np.array([298609.6552, 2354084.1487]) - p0
Tx[78, :] = np.array([298609.6819, 2354083.6253]) - p0
Tx[79, :] = np.array([298610.1816, 2354083.6293]) - p0
Tx[80, :] = np.array([298610.1512, 2354084.1489]) - p0
Tx[81, :] = np.array([298610.1396, 2354084.6229]) - p0
Tx[82, :] = np.array([298610.1414, 2354085.1562]) - p0
Tx[83, :] = np.array([298609.6353, 2354085.1503]) - p0
Tx[84, :] = np.array([298609.1376, 2354085.1306]) - p0
Tx[85, :] = np.array([298608.6384, 2354085.1249]) - p0
Tx[86, :] = np.array([298608.1365, 2354085.1167]) - p0
Tx[87, :] = np.array([298607.6320, 2354085.1233]) - p0
Tx[88, :] = np.array([298607.1375, 2354085.1285]) - p0
Tx[89, :] = np.array([298606.6346, 2354085.1308]) - p0
Tx[90, :] = np.array([298606.1340, 2354085.1187]) - p0
Tx[91, :] = np.array([298605.6357, 2354085.1098]) - p0
Tx[92, :] = np.array([298605.1339, 2354085.1129]) - p0
Tx[93, :] = np.array([298605.1224, 2354085.6164]) - p0
Tx[94, :] = np.array([298604.6349, 2354085.0960]) - p0
Tx[95, :] = np.array([298604.6356, 2354085.6111]) - p0
Tx[96, :] = np.array([298604.1292, 2354085.5975]) - p0
Tx[97, :] = np.array([298604.1243, 2354086.1044]) - p0
Tx[98, :] = np.array([298604.6182, 2354086.1130]) - p0
Tx[99, :] = np.array([298604.6076, 2354086.6167]) - p0
Tx[100, :] = np.array([298604.1310, 2354086.6027]) - p0
Tx[101, :] = np.array([298604.1401, 2354087.0989]) - p0
Tx[102, :] = np.array([298604.5986, 2354087.1199]) - p0
Tx[103, :] = np.array([298611.6833, 2354085.6072]) - p0
Tx[104, :] = np.array([298611.1745, 2354085.6015]) - p0
Tx[105, :] = np.array([298611.1425, 2354086.0848]) - p0
Tx[106, :] = np.array([298611.6452, 2354086.1118]) - p0
Tx[107, :] = np.array([298611.6090, 2354086.6144]) - p0
Tx[108, :] = np.array([298611.1054, 2354086.6012]) - p0
Tx[109, :] = np.array([298611.1042, 2354087.1082]) - p0
Tx[110, :] = np.array([298611.6032, 2354087.1149]) - p0
Tx[111, :] = np.array([298612.1175, 2354087.1200]) - p0
Tx[112, :] = np.array([298612.1255, 2354087.6165]) - p0
Tx[113, :] = np.array([298611.6215, 2354087.6255]) - p0
Tx[114, :] = np.array([298611.1133, 2354087.6264]) - p0
Tx[115, :] = np.array([298612.1141, 2354088.1246]) - p0
Tx[116, :] = np.array([298611.6216, 2354088.1302]) - p0
Tx[117, :] = np.array([298611.1070, 2354088.1211]) - p0
Tx[118, :] = np.array([298610.6204, 2354088.1582]) - p0
Tx[119, :] = np.array([298610.6092, 2354088.6707]) - p0
Tx[120, :] = np.array([298611.1083, 2354088.6447]) - p0
Tx[121, :] = np.array([298611.6160, 2354088.6395]) - p0
Tx[122, :] = np.array([298610.6813, 2354083.6292]) - p0
Tx[123, :] = np.array([298610.6475, 2354084.1563]) - p0
Tx[124, :] = np.array([298610.6448, 2354084.6357]) - p0
Tx[125, :] = np.array([298611.1846, 2354084.6620]) - p0
Tx[126, :] = np.array([298611.1994, 2354084.1390]) - p0
Tx[127, :] = np.array([298611.1823, 2354083.6428]) - p0
Tx[128, :] = np.array([298611.6880, 2354083.6406]) - p0
Tx[129, :] = np.array([298611.6515, 2354084.1711]) - p0
Tx[130, :] = np.array([298611.6407, 2354084.6489]) - p0
Tx[131, :] = np.array([298612.1390, 2354084.6449]) - p0
Tx[132, :] = np.array([298612.1540, 2354084.1705]) - p0
Tx[133, :] = np.array([298612.6359, 2354084.6577]) - p0
Tx[134, :] = np.array([298612.6395, 2354084.1697]) - p0
Tx[135, :] = np.array([298612.6370, 2354083.6538]) - p0
Tx[136, :] = np.array([298613.1405, 2354083.6868]) - p0
Tx[137, :] = np.array([298613.1406, 2354084.1560]) - p0
Tx[138, :] = np.array([298613.1327, 2354084.6577]) - p0
Tx[139, :] = np.array([298613.1366, 2354085.1673]) - p0
Tx[140, :] = np.array([298613.1184, 2354085.6717]) - p0
Tx[141, :] = np.array([298613.1142, 2354086.1763]) - p0
Tx[142, :] = np.array([298613.6457, 2354085.6697]) - p0
Tx[143, :] = np.array([298613.6441, 2354085.1596]) - p0
Tx[144, :] = np.array([298613.6326, 2354084.6580]) - p0
Tx[145, :] = np.array([298613.6404, 2354084.1482]) - p0
Tx[146, :] = np.array([298613.6499, 2354083.6886]) - p0
Tx[147, :] = np.array([298613.1379, 2354083.1766]) - p0
Tx[148, :] = np.array([298613.1497, 2354082.6790]) - p0
Tx[149, :] = np.array([298613.1492, 2354082.1705]) - p0
Tx[150, :] = np.array([298613.6630, 2354082.1454]) - p0
Tx[151, :] = np.array([298614.1583, 2354081.6012]) - p0
Tx[152, :] = np.array([298613.6540, 2354081.6356]) - p0
Tx[153, :] = np.array([298613.1439, 2354081.6623]) - p0
Tx[154, :] = np.array([298613.1530, 2354081.1617]) - p0
Tx[155, :] = np.array([298613.6526, 2354081.1463]) - p0
Tx[156, :] = np.array([298613.1480, 2354080.6561]) - p0
Tx[157, :] = np.array([298613.1395, 2354080.1452]) - p0
Tx[158, :] = np.array([298613.1540, 2354079.6386]) - p0
Tx[159, :] = np.array([298613.1505, 2354079.1286]) - p0
Tx[160, :] = np.array([298613.1415, 2354078.6210]) - p0
Tx[161, :] = np.array([298613.6557, 2354078.6218]) - p0
Tx[162, :] = np.array([298614.1436, 2354083.6585]) - p0
Tx[163, :] = np.array([298614.1426, 2354084.1502]) - p0
Tx[164, :] = np.array([298614.1348, 2354084.6603]) - p0
Tx[165, :] = np.array([298614.1271, 2354085.1728]) - p0
Tx[166, :] = np.array([298614.6380, 2354085.1642]) - p0
Tx[167, :] = np.array([298614.6388, 2354084.6585]) - p0
Tx[168, :] = np.array([298614.6445, 2354084.1448]) - p0
Tx[169, :] = np.array([298614.6489, 2354083.6400]) - p0
Tx[170, :] = np.array([298615.1552, 2354083.6422]) - p0
Tx[171, :] = np.array([298615.1377, 2354084.1475]) - p0
Tx[172, :] = np.array([298615.1324, 2354084.6569]) - p0
Tx[173, :] = np.array([298615.1282, 2354085.1647]) - p0
Tx[174, :] = np.array([298615.6277, 2354085.1596]) - p0
Tx[175, :] = np.array([298615.6353, 2354084.6545]) - p0
Tx[176, :] = np.array([298615.6411, 2354084.1476]) - p0
Tx[177, :] = np.array([298615.6535, 2354083.6039]) - p0
Tx[178, :] = np.array([298616.1607, 2354083.6049]) - p0
Tx[179, :] = np.array([298616.1477, 2354084.1506]) - p0
Tx[180, :] = np.array([298616.1348, 2354084.6555]) - p0
Tx[181, :] = np.array([298616.1199, 2354085.1620]) - p0
Tx[182, :] = np.array([298615.6512, 2354085.6585]) - p0
Tx[183, :] = np.array([298615.6378, 2354086.1646]) - p0
Tx[184, :] = np.array([298616.1548, 2354085.6584]) - p0
Tx[185, :] = np.array([298616.6587, 2354085.6560]) - p0
Tx[186, :] = np.array([298617.1646, 2354085.6780]) - p0
Tx[187, :] = np.array([298617.1634, 2354086.1882]) - p0
Tx[188, :] = np.array([298616.6570, 2354086.1598]) - p0
Tx[189, :] = np.array([298616.1520, 2354086.1711]) - p0
Tx[190, :] = np.array([298616.1759, 2354086.6578]) - p0
Tx[191, :] = np.array([298616.6791, 2354086.6612]) - p0
Tx[192, :] = np.array([298616.6891, 2354087.1669]) - p0
Tx[193, :] = np.array([298616.1839, 2354087.1899]) - p0
Tx[194, :] = np.array([298616.1933, 2354087.7160]) - p0
Tx[195, :] = np.array([298616.6962, 2354087.6792]) - p0
Tx[196, :] = np.array([298616.7053, 2354088.1869]) - p0
Tx[197, :] = np.array([298616.1990, 2354088.2208]) - p0
Tx[198, :] = np.array([298616.6932, 2354088.6978]) - p0
Tx[199, :] = np.array([298616.5761, 2354085.1480]) - p0
Tx[200, :] = np.array([298616.5881, 2354084.6199]) - p0
Tx[201, :] = np.array([298616.6404, 2354084.1429]) - p0
Tx[202, :] = np.array([298616.6655, 2354083.6028]) - p0
Tx[203, :] = np.array([298617.1700, 2354083.5984]) - p0
Tx[204, :] = np.array([298617.1451, 2354084.1559]) - p0
Tx[205, :] = np.array([298617.1360, 2354084.6628]) - p0
Tx[206, :] = np.array([298617.1415, 2354085.1648]) - p0
Tx[207, :] = np.array([298617.6331, 2354085.1743]) - p0
Tx[208, :] = np.array([298617.6413, 2354084.6687]) - p0
Tx[209, :] = np.array([298617.6418, 2354084.1389]) - p0
Tx[210, :] = np.array([298617.6736, 2354083.6153]) - p0
Tx[211, :] = np.array([298618.2032, 2354083.5949]) - p0
Tx[212, :] = np.array([298618.1399, 2354084.1416]) - p0
Tx[213, :] = np.array([298618.1397, 2354084.6872]) - p0
Tx[214, :] = np.array([298618.1316, 2354085.1840]) - p0
Tx[215, :] = np.array([298618.6486, 2354085.2149]) - p0
Tx[216, :] = np.array([298618.6310, 2354084.6815]) - p0
Tx[217, :] = np.array([298618.6407, 2354084.1445]) - p0
Tx[218, :] = np.array([298618.6744, 2354083.6374]) - p0
Tx[219, :] = np.array([298619.1722, 2354083.6488]) - p0
Tx[220, :] = np.array([298619.1376, 2354084.1545]) - p0
Tx[221, :] = np.array([298619.1287, 2354084.6807]) - p0
Tx[222, :] = np.array([298619.1330, 2354085.1822]) - p0
Tx[223, :] = np.array([298619.1273, 2354085.6893]) - p0
Tx[224, :] = np.array([298619.6187, 2354086.2068]) - p0
Tx[225, :] = np.array([298619.6339, 2354085.6987]) - p0
Tx[226, :] = np.array([298619.6466, 2354085.1823]) - p0
Tx[227, :] = np.array([298619.6353, 2354084.6749]) - p0
Tx[228, :] = np.array([298619.6417, 2354084.1745]) - p0
Tx[229, :] = np.array([298619.6846, 2354083.6551]) - p0
Tx[230, :] = np.array([298620.1394, 2354084.1739]) - p0
Tx[231, :] = np.array([298620.1309, 2354084.6747]) - p0
Tx[232, :] = np.array([298620.6375, 2354084.7072]) - p0
Tx[233, :] = np.array([298620.6535, 2354084.1937]) - p0
Tx[234, :] = np.array([298621.1562, 2354084.2068]) - p0
Tx[235, :] = np.array([298621.1364, 2354084.7122]) - p0
Tx[236, :] = np.array([298621.6385, 2354084.7303]) - p0
Tx[237, :] = np.array([298621.6651, 2354084.2222]) - p0
Tx[238, :] = np.array([298622.1601, 2354084.2389]) - p0
Tx[239, :] = np.array([298622.1370, 2354084.7480]) - p0
Tx[240, :] = np.array([298622.6385, 2354084.7663]) - p0
Tx[241, :] = np.array([298622.6600, 2354084.2542]) - p0
Tx[242, :] = np.array([298623.1648, 2354084.2689]) - p0
Tx[243, :] = np.array([298623.1408, 2354084.7816]) - p0
Tx[244, :] = np.array([298623.6409, 2354084.7926]) - p0
Tx[245, :] = np.array([298623.6678, 2354084.2861]) - p0
Tx[246, :] = np.array([298624.1386, 2354084.8036]) - p0
Tx[247, :] = np.array([298624.1635, 2354084.2994]) - p0
Tx[248, :] = np.array([298624.6636, 2354084.3205]) - p0
Tx[249, :] = np.array([298624.6389, 2354084.8140]) - p0
Tx[250, :] = np.array([298625.1366, 2354084.8288]) - p0
Tx[251, :] = np.array([298625.1661, 2354084.3260]) - p0
Tx[252, :] = np.array([298625.6665, 2354084.3414]) - p0
Tx[253, :] = np.array([298625.6354, 2354084.8437]) - p0
Tx[254, :] = np.array([298626.1636, 2354084.3514]) - p0
Tx[255, :] = np.array([298623.1350, 2354083.2604]) - p0
Tx[256, :] = np.array([298623.6459, 2354083.2540]) - p0
Tx[257, :] = np.array([298624.1560, 2354083.2374]) - p0
Tx[258, :] = np.array([298624.6663, 2354083.2462]) - p0
Tx[259, :] = np.array([298624.6826, 2354082.7437]) - p0
Tx[260, :] = np.array([298624.1749, 2354082.7208]) - p0
Tx[261, :] = np.array([298623.6692, 2354082.7379]) - p0
Tx[262, :] = np.array([298623.1639, 2354082.7469]) - p0
Tx[263, :] = np.array([298623.1689, 2354082.2433]) - p0
Tx[264, :] = np.array([298623.6787, 2354082.2317]) - p0
Tx[265, :] = np.array([298624.1985, 2354082.2183]) - p0
Tx[266, :] = np.array([298624.6866, 2354082.2383]) - p0
Tx[267, :] = np.array([298625.1949, 2354082.2558]) - p0
Tx[268, :] = np.array([298625.2143, 2354081.7460]) - p0
Tx[269, :] = np.array([298624.7009, 2354081.7275]) - p0
Tx[270, :] = np.array([298624.6954, 2354081.2262]) - p0
Tx[271, :] = np.array([298625.2236, 2354081.2382]) - p0
Tx[272, :] = np.array([298625.2363, 2354080.7305]) - p0
Tx[273, :] = np.array([298624.7062, 2354080.7236]) - p0
Tx[274, :] = np.array([298624.7133, 2354080.2191]) - p0
Tx[275, :] = np.array([298625.2658, 2354080.2344]) - p0
Tx[276, :] = np.array([298625.2716, 2354079.7283]) - p0
Tx[277, :] = np.array([298624.7364, 2354079.7128]) - p0
Tx[278, :] = np.array([298624.7416, 2354079.2061]) - p0
Tx[279, :] = np.array([298625.2491, 2354079.2185]) - p0
Tx[280, :] = np.array([298623.1637, 2354081.7384]) - p0
Tx[281, :] = np.array([298622.6586, 2354081.7004]) - p0
Tx[282, :] = np.array([298622.6515, 2354081.1890]) - p0
Tx[283, :] = np.array([298622.1315, 2354081.1643]) - p0
Tx[284, :] = np.array([298621.6273, 2354081.1723]) - p0
Tx[285, :] = np.array([298621.6316, 2354080.6624]) - p0
Tx[286, :] = np.array([298622.1501, 2354080.6556]) - p0
Tx[287, :] = np.array([298622.6541, 2354080.6798]) - p0
Tx[288, :] = np.array([298622.6727, 2354080.1768]) - p0
Tx[289, :] = np.array([298622.1474, 2354080.1466]) - p0
Tx[290, :] = np.array([298621.6630, 2354080.1541]) - p0
Tx[291, :] = np.array([298621.6689, 2354079.6337]) - p0
Tx[292, :] = np.array([298622.1509, 2354079.6419]) - p0
Tx[293, :] = np.array([298622.6775, 2354079.6703]) - p0
Tx[294, :] = np.array([298622.6726, 2354079.1622]) - p0
Tx[295, :] = np.array([298622.1617, 2354079.1326]) - p0
Tx[296, :] = np.array([298621.6529, 2354079.1229]) - p0
Tx[297, :] = np.array([298626.6606, 2354084.3659]) - p0
Tx[298, :] = np.array([298627.1570, 2354084.3670]) - p0
Tx[299, :] = np.array([298627.1370, 2354084.8710]) - p0
Tx[300, :] = np.array([298627.6319, 2354084.8747]) - p0
Tx[301, :] = np.array([298627.6622, 2354084.3697]) - p0
Tx[302, :] = np.array([298628.1326, 2354084.8789]) - p0
Tx[303, :] = np.array([298628.1463, 2354084.3800]) - p0
Tx[304, :] = np.array([298628.6313, 2354084.8911]) - p0
Tx[305, :] = np.array([298628.6615, 2354084.3717]) - p0
Tx[306, :] = np.array([298629.1306, 2354084.8933]) - p0
Tx[307, :] = np.array([298629.1615, 2354084.3833]) - p0
Tx[308, :] = np.array([298629.6307, 2354084.9125]) - p0
Tx[309, :] = np.array([298629.6646, 2354084.3948]) - p0
Tx[310, :] = np.array([298630.1340, 2354084.9249]) - p0
Tx[311, :] = np.array([298630.1594, 2354084.4232]) - p0
Tx[312, :] = np.array([298630.6318, 2354084.9324]) - p0
Tx[313, :] = np.array([298630.6612, 2354084.4580]) - p0
Tx[314, :] = np.array([298631.2187, 2354083.3883]) - p0
Tx[315, :] = np.array([298631.2218, 2354082.3712]) - p0
Tx[316, :] = np.array([298630.2159, 2354083.3792]) - p0
Tx[317, :] = np.array([298629.2029, 2354083.3825]) - p0
Tx[318, :] = np.array([298628.1967, 2354083.3782]) - p0
Tx[319, :] = np.array([298627.2335, 2354082.3535]) - p0
Tx[320, :] = np.array([298628.2356, 2354082.3791]) - p0
Tx[321, :] = np.array([298629.2348, 2354082.3807]) - p0
Tx[322, :] = np.array([298629.2770, 2354081.3799]) - p0
Tx[323, :] = np.array([298628.2694, 2354081.3802]) - p0
Tx[324, :] = np.array([298627.2663, 2354081.3675]) - p0
Tx[325, :] = np.array([298628.3160, 2354080.3775]) - p0
Tx[326, :] = np.array([298629.3220, 2354080.3841]) - p0
Tx[327, :] = np.array([298630.3279, 2354080.3862]) - p0
Tx[328, :] = np.array([298630.3704, 2354079.3924]) - p0
Tx[329, :] = np.array([298629.3623, 2354079.3802]) - p0
Tx[330, :] = np.array([298628.3342, 2354079.3824]) - p0
Tx[331, :] = np.array([298628.3749, 2354078.3795]) - p0
Tx[332, :] = np.array([298629.3982, 2354078.3895]) - p0
Tx[333, :] = np.array([298630.6250, 2354085.4334]) - p0
Tx[334, :] = np.array([298630.1148, 2354085.4346]) - p0
Tx[335, :] = np.array([298629.5977, 2354085.4260]) - p0
Tx[336, :] = np.array([298629.0921, 2354085.4069]) - p0
Tx[337, :] = np.array([298628.5832, 2354085.3937]) - p0
Tx[338, :] = np.array([298628.0748, 2354085.3920]) - p0
Tx[339, :] = np.array([298627.5699, 2354085.3777]) - p0
Tx[340, :] = np.array([298627.0581, 2354085.3496]) - p0
Tx[341, :] = np.array([298627.0440, 2354085.8594]) - p0
Tx[342, :] = np.array([298627.5491, 2354085.8708]) - p0
Tx[343, :] = np.array([298628.0570, 2354085.8833]) - p0
Tx[344, :] = np.array([298628.5701, 2354085.8841]) - p0
Tx[345, :] = np.array([298629.0761, 2354085.8861]) - p0
Tx[346, :] = np.array([298629.5895, 2354085.8885]) - p0
Tx[347, :] = np.array([298630.1016, 2354085.8637]) - p0
Tx[348, :] = np.array([298630.6107, 2354085.9368]) - p0
Tx[349, :] = np.array([298630.5969, 2354086.4495]) - p0
Tx[350, :] = np.array([298630.0616, 2354086.3773]) - p0
Tx[351, :] = np.array([298629.5689, 2354086.3965]) - p0
Tx[352, :] = np.array([298629.0546, 2354086.4048]) - p0
Tx[353, :] = np.array([298628.5498, 2354086.3892]) - p0
Tx[354, :] = np.array([298628.0564, 2354086.3965]) - p0
Tx[355, :] = np.array([298627.5584, 2354086.3823]) - p0
Tx[356, :] = np.array([298627.0596, 2354086.3679]) - p0
Tx[357, :] = np.array([298627.0814, 2354087.9662]) - p0
Tx[358, :] = np.array([298627.5875, 2354087.9724]) - p0
Tx[359, :] = np.array([298630.0659, 2354086.8908]) - p0
Tx[360, :] = np.array([298630.5976, 2354086.9659]) - p0
Tx[361, :] = np.array([298630.6216, 2354087.4763]) - p0
Tx[362, :] = np.array([298630.6231, 2354087.9851]) - p0
Tx[363, :] = np.array([298630.1070, 2354087.9773]) - p0
Tx[364, :] = np.array([298630.6289, 2354088.4926]) - p0
Tx[365, :] = np.array([298630.6374, 2354089.0000]) - p0
Tx[366, :] = np.array([298630.1284, 2354089.0167]) - p0
Tx[367, :] = np.array([298630.1131, 2354088.4647]) - p0
Tx[368, :] = np.array([298629.5976, 2354088.4960]) - p0
Tx[369, :] = np.array([298629.6156, 2354089.0127]) - p0
Tx[370, :] = np.array([298629.1024, 2354089.0193]) - p0
Tx[371, :] = np.array([298629.0885, 2354088.4984]) - p0
Tx[372, :] = np.array([298628.5778, 2354088.5128]) - p0
Tx[373, :] = np.array([298628.6028, 2354089.0272]) - p0
Tx[374, :] = np.array([298628.0993, 2354089.0330]) - p0
Tx[375, :] = np.array([298628.0736, 2354088.4813]) - p0
Tx[376, :] = np.array([298627.5638, 2354088.4844]) - p0
return(Tx, Rx)
def visibility():
""" determine visibility type of WHERE1 measurements campaign points
Returns
-------
visi
visibility status of each link
Warning
-------
This should be done automatically in the future
"""
R1 = []
for i in range(1, 232):
R1.append('NLOS2')
for i in range(1, 24):
R1.append('NLOS')
for i in range(1, 43):
R1.append('LOS')
for i in range(1, 81):
R1.append('NLOS2')
R1[330] = 'NLOS'
R2 = []
for i in range(1, 82):
R2.append('NLOS2')
for i in range(1, 52):
R2.append('NLOS')
for i in range(1, 100):
R2.append('LOS')
for i in range(1, 3):
R2.append('NLOS')
for i in range(1, 144):
R2.append('NLOS2')
R2[121] = 'NLOS2'
R2[122] = 'NLOS2'
R2[123] = 'NLOS2'
R2[124] = 'NLOS2'
R2[125] = 'NLOS2'
R2[127] = 'NLOS2'
R3 = []
for i in range(1, 106):
R3.append('NLOS2')
for i in range(1, 17):
R3.append('NLOS')
for i in range(1, 12):
R3.append('NLOS2')
for i in range(1, 100):
R3.append('LOS')
for i in range(1, 146):
R3.append('NLOS2')
R3[107] = 'NLOS2'
R3[130] = 'NLOS'
R3[131] = 'NLOS'
R3[209] = 'NLOS2'
R3[210] = 'NLOS2'
R3[216] = 'NLOS2'
R3[217] = 'NLOS2'
R3[218] = 'NLOS2'
R3[219] = 'NLOS2'
R3[220] = 'NLOS2'
R3[225] = 'NLOS2'
R3[226] = 'NLOS2'
R3[227] = 'NLOS2'
R3[228] = 'NLOS2'
R3[229] = 'NLOS2'
R3[230] = 'NLOS2'
R4 = []
for i in range(1, 82):
R4.append('NLOS')
for i in range(1, 41):
R4.append('LOS')
for i in range(1, 12):
R4.append('NLOS')
for i in range(1, 6):
R4.append('NLOS2')
for i in range(1, 9):
R4.append('NLOS')
for i in range(1, 18):
R4.append('NLOS2')
for i in range(1, 70):
R4.append('NLOS')
for i in range(1, 146):
R4.append('NLOS2')
visi = []
visi.append(R1)
visi.append(R2)
visi.append(R3)
visi.append(R4)
return visi
def trait(filename, itx=np.array([]), dico={}, h=1):
""" evaluate various parameters for all measures in itx array
Parameters
----------
filename
itx
dico
h
height (default h1)
Notes
-----
F['PL_FS_Rx1'] = -20*log10(((0.3/f)/(4*pi*M.de[0]*0.3)))
F['PL_FS_Rx2'] = -20*log10(((0.3/f)/(4*pi*M.de[1]*0.3)))
F['PL_FS_Rx3'] = -20*log10(((0.3/f)/(4*pi*M.de[2]*0.3)))
F['PL_FS_Rx4'] = -20*log10(((0.3/f)/(4*pi*M.de[3]*0.3)))
"""
F = {}
#F['PL'] = {}
F['Et'] = {}
F['Es'] = {}
F['Ef'] = {}
F['dist'] = {}
F['tau1'] = {}
F['taumax'] = {}
F['taurms'] = {}
F['taumoy'] = {}
F['los'] = {}
F['lqi'] = {}
for i in itx:
iTx = dico[i]
try:
M = UWBMeasure(iTx, h)
#f,pl = M.tdd.PL(2,6,0.02)
#F['PL'] = appendlink(F['PL'],pl)
etot = M.Etot()
try:
F['Tx'] = np.vstack((F['Tx'], M.tx))
except:
F['Tx'] = M.tx
F['Et'] = appendlink(F['Et'], etot)
emax = M.Emax()
F['Es'] = appendlink(F['Es'], emax)
dist = M.de * 0.3
F['dist'] = appendlink(F['dist'], dist)
efirst = M.Efirst()
F['Ef'] = appendlink(F['Ef'], efirst)
tau1 = M.toa_win()
F['tau1'] = appendlink(F['tau1'], tau1)
taurms = M.tau_rms()
F['taurms'] = appendlink(F['taurms'], taurms)
taumoy = M.tau_moy()
F['taumoy'] = appendlink(F['taumoy'], taumoy)
taumax = M.taumax()
F['taumax'] = appendlink(F['taumax'], taumax)
lqi = M.lqi
F['lqi'] = appendlink(F['lqi'], lqi)
los = M.type
vlos = zeros(4)
if los[0] == 'LOS':
vlos[0] = 1
else:
vlos[0] = 0
if los[1] == 'LOS':
vlos[1] = 1
else:
vlos[1] = 0
if los[2] == 'LOS':
vlos[2] = 1
else:
vlos[2] = 0
if los[3] == 'LOS':
vlos[3] = 1
else:
vlos[3] = 0
F['los'] = appendlink(F['los'], vlos)
except:
pass
F['Rx'] = M.rx
io.savemat(filename, F)
return(F)
class RAW_DATA(PyLayers):
"""
Members
-------
ch1
ch2
ch3
ch4
time
timeTX
tx
"""
def __init__(self, d):
#self.time = d.Time[0]
#self.ch1 = d.CH1[0]
#self.ch2 = d.CH2[0]
#self.ch3 = d.CH3[0]
#self.ch4 = d.CH4[0]
#self.timetx = d.TimeTX[0]
#self.tx = d.TX[0]
self.time = d[0]
self.ch1 = d[1]
self.ch2 = d[2]
self.ch3 = d[3]
self.ch4 = d[4]
self.timetx = d[5]
self.tx = d[6]
class CAL_DATA(PyLayers):
"""
CAL_DATA
ch1
ch2
ch3
ch4
vna_att1
vna_att2
vna_freq
"""
def __init__(self, d):
"""
depending of the version of scipy
io.loadma do not give the same output
"""
#self.ch1 = d.CH1
#self.ch2 = d.CH2
#self.ch3 = d.CH3
#self.ch4 = d.CH4
#self.vna_freq = d.VNA_Freq
#self.vna_att1 = d.VNA_Attenuator1
#self.vna_att2 = d.VNA_Attenuator2
self.ch1 = d[0]
self.ch2 = d[1]
self.ch3 = d[2]
self.ch4 = d[3]
self.vna_freq = d[4]
self.vna_att1 = d[5]
self.vna_att2 = d[6]
def plot(self):
plt.plot(self.ch1)
plt.show()
def getwave(self):
"""
getwave
"""
#
# place a window on each channel
#
s1 = self.ch1
s2 = self.ch2
class Fdd(PyLayers):
""" Frequency Domain Deconv Data
Attributes
----------
ch1
channel 1
ch2
channel 2
ch3
channel 3
ch4
channel 4
freq
frequency
tx
Methods
-------
plot
"""
def __init__(self, d):
"""
"""
#self.freq = d.Freq[0]*1e-9
#self.ch1 = d.CH1[0]
#self.ch2 = d.CH2[0]
#self.ch3 = d.CH3[0]
#self.ch4 = d.CH4[0]
#self.tx = d.TX[0]
self.freq = d[0][0] * 1e-9
self.ch1 = d[1][0]
self.ch2 = d[2][0]
self.ch3 = d[3][0]
self.ch4 = d[4][0]
self.tx = d[5][0]
def plot(self, typ='moddB'):
""" plot Fdd
Parameters
----------
typ : string
'moddB' : modulus in dB ,
'mod', : modulus in linear scale,
'ang' : unwraped phase in radians
Examples
--------
.. plot::
:include-source:
>>> from pylayers.util.project import *
>>> from pylayers.measures.mesuwb import *
>>> import matplotlib.pylab as plt
>>> M = UWBMeasure(1)
>>> F = M.fdd
>>> fig = plt.figure()
>>> F.plot('moddB')
>>> fig = plt.figure()
>>> F.plot('mod')
>>> F.plot('ang')
"""
f = self.freq
if (typ == 'moddB'):
v1 = 20 * np.log10(abs(self.ch1))
v2 = 20 * np.log10(abs(self.ch2))
v3 = 20 * np.log10(abs(self.ch3))
v4 = 20 * np.log10(abs(self.ch4))
if (typ == 'mod'):
v1 = abs(self.ch1)
v2 = abs(self.ch2)
v3 = abs(self.ch3)
v4 = abs(self.ch4)
if (typ == 'ang'):
v1 = np.unwrap(np.angle(self.ch1))
v2 = np.unwrap(np.angle(self.ch2))
v3 = np.unwrap(np.angle(self.ch3))
v4 = np.unwrap(np.angle(self.ch4))
plt.subplot(221)
plt.plot(f, v1)
plt.xlabel('Freq (GHz)')
plt.title('CH1')
plt.subplot(222)
plt.plot(f, v2)
plt.xlabel('Freq (GHz)')
plt.title('CH2')
plt.subplot(223)
plt.plot(f, v3)
plt.xlabel('Freq (GHz)')
plt.title('CH3')
plt.subplot(224)
plt.plot(f, v4)
plt.xlabel('Freq (GHz)')
plt.title('CH4')
plt.show()
class Tdd(PyLayers):
"""
Time Domain Deconv Data
Attributes
----------
ch1
signal on channel 1 (ch.TUchannel)
ch2
signal on channel 2 (ch.TUchannel)
ch3
signal on channel 3 (ch.TUchannel)
ch4
signal on channel 4 (ch.TUchannel)
tx
exitation waveform ( Impulse feeding Tx antenna) (bs.TUsignal)
time is expressed in nano seconds
Methods
-------
PL
Calculate NB Path Loss on a given UWB frequency band
box
return min and max value
show
display the 4 channels
show_span(delay,wide)
"""
def __init__(self,d):
t = d[0][0] * 1e9
self.ch3 = ch.TUchannel(x=t, y=d[1][0])
self.ch4 = ch.TUchannel(x=t, y=d[2][0])
self.ch1 = ch.TUchannel(x=t, y=d[3][0])
self.ch2 = ch.TUchannel(x=t, y=d[4][0])
self.tx = ch.TUchannel(t, d[5][0])
def PL(self, fmin, fmax, B):
""" Calculate NB Path Loss on a given UWB frequency band
Parameters
----------
fmin
start frequency GHz
fmax
stop frequency GHz
B
NB bandwith (GHz)
Examples
--------
.. plot::
:include-source:
>>> from pylayers.util.project import *
>>> from pylayers.measures.mesuwb import *
>>> import matplotlib.pylab as plt
>>> M = UWBMeasure(1)
>>> T = M.tdd
>>> freq,pl = T.PL(3,7,10)
"""
S1 = self.ch1.fft()
S2 = self.ch2.fft()
S3 = self.ch3.fft()
S4 = self.ch4.fft()
df = S4.x[1] - S4.x[0]
Stx = self.tx.fft()
freq = np.arange(fmin, fmax, B)
N = len(freq)
i_start = np.nonzero(
(S1.x >= fmin - df / 2.) & (S1.x < fmin + df / 2.))
i_stop = np.nonzero(
(S1.x >= fmax - df / 2.) & (S1.x < fmax + df / 2.))
f = S1.x[i_start[0][0]:i_stop[0][0]]
for k in range(N):
u = np.nonzero((f >= fmin + k * B) & (f < fmin + (k + 1) * B))
Et = 10 * np.log10(np.sum(Stx.y[u[0]] * np.conj(
Stx.y[u[0]]))).astype('float')
Er1 = 10 * np.log10(np.sum(
S1.y[u[0]] * np.conj(S1.y[u[0]]))).astype('float')
Er2 = 10 * np.log10(np.sum(
S2.y[u[0]] * np.conj(S2.y[u[0]]))).astype('float')
Er3 = 10 * np.log10(np.sum(
S3.y[u[0]] * np.conj(S3.y[u[0]]))).astype('float')
Er4 = 10 * np.log10(np.sum(
S4.y[u[0]] * np.conj(S4.y[u[0]]))).astype('float')
PL1 = Et - Er1
PL2 = Et - Er2
PL3 = Et - Er3
PL4 = Et - Er4
try:
pl = np.vstack((pl, np.array([PL1, PL2, PL3, PL4])))
except:
pl = np.array([PL1, PL2, PL3, PL4])
return(freq, pl)
def show(self, fig = [], delay=np.array([[0], [0], [0], [0]]), display=True,
title=['Rx1', 'Rx2', 'Rx3', 'Rx4'], col=['k', 'b', 'g', 'c'],
xmin=0, xmax=200,typ='v'):
""" show the 4 Impulse Radio Impulse responses
Parameters
----------
delay
delay values to be displayed vertically [tau0 - toa_th toa_cum toa_max , taum-taurms taum+taurms]
display
if display == False the first subplot is reserved for displaying the Layout
Examples
--------
.. plot::
:include-source:
>>> from pylayers.measures.mesuwb import *
>>> import matplotlib.pylab as plt
>>> ntx = 2
>>> M = UWBMeasure(ntx)
>>> T = M.tdd
>>> fig = plt.figure()
>>> t = plt.title('test Tdd.show Tx='+str(ntx))
>>> T.show()
"""
if fig == []:
f = plt.gcf()
else:
f = fig
#plt.axis([0,200,-2,2])
self.ch1.zlr(xmin, xmax)
self.ch2.zlr(xmin, xmax)
self.ch3.zlr(xmin, xmax)
self.ch4.zlr(xmin, xmax)
a1 = f.add_subplot(4, 1, 1)
f,a = self.ch1.plot(color=col[0], vline=np.array([delay[0]]),fig=f,ax=a1,typ=typ,unit2='mV')
a1.set_title(title[0])
a2 = f.add_subplot(4, 1, 2,sharex=a1)
f,a= self.ch2.plot(color=col[1], vline=np.array([delay[1]]),fig=f,ax=a2,typ=typ,unit2='mV')
a2.set_title(title[1])
a3 = f.add_subplot(4, 1, 3,sharex=a1)
f,a = self.ch3.plot(color=col[2], vline=np.array([delay[2]]),fig=f,ax=a3,typ=typ,unit2='mV')
a3.set_title(title[2])
a4 = f.add_subplot(4, 1, 4,sharex=a1)
f,a = self.ch4.plot(color=col[3], vline=np.array([delay[3]]),fig=f, ax=a4,typ=typ,unit2='mV')
a4.set_title(title[3])
if display:
plt.show()
return f,a4
def show_span(self, delay=np.array([0, 0, 0, 0]), wide=np.array([0, 0, 0, 0])):
""" show span
Examples
--------
.. plot::
:include-source:
>>> from pylayers.util.project import *
>>> from pylayers.measures.mesuwb import *
>>> M = UWBMeasure(2)
>>> T = M.tdd
>>> s1 = T.show_span()
>>> plt.show()
"""
fig = plt.figure()
sp1 = fig.add_subplot(221)
plt.plot(self.ch1.x, self.ch1.y)
plt.axvspan(delay[0] - wide[0] / 2, delay[0] + wide[0] / 2,
facecolor='g', alpha=0.5)
plt.xlabel('Time (ns)')
plt.title('Rx1')
sp2 = fig.add_subplot(222)
plt.plot(self.ch2.x, self.ch2.y)
plt.axvspan(delay[1] - wide[1] / 2, delay[1] + wide[1] / 2,
facecolor='g', alpha=0.5)
plt.xlabel('Time (ns)')
plt.title('Rx2')
plt.sp3 = fig.add_subplot(223)
plt.plot(self.ch3.x, self.ch3.y)
plt.axvspan(delay[2] - wide[2] / 2, delay[2] + wide[2] / 2,
facecolor='g', alpha=0.5)
plt.xlabel('Time (ns)')
plt.title('Rx3')
sp4 = fig.add_subplot(224)
plt.plot(self.ch4.x, self.ch4.y)
plt.axvspan(delay[3] - wide[3] / 2, delay[3] + wide[3] / 2,
facecolor='g', alpha=0.5)
plt.xlabel('Time (ns)')
plt.title('Rx4')
plt.show()
return(fig)
def box(self):
""" evaluate min and max of the 4 channels
Examples
--------
>>> from pylayers.measures.mesuwb import *
>>> M = UWBMeasure(1)
>>> T = M.tdd
>>> bo = T.box()
"""
max1 = max(self.ch1.y)
min1 = min(self.ch1.y)
max2 = max(self.ch2.y)
min2 = min(self.ch2.y)
max3 = max(self.ch3.y)
min3 = min(self.ch3.y)
max4 = max(self.ch4.y)
min4 = min(self.ch4.y)
ma = max(max1, max2, max3, max4)
mi = min(min1, min2, min3, min4)
b = np.array([mi, ma])
return(b)
def plot(self, type='raw'):
"""
type : raw | filter
"""
b = self.box()
t = self.time * 1e9
tmin = min(t)
tmax = max(t)
ymin = b[0]
ymax = b[1]
ax = [tmin, tmax, ymin, ymax]
s1 = self.ch1
s2 = self.ch2
s3 = self.ch3
s4 = self.ch4
if type == 'filter':
[b, a] = signal.butter(5, 0.2)
[w, h] = signal.freqz(b, a)
plt.plot(w, abs(h))
plt.show()
s1 = signal.lfilter(b, a, s1)
s2 = signal.lfilter(b, a, s2)
s3 = signal.lfilter(b, a, s3)
s4 = signal.lfilter(b, a, s4)
plt.subplot(221)
plt.plot(t, s1)
plt.xlabel('Time (ns)')
plt.title('CH1')
plt.axis(ax)
plt.subplot(222)
plt.plot(t, s2)
plt.xlabel('Time (ns)')
plt.title('CH2')
plt.axis(ax)
plt.subplot(223)
plt.plot(t, s3)
plt.xlabel('Time (ns)')
plt.title('CH3')
plt.axis(ax)
plt.subplot(224)
plt.plot(t, s4)
plt.xlabel('Time (ns)')
plt.title('CH4')
plt.axis(ax)
plt. show()
class TFP(object):
"""
Tx
Rx
distance
los_cond
Etot
Emax
Etau0
tau_moy
tau_rms
Epercent
toa_max
toa_th
toa_cum
angular
"""
def __init__(self):
self.metadata = {}
self.metadata['Tx'] = np.array([]).reshape(3, 0)
self.metadata['Rx'] = np.array([]).reshape(3, 0)
self.metadata['distance'] = np.array([])
self.metadata['los_cond'] = np.parray([])
self.chan_param = {}
self.chan_param['Etot'] = np.array([])
self.chan_param['Emax'] = np.array([])
self.chan_param['Etau0'] = np.array([])
self.chan_param['tau_moy'] = np.array([])
self.chan_param['tau_rms'] = np.array([])
self.chan_param['Epercent'] = np.array([])
self.chan_param['toa_max'] = np.array([])
self.chan_param['toa_th'] = np.array([])
self.chan_param['toa_cum'] = np.array([])
self.chan_param['toa_new'] = np.array([])
self.chan_param['toa_win'] = np.array([])
self.chan_param['toa_seu'] = np.array([])
self.chan_param['angular'] = np.array([])
def append(self, FP):
""" append data to fingerprint
Parameters
----------
FP
"""
tx = FP.metadata['Tx'].reshape(3, 1)
rx = FP.metadata['Rx'].reshape(3, 1)
self.metadata['Tx'] = hstack((self.metadata['Tx'], tx))
self.metadata['Rx'] = hstack((self.metadata['Rx'], rx))
self.metadata['distance'] = hstack(
(self.metadata['distance'], FP.metadata['distance']))
self.metadata['delay'] = hstack(
(self.metadata['delay'], FP.metadata['delay']))
self.metadata['los_cond'] = hstack(
(self.metadata['los_cond'], FP.metadata['los_cond']))
self.metadata['angular'] = hstack(
(self.metadata['angular'], FP.metadata['angular']))
self.chan_param['Etot'] = hstack(
(self.chan_param['Etot'], FP.chan_param['Etot']))
self.chan_param['Emax'] = hstack(
(self.chan_param['Emax'], FP.chan_param['Emax']))
self.chan_param['Etau0'] = hstack(
(self.chan_param['Etau0'], FP.chan_param['Etau0']))
self.chan_param['tau_moy'] = hstack(
(self.chan_param['tau_moy'], FP.chan_param['tau_moy']))
self.chan_param['tau_rms'] = hstack(
(self.chan_param['tau_rms'], FP.chan_param['tau_rms']))
self.chan_param['Epercent'] = hstack(
(self.chan_param['Epercent'], FP.chan_param['Epercent']))
self.chan_param['toa_max'] = hstack(
(self.chan_param['toa_max'], FP.chan_param['toa_max']))
self.chan_param['toa_th'] = hstack(
(self.chan_param['toa_th'], FP.chan_param['toa_th']))
self.chan_param['toa_cum'] = hstack(
(self.chan_param['toa_cum'], FP.chan_param['toa_cum']))
#self.chan_param['toa_cum_tmtm']=hstack((self.chan_param['toa_cum_tmtm'],FP.chan_param['toa_cum_tmtm']))
#self.chan_param['toa_cum_tm']=hstack((self.chan_param['toa_cum_tm'],FP.chan_param['toa_cum_tm']))
#self.chan_param['toa_cum_tmt']=hstack((self.chan_param['toa_cum_tmt'],FP.chan_param['toa_cum_tmt']))
self.chan_param['toa_win'] = hstack(
(self.chan_param['toa_win'], FP.chan_param['toa_win']))
self.chan_param['toa_new'] = hstack(
(self.chan_param['toa_new'], FP.chan_param['toa_new']))
#self.chan_param['toa_th_tmtm']=hstack((self.chan_param['toa_th_tmtm'],FP.chan_param['toa_th_tmtm']))
#self.chan_param['toa_th_tm']=hstack((self.chan_param['toa_th_tm'],FP.chan_param['toa_th_tm']))
#self .chan_param['toa_th_tmt']=hstack((self.chan_param['toa_th_tmt'],FP.chan_param['toa_th_tmt']))
class FP(object):
""" Fingerprint class
Rxid : 1 | 2 | 3 | 4
alpha : pdf percentile to suppress below and above (used in tau_rms and tau_moy)
Tint : Integration time for Emax (ns)
Tsym : Integration symetry default (0.25 | 0,75)
nint : number of interval for toa_max
thlos : threshold for los case toa_th
thnlos : threshold for nlos case toa_th
thcum : threshold for toa_cum
This method build the Fingerprint from UWBMeasure M - Rx number k
Attributes
----------
metadata : dictionnary
Tx
Rx
distance (m)
type
chan_param : dictionnary
Etot
Emax
Etau0
tau_moy
tau_rms
Epercent
toa_max
toa_th
toa_cum
"""
def __init__(self, M, k, alpha=0.1, Tint=0.225, sym=0.25, nint=8, thlos=0.05, thnlos=0.15, thcum=0.15, w=6):
""" object constructor
Parameters
----------
M : UWB Mesure
k : int
Rx index
alpha : quantile parameter
0.1
Tint : Integation time (ns)
0.225
sym : float
0.25
nint : int
8
thlos : float
w : w
"""
#
# Metadata : general parameters links to measurement configuration
#
self.metadata = {}
self.metadata['Tx'] = M.tx
self.metadata['Rx'] = M.rx[k, :]
self.metadata['distance'] = M.de[k - 1] * 0.3
self.metadata['delay'] = M.de[k - 1]
self.metadata['los_cond'] = M.type[k - 1]
self.metadata['angular'] = M.ag[k - 1]
#
# Chan_param : radio channel features
#
self.chan_param = {}
if k == 1:
Etot = M.tdd.ch1.Etot(tau0=M.de[0], dB=True)
Emax = M.tdd.ch1.Emax(Tint, sym, dB=True)
#Etot = M.tdd.ch1.Etot(tau0=M.de[0],dB=False)
#Emax = M.tdd.ch1.Emax(Tint,sym,dB=False)
Etau0 = M.tdd.ch1.Etau0(tau0=M.de[0])
tau_moy = M.tdd.ch1.tau_moy(alpha)
tau_rms = M.tdd.ch1.tau_rms(alpha)
Epercent = M.tdd.ch1.Epercent()
toa_max = M.tdd.ch1.toa_max(nint)
toa_th = M.tdd.ch1.toa_th(thlos, thnlos, visibility=M.type[0])
toa_cum = M.tdd.ch1.toa_cum(thcum)
#toa_cum_tmtm = M.tdd.ch1.toa_cum_tmtm()
#toa_cum_tm = M.tdd.ch1.toa_cum_tm()
#toa_cum_tmt = M.tdd.ch1.toa_cum_tmt()
#toa_new = M.tdd.ch1.toa_new()
toa_win = M.tdd.ch1.toa_win(w)
#toa_th_tmtm = M.tdd.ch1.toa_th_tmtm()
#toa_th_tm = M.tdd.ch1.toa_th_tm()
#toa_th_tmt = M.tdd.ch1.toa_th_tmt()
if k == 2:
Etot = M.tdd.ch2.Etot(tau0=M.de[1], dB=True)
Emax = M.tdd.ch2.Emax(Tint, sym, dB=True)
#Etot = M.tdd.ch2.Etot(tau0=M.de[1],dB=False)
#Emax = M.tdd.ch2.Emax(Tint,sym,dB=False)
Etau0 = M.tdd.ch2.Etau0(tau0=M.de[1])
tau_moy = M.tdd.ch2.tau_moy(alpha)
tau_rms = M.tdd.ch2.tau_rms(alpha)
Epercent = M.tdd.ch2.Epercent()
toa_max = M.tdd.ch2.toa_max(nint)
toa_th = M.tdd.ch2.toa_th(thlos, thnlos, visibility=M.type[1])
toa_cum = M.tdd.ch2.toa_cum(thcum)
#toa_cum_tmtm = M.tdd.ch2.toa_cum_tmtm()
#toa_cum_tm = M.tdd.ch2.toa_cum_tm()
#toa_cum_tmt = M.tdd.ch2.toa_cum_tmt()
#toa_new = M.tdd.ch2.toa_new()
toa_win = M.tdd.ch2.toa_win(w)
#toa_th_tmtm = M.tdd.ch2.toa_th_tmtm()
#toa_th_tm = M.tdd.ch2.toa_th_tm()
#toa_th_tmt = M.tdd.ch2.toa_th_tmt()
if k == 3:
Etot = M.tdd.ch3.Etot(tau0=M.de[2], dB=True)
Emax = M.tdd.ch3.Emax(Tint, sym, dB=True)
#Etot = M.tdd.ch3.Etot(tau0=M.de[2],dB=False)
#Emax = M.tdd.ch3.Emax(Tint,sym,dB=False)
Etau0 = M.tdd.ch3.Etau0(tau0=M.de[2])
tau_moy = M.tdd.ch3.tau_moy(alpha)
tau_rms = M.tdd.ch3.tau_rms(alpha)
Epercent = M.tdd.ch3.Epercent()
toa_max = M.tdd.ch3.toa_max(nint)
toa_th = M.tdd.ch3.toa_th(thlos, thnlos, visibility=M.type[2])
toa_cum = M.tdd.ch3.toa_cum(thcum)
#toa_cum_tmtm = M.tdd.ch3.toa_cum_tmtm()
#toa_cum_tm = M.tdd.ch3.toa_cum_tm()
#toa_cum_tmt = M.tdd.ch3.toa_cum_tmt()
#toa_new = M.tdd.ch3.toa_new()
toa_win = M.tdd.ch3.toa_win(w)
#toa_th_tmtm = M.tdd.ch3.toa_th_tmtm()
#toa_th_tm = M.tdd.ch3.toa_th_tm()
#toa_th_tmt = M.tdd.ch3.toa_th_tmt()
if k == 4:
Etot = M.tdd.ch4.Etot(tau0=M.de[3], dB=True)
Emax = M.tdd.ch4.Emax(Tint, sym, dB=True)
#Etot = M.tdd.ch4.Etot(tau0=M.de[3],dB=False)
#Emax = M.tdd.ch4.Emax(Tint,sym,dB=False)
Etau0 = M.tdd.ch4.Etau0(tau0=M.de[3])
tau_moy = M.tdd.ch4.tau_moy(alpha)
tau_rms = M.tdd.ch4.tau_rms(alpha)
Epercent = M.tdd.ch4.Epercent()
toa_max = M.tdd.ch4.toa_max(nint)
toa_th = M.tdd.ch4.toa_th(thlos, thnlos, visibility=M.type[3])
toa_cum = M.tdd.ch4.toa_cum(thcum)
#toa_cum_tmtm = M.tdd.ch4.toa_cum_tmtm()
#toa_cum_tm = M.tdd.ch4.toa_cum_tm()
#toa_cum_tmt = M.tdd.ch4.toa_cum_tmt()
#toa_new = M.tdd.ch4.toa_new()
toa_win = M.tdd.ch4.toa_win(w)
#toa_th_tmtm = M.tdd.ch4.toa_th_tmtm()
#toa_th_tm = M.tdd.ch4.toa_th_tm()
#toa_th_tmt = M.tdd.ch4.toa_th_tmt()
self.chan_param['Etot'] = Etot
self.chan_param['Emax'] = Emax
self.chan_param['Etau0'] = Etau0
self.chan_param['tau_moy'] = tau_moy
self.chan_param['tau_rms'] = tau_rms
self.chan_param['Epercent'] = Epercent
self.chan_param['toa_max'] = toa_max
self.chan_param['toa_th'] = toa_th
self.chan_param['toa_cum'] = toa_cum
#self.chan_param['toa_cum_tmtm']=toa_cum_tmtm
#self.chan_param['toa_cum_tm']=toa_cum_tm
#self.chan_param['toa_cum_tmt']=toa_cum_tmt
#self.chan_param['toa_new']=toa_new
self.chan_param['toa_win'] = toa_win
#self.chan_param['toa_th_tmtm']=toa_th_tmtm
#self.chan_param['toa_th_tm']=toa_th_tm
#self. chan_param['toa_th_tmt']=toa_th_tmt
#\hline
#\hline
#$E_{tot}$ & ~& & & \\
#\hline
# & & & & \\
# \hline
# & & & & \\
# \hline
# & & & &
#\\
#\hline
# & & & &
#\\
#\hline
# & & & &
#\\
#\hline
# & & & &
#\\
#\hline
# & & & &
#\\
#\hline
#\end{supertabular}
#\end{center}
#\bigskip
class UWBMeasure(PyLayers):
""" UWBMeasure class
Attributes
----------
tdd
Time domain deconv data
fdd
Freq domain deconv data
Date_Time
LQI
Operators
RAW_DATA
CAL_DATAip
Tx_height
Tx_position
Methods
-------
info() :
show()
emax()
etot()
TDoA()
Fingerprint()
fp() : calculate fingerprint
TOA()
Notes
-----
"""
def __init__(self, nTx=1, h=1, display=False):
""" object constructor
Parameters
----------
nTx : int
Tx index
h : int
height indicator (default 1 - 1.2m) 0 - 1.5 m
Examples
--------
.. plot::
:include-source:
>>> from pylayers.measures.mesuwb import *
>>> M1 = UWBMeasure(1)
>>> f,a = M1.show()
"""
super(UWBMeasure,self).__init__()
self.validindex = [1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,
23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,
43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,
62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,
81,82,83,84,85,89,90,91,92,93,94,95,96,97,98,99,100,101,103,
104,105,106,107,108,109,110,111,113,114,116,117,119,120,122,
123,124,125,126,127,128,129,133,134,136,137,138,139,140,141,
142,143,144,145,146,147,162,163,164,165,166,167,168,169,170,
171,172,173,174,175,176,177,179,180,181,182,183,184,185,186,
188,189,199,200,201,202,203,204,205,206,207,208,209,210,211,
212,213,214,215,216,217,218,219,220,221,222,223,227,228,229,
230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,
245,246,247,248,249,250,251,252,253,258,259,266,267,268,269,
270,271,272,273,274,275,276,277,278,279,297,298,299,300,301,
302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,
317,318,319,320,321,322,323,324,325,326,327,328,329,330,332,
333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,
348,349,350,351,352,353,354,355,356,360,361,362,363,364,365,
366,367,368,369,370,371,372,373,374,375]
# Raw data matlab file reading
Tx, Rx = ptw1()
visi = visibility()
if not os.path.exists(mesdir):
raise AttributeError('Incorrect Measure directory set in $MESDIR')
filename = mesname(nTx, mesdir, h)
if os.path.exists(filename) :
b = io.loadmat(filename)
# Conversion
self.CAL_DATA = CAL_DATA(b['CAL_DATA'][0][0])
self.RAW_DATA = RAW_DATA(b['RAW_DATA'][0][0])
#T = b['DECONV_DATA'][0][0].TIME_DOMAIN[0][0]
#F = b['DECONV_DATA'][0][0].FREQ_DOMAIN[0][0]
#self.tdd = Tdd(T)
#self.fdd = Fdd(F)
self.tdd = Tdd(b['DECONV_DATA'][0][0][0][0][0])
self.fdd = Fdd(b['DECONV_DATA'][0][0][1][0][0])
self.Date_Time = b['Date_Time']
self.LQI = {}
#self.LQI['Method1_CH1']=b['LQI'][0][0].Method1_CH1[0][0]
#self.LQI['Method1_CH2']=b['LQI'][0][0].Method1_CH2[0][0]
#self.LQI['Method1_CH3']=b['LQI'][0][0].Method1_CH3[0][0]
#self.LQI['Method1_CH4']=b['LQI'][0][0].Method1_CH4[0][0]
#self.LQI['Method2_CH1']=b['LQI'][0][0].Method2_CH1[0][0]
#self.LQI['Method2_CH2']=b['LQI'][0][0].Method2_CH2[0][0]
#self.LQI['Method2_CH3']=b['LQI'][0][0].Method2_CH3[0][0]
#self.LQI['Method2_CH4']=b['LQI'][0][0].Method2_CH4[0][0]
self.LQI['Method1_CH1'] = b['LQI'][0][0][0][0][0]
self.LQI['Method1_CH2'] = b['LQI'][0][0][1][0][0]
self.LQI['Method1_CH3'] = b['LQI'][0][0][2][0][0]
self.LQI['Method1_CH4'] = b['LQI'][0][0][3][0][0]
self.LQI['Method2_CH1'] = b['LQI'][0][0][4][0][0]
self.LQI['Method2_CH2'] = b['LQI'][0][0][5][0][0]
self.LQI['Method2_CH3'] = b['LQI'][0][0][6][0][0]
self.LQI['Method2_CH4'] = b['LQI'][0][0][7][0][0]
lqi1 = self.LQI['Method1_CH1']
lqi2 = self.LQI['Method1_CH2']
lqi3 = self.LQI['Method1_CH3']
lqi4 = self.LQI['Method1_CH4']
self.lqi = np.array([lqi1, lqi2, lqi3, lqi4])
self.Operators = b['Operators']
self.Tx_height = b['Tx_height']
self.Tx_position = b['Tx_position']
# appending geometrical information
if self.Tx_height == '120cm':
d = 1.2
else:
d = 1.5
self.rx = Rx
self.tx = np.hstack((Tx[nTx, :], d))
self.ntx = nTx
# calculate delay
d1 = pyu.delay(self.rx[1, :], self.tx)
d2 = pyu.delay(self.rx[2, :], self.tx)
d3 = pyu.delay(self.rx[3, :], self.tx)
d4 = pyu.delay(self.rx[4, :], self.tx)
self.de = np.array([d1, d2, d3, d4])
#display measurements
if display:
self.tdd.show(self.de)
#calculate angle
ang1 = geu.angular(self.tx, self.rx[1, :])
ang2 = geu.angular(self.tx, self.rx[2, :])
ang3 = geu.angular(self.tx, self.rx[3, :])
ang4 = geu.angular(self.tx, self.rx[4, :])
self.ag = np.array([ang1, ang2, ang3, ang4])
type1 = visi[0][nTx - 1]
type2 = visi[1][nTx - 1]
type3 = visi[2][nTx - 1]
type4 = visi[3][nTx - 1]
self.type = [type1, type2, type3, type4]
self.valid = True
else:
raise AttributeError("non valid Rx point ")
self.valid = False
def __repr__(self):
st = ''
st = st + "Date_Time : " + self.Date_Time[0]+'\n'
st = st + "Tx_height : " + self.Tx_height[0]+'\n'
st = st + "Tx_position :" + self.Tx_position[0]+'\n'
st = st + "Tx : " + str(self.tx)+'\n'
return(st)
def info(self):
print( "Date_Time :", self.Date_Time)
#print "Operators : ", self.Operators
print( "Tx_height :", self.Tx_height)
print( "Tx_position :", self.Tx_position)
print( "Tx : ", self.tx)
for i in range(4):
print( "------Tx" + str(i + 1) + " ------")
print( "delays (ns):", self.de[i])
print( "range (meters):", self.de[i] * 0.3)
print( "visibility :", self.type[i])
print( "angular (degree) :", self.ag[i])
if i == 0:
print( "LQI Meth1", self.LQI['Method1_CH1'], " (dB)")
print( "LQI Meth2", self.LQI['Method2_CH1'], " (dB)")
if i == 1:
print( "LQI Meth1", self.LQI['Method1_CH2'], " (dB)")
print( "LQI Meth2", self.LQI['Method2_CH2'], " (dB)")
if i == 2:
print( "LQI Meth1", self.LQI['Method1_CH3'], " (dB)")
print( "LQI Meth2", self.LQI['Method2_CH3'], " (dB)")
if i == 3:
print( "LQI Meth1", self.LQI['Method1_CH4'], " (dB)")
print( "LQI Meth2", self.LQI['Method2_CH4'], " (dB)")
def show(self,fig=[],delay=np.array([[0], [0], [0], [0]]),display=True,
col=['k', 'b', 'g', 'c'],xmin=0, xmax=100, C=0, NC=1,typ='v'):
""" show measurement in time domain
Parameters
----------
delay : np.array(1,4)
display
optional
col
optional
xmin
optional
xmax
optional
C
optional
NC
optional
"""
if fig ==[]:
fig = plt.gcf()
title = []
tit = ['Rx 1 : '+str(self.rx[1,:])+' Tx '+str(self.ntx)+ ': '+str(self.tx),
'Rx 2 : '+str(self.rx[2,:]),
'Rx 3 : '+str(self.rx[3,:]),
'Rx 4 : '+str(self.rx[4,:])
]
f,a = self.tdd.show(delay=delay,
display = display,
title = tit,
col = col,
xmin=xmin,
xmax=xmax,
typ='v',
fig=fig)
return f,a
def Epercent(self):
epercent1 = self.tdd.ch1.Epercent()
epercent2 = self.tdd.ch2.Epercent()
epercent3 = self.tdd.ch3.Epercent()
epercent4 = self.tdd.ch4.Epercent()
epercent = np.array([epercent1, epercent2, epercent3, epercent4])
return epercent
def toa_max2(self):
""" calculate toa_max (meth2)
"""
toa_max21 = self.tdd.ch1.toa_max2()
toa_max22 = self.tdd.ch2.toa_max2()
toa_max23 = self.tdd.ch3.toa_max2()
toa_max24 = self.tdd.ch4.toa_max2()
def tau_Emax(self):
""" calculate the delay of energy peak
"""
tau_Emax1 = self.tdd.ch1.tau_Emax()
tau_Emax2 = self.tdd.ch2.tau_Emax()
tau_Emax3 = self.tdd.ch3.tau_Emax()
tau_Emax4 = self.tdd.ch4.tau_Emax()
tau_Emax = np.array([tau_Emax1, tau_Emax2,
tau_Emax3, tau_Emax4])
return tau_Emax
def tau_moy(self, display=False):
""" calculate mean excess delay
"""
taum1 = self.tdd.ch1.tau_moy()
taum2 = self.tdd.ch2.tau_moy()
taum3 = self.tdd.ch3.tau_moy()
taum4 = self.tdd.ch4.tau_moy()
taum = np.array([taum1, taum2, taum3, taum4])
if display:
self.tdd.show(taum)
return taum
def tau_rms(self, display=False):
""" calculate the rms delay spread
"""
taurms1 = self.tdd.ch1.tau_rms()
taurms2 = self.tdd.ch2.tau_rms()
taurms3 = self.tdd.ch3.tau_rms()
taurms4 = self.tdd.ch4.tau_rms()
taurms = np.array([taurms1, taurms2, taurms3, taurms4])
if display:
self.tdd.show_span(self.tau_moy(display=False), taurms)
return taurms
def toa_new(self, display=False):
""" descendant threshold based toa estimation
"""
toa1 = self.tdd.ch1.toa_new()
toa2 = self.tdd.ch2.toa_new()
toa3 = self.tdd.ch3.toa_new()
toa4 = self.tdd.ch4.toa_new()
toa = np.array([toa1, toa2, toa3, toa4])
if display:
self.tdd.show(toa)
return toa
def toa_win(self, n=9, display=False):
""" descendant threshold based toa estimation
Parameters
----------
n : key parameter n = 9
display : False
"""
toa1 = self.tdd.ch1.toa_win(w=n)
toa2 = self.tdd.ch2.toa_win(w=n)
toa3 = self.tdd.ch3.toa_win(w=n)
toa4 = self.tdd.ch4.toa_win(w=n)
toa = np.array([toa1, toa2, toa3, toa4])
if display:
self.tdd.show(toa)
return toa
def toa_max(self, n=6, display=False):
""" descendant threshold based toa estimation
Parameters
----------
n : integer
(default 6)
"""
toa1 = self.tdd.ch1.toa_max(nint=n)
toa2 = self.tdd.ch2.toa_max(nint=n)
toa3 = self.tdd.ch3.toa_max(nint=n)
toa4 = self.tdd.ch4.toa_max(nint=n)
toa = np.array([toa1, toa2, toa3, toa4])
if display:
self.tdd.show(delay=toa)
return toa
def toa_th(self, r, k, display=False):
""" threshold based toa estimation using energy peak
Parameters
----------
r : float
threshold los
k : float
threshold nlos
"""
toa1 = self.tdd.ch1.toa_th(visibility=self.type[0], thlos=r, thnlos=k)
toa2 = self.tdd.ch2.toa_th(visibility=self.type[1], thlos=r, thnlos=k)
toa3 = self.tdd.ch3.toa_th(visibility=self.type[2], thlos=r, thnlos=k)
toa4 = self.tdd.ch4.toa_th(visibility=self.type[3], thlos=r, thnlos=k)
toa = np.array([toa1, toa2, toa3, toa4])
if display:
self.tdd.show(toa)
return toa
def toa_cum(self, n, display=False):
""" threshold based toa estimation using cumulative energy
Parameters
----------
n : int
display : boolean
"""
toa1 = self.tdd.ch1.toa_cum(th=n)
toa2 = self.tdd.ch2.toa_cum(th=n)
toa3 = self.tdd.ch3.toa_cum(th=n)
toa4 = self.tdd.ch4.toa_cum(th=n)
toa = np.array([toa1, toa2, toa3, toa4])
if display:
self.tdd.show(toa)
return toa
def taumax(self):
"""
"""
tmax1 = self.tdd.ch1.taumax()
tmax2 = self.tdd.ch2.taumax()
tmax3 = self.tdd.ch3.taumax()
tmax4 = self.tdd.ch4.taumax()
taumx = np.array([tmax1, tmax2, tmax3, tmax4])
return taumx
def Emax(self, Tint=1, sym=0.25, dB=True):
""" calculate maximum energy
Parameters
----------
Tint : float
sym :float
dB : boolean
"""
taumax = self.taumax()
Emax1 = self.tdd.ch1.Ewin(taumax[0], Tint=Tint, sym=sym, dB=dB)
Emax2 = self.tdd.ch2.Ewin(taumax[1], Tint=Tint, sym=sym, dB=dB)
Emax3 = self.tdd.ch3.Ewin(taumax[2], Tint=Tint, sym=sym, dB=dB)
Emax4 = self.tdd.ch4.Ewin(taumax[3], Tint=Tint, sym=sym, dB=dB)
emax = np.array([Emax1, Emax2, Emax3, Emax4])
return emax
def Etot(self,toffns=0.7,tdns=75,dB=True):
""" Calculate total energy for the 4 channels
Parameters
----------
toffns : float
time offset for selecting time window
tdns : float
time duration of the window
Notes
-----
This function gets the total energy of the channel
from [tau_0 + tofffset , tau_0 + toffset +tduration ]
"""
de0 = self.de[0] + toffns
de1 = self.de[1] + toffns
de2 = self.de[2] + toffns
de3 = self.de[3] + toffns
Etot1 = self.tdd.ch1.Etot(de0, de0 + tdns)
Etot2 = self.tdd.ch2.Etot(de1, de1 + tdns)
Etot3 = self.tdd.ch3.Etot(de2, de2 + tdns)
Etot4 = self.tdd.ch4.Etot(de3, de3 + tdns)
etot = np.array([Etot1, Etot2, Etot3, Etot4])
if dB==True:
etot = 10*np.log10(etot),
return etot
def Efirst(self, Tint=1, sym=0.25, dB=True):
""" calculate energy in first path
Parameters
----------
Tint : float
sym : float
dB : boolean
"""
# ???
#sig = 1/(2*np.sqrt(22))
#phi1 = self.tdd.ch1.correlate(self.tdd.tx,True)
#phi2 = self.tdd.ch2.correlate(self.tdd.tx,True)
#phi3 = self.tdd.ch3.correlate(self.tdd.tx,True)
#phi4 = self.tdd.ch4.correlate(self.tdd.tx,True)
#Efirst1 = phi1.corrgauss(sig).Efirst_loc(12,sum(self.tdd.tx.y * self.tdd.tx.y)* self.tdd.tx.dx())
#Efirst2 = phi2.corrgauss(sig).Efirst_loc(12,sum(self.tdd.tx.y * self.tdd.tx.y)* self.tdd.tx.dx())
#Efirst3 = phi3.corrgauss(sig).Efirst_loc(12,sum(self.tdd.tx.y * self.tdd.tx.y)* self.tdd.tx.dx())
#Efirst4 = phi4.corrgauss(sig).Efirst_loc(12,sum(self.tdd.tx.y * self.tdd.tx.y)* self.tdd.tx.dx())
toa = self.toa_win()
Ef1 = self.tdd.ch1.Ewin(tau=toa[0], Tint=Tint, sym=sym, dB=dB)
Ef2 = self.tdd.ch2.Ewin(tau=toa[1], Tint=Tint, sym=sym, dB=dB)
Ef3 = self.tdd.ch3.Ewin(tau=toa[2], Tint=Tint, sym=sym, dB=dB)
Ef4 = self.tdd.ch4.Ewin(tau=toa[3], Tint=Tint, sym=sym, dB=dB)
efirst = np.array([Ef1, Ef2, Ef3, Ef4])
return efirst
def Etau0(self, Tint=1, sym=0.25, dB=True):
""" calculate the energy around delay tau0
"""
Etau01 = self.tdd.ch1.Ewin(tau=self.de[0], Tint=Tint, sym=sym, dB=dB)
Etau02 = self.tdd.ch2.Ewin(tau=self.de[1], Tint=Tint, sym=sym, dB=dB)
Etau03 = self.tdd.ch3.Ewin(tau=self.de[2], Tint=Tint, sym=sym, dB=dB)
Etau04 = self.tdd.ch4.Ewin(tau=self.de[3], Tint=Tint, sym=sym, dB=dB)
etau0 = np.array([Etau01, Etau02, Etau03, Etau04])
return etau0
def ecdf(self, Tnoise=10, rem_noise=True, in_positivity=False, display=False, normalize=True, delay=0):
""" calculate energy cumulative density function
Parameters
----------
Tnoise
rem_noise
in_positivity
display
normalize
delay
"""
ecdf1, var1 = self.tdd.ch1.ecdf(delay=self.de[0])
ecdf2, var2 = self.tdd.ch2.ecdf(delay=self.de[1])
ecdf3, var3 = self.tdd.ch3.ecdf(delay=self.de[2])
ecdf4, var4 = self.tdd.ch4.ecdf(delay=self.de[3])
ecdf = np.array([ecdf1, ecdf2, ecdf3, ecdf4])
var = np.array([var1, var2, var3, var4])
return ecdf, var
def tdelay(self):
""" build an array with delay values
Returns
-------
t2 : np.array
[tau0 , tau_th , toa_cum , toa_max , tau_moy ,tau_rms,
tau_moy+tau_rms]
"""
tau0 = self.de
tau_moy = np.array([self.F1.chan_param['tau_moy'],
self.F2.chan_param['tau_moy'],
self.F3.chan_param['tau_moy'],
self.F4.chan_param['tau_moy']])
tau_rms = np.array([self.F1.chan_param['tau_rms'],
self.F2.chan_param['tau_rms'],
self.F3.chan_param['tau_rms'],
self.F4.chan_param['tau_rms']])
toa_cum = np.array([self.F1.chan_param['toa_cum'],
self.F2.chan_param['toa_cum'],
self.F3.chan_param['toa_cum'],
self.F4.chan_param['toa_cum']])
toa_th = np.array([self.F1.chan_param['toa_th'],
self.F2.chan_param['toa_th'],
self.F3.chan_param['toa_th'],
self.F4.chan_param['toa_th']])
toa_max = np.array([self.F1.chan_param['toa_max'],
self.F2.chan_param['toa_max'],
self.F3.chan_param['toa_max'],
self.F4.chan_param['toa_max']])
t1 = vstack((tau0, toa_th, toa_cum, toa_max, tau_moy -
tau_rms, tau_moy + tau_rms))
t2 = t1.T
return(t2)
def fp(self, alpha=0.1):
""" build fingerprint
Parameters
----------
alpha : float
alpha is a quantile parameter for taum and taurms calculation
"""
self.F1 = FP(self, 1, alpha=alpha)
self.F2 = FP(self, 2, alpha=alpha)
self.F3 = FP(self, 3, alpha=alpha)
self.F4 = FP(self, 4, alpha=alpha)
def outlatex(self, S):
""" measurement output latex
M.outlatex(S)
S : a Simulation object
"""
tt = self.tdelay()
tt = np.array([[tt[0, 0]], [tt[1, 0]], [tt[2, 0]], [tt[3, 0]]])
self.show(tt, display=False)
fig = plt.gcf()
sp1 = fig.add_subplot(5, 1, 1)
S.indoor.show(fig, sp1)
sp1.plot(self.rx[1:, 0], self.rx[1:, 1], 'ob')
sp1.annotate('Rx1', xy=(self.rx[1, 0], self.rx[1, 1]))
sp1.annotate('Rx2', xy=(self.rx[2, 0], self.rx[2, 1]))
sp1.annotate('Rx3', xy=(self.rx[3, 0], self.rx[3, 1]))
sp1.annotate('Rx4', xy=(self.rx[4, 0], self.rx[4, 1]))
sp1.plot(hstack((self.tx[0], self.tx[0])),
hstack((self.tx[1], self.tx[1])), 'or')
title(self.Tx_position)
sz = fig.get_size_inches()
fig.set_size_inches(sz * 2.3)
ext1 = '.pdf'
ext2 = '.tex'
ext3 = '.png'
#
if self.tx[2] < 1.3:
h = 1
else:
h = 2
#
#filename='Tx'+self.Tx_position+'h'+str(h)
filename = str(h) + self.Tx_position
filename = filename.replace('P', '')
fig.savefig('./figures/' + filename + ext3, orientation='portrait')
fig.clf()
plt.close(fig)
plt.clf()
#fig.savefig('./figures/'+filename+ext1,orientation='portrait')
#clf() # very important to close the figure otherwise memory error
# entete='\\clearpage\\setcounter{page}{1}\\pagestyle{Standard} \n {\\centering '+ self.Tx_position
# position = ' $T_{x}=[%5.2f,%5.2f,%5.2f]$ \\par} {\\centering \\par} \n' % (self.tx[0] , self.tx[1] , self.tx[2])
# tfigure = '\\begin{figure}[htp]\n\\centering\n \\includegraphics[width=14.078cm,height=14.131cm]{'+filename+ext1+'}\n \\end{figure}\n'
#
# l1='\\begin{center}\n'
# l11='\\end{center}\n'
# l2='\\tablehead{}\n'
# l3='\\begin{supertabular}{|l|l|l|l|l|}\n'
# l33='\\end{supertabular}\n'
# l4='\\hline\n'
# l5='Parameter & $Rx_1$ & $Rx_2$ &$Rx_3$ &$Rx_4$ \\\\\n'
#
# d1 = '%5.2f' % self.F1.metadata['distance']
# d2 = '%5.2f' % self.F2.metadata['distance']
# d3 = '%5.2f' % self.F3.metadata['distance']
# d4 = '%5.2f' % self.F4.metadata['distance']
#
# t1 = '%5.2f' % self.F1.metadata['delay']
# t2 = '%5.2f' % self.F2.metadata['delay']
# t3 = '%5.2f' % self.F3.metadata['delay']
# t4 = '%5.2f' % self.F4.metadata['delay']
#
# ldistance='distance (m) & ' + d1 +'&' + d2 +'&' + d3 +'&' + d4 +' \\\\\n'
# ldelay ='$\\tau_0$ (ns) & ' + t1 +'&' + t2 +'&' + t3 +'&' + t4 +' \\\\\n'
#
# Etot1 = '%5.3f' % self.F1.chan_param['Etot']
# Etot2 = '%5.3f' % self.F2.chan_param['Etot']
# Etot3 = '%5.3f' % self.F3.chan_param['Etot']
# Etot4 = '%5.3f' % self.F4.chan_param['Etot']
# lEtot='$E_{tot}$ (dBJ) & ' + Etot1 +'&' + Etot2 +'&' + Etot3 +'&' + Etot4 +' \\\\\n'
#
# Emax1 = '%5.3f' % self.F1.chan_param['Emax']
# Emax2 = '%5.3f' % self.F2.chan_param['Emax']
# Emax3 = '%5.3f' % self.F3.chan_param['Emax']
# Emax4 = '%5.3f' % self.F4.chan_param['Emax']
# lEmax='$E_{max}$ (dBJ) & ' + Emax1 +' &' + Emax2 +'&' + Emax3 +' &' + Emax4 +' \\\\\n'
#
# tau_moy1 = '%5.3f' % self.F1.chan_param['tau_moy']
# tau_moy2 = '%5.3f' % self.F2.chan_param['tau_moy']
# tau_moy3 = '%5.3f' % self.F3.chan_param['tau_moy']
# tau_moy4 = '%5.3f' % self.F4.chan_param['tau_moy']
# ltau_moy='$\\tau_{m}$ (ns) & ' + tau_moy1 +'&' + tau_moy2 +'&' + tau_moy3 +'&' + tau_moy4 +' \\\\\n'
#
#
# tau_rms1 = '%5.3f' % self.F1.chan_param['tau_rms']
# tau_rms2 = '%5.3f' % self.F2.chan_param['tau_rms']
# tau_rms3 = '%5.3f' % self.F3.chan_param['tau_rms']
# tau_rms4 = '%5.3f' % self.F4.chan_param['tau_rms']
# ltau_rms='$\\tau_{rms}$ (ns) & ' + tau_rms1 +'&' + tau_rms2 +'&' + tau_rms3 +'&' + tau_rms4 +' \\\\\n'
#
# toa_max1 = '%5.3f' % self.F1.chan_param['toa_max']
# toa_max2 = '%5.3f' % self.F2.chan_param['toa_max']
# toa_max3 = '%5.3f' % self.F3.chan_param['toa_max']
# toa_max4 = '%5.3f' % self.F4.chan_param['toa_max']
# ltoa_max='$\\hat{\\tau}_{0}^{max}$ (ns) & ' + toa_max1 +'&' + toa_max2 +'&' + toa_max3 +'&' + toa_max4 +' \\\\\n'
#
# toa_th1 = '%5.3f' % self.F1.chan_param['toa_th']
# toa_th2 = '%5.3f' % self.F2.chan_param['toa_th']
# toa_th3 = '%5.3f' % self.F3.chan_param['toa_th']
# toa_th4 = '%5.3f' % self.F4.chan_param['toa_th']
# ltoa_th='$\\hat{\\tau}_{0}^{th}$ (ns) & ' + toa_th1 +'&' + toa_th2 +'&' + toa_th3 +'&' + toa_th4 +' \\\\\n'
#
#
# toa_cum1 = '%5.3f' % self.F1.chan_param['toa_cum']
# toa_cum2 = '%5.3f' % self.F2.chan_param['toa_cum']
# toa_cum3 = '%5.3f' % self.F3.chan_param['toa_cum']
# toa_cum4 = '%5.3f' % self.F4.chan_param['toa_cum']
# ltoa_cum='$\\hat{\\tau}_{0}^{cum}$ (ns) & ' + toa_cum1 +'&' + toa_cum2 +'&' + toa_cum3 +'&' + toa_cum4 +' \\\\\n'
#
# fd = open('./figures/'+filename+ext2,'w')
# fd.write(entete+position)
# fd.write(tfigure)
# fd.write(l1)
# fd.write(l2)
# fd.write(l3)
# fd.write(l4)
# fd.write(l5)
# fd.write(l4)
# fd.write(ldistance)
# fd.write(l4)
# fd.write(ldelay)
# fd.write(l4)
# fd.write(l4)
# fd.write(lEtot)
# fd.write(l4)
# fd.write(lEmax)
# fd.write(l4)
# fd.write(ltau_moy)
# fd.write(l4)
# fd.write(ltau_rms)
# fd.write(l4)
# fd.write(ltoa_th)
# fd.write(l4)
# fd.write(ltoa_cum)
# fd.write(l4)
# fd.write(ltoa_max)
# fd.write(l4)
# fd.write(l33)
# fd.write(l11)
# fd.close()
if __name__ == "__main__":
doctest.testmod()
|
buguen/pylayers
|
pylayers/measures/mesuwb.py
|
Python
|
lgpl-3.0
| 77,904
|
# ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Eos is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Eos. If not, see <http://www.gnu.org/licenses/>.
# ==============================================================================
from abc import ABCMeta
from abc import abstractmethod
class BaseDataHandler(metaclass=ABCMeta):
"""Abstract base class for data handlers.
Data handlers fetch 'raw' data from external source. Its abstract methods
are named against data structures (usually tables) they request, returning
iterable with rows, each row being dictionary in {field name: field value}
format.
"""
@abstractmethod
def get_evetypes(self):
"""
Fields:
typeID
groupID
capacity
mass
radius
volume
"""
...
@abstractmethod
def get_evegroups(self):
"""
Fields:
groupID
categoryID
"""
...
@abstractmethod
def get_dgmattribs(self):
"""
Fields:
attributeID
maxAttributeID
defaultValue
highIsGood
stackable
"""
...
@abstractmethod
def get_dgmtypeattribs(self):
"""
Fields:
typeID
attributeID
value
"""
...
@abstractmethod
def get_dgmeffects(self):
"""
Fields:
effectID
effectCategory
isOffensive
isAssistance
durationAttributeID
dischargeAttributeID
rangeAttributeID
falloffAttributeID
trackingSpeedAttributeID
fittingUsageChanceAttributeID
resistanceID
modifierInfo
"""
...
@abstractmethod
def get_dgmtypeeffects(self):
"""
Fields:
typeID
effectID
isDefault
"""
...
@abstractmethod
def get_dbuffcollections(self):
"""
Fields:
buffID
operationName
aggregateMode
itemModifiers
dogmaAttributeID
locationModifiers
dogmaAttributeID
locationGroupModifiers
dogmaAttributeID
groupID
locationRequiredSkillModifiers
dogmaAttributeID
skillID
Each data row can contain description of multiple modifiers. Each
modifier section is a list of rows, with each row containing specified
sub-fields.
"""
...
@abstractmethod
def get_skillreqs(self):
"""
Fields:
typeID
skillTypeID
level
"""
...
@abstractmethod
def get_typefighterabils(self):
"""
Fields:
typeID
abilityID
cooldownSeconds
chargeCount
"""
...
@abstractmethod
def get_version(self):
"""Get version of data.
Returns:
String with version.
"""
...
|
pyfa-org/eos
|
eos/data_handler/base.py
|
Python
|
lgpl-3.0
| 3,864
|
"""A minimal python interface to read Amptek's mca files"""
import re
import sys
import warnings
import matplotlib.pyplot as plt
import numpy as np
from scipy import interpolate
from scipy.stats import linregress
from io import open # python 2 compatibility
__author__ = 'Dih5'
__version__ = "0.4.0"
def _str_to_array(s, sep=" "):
"""
Convert a string to a numpy array
Args:
s (str): The string
sep (str): The separator in the string.
Returns:
(`numpy.ndarray`): The 2D array with the data.
"""
line_len = len(np.fromstring(s[:s.find('\n')], sep=sep))
return np.reshape(np.fromstring(s, sep=sep), (-1, line_len))
class Mca:
"""
A mca file.
Attributes:
raw(str): The text of the file.
calibration_points (`numpy.ndarray`): The 2D array with the calibration data or None if there is no such
information.
"""
def __init__(self, file, encoding='iso-8859-15', calibration=None):
"""
Load the content of a mca file.
Args:
file(str): The path to the file.
encoding (str): The encoding to use to read the file.
calibration (str or list): A path with a file used to read calibration or a 2D matrix describing
it.
"""
with open(file, "r", encoding=encoding) as f:
self.raw = f.read()
if calibration is None:
self.calibration_points = self.get_calibration_points()
elif isinstance(calibration, str):
self.calibration_points = Mca(calibration, encoding=encoding).get_calibration_points()
else:
self.calibration_points = np.asarray(calibration)
if self.calibration_points is None:
warnings.warn("Warning: no calibration data was found. Using channel number instead of energy")
def get_section(self, section):
"""
Find the str representing a section in the MCA file.
Args:
section(str): The name of the section to search for.
Returns:
(str): The text of the section or "" if not found.
"""
m = re.match(r"(?:.*)(^<<%s>>$)(.*?)(?:<<.*>>)" % section, self.raw, re.DOTALL + re.MULTILINE)
return m.group(2).strip() if m else ""
def get_variable(self, variable):
"""
Find the str representing a variable in the MCA file.
Args:
variable(str): The name of the variable to search for.
Returns:
(str): The text of the value or "" if not found.
"""
# There are various patterns used in the file, depending on the section
# Just try them all
# Pattern 1: FOO - VALUE
m = re.match(r"(?:.*)%s - (.*?)$" % variable, self.raw, re.DOTALL + re.MULTILINE)
# Pattern 2: FOO=VALUE; EXPLANATION
if not m:
m = re.match(r"(?:.*)%s=(.*?);" % variable, self.raw, re.DOTALL + re.MULTILINE)
# Pattern 3: FOO: VALUE
if not m:
m = re.match(r"(?:.*)%s: (.*?)$" % variable, self.raw, re.DOTALL + re.MULTILINE)
return m.group(1).strip() if m else ""
def get_calibration_points(self):
"""
Get the calibration points from the MCA file, regardless of the calibration parameter used to create the object.
Returns:
(`numpy.ndarray`): The 2D array with the data or None if there is no calibration data.
"""
cal = self.get_section("CALIBRATION")
if not cal:
return
cal = cal[cal.find('\n') + 1:] # remove first line
return _str_to_array(cal)
def get_calibration_function(self, method=None):
"""
Get a calibration function from the file.
Args:
method(str): The method to use. Available methods include:
* 'bestfit': A linear fit in the sense of least-squares (default).
* 'interpolation': Use a linear interpolation.
Returns:
(`Callable`): A function mapping channel number to energy. Note the first channel is number 0.
"""
points = self.calibration_points
if points is None:
# User was already warned when the object was created.
return np.vectorize(lambda x: x)
info = sys.version_info
if info[0] == 3 and info[1] < 4 or info[0] == 2 and info[1] < 7: # py2 < 2.7 or py3 < 3.4
extrapolation_support = False
else:
extrapolation_support = True
if method is None:
method = "bestfit"
if method == "interpolation" and not extrapolation_support:
warnings.warn("Warning: extrapolation not supported with active Python interpreter. Using best fit instead")
method = "bestfit"
if method == "interpolation":
return interpolate.interp1d(points[:, 0], points[:, 1], fill_value="extrapolate")
elif method == "bestfit":
slope, intercept, _, _, _ = linregress(points[:, 0], points[:, 1])
return np.vectorize(lambda x: slope * x + intercept)
else:
raise ValueError("Unknown method: %s" % method)
def get_points(self, calibration_method=None, trim_zeros=True, background=None):
"""
Get the points of the spectrum.
Args:
calibration_method (str): The method used for the calibration. See `get_calibration_function`.
trim_zeros (bool): Whether to remove values with no counts.
background (`Mca`): An spectrum describing a background to subtract from the returned points. The background
is scaled using the REAL_TIME parameters.
Returns:
(tuple): tuple containing:
x (List[float]): The list of x coordinates (mean bin energy).
y (List[float]): The list of y coordinates (counts in each bin).
"""
f = self.get_calibration_function(method=calibration_method)
yy = _str_to_array(self.get_section("DATA"))[:, 0]
if background:
background_yy = _str_to_array(background.get_section("DATA"))[:, 0]
yy -= background_yy * (float(self.get_variable("REAL_TIME")) / float(background.get_variable("REAL_TIME")))
xx = f(range(len(yy)))
if trim_zeros:
yy = np.trim_zeros(yy, 'f')
xx = xx[len(xx) - len(yy):]
yy = np.trim_zeros(yy, 'b')
removed_count = len(yy) - len(xx)
if removed_count: # Then removed_count is negative
xx = xx[:len(yy) - len(xx)]
return xx, yy
def get_counts(self, calibration_method=None, background=None):
"""
Get the number of counts in the spectrum.
Args:
calibration_method (str): The method used for the calibration. See `get_calibration_function`.
background (`Mca`): An spectrum describing a background to subtract from the returned points. The background
is scaled using the REAL_TIME parameters.
Returns:
(float): Number of counts in the spectrum.
"""
xx, yy = self.get_points(calibration_method=calibration_method, background=background)
return sum(yy)
def get_total_energy(self, calibration_method=None, background=None):
"""
Get the total energy in the spectrum.
Args:
calibration_method (str): The method used for the calibration. See `get_calibration_function`.
background (`Mca`): An spectrum describing a background to subtract from the returned points. The background
is scaled using the REAL_TIME parameters.
Returns:
(float): Total energy of counts in the spectrum, in the units set in the calibration.
If there is no calibration available, a meaningless number is returned.
"""
xx, yy = self.get_points(calibration_method=calibration_method, background=background)
return sum([x * y for x, y in zip(xx, yy)])
def plot(self, log_y=False, log_x=False, calibration_method=None, background=None):
"""
Show a plot of the spectrum.
Args:
log_y(bool): Whether the y-axis is in logarithmic scale.
log_x(bool): Whether the x-axis is in logarithmic scale.
calibration_method (str): The method used for the calibration. See `get_calibration_function`.
background (`Mca`): An spectrum describing a background to subtract from the returned points. The background
is scaled using the REAL_TIME parameters.
"""
xx, yy = self.get_points(calibration_method=calibration_method, background=background)
if log_y and log_x:
plt.loglog(xx, yy)
elif log_y:
plt.semilogy(xx, yy)
elif log_x:
plt.semilogx(xx, yy)
else:
plt.plot(xx, yy)
plt.show()
|
Dih5/mcareader
|
mcareader.py
|
Python
|
lgpl-3.0
| 9,128
|
import socket
import serial
import time
DEFAULT_SERIAL_PORT = "/dev/ttyUSB0"
DEFAULT_SERIAL_BAUD = 1000000
DEFAULT_UDP_ADDRESS = "127.0.0.1"
DEFAULT_UDP_PORT = 13320
def get_args():
"""
Get and parse arguments.
"""
import argparse
parser = argparse.ArgumentParser(description="Swift Navigation UDP Receive tool.")
parser.add_argument("-s", "--serial-port",
default=[DEFAULT_SERIAL_PORT], nargs=1,
help="specify the serial port to use.")
parser.add_argument("-b", "--baud",
default=[DEFAULT_SERIAL_BAUD], nargs=1,
help="specify the baud rate to use.")
parser.add_argument("-a", "--address",
default=[DEFAULT_UDP_ADDRESS], nargs=1,
help="specify the UDP IP Address to use.")
parser.add_argument("-p", "--udp-port",
default=[DEFAULT_UDP_PORT], nargs=1,
help="specify the UDP Port to use.")
return parser.parse_args()
def main():
"""Simple Command line interface for receiving observations over UDP and repeating
them over serial
"""
args = get_args()
port = int(args.udp_port[0])
address = args.address[0]
ser = serial.Serial(args.serial_port[0], args.baud[0])
sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) # UDP
sock.bind((args.address[0], args.udp_port[0]))
try:
while True:
data, addr = sock.recvfrom(1024)
if data:
ser.write(data)
except KeyboardInterrupt:
pass
if ser.isopen():
ser.close()
if __name__ == "__main__":
main()
|
mfine/piksi_tools
|
piksi_tools/ardupilot/udp_receive.py
|
Python
|
lgpl-3.0
| 1,635
|
from __future__ import division
from __future__ import print_function
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Adam.Dybbroe
# Author(s):
# Adam.Dybbroe <a000680@c14526.ad.smhi.se>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Test deriving the 3.9 relfectance of real data and make some imagery
"""
from mpop.satellites import GeostationaryFactory
from datetime import datetime
from mpop.projector import get_area_def
import sys
europe = get_area_def("EuropeCanary")
if len(sys.argv) == 1:
from my_msg_module import get_last_SEVIRI_date
tslot = get_last_SEVIRI_date(True, delay=5)
#tslot = datetime(2013, 10, 11, 11, 30)
#tslot = datetime(2015, 7, 7, 15, 10)
#tslot = datetime(2015, 10, 15, 11, 00)
elif len(sys.argv) == 6:
year = int(sys.argv[1])
month = int(sys.argv[2])
day = int(sys.argv[3])
hour = int(sys.argv[4])
minute = int(sys.argv[5])
tslot = datetime(year, month, day, hour, minute)
else:
print("\n*** Error, wrong number of input arguments")
print(" usage:")
print(" python demo_refl039.py")
print(" or")
print(" python demo_refl039.py 2017 2 17 14 35\n")
quit()
print("*** plot day microphysics RGB for ", str(tslot))
#glbd = GeostationaryFactory.create_scene("meteosat", "09", "seviri", tslot)
glbd = GeostationaryFactory.create_scene("Meteosat-9", "", "seviri", tslot)
print("... load sat data")
glbd.load(['VIS006','VIS008','IR_016','IR_039','IR_108','IR_134'], area_extent=europe.area_extent)
#area="EuropeCanaryS95"
area="EuroMercator" # blitzortung projection
local_data = glbd.project(area, precompute=True)
print("... read responce functions")
from pyspectral.near_infrared_reflectance import Calculator
from pyspectral.solar import (SolarIrradianceSpectrum, TOTAL_IRRADIANCE_SPECTRUM_2000ASTM)
solar_irr = SolarIrradianceSpectrum(TOTAL_IRRADIANCE_SPECTRUM_2000ASTM, dlambda=0.0005)
#from pyspectral.seviri_rsr import load
#seviri = load()
#rsr = {'wavelength': seviri['IR3.9']['wavelength'],
# 'response': seviri['IR3.9']['met10']['95']}
#sflux = solar_irr.solar_flux_over_band(rsr)
solar_irr = SolarIrradianceSpectrum(TOTAL_IRRADIANCE_SPECTRUM_2000ASTM, dlambda=0.0005)
from pyspectral.rsr_reader import RelativeSpectralResponse
seviri = RelativeSpectralResponse('Meteosat-10', 'seviri')
sflux = solar_irr.inband_solarflux(seviri.rsr['IR3.9'])
ch39 = local_data['IR_039']
ch11 = local_data['IR_108']
ch13 = local_data['IR_134']
lonlats = ch39.area.get_lonlats()
from pyorbital.astronomy import sun_zenith_angle
sunz = sun_zenith_angle(tslot, lonlats[0], lonlats[1])
print("... create look-up-table")
#refl37 = Calculator(rsr)
refl37 = Calculator('Meteosat-9', 'seviri', 'IR3.9', solar_flux=sflux)
#refl37.make_tb2rad_lut('/tmp/seviri_37_tb2rad_lut.npz')
# new syntax ->
#refl37.make_tb2rad_lut('IR3.9','/data/COALITION2/database/meteosat/SEVIRI/seviri_tb2rad_lut/')
print("... calculate reflectance")
r39 = refl37.reflectance_from_tbs(sunz, ch39.data, ch11.data, ch13.data) # , lookuptable='/tmp/seviri_37_tb2rad_lut.npz'
import numpy as np
r39 = np.ma.masked_array(r39, mask = np.logical_or(np.less(r39, -0.1),
np.greater(r39, 3.0)))
print("... show new RGB image")
from mpop.imageo.geo_image import GeoImage
img = GeoImage((local_data[0.8].data, local_data[1.6].data, r39 * 100), area,
tslot, crange=((0, 100), (0, 70), (0, 30)),
fill_value=(0, 0, 0), mode="RGB")
img.enhance(gamma=1.7)
img.show()
|
meteoswiss-mdr/monti-pytroll
|
scripts/demo_refl039.py
|
Python
|
lgpl-3.0
| 4,143
|
try:
import eigen
except ImportError:
import eigen3 as eigen
try:
import sva
except ImportError:
import spacevecalg as sva
import rbdyn
def makeZXZArm(isFixed = True, X_base = sva.PTransformd.Identity()):
mbg = rbdyn.MultiBodyGraph()
mass = 1.0
I = eigen.Matrix3d.Identity()
h = eigen.Vector3d.Zero()
rbi = sva.RBInertiad(mass, h, I)
b0 = rbdyn.Body(rbi, "b0")
b1 = rbdyn.Body(rbi, "b1")
b2 = rbdyn.Body(rbi, "b2")
b3 = rbdyn.Body(rbi, "b3")
mbg.addBody(b0)
mbg.addBody(b1)
mbg.addBody(b2)
mbg.addBody(b3)
j0 = rbdyn.Joint(rbdyn.Joint.Rev, eigen.Vector3d.UnitZ(), True, "j0")
j1 = rbdyn.Joint(rbdyn.Joint.Rev, eigen.Vector3d.UnitX(), True, "j1")
j2 = rbdyn.Joint(rbdyn.Joint.Rev, eigen.Vector3d.UnitZ(), True, "j2")
mbg.addJoint(j0)
mbg.addJoint(j1)
mbg.addJoint(j2)
to = sva.PTransformd(eigen.Vector3d(0, 0.5, 0))
_from = sva.PTransformd(eigen.Vector3d(0, 0, 0))
mbg.linkBodies("b0", sva.PTransformd.Identity(), "b1", _from, "j0")
mbg.linkBodies("b1", to, "b2", _from, "j1")
mbg.linkBodies("b2", to, "b3", _from, "j2")
mb = mbg.makeMultiBody("b0", isFixed, X_base)
mbc = rbdyn.MultiBodyConfig(mb)
mbc.zero(mb)
return mb,mbc
def makeEnv():
mbg = rbdyn.MultiBodyGraph()
mass = 1.0
I = eigen.Matrix3d.Identity()
h = eigen.Vector3d.Zero()
rbi = sva.RBInertiad(mass, h, I)
b0 = rbdyn.Body(rbi, "b0")
mbg.addBody(b0)
mb = mbg.makeMultiBody("b0", True)
mbc = rbdyn.MultiBodyConfig(mb)
mbc.zero(mb)
return mb,mbc
|
jorisv/Tasks
|
binding/python/tests/arms.py
|
Python
|
lgpl-3.0
| 1,512
|
from font import _font as font
out=""
for i in font:
out+="".join(i)
with open("font.ort", 'w') as fd:
fd.write("function() get_font -> ptr does\nreturn \"")
fd.write(out)
fd.write("\"\nfunction() get_colors -> ptr does\nreturn \"")
for item in [[0,0,0],
[0,0,170],
[0,170,0],
[0,170,170],
[170,0,0],
[170,0,170],
[170,85,0],
[170,170,170],
[85,85,85],
[85,85,255],
[85,255,85],
[85,255,255],
[255,85,85],
[255,85,255],
[255,255,85],
[255,255,255]]:
fd.write("".join("\\x"+hex(i)[2:]+("0"*(2-len(hex(i)[2:]))) for i in item))
fd.write("\"\n")
|
602p/orth
|
os/kernel/font/makefont.py
|
Python
|
lgpl-3.0
| 611
|
#!/usr/bin/env python
import pyaudio
import wave
import audioop
from collections import deque
import os
import urllib2
import urllib
import time
import math
import thread
import threading
import cv2
import sys
import httplib, urllib, base64
import numpy as np
import json
import Image
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import StringIO
from datetime import datetime
import paho.mqtt.client as paho
import logging
def on_connect(client, userdata, flags, rc):
print("CONNACK received with code %d." % (rc))
def on_publish(client, userdata, mid):
#print("mid: "+str(mid))
return
def on_subscribe(client, userdata, mid, granted_qos):
print("Subscribed: "+str(mid)+" "+str(granted_qos))
def on_message(client, userdata, msg):
print(msg.topic+" "+str(msg.qos)+" "+str(msg.payload))
client = paho.Client()
client.on_connect = on_connect
client.on_publish = on_publish
client.on_subscribe = on_subscribe
client.on_message = on_message
client.connect("192.168.2.15", 1883)
client.loop_start()
capture = None
myApiId = sys.argv[1]
headers = {
# Request headers
'Content-Type': 'application/octet-stream',
'Ocp-Apim-Subscription-Key': myApiId,
}
params = urllib.urlencode({
'faceRectangles': '',
})
lastTime = time.time()
lastTimeImageSave = time.time()
emotionKnown = False
analyseImage = False
emotionalConf = 0
status = ''
processDelaySec = 30
#Seconds between image save, -1 to disable
imageSavingPeriod = 5
soundsFolder = '/media/RouterMedia/BabyMonitor/sounds'
imagesFolder = '/media/RouterMedia/BabyMonitor/images'
#logsFolder = '/media/RouterMedia/BabyMonitor/logs'
logsFolder = '/home/pi/workspace/logs'
logging.basicConfig(filename= logsFolder + '/log_' + time.strftime("%Y-%m-%d_%H:%M:%S") + '.log', filemode='w',level=logging.DEBUG,format='%(asctime)s %(levelname)s:%(message)s - ', datefmt='%m/%d/%Y %I:%M:%S %p')
logging.info('BabyMonitor Initiated')
# Microphone stream config.
CHUNK = 2048 # CHUNKS of bytes to read each time from mic
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 16000
THRESHOLD = 5500 # The threshold intensity that defines silence
# and noise signal (an int. lower than THRESHOLD is silence).
SILENCE_LIMIT = 2 # Silence limit in seconds. The max ammount of seconds where
# only silence is recorded. When this time passes the
# recording finishes and the file is delivered.
PREV_AUDIO = 0.5 # Previous audio (in seconds) to prepend. When noise
# is detected, how much of previously recorded audio is
# prepended. This helps to prevent chopping the beggining
# of the phrase.
def audio_int(num_samples=50):
""" Gets average audio intensity of your mic sound. You can use it to get
average intensities while you're talking and/or silent. The average
is the avg of the 20% largest intensities recorded.
"""
print "Getting intensity values from mic."
p = pyaudio.PyAudio()
stream = p.open(format=FORMAT,
channels=CHANNELS,
rate=RATE,
input_device_index = 2,
input=True,
frames_per_buffer=CHUNK)
values = [math.sqrt(abs(audioop.avg(stream.read(CHUNK), 4)))
for x in range(num_samples)]
values = sorted(values, reverse=True)
r = sum(values[:int(num_samples * 0.2)]) / int(num_samples * 0.2)
print " Finished "
print " Average audio intensity is ", r
stream.close()
p.terminate()
return r
def listen_for_speech(threshold=THRESHOLD, num_phrases=-1):
"""
Listens to Microphone, extracts phrases from it and sends it to
Google's TTS service and returns response. a "phrase" is sound
surrounded by silence (according to threshold). num_phrases controls
how many phrases to process before finishing the listening process
(-1 for infinite).
"""
#Open stream
p = pyaudio.PyAudio()
stream = p.open(format=FORMAT,
channels=CHANNELS,
rate=RATE,
input=True,
input_device_index = 2,
frames_per_buffer=CHUNK)
logging.info("* Listening mic. ")
audio2send = []
cur_data = '' # current chunk of audio data
rel = RATE/CHUNK
slid_win = deque(maxlen=SILENCE_LIMIT * rel)
#Prepend audio from 0.5 seconds before noise was detected
prev_audio = deque(maxlen=PREV_AUDIO * rel)
started = False
n = num_phrases
response = []
firstTime = True
numReads = 0
while (num_phrases == -1 or n > 0):
try:
cur_data = stream.read(CHUNK)
except IOError as ex:
#if ex[1] != pyaudio.paInputOverflowed:
# raise
cur_data = '\x00' * CHUNK
except:
logging.error("Unexpected error:" + sys.exc_info()[0])
numReads = numReads + 1
if numReads < 5:
continue
slid_win.append(math.sqrt(abs(audioop.avg(cur_data, 4))))
# sliding window average of the noise level
# print slid_win[-1]
if(sum([x > THRESHOLD for x in slid_win]) > 0):
if(not started):
logging.info("Starting record of phrase")
started = True
audio2send.append(cur_data)
elif (started is True):
logging.info("Finished")
# The limit was reached, finish capture and deliver.
filename = save_speech(list(prev_audio) + audio2send, p)
(rc, mid) = client.publish("/home/babyMonitor/soundDetected", filename, qos=1)
logging.info("saved to :" + filename)
# Remove temp file. Comment line to review.
#os.remove(filename)
# Reset all
started = False
slid_win = deque(maxlen=SILENCE_LIMIT * rel)
prev_audio = deque(maxlen=0.5 * rel)
audio2send = []
n -= 1
logging.info("Listening ...")
else:
prev_audio.append(cur_data)
logging.info("* Done recording")
stream.close()
p.terminate()
return response
def save_speech(data, p):
""" Saves mic data to temporary WAV file. Returns filename of saved
file """
global soundsFolder
filename = soundsFolder + '/output_'+ time.strftime("%Y-%m-%d_%H-%M-%S") + '.wav'
# writes data to WAV file
data = ''.join(data)
wf = wave.open(filename, 'wb')
wf.setnchannels(1)
wf.setsampwidth(p.get_sample_size(pyaudio.paInt16))
wf.setframerate(16000) # TODO make this value a function parameter?
wf.writeframes(data)
wf.close()
return filename
class CamHandler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path.endswith('.jpg'):
global lastTime
global emotionKnown
global emotionalConf
global status
global processDelaySec
global imagesFolder
global imageSavingPeriod
global lastTimeImageSave
self.send_response(200)
self.send_header('Content-type','multipart/x-mixed-replace; boundary=--jpgboundary')
self.end_headers()
while True:
try:
ret,frame = capture.read()
if not ret:
continue
ret, im = cv2.imencode( '.jpg', frame )
bindata = np.array(im).tostring()
(rows,cols,channels) = frame.shape
if time.time() - lastTime > processDelaySec and analyseImage:
logging.info("Processing Frame")
try:
conn = httplib.HTTPSConnection('api.projectoxford.ai')
conn.request("POST", "/emotion/v1.0/recognize?%s" % params, bindata, headers)
response = conn.getresponse()
data = response.read()
conn.close()
d = json.loads(data)
#print d
if len(d)>0:
emotionalConf = 0
for sc in d[0]['scores']:
if d[0]['scores'][sc] > emotionalConf:
emotionalConf = d[0]['scores'][sc]
status = sc
#print sc, d[0]['scores'][sc]
emotionKnown = True
#print 'We are:',emotionalConf*100,'% confident that you are', status
except Exception as e:
logging.info("[Errno {0}] {1}".format(e.errno, e.strerror))
lastTime = time.time()
# Display the resulting frame
if emotionKnown:
cv2.putText(frame,"Last Emotion: "+ status + ", confidence level: " + str(int(emotionalConf*100)) + '% ', (10, rows -20), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255,255,255),1)
cv2.putText(frame,time.strftime("%Y-%m-%d %H:%M:%S"), (cols -200, rows -20), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255,255,255), 1)
(rc, mid) = client.publish("/home/babyMonitor/faceEmotion", str(status), qos=1)
else:
cv2.putText(frame,time.strftime("%Y-%m-%d %H:%M:%S"), (cols -200, rows -20), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255,255,255), 1)
if imageSavingPeriod != -1 and (time.time() - lastTimeImageSave) > imageSavingPeriod:
cv2.imwrite(imagesFolder + '/image_'+ time.strftime("%Y-%m-%d_%H:%M:%S") + '.png',frame)
lastTimeImageSave = time.time()
imgRGB=cv2.cvtColor(frame,cv2.COLOR_BGR2RGB)
jpg = Image.fromarray(imgRGB)
tmpFile = StringIO.StringIO()
jpg.save(tmpFile,'JPEG')
self.wfile.write("--jpgboundary")
self.send_header('Content-type','image/jpeg')
self.send_header('Content-length',str(tmpFile.len))
self.end_headers()
jpg.save(self.wfile,'JPEG')
#time.sleep(0.05)
except KeyboardInterrupt:
break
return
if self.path.endswith('.html'):
self.send_response(200)
self.send_header('Content-type','text/html')
self.end_headers()
self.wfile.write('<html><head></head><body>')
self.wfile.write('<img src="http://127.0.0.1:8080/cam.jpg"/>')
self.wfile.write('</body></html>')
return
def main():
global capture
capture = cv2.VideoCapture(0)
capture.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, 800);
capture.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, 600);
#capture.set(cv2.cv.CV_CAP_PROP_SATURATION,0.2);
global frame
try:
thread.start_new_thread( listen_for_speech, () )
# Use this to get the noise level and calibrate the threshold
#audio_int() # To measure your mic levels
except:
logging.error("Error: Unable to start thread")
try:
server = HTTPServer(('',8080),CamHandler)
logging.info("server started")
server.serve_forever()
except KeyboardInterrupt:
capture.release()
server.socket.close()
capture.release()
if(__name__ == '__main__'):
main()
|
liyazhuo/emotional_intelligence
|
babyMonitor.py
|
Python
|
lgpl-3.0
| 11,850
|
import os
import time
os.system('cls')
rows = 6
cols = 50
grid = []
for _ in range(rows):
grid.append([False] * cols)
for line in open('input.txt', 'r'):
if line.startswith('rect'):
(a, b) = line[4:].strip().split('x')
for i in range(int(b)):
for j in range(int(a)):
grid[i][j] = True
elif line.startswith('rotate row'):
(a, b) = line[13:].strip().split(' by ')
rowCopy = [False] * cols
for i in range(cols):
rowCopy[(i + int(b)) % cols] = grid[int(a)][i]
grid[int(a)] = rowCopy
elif line.startswith('rotate column'):
(a, b) = line[16:].strip().split(' by ')
colCopy = [False] * rows
for i in range(rows):
colCopy[(i + int(b)) % rows] = grid[i][int(a)]
for i in range(rows):
grid[i][int(a)] = colCopy[i]
print('\033[1;1H' + '\n'.join([''.join(['█' if cell else '░' for cell in row]) for row in grid]))
time.sleep(0.05)
print('Done!')
input()
|
ultramega/adventofcode2016
|
day08/part2.py
|
Python
|
unlicense
| 1,019
|
#!/usr/bin/env python
from sqlite3 import connect as sqconnect
from uuid import uuid4
from hashlib import sha512
from optparse import OptionParser
opts = OptionParser()
opts.add_option(
'-i', '--init-db', dest='initdb',
action='store_true', default=False,
help="Initialize the database"
)
opts.add_option(
'-r', '--reset-admin', dest='resetadmin',
action='store_true', default=False,
help="Reset admin password"
)
opts.add_option(
'-p', '--admin--password', dest='adminpw',
metavar='adminpw', default=None,
help="Admin password, if none is provided a random will be generated"
)
(options, args) = opts.parse_args()
salt = uuid4().hex
with open('./secrets', 'r') as sfile:
salt = sfile.read()
if options.adminpw is None:
adminPW = uuid4().hex
else:
adminPW = options.adminpw
adminPWhashed = sha512(adminPW + salt).hexdigest()
if not options.resetadmin and not options.initdb and options.adminpw is None:
opts.print_help()
def _create_db():
lconn = sqconnect('./data.db')
cur = lconn.cursor()
try:
cur.execute('''
CREATE TABLE
datasets(
datasetID INTEGER PRIMARY KEY not null,
type TEXT,
name TEXT,
description TEXT,
license TEXT,
path text,
created_at INTEGER,
updated_at INTEGER,
url text)
''')
lconn.commit()
except Exception as e:
print(e)
try:
cur.execute('''
CREATE TABLE
sameAs(
sameAsID INTEGER PRIMARY KEY not null,
datasetID INT,
librisid TEXT)
''')
lconn.commit()
except Exception as e:
print(e)
try:
cur.execute('''
CREATE TABLE
distribution(
distID INTEGER PRIMARY KEY not null,
datasetID INT,
encodingFormat TEXT)
''')
lconn.commit()
except Exception as e:
print(e)
try:
cur.execute('''
CREATE TABLE
provider(
prodviderID INTEGER PRIMARY KEY not null,
datasetID INT,
name TEXT,
email TEXT)
''')
except Exception as e:
print(e)
try:
cur.execute('''
CREATE TABLE
users(
userID INTEGER PRIMARY KEY not null,
username text unique,
password text
)
''')
lconn.commit()
except Exception as e:
print(e)
try:
cur.execute('''
INSERT INTO users
(username, password)
VALUES
(?, ?)
''', ('admin', adminPWhashed)
)
lconn.commit()
print("Admin password: %s" % adminPW)
except Exception as e:
print(e)
cur.close()
if options.initdb is True:
try:
_create_db()
print("Database initialized")
except Exception as e:
print("Could not initialize database: %s" % e)
if options.resetadmin is True:
try:
conn = sqconnect('./data.db')
cur = conn.cursor()
cur.execute('''
UPDATE users
SET password=?
WHERE ROWID=1
''', (adminPWhashed, )
)
conn.commit()
print("Admin password reset to %s" % adminPW)
except Exception as e:
print("Could not reset admin password %s" % e)
|
Kungbib/data.kb.se
|
flaskapp/initdb.py
|
Python
|
unlicense
| 3,461
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class DNA(object):
def __init__(self, dna):
self.dna = dna.upper()
def to_rna(self):
return self.dna.replace('T', 'U')
|
mvader/exercism-solutions
|
python/rna-transcription/dna.py
|
Python
|
unlicense
| 173
|
from threadly import Clock
class Stats(object):
def __init__(self):
self.__clock = Clock()
self.__startTime = self.__clock.accurate_time()
self.__totalRead = 0
self.__totalWrite = 0
def getTotalRead(self):
"""
Returns the total bytes read.
"""
return self.__totalRead
def getTotalWrite(self):
"""
Returns the total bytes writen.
"""
return self.__totalWrite
def getReadRate(self):
"""
Returns the bytes read per second.
"""
X = round(self.__totalRead/(self.__clock.accurate_time() - self.__startTime), 4)
if X > 0:
return X
else:
return 0
def getWriteRate(self):
"""
Returns the bytes written per second.
"""
X = round(self.__totalWrite/(self.__clock.accurate_time() - self.__startTime), 4)
if X > 0:
return X
else:
return 0
def _addRead(self, size):
self.__totalRead += size
def _addWrite(self, size):
self.__totalWrite += size
def noExcept(task, *args, **kwargs):
"""
Helper function that helps swallow exceptions.
"""
try:
task(*args, **kwargs)
except:
pass
|
lwahlmeier/python-litesockets
|
litesockets/stats.py
|
Python
|
unlicense
| 1,153
|
from sys import argv
if len(argv) == 1:
print("No input given. Assuming input is on the first line of \'input\'.")
input_string = open('input').readline()
else:
input_string = argv[1]
def get_twice_coordinate(string):
"""Returns the coordinates of the first place where you've been twice."""
string = string.split(', ')
x = 0
y = 0
degree = 0
clist = [[0, 0]]
for item in string:
item = [item[0], int(item[1:])]
if item[0] == "L":
degree += 90
degree %= 360
elif item[0] == "R":
degree -= 90
degree %= 360
else:
print('ERROR: illegal input:', item)
break
if degree == 0:
for _ in range(item[1]):
y += 1
if [x, y] in clist:
return (x, y)
clist.append([x, y])
elif degree == 90:
for _ in range(item[1]):
x -= 1
if [x, y] in clist:
return (x, y)
clist.append([x, y])
elif degree == 270:
for _ in range(item[1]):
x += 1
if [x, y] in clist:
return (x, y)
clist.append([x, y])
elif degree == 180:
for _ in range(item[1]):
y -= 1
if [x, y] in clist:
return (x, y)
clist.append([x, y])
else:
print('ERROR: illegal move', item)
break
return None
def get_shortest_route(x, y):
"""Returns the shortest route from (0, 0) to (x, y)"""
return abs(x) + abs(y)
(xc, yc) = get_twice_coordinate(input_string)
print("-----------------------------------------")
print(xc, yc)
print(get_shortest_route(xc, yc))
|
editicalu/adventofcode2016
|
01/b.py
|
Python
|
unlicense
| 1,836
|
import os
PROJECT_PATH = os.path.dirname(os.path.dirname(__file__))
BASE_PATH = os.path.dirname(PROJECT_PATH)
|
kowalskj/django_MY_PROGECT
|
MY_PROGECT/settings/paths.py
|
Python
|
unlicense
| 117
|
"""
houses support routines and the command-line dispatchers for carml
command.
"""
__all__ = []
__version__ = '20.0.0'
|
meejah/carml
|
carml/__init__.py
|
Python
|
unlicense
| 121
|
import logging
from google.appengine.api import search
from webapp2 import (
WSGIApplication as Endpoint,
Route as path,
RequestHandler as Service
)
from webapp2_extras.routes import (
PathPrefixRoute as base
)
import convert
import geofencesearch
from service import Service
class TerritoryService( Service ):
index = search.Index( 'territory' )
def makeDoc( self, params, doc_id = None ):
geopt_corners = convert.to_list_of_Search_API_GeoPoints( params.get( 'corners' ), 'comma-gapped-list/whitespace-gapped-pairs' )
centroid = geofencesearch.computeGeoPtCentroidFromGeoPtCorners( geopt_corners )
geojson = geofencesearch.create_geojson( {
'specific_type' : {
'name': 'Territory',
'alias' : 'ServiceArea'
},
'provider_name' : params.get( 'provider_name' ),
'service_price' : params.get( 'service_price' ),
}, geopt_corners )
return search.Document(
doc_id = doc_id,
fields = [
search.TextField( name='provider_name', value=params.get( 'provider_name' ) ),
search.NumberField( name='service_price', value=float( params.get( 'service_price' ) ) ),
search.TextField( name='corners', value=params.get( 'corners' ) ),
search.GeoField( name='centroid', value=centroid ),
search.TextField( name='geojson', value=geojson )
] )
def searchTerritoriesIntersectingLatLong( sef, lat, long ):
"""
make a query string using lat long and
search for territories intersect
"""
def processRequest( self, action, params ):
try:
return super( TerritoryService, self ).processRequest( action, params )
except BaseException as e:
logging.warn( "Action %s unsupported by superclass, Service. Attempting baseclass implementation." % action )
if action == 'latlongsearch':
geopoint = convert.to_Search_API_GeoPoint_or_raise( params.get( 'latlongquery' ) )
query = "distance(centroid, geopoint(%s, %s)) < %s" % ( str( geopoint.latitude ), str( geopoint.longitude ), str( geofencesearch.MAX_TERRITORY_RADIUS_M ) )
result = self.searchDoc( query )
return [ convert.to_dict( doc, 'x-search-api-doc' ) for doc in result ]
else:
raise TypeError( "Action %s must be latlongsearch, or %s" % ( action, str( e ) ) )
endpoint = Endpoint( [
base( r'/mozio-geofence', [
path( r'/api/territory', handler = TerritoryService ),
path( r'/api/territory/in/<input_format>', handler = TerritoryService ),
path( r'/api/territory/out/<output_format>', handler = TerritoryService ),
path( r'/api/territory/in/<input_format>/out/<output_format>', handler = TerritoryService )
] )
], debug = True )
|
dosaygo/mozio-geofence-api-hiring-project
|
api/territory.py
|
Python
|
unlicense
| 2,860
|
import unittest
import utils
from linkedlist import ListNode
# O(n) time. O(1) space. Two pointers
class Solution:
def partition(self, head: ListNode, x: int) -> ListNode:
dummy_lo = lo = ListNode(0)
dummy_hi = hi = ListNode(0)
while head:
if head.val < x:
lo.next = head
lo = head
else:
hi.next = head
hi = head
head = head.next
lo.next = dummy_hi.next
hi.next = None
return dummy_lo.next
class Test(unittest.TestCase):
def test(self):
utils.test(self, __file__, Solution,
process_args=self.process_args,
process_result=utils.linked_list_to_array)
@staticmethod
def process_args(args):
args.head = ListNode.from_array(args.head)
if __name__ == '__main__':
unittest.main()
|
chrisxue815/leetcode_python
|
problems/test_0086.py
|
Python
|
unlicense
| 905
|
"""
Clone of 2048 game.
"""
import random
# Directions, DO NOT MODIFY
UP = 1
DOWN = 2
LEFT = 3
RIGHT = 4
# Offsets for computing tile indices in each direction.
# DO NOT MODIFY this dictionary.
OFFSETS = {UP: (1, 0),
DOWN: (-1, 0),
LEFT: (0, 1),
RIGHT: (0, -1)}
def should_merge_tiles(line, last_tile_merged):
"""
Check if last two tiles in a line should be merged
"""
return len(line) > 1 and line[-1] == line[-2] \
and not last_tile_merged
def merge_tiles(line, last_tile_merged):
"""
Merge last two tiles in a line if necessary
Return resulting line and flag indication if the merge occured
"""
if should_merge_tiles(line, last_tile_merged):
line[-2] += line[-1]
line.pop()
last_tile_merged = True
else:
last_tile_merged = False
return line, last_tile_merged
def merge(line):
"""
Helper function that merges a single row or column in 2048
"""
merged_line = []
last_tile_merged = False
for tile in line:
if tile != 0:
merged_line.append(tile)
merged_line, last_tile_merged = merge_tiles(merged_line, last_tile_merged)
while len(merged_line) < len(line):
merged_line.append(0)
return merged_line
class TwentyFortyEight:
"""
Class to run the game logic.
"""
def __init__(self, grid_height, grid_width):
self.height = grid_height
self.width = grid_width
self.reset()
self.sides = {UP: [(0, col) for col in range(self.width)],
DOWN: [(self.height - 1, col) for col in range(self.width)],
LEFT: [(row, 0) for row in range(self.height)],
RIGHT: [(row, self.width - 1) for row in range(self.height)]}
def reset(self):
"""
Reset the game so the grid is empty.
"""
self.grid = [[0 for dummy_col in range(self.width)] for dummy_row in range(self.height)]
def __str__(self):
"""
Return a string representation of the grid for debugging.
"""
return '\n'.join([str(row) for row in self.grid])
def get_grid_height(self):
"""
Get the height of the board.
"""
return self.height
def get_grid_width(self):
"""
Get the width of the board.
"""
return self.width
def get_side(self, direction):
"""
Get one of the four sides on the grid,
as specified in direction parameter.
"""
return self.sides[direction]
def move(self, direction):
"""
Move all tiles in the given direction and add
a new tile if any tiles moved.
"""
side = self.get_side(direction)
grid_changed = False
for start_tile in side:
line = self.get_line(start_tile, OFFSETS[direction])
merged_line = merge(line)
grid_changed = self.set_line(start_tile, OFFSETS[direction], merged_line) or grid_changed
if grid_changed:
self.new_tile()
def new_tile(self):
"""
Create a new tile in a randomly selected empty
square. The tile should be 2 90% of the time and
4 10% of the time.
"""
value = 2 if random.random() < 0.9 else 4
empty_tiles = [(row, col) \
for col in range(self.width) \
for row in range(self.height) \
if self.get_tile(row, col) == 0]
if empty_tiles:
tile = random.choice(empty_tiles)
self.set_tile(tile[0], tile[1], value)
def set_tile(self, row, col, value):
"""
Set the tile at position row, col to have the given value.
"""
self.grid[row][col] = value
def get_tile(self, row, col):
"""
Return the value of the tile at position row, col.
"""
return self.grid[row][col]
def set_line(self, start_tile, offset, new_line):
"""
Set values of a line of tiles, starting at start_tile
and moving by one offset at a time.
Return flag indicating if line has changed comapred to it's previous state.
"""
row = start_tile[0]
col = start_tile[1]
line_changed = False
for new_value in new_line:
old_value = self.get_tile(row, col)
if old_value != new_value:
line_changed = True
self.set_tile(row, col, new_value)
row += offset[0]
col += offset[1]
return line_changed
def get_line(self, start_tile, offset):
"""
Return values of a line of tiles, starting at start_tile
and moving by one offset at a time
"""
row = start_tile[0]
col = start_tile[1]
line = []
while 0 <= row < self.height and 0 <= col < self.width:
line.append(self.get_tile(row, col))
row += offset[0]
col += offset[1]
return line
# import poc_2048_gui
# poc_2048_gui.run_gui(TwentyFortyEight(4, 4))
|
algenon/poc
|
src/game_2048.py
|
Python
|
unlicense
| 5,148
|
'''
Demo_2 sums up all the input number collected from the input and gives the average value of the inputs
'''
number = 0
i = 0
sum = 0
average = 0
n=0
print('please enter the numbers, if it equals to 0 or be less than 0, the input will end')
while True:
n = int(input('please enter a number: '))
if n <= 0:
break
sum = sum + n
number = number + 1
print('the sum of the numbers are: ', sum)
print('the average value of the numbers are: ',sum/number)
|
AlexYu-beta/Python_Study
|
Demo_2/Demo2_2.py
|
Python
|
unlicense
| 473
|
import gmaneLegacy as g, numpy as n
from scipy.stats import ks_2samp
a=n.random.random(1000)
b=n.random.random(1000)
b_=b+.3
aa=g.kolmogorovSmirnovDistance(a,b)
bb=ks_2samp(a,b)
aa_=g.kolmogorovSmirnovDistance(a,b_)
bb_=ks_2samp(a,b_)
b__=b+.07
aa2=g.kolmogorovSmirnovDistance(a,b__)
bb2=ks_2samp(a,b__)
|
ttm/gmaneLegacy
|
tests/compKolm.py
|
Python
|
unlicense
| 308
|
def a(x): # Объявление функции
n = 1 # Присваивание переменной n начального значения.
while n < len(x): # Задаётся условие для выполнения программы:"Пока порядковый номер элемента меньше количества элементов в списке:"
for i in range(len(x)-n): # Задается условие для выполнения программы:"После каждого прохода цикла по списку количество проверяемых на
# соответствие предыдущему условию объектов списка равно разности количества чисел в списке и количества выполненных циклов"
if x[i] > x[i+1]: # Задается условие: "Если при сравнении двух соседних чисел первое больше второго,
x[i],x[i+1] = x[i+1],x[i] # в списке они меняются местами"
print(x) # Визуальный вывод функции для проверки правильности.
n += 1 # Счетчик проходов(элементов, которые больше не участвуют в цикле)
a([1, 9, 4, 5, 7, 10, 6, 3, 2, 11])
|
Pattystar/school-orrepo
|
Homework-02.3.py
|
Python
|
apache-2.0
| 1,640
|
import threading
import unittest
import mock
import pytest
class TestThreadingHandler(unittest.TestCase):
def _makeOne(self, *args):
from kazoo.handlers.threading import SequentialThreadingHandler
return SequentialThreadingHandler(*args)
def _getAsync(self, *args):
from kazoo.handlers.threading import AsyncResult
return AsyncResult
def test_proper_threading(self):
h = self._makeOne()
h.start()
# In Python 3.3 _Event is gone, before Event is function
event_class = getattr(threading, '_Event', threading.Event)
assert isinstance(h.event_object(), event_class)
def test_matching_async(self):
h = self._makeOne()
h.start()
async_result = self._getAsync()
assert isinstance(h.async_result(), async_result)
def test_exception_raising(self):
h = self._makeOne()
with pytest.raises(h.timeout_exception):
raise h.timeout_exception("This is a timeout")
def test_double_start_stop(self):
h = self._makeOne()
h.start()
assert h._running is True
h.start()
h.stop()
h.stop()
assert h._running is False
def test_huge_file_descriptor(self):
import resource
import socket
from kazoo.handlers.utils import create_tcp_socket
try:
resource.setrlimit(resource.RLIMIT_NOFILE, (4096, 4096))
except (ValueError, resource.error):
self.skipTest('couldnt raise fd limit high enough')
fd = 0
socks = []
while fd < 4000:
sock = create_tcp_socket(socket)
fd = sock.fileno()
socks.append(sock)
h = self._makeOne()
h.start()
h.select(socks, [], [], 0)
h.stop()
for sock in socks:
sock.close()
class TestThreadingAsync(unittest.TestCase):
def _makeOne(self, *args):
from kazoo.handlers.threading import AsyncResult
return AsyncResult(*args)
def _makeHandler(self):
from kazoo.handlers.threading import SequentialThreadingHandler
return SequentialThreadingHandler()
def test_ready(self):
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
assert async_result.ready() is False
async_result.set('val')
assert async_result.ready() is True
assert async_result.successful() is True
assert async_result.exception is None
def test_callback_queued(self):
mock_handler = mock.Mock()
mock_handler.completion_queue = mock.Mock()
async_result = self._makeOne(mock_handler)
async_result.rawlink(lambda a: a)
async_result.set('val')
assert mock_handler.completion_queue.put.called
def test_set_exception(self):
mock_handler = mock.Mock()
mock_handler.completion_queue = mock.Mock()
async_result = self._makeOne(mock_handler)
async_result.rawlink(lambda a: a)
async_result.set_exception(ImportError('Error occured'))
assert isinstance(async_result.exception, ImportError)
assert mock_handler.completion_queue.put.called
def test_get_wait_while_setting(self):
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
lst = []
bv = threading.Event()
cv = threading.Event()
def wait_for_val():
bv.set()
val = async_result.get()
lst.append(val)
cv.set()
th = threading.Thread(target=wait_for_val)
th.start()
bv.wait()
async_result.set('fred')
cv.wait()
assert lst == ['fred']
th.join()
def test_get_with_nowait(self):
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
timeout = self._makeHandler().timeout_exception
with pytest.raises(timeout):
async_result.get(block=False)
with pytest.raises(timeout):
async_result.get_nowait()
def test_get_with_exception(self):
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
lst = []
bv = threading.Event()
cv = threading.Event()
def wait_for_val():
bv.set()
try:
val = async_result.get()
except ImportError:
lst.append('oops')
else:
lst.append(val)
cv.set()
th = threading.Thread(target=wait_for_val)
th.start()
bv.wait()
async_result.set_exception(ImportError)
cv.wait()
assert lst == ['oops']
th.join()
def test_wait(self):
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
lst = []
bv = threading.Event()
cv = threading.Event()
def wait_for_val():
bv.set()
try:
val = async_result.wait(10)
except ImportError:
lst.append('oops')
else:
lst.append(val)
cv.set()
th = threading.Thread(target=wait_for_val)
th.start()
bv.wait(10)
async_result.set("fred")
cv.wait(15)
assert lst == [True]
th.join()
def test_wait_race(self):
"""Test that there is no race condition in `IAsyncResult.wait()`.
Guards against the reappearance of:
https://github.com/python-zk/kazoo/issues/485
"""
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
async_result.set("immediate")
cv = threading.Event()
def wait_for_val():
# NB: should not sleep
async_result.wait(20)
cv.set()
th = threading.Thread(target=wait_for_val)
th.daemon = True
th.start()
# if the wait() didn't sleep (correctly), cv will be set quickly
# if it did sleep, the cv will not be set yet and this will timeout
cv.wait(10)
assert cv.is_set() is True
th.join()
def test_set_before_wait(self):
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
lst = []
cv = threading.Event()
async_result.set('fred')
def wait_for_val():
val = async_result.get()
lst.append(val)
cv.set()
th = threading.Thread(target=wait_for_val)
th.start()
cv.wait()
assert lst == ['fred']
th.join()
def test_set_exc_before_wait(self):
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
lst = []
cv = threading.Event()
async_result.set_exception(ImportError)
def wait_for_val():
try:
val = async_result.get()
except ImportError:
lst.append('ooops')
else:
lst.append(val)
cv.set()
th = threading.Thread(target=wait_for_val)
th.start()
cv.wait()
assert lst == ['ooops']
th.join()
def test_linkage(self):
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
cv = threading.Event()
lst = []
def add_on():
lst.append(True)
def wait_for_val():
async_result.get()
cv.set()
th = threading.Thread(target=wait_for_val)
th.start()
async_result.rawlink(add_on)
async_result.set(b'fred')
assert mock_handler.completion_queue.put.called
async_result.unlink(add_on)
cv.wait()
assert async_result.value == b'fred'
th.join()
def test_linkage_not_ready(self):
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
lst = []
def add_on():
lst.append(True)
async_result.set('fred')
assert not mock_handler.completion_queue.called
async_result.rawlink(add_on)
assert mock_handler.completion_queue.put.called
def test_link_and_unlink(self):
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
lst = []
def add_on():
lst.append(True)
async_result.rawlink(add_on)
assert not mock_handler.completion_queue.put.called
async_result.unlink(add_on)
async_result.set('fred')
assert not mock_handler.completion_queue.put.called
def test_captured_exception(self):
from kazoo.handlers.utils import capture_exceptions
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
@capture_exceptions(async_result)
def exceptional_function():
return 1 / 0
exceptional_function()
with pytest.raises(ZeroDivisionError):
async_result.get()
def test_no_capture_exceptions(self):
from kazoo.handlers.utils import capture_exceptions
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
lst = []
def add_on():
lst.append(True)
async_result.rawlink(add_on)
@capture_exceptions(async_result)
def regular_function():
return True
regular_function()
assert not mock_handler.completion_queue.put.called
def test_wraps(self):
from kazoo.handlers.utils import wrap
mock_handler = mock.Mock()
async_result = self._makeOne(mock_handler)
lst = []
def add_on(result):
lst.append(result.get())
async_result.rawlink(add_on)
@wrap(async_result)
def regular_function():
return 'hello'
assert regular_function() == 'hello'
assert mock_handler.completion_queue.put.called
assert async_result.get() == 'hello'
def test_multiple_callbacks(self):
mockback1 = mock.Mock(name='mockback1')
mockback2 = mock.Mock(name='mockback2')
handler = self._makeHandler()
handler.start()
async_result = self._makeOne(handler)
async_result.rawlink(mockback1)
async_result.rawlink(mockback2)
async_result.set('howdy')
async_result.wait()
handler.stop()
mockback2.assert_called_once_with(async_result)
mockback1.assert_called_once_with(async_result)
|
python-zk/kazoo
|
kazoo/tests/test_threading_handler.py
|
Python
|
apache-2.0
| 10,586
|
#!/usr/bin/env python
import os
import sys
__author__ = 'Douglas Anastasia'
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CloudPortal.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
cloudtp/Cloud-Portal
|
manage.py
|
Python
|
apache-2.0
| 288
|
# coding=utf-8
# Copyright 2021 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.
"""Unit tests for color_miner.py."""
from typing import Any, Dict, List, Optional
import unittest.mock as mock
from absl.testing import parameterized
import constants
from util import app_util
from util import color_miner
def _build_dummy_product(
properties_to_be_updated: Optional[Dict[str, Any]] = None,
properties_to_be_removed: Optional[List[str]] = None) -> Dict[str, Any]:
"""Builds a dummy product data.
Args:
properties_to_be_updated: The properties of a product and their values to be
updated in a request body.
properties_to_be_removed: The properties of a product that should be
removed.
Returns:
A dummy product data.
"""
product = {
'color': '',
'title': '',
'description': '',
'googleProductCategory': 'Apparel & Accessories',
}
if properties_to_be_updated:
for key, value in properties_to_be_updated.items():
product[key] = value
if properties_to_be_removed:
for key in properties_to_be_removed:
if key in product:
del product[key]
return product
@mock.patch('util.color_miner._COLOR_OPTIMIZER_CONFIG_FILE_NAME',
'color_optimizer_config_{}_test')
@mock.patch(
'util.color_miner._GPC_STRING_TO_ID_MAPPING_CONFIG_FILE_NAME',
'gpc_string_to_id_mapping_{}_test')
class ColorMinerTest(parameterized.TestCase):
def setUp(self):
super(ColorMinerTest, self).setUp()
app_util.setup_test_app()
@parameterized.named_parameters([
{
'testcase_name':
'mines_from_color',
'product':
_build_dummy_product(properties_to_be_updated={'color': '青'}),
'expected_standard_colors': ['青'],
'expected_unique_colors': ['青']
},
{
'testcase_name':
'mines_from_title',
'product':
_build_dummy_product(
properties_to_be_removed=['color'],
properties_to_be_updated={
'title': 'タイトルレッド青空'
}),
'expected_standard_colors': ['レッド'],
'expected_unique_colors': ['レッド']
},
{
'testcase_name':
'mines_two_colors_from_title',
'product':
_build_dummy_product(
properties_to_be_removed=['color'],
properties_to_be_updated={
'title': 'タイトルレッド・オレンジ'
}),
'expected_standard_colors': ['レッド', 'オレンジ'],
'expected_unique_colors': ['レッド', 'オレンジ']
},
{
'testcase_name':
'mines_three_colors_from_title',
'product':
_build_dummy_product(
properties_to_be_removed=['color'],
properties_to_be_updated={
'title':
'タイトルレッド・オレンジ・ブルー'
}),
'expected_standard_colors': [
'レッド', 'オレンジ', 'ブルー'
],
'expected_unique_colors': ['レッド', 'オレンジ', 'ブルー']
},
{
'testcase_name':
'mines_from_description',
'product':
_build_dummy_product(
properties_to_be_removed=['color'],
properties_to_be_updated={
'title': '',
'description': '詳細赤青空'
}),
'expected_standard_colors': ['赤'],
'expected_unique_colors': ['赤']
},
])
def test_mine_color_mines_color_with_language_ja(self, product,
expected_standard_colors,
expected_unique_colors):
miner = color_miner.ColorMiner(language='ja')
mined_standard_color, mined_unique_color = miner.mine_color(product)
self.assertCountEqual(expected_standard_colors, mined_standard_color)
self.assertCountEqual(expected_unique_colors, mined_unique_color)
@parameterized.named_parameters([
{
'testcase_name':
'mines_from_color',
'product':
_build_dummy_product(properties_to_be_updated={'color': 'Blue'}),
'expected_standard_colors': ['Blue'],
'expected_unique_colors': ['Blue']
},
{
'testcase_name':
'mines_from_title',
'product':
_build_dummy_product(
properties_to_be_removed=['color'],
properties_to_be_updated={'title': 'Title Red'}),
'expected_standard_colors': ['Red'],
'expected_unique_colors': ['Red']
},
{
'testcase_name':
'mines_two_colors_from_title',
'product':
_build_dummy_product(
properties_to_be_removed=['color'],
properties_to_be_updated={'title': 'Title Red Green'}),
'expected_standard_colors': ['Red', 'Green'],
'expected_unique_colors': ['Red', 'Green']
},
{
'testcase_name':
'mines_from_description',
'product':
_build_dummy_product(
properties_to_be_removed=['color'],
properties_to_be_updated={
'title': '',
'description': 'Description Green'
}),
'expected_standard_colors': ['Green'],
'expected_unique_colors': ['Green']
},
])
def test_mine_color_mines_color_with_language_en(self, product,
expected_standard_colors,
expected_unique_colors):
miner = color_miner.ColorMiner(language=constants.LANGUAGE_CODE_EN)
mined_standard_color, mined_unique_color = miner.mine_color(product)
self.assertCountEqual(expected_standard_colors, mined_standard_color)
self.assertCountEqual(expected_unique_colors, mined_unique_color)
@parameterized.named_parameters([
{
'testcase_name':
'mines_from_color',
'product':
_build_dummy_product(
properties_to_be_updated={'color': 'xanh nước biển'}),
'expected_standard_colors': ['xanh nước biển'],
'expected_unique_colors': ['xanh nước biển'],
},
{
'testcase_name':
'mines_from_title',
'product':
_build_dummy_product(
properties_to_be_removed=['color'],
properties_to_be_updated={'title': 'Title màu đỏ'}),
'expected_standard_colors': ['Màu Đỏ'],
'expected_unique_colors': ['Màu Đỏ'],
},
{
'testcase_name':
'mines_two_colors_from_title',
'product':
_build_dummy_product(
properties_to_be_removed=['color'],
properties_to_be_updated={
'title': 'Title màu đỏ xanh lá cây',
}),
'expected_standard_colors': ['Màu Đỏ', 'Xanh Lá Cây'],
'expected_unique_colors': ['Màu Đỏ', 'Xanh Lá Cây'],
},
{
'testcase_name':
'mines_from_description',
'product':
_build_dummy_product(
properties_to_be_removed=['color'],
properties_to_be_updated={
'title': '',
'description': 'Description xanh lá cây',
}),
'expected_standard_colors': ['Xanh Lá Cây'],
'expected_unique_colors': ['Xanh Lá Cây'],
},
])
def test_mine_color_mines_color_with_language_vi(self, product,
expected_standard_colors,
expected_unique_colors):
miner = color_miner.ColorMiner(language='vi')
mined_standard_color, mined_unique_color = miner.mine_color(product)
self.assertCountEqual(expected_standard_colors, mined_standard_color)
self.assertCountEqual(expected_unique_colors, mined_unique_color)
def test_mine_color_mines_three_colors_from_title_including_four_colors(self):
miner = color_miner.ColorMiner(language='ja')
product = _build_dummy_product(
properties_to_be_removed=['color'],
properties_to_be_updated={
'title':
'タイトル・レッド・オレンジ・ブルー・グリーン'
})
mined_standard_color, mined_unique_color = miner.mine_color(product)
self.assertLen(mined_standard_color, 3)
self.assertLen(mined_unique_color, 3)
@parameterized.named_parameters([{
'testcase_name': 'string',
'category': 'Software'
}, {
'testcase_name': 'number',
'category': '123456'
}])
def test_mine_color_does_not_mine_from_text_when_google_product_category_is_invalid(
self, category):
product = _build_dummy_product(
properties_to_be_removed=['color'],
properties_to_be_updated={
'title': 'タイトルレッド',
'description': '詳細赤',
'googleProductCategory': category
})
miner = color_miner.ColorMiner(language='ja')
mined_standard_color, mined_unique_color = miner.mine_color(product)
self.assertIsNone(mined_standard_color)
self.assertIsNone(mined_unique_color)
|
google/shoptimizer
|
shoptimizer_api/util/color_miner_test.py
|
Python
|
apache-2.0
| 10,200
|
# coding=utf-8
# Copyright 2022 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.
"""Pytree containing parameters for a pair of coupled Gaussian mixture models.
"""
import jax
import jax.numpy as jnp
from ott.core import sinkhorn
from ott.geometry import costs
from ott.geometry import geometry
from ott.geometry import pointcloud
from ott.tools.gaussian_mixture import gaussian_mixture
@jax.tree_util.register_pytree_node_class
class GaussianMixturePair:
"""Pytree for a coupled pair of Gaussian mixture models.
Includes methods used in estimating an optimal pairing between GMM components
using the Wasserstein-like method described in
https://arxiv.org/abs/1907.05254 as well as generalization that allows for
the re-weighting of components.
The Delon & Desolneux paper above proposes fitting a pair of GMMs to a pair
of point clouds in such a way that the sum of the log likelihood of the
points minus a weighted penalty involving a Wasserstein-like distance between
the GMMs. Their proposed algorithm involves using EM in which a balanced
Sinkhorn algorithm is used to estimate a coupling between the GMMs at each
step of EM.
Our generalization of this algorithm allows for a mismatch between the
marginals of the coupling and the GMM component weights. This mismatch can be
interpreted as components being re-weighted rather than being transported.
We penalize reweighting with a generalized KL-divergence penalty, and we give
the option to use the unbalanced Sinkhorn algorithm rather than the balanced
to compute the divergence between GMMs.
"""
def __init__(
self,
gmm0: gaussian_mixture.GaussianMixture,
gmm1: gaussian_mixture.GaussianMixture,
epsilon: float = 1.e-2,
tau: float = 1.,
lock_gmm1: bool = False,
):
"""Constructor.
When fitting a pair of coupled GMMs with *no* reweighting of components
using the algorithm in https://arxiv.org/abs/1907.05254, set tau = 1. The
coupling between components will be determined via the balanced Sinkhorn
algorithm.
When fitting a pair of coupled GMMs in which reweighting of components is
allowed, set tau to a value in (0, 1). The resulting coupling will penalize
the generalized KL divergence between the coupling's marginals and the GMM
component weights with a weight of rho = epsilon tau / (1 - tau).
Args:
gmm0: first GMM in the pair
gmm1: second GMM in the pair
epsilon: regularization weight to use for the Sinkhorn algorithm
tau: encodes the weight, rho, to use for the generalized KL divergence
between the coupling's marginals and GMM component weights as
rho = epsilon tau / (1 - tau)
lock_gmm1: indicates whether the parameters of gmm1 should be modified
during optimization
"""
self._gmm0 = gmm0
self._gmm1 = gmm1
self._epsilon = epsilon
self._tau = tau
self._lock_gmm1 = lock_gmm1
@property
def dtype(self):
return self.gmm0.dtype
@property
def gmm0(self):
return self._gmm0
@property
def gmm1(self):
return self._gmm1
@property
def epsilon(self):
return self._epsilon
@property
def tau(self):
return self._tau
@property
def rho(self):
return self.epsilon * self.tau / (1. - self.tau)
@property
def lock_gmm1(self):
return self._lock_gmm1
def get_bures_geometry(self) -> pointcloud.PointCloud:
"""Get a Bures Geometry for the two GMMs."""
mean0 = self.gmm0.loc
dimension = mean0.shape[-1]
cov0 = self.gmm0.covariance
cov0 = cov0.reshape(cov0.shape[:-2] + (dimension * dimension,))
x = jnp.concatenate([mean0, cov0], axis=-1)
mean1 = self.gmm1.loc
cov1 = self.gmm1.covariance
cov1 = cov1.reshape(cov1.shape[:-2] + (dimension * dimension,))
y = jnp.concatenate([mean1, cov1], axis=-1)
return pointcloud.PointCloud(
x=x, y=y,
cost_fn=costs.Bures(dimension=dimension),
epsilon=self.epsilon)
def get_cost_matrix(self) -> jnp.ndarray:
"""Get matrix of W2^2 costs between all pairs of (gmm0, gmm1) components."""
return self.get_bures_geometry().cost_matrix
def get_sinkhorn(self, cost_matrix: jnp.ndarray) -> sinkhorn.SinkhornOutput:
"""Get the output of ott.sinkhorn's method for a given cost matrix."""
# We use a Geometry here rather than the PointCloud created in
# in get_bures_geometry to avoid recomputing the cost matrix, since
# the cost matrix is quite expensive
geom = geometry.Geometry(cost_matrix=cost_matrix, epsilon=self.epsilon)
return sinkhorn.sinkhorn(
geom,
a=self.gmm0.component_weights,
b=self.gmm1.component_weights,
tau_a=self.tau, tau_b=self.tau)
def get_normalized_sinkhorn_coupling(
self,
sinkhorn_output: sinkhorn.SinkhornOutput,
) -> jnp.ndarray:
"""Get the normalized coupling matrix for the specified Sinkhorn output.
Args:
sinkhorn_output: Sinkhorn algorithm output as returned by get_sinkhorn()
Returns:
A coupling matrix that tells how much of the mass of each component of
gmm0 is mapped to each component of gmm1.
"""
return sinkhorn_output.matrix / jnp.sum(sinkhorn_output.matrix)
def tree_flatten(self):
"""Method used by jax.tree_util to flatten a GaussianMixturePair.
We control the subset of parameters that we will optimize in fit_gmm_pair
by selectively placing them in either children (the parameters to optimize)
or aux_data (the parameters to leave alone).
Returns:
A tuple of child pytrees and a dict of auxiliary data.
"""
children = [self.gmm0]
aux_data = {'epsilon': self.epsilon,
'tau': self.tau,
'lock_gmm1': self.lock_gmm1}
if self.lock_gmm1:
aux_data['gmm1'] = self.gmm1
else:
children.append(self.gmm1)
return tuple(children), aux_data
@classmethod
def tree_unflatten(cls, aux_data, children):
"""Method used by jax.tree_util to unflatten a GaussianMixturePair.
tree_flatten controls which parameters get optimized by placing them in
either children or aux_data; here we invert the process.
Args:
aux_data: auxiliary data that is passed to the constructor as kwargs
children: child pytrees passed to the constructor as args
Returns:
A GaussianMixturePair.
"""
children = list(children)
if 'gmm1' in aux_data:
gmm1 = aux_data.pop('gmm1')
children.insert(1, gmm1)
return cls(*children, **aux_data)
def __repr__(self):
class_name = type(self).__name__
children, aux = self.tree_flatten()
return '{}({})'.format(
class_name, ', '.join([repr(c) for c in children] +
[f'{k}: {repr(v)}' for k, v in aux.items()]))
def __hash__(self):
return jax.tree_util.tree_flatten(self).__hash__()
def __eq__(self, other):
return jax.tree_util.tree_flatten(self) == jax.tree_util.tree_flatten(other)
|
google-research/ott
|
ott/tools/gaussian_mixture/gaussian_mixture_pair.py
|
Python
|
apache-2.0
| 7,513
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: 使用函数实现设计模式
如果合理利用作为一等对象的函数,某些设计模式可以简化
"""
|
yidao620c/core-python
|
ch06design/__init__.py
|
Python
|
apache-2.0
| 174
|
"""The kraken integration."""
from __future__ import annotations
import asyncio
from datetime import timedelta
import logging
import async_timeout
import krakenex
import pykrakenapi
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_SCAN_INTERVAL
from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import (
CONF_TRACKED_ASSET_PAIRS,
DEFAULT_SCAN_INTERVAL,
DEFAULT_TRACKED_ASSET_PAIR,
DISPATCH_CONFIG_UPDATED,
DOMAIN,
KrakenResponse,
)
from .utils import get_tradable_asset_pairs
PLATFORMS = ["sensor"]
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up kraken from a config entry."""
kraken_data = KrakenData(hass, entry)
await kraken_data.async_setup()
hass.data[DOMAIN] = kraken_data
entry.async_on_unload(entry.add_update_listener(async_options_updated))
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(
config_entry, PLATFORMS
)
if unload_ok:
hass.data.pop(DOMAIN)
return unload_ok
class KrakenData:
"""Define an object to hold kraken data."""
def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
"""Initialize."""
self._hass = hass
self._config_entry = config_entry
self._api = pykrakenapi.KrakenAPI(krakenex.API(), retry=0, crl_sleep=0)
self.tradable_asset_pairs: dict[str, str] = {}
self.coordinator: DataUpdateCoordinator[KrakenResponse | None] | None = None
async def async_update(self) -> KrakenResponse | None:
"""Get the latest data from the Kraken.com REST API.
All tradeable asset pairs are retrieved, not the tracked asset pairs
selected by the user. This enables us to check for an unknown and
thus likely removed asset pair in sensor.py and only log a warning
once.
"""
try:
async with async_timeout.timeout(10):
return await self._hass.async_add_executor_job(self._get_kraken_data)
except pykrakenapi.pykrakenapi.KrakenAPIError as error:
if "Unknown asset pair" in str(error):
_LOGGER.info(
"Kraken.com reported an unknown asset pair. Refreshing list of tradable asset pairs"
)
await self._async_refresh_tradable_asset_pairs()
else:
raise UpdateFailed(
f"Unable to fetch data from Kraken.com: {error}"
) from error
except pykrakenapi.pykrakenapi.CallRateLimitError:
_LOGGER.warning(
"Exceeded the Kraken.com call rate limit. Increase the update interval to prevent this error"
)
return None
def _get_kraken_data(self) -> KrakenResponse:
websocket_name_pairs = self._get_websocket_name_asset_pairs()
ticker_df = self._api.get_ticker_information(websocket_name_pairs)
# Rename columns to their full name
ticker_df = ticker_df.rename(
columns={
"a": "ask",
"b": "bid",
"c": "last_trade_closed",
"v": "volume",
"p": "volume_weighted_average",
"t": "number_of_trades",
"l": "low",
"h": "high",
"o": "opening_price",
}
)
response_dict: KrakenResponse = ticker_df.transpose().to_dict()
return response_dict
async def _async_refresh_tradable_asset_pairs(self) -> None:
self.tradable_asset_pairs = await self._hass.async_add_executor_job(
get_tradable_asset_pairs, self._api
)
async def async_setup(self) -> None:
"""Set up the Kraken integration."""
if not self._config_entry.options:
options = {
CONF_SCAN_INTERVAL: DEFAULT_SCAN_INTERVAL,
CONF_TRACKED_ASSET_PAIRS: [DEFAULT_TRACKED_ASSET_PAIR],
}
self._hass.config_entries.async_update_entry(
self._config_entry, options=options
)
await self._async_refresh_tradable_asset_pairs()
await asyncio.sleep(1) # Wait 1 second to avoid triggering the CallRateLimiter
self.coordinator = DataUpdateCoordinator(
self._hass,
_LOGGER,
name=DOMAIN,
update_method=self.async_update,
update_interval=timedelta(
seconds=self._config_entry.options[CONF_SCAN_INTERVAL]
),
)
await self.coordinator.async_config_entry_first_refresh()
def _get_websocket_name_asset_pairs(self) -> str:
return ",".join(wsname for wsname in self.tradable_asset_pairs.values())
def set_update_interval(self, update_interval: int) -> None:
"""Set the coordinator update_interval to the supplied update_interval."""
if self.coordinator is not None:
self.coordinator.update_interval = timedelta(seconds=update_interval)
async def async_options_updated(hass: HomeAssistant, config_entry: ConfigEntry) -> None:
"""Triggered by config entry options updates."""
hass.data[DOMAIN].set_update_interval(config_entry.options[CONF_SCAN_INTERVAL])
async_dispatcher_send(hass, DISPATCH_CONFIG_UPDATED, hass, config_entry)
|
kennedyshead/home-assistant
|
homeassistant/components/kraken/__init__.py
|
Python
|
apache-2.0
| 5,750
|
#!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from .utils import MockedObject
from .utils import Utils
__all__ = ('MockedObject', 'Utils')
|
GoogleCloudPlatform/datacatalog-connectors
|
google-datacatalog-connectors-commons-test/src/google/datacatalog_connectors/commons_test/utils/__init__.py
|
Python
|
apache-2.0
| 690
|
# ===============================================================================
# Copyright 2015 Jake Ross
#
# 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.
# ===============================================================================
# ============= enthought library imports =======================
from traits.api import HasTraits, Str, Int, Bool, Any, Float, \
Dict, Instance, List, Date, Time, Long, Bytes, Tuple
# ============= standard library imports ========================
# ============= local library imports ==========================
class PersistenceSpec(HasTraits):
run_spec = Instance('pychron.experiment.automated_run.spec.AutomatedRunSpec')
monitor = Instance('pychron.monitors.automated_run_monitor.AutomatedRunMonitor')
isotope_group = Instance('pychron.processing.isotope_group.IsotopeGroup')
auto_save_detector_ic = Bool
signal_fods = Dict
baseline_fods = Dict
save_as_peak_hop = Bool(False)
experiment_type = Str
experiment_id = Int
sensitivity_multiplier = Float
experiment_queue_name = Str
experiment_queue_blob = Str
instrument_name = Str
laboratory = Str
extraction_name = Str
extraction_blob = Str
measurement_name = Str
measurement_blob = Str
post_measurement_name = Str
post_measurement_blob = Str
post_equilibration_name = Str
post_equilibration_blob = Str
hops_name = Str
hops_blob = Str
positions = List # list of position names
extraction_positions = List # list of x,y or x,y,z tuples
# for saving to mass spec
runscript_name = Str
runscript_blob = Str
settings = Tuple
spec_dict = Dict
defl_dict = Dict
gains = Dict
trap = Float
emission = Float
active_detectors = List
previous_blank_runid = Str
previous_blank_id = Long
previous_blanks = Dict
rundate = Date
runtime = Time
# load_name = Str
# load_holder = Str
cdd_ic_factor = Any
whiff_result = None
timestamp = None
use_repository_association = True
tag = 'ok'
peak_center = None
intensity_scalar = 1.0
pid = Str
response_blob = Bytes
output_blob = Bytes
setpoint_blob = Bytes
snapshots = List
videos = List
conditionals = List
tripped_conditional = None
grain_polygons = List
power_achieved = Float
lab_temperatures = List
lab_humiditys = List
lab_pneumatics = List
# lithographic_unit = Str
# lat_long = Str
# rock_type = Str
# reference = Str
# ============= EOF =============================================
|
UManPychron/pychron
|
pychron/experiment/automated_run/persistence_spec.py
|
Python
|
apache-2.0
| 3,105
|
# Test osqp python module
import osqp
# import osqppurepy as osqp
import numpy as np
from scipy import sparse
# Unit Test
import unittest
import numpy.testing as nptest
import shutil as sh
class codegen_matrices_tests(unittest.TestCase):
def setUp(self):
# Simple QP problem
self.P = sparse.diags([11., 0.1], format='csc')
self.P_new = sparse.eye(2, format='csc')
self.q = np.array([3, 4])
self.A = sparse.csc_matrix([[-1, 0], [0, -1], [-1, -3],
[2, 5], [3, 4]])
self.A_new = sparse.csc_matrix([[-1, 0], [0, -1], [-2, -2],
[2, 5], [3, 4]])
self.u = np.array([0, 0, -15, 100, 80])
self.l = -np.inf * np.ones(len(self.u))
self.n = self.P.shape[0]
self.m = self.A.shape[0]
self.opts = {'verbose': False,
'eps_abs': 1e-08,
'eps_rel': 1e-08,
'alpha': 1.6,
'max_iter': 3000,
'warm_start': True}
self.model = osqp.OSQP()
self.model.setup(P=self.P, q=self.q, A=self.A, l=self.l, u=self.u,
**self.opts)
def test_solve(self):
# Generate the code
self.model.codegen('code2', python_ext_name='mat_emosqp',
force_rewrite=True, parameters='matrices')
sh.rmtree('code2')
import mat_emosqp
# Solve problem
x, y, _, _, _ = mat_emosqp.solve()
# Assert close
nptest.assert_array_almost_equal(x, np.array([0., 5.]), decimal=5)
nptest.assert_array_almost_equal(
y, np.array([1.5, 0., 1.5, 0., 0.]), decimal=5)
def test_update_P(self):
import mat_emosqp
# Update matrix P
Px = self.P_new.data
Px_idx = np.arange(self.P_new.nnz)
mat_emosqp.update_P(Px, Px_idx, len(Px))
# Solve problem
x, y, _, _, _ = mat_emosqp.solve()
# Assert close
nptest.assert_array_almost_equal(x, np.array([0., 5.]), decimal=5)
nptest.assert_array_almost_equal(
y, np.array([0., 0., 3., 0., 0.]), decimal=5)
# Update matrix P to the original value
Px = self.P.data
Px_idx = np.arange(self.P.nnz)
mat_emosqp.update_P(Px, Px_idx, len(Px))
def test_update_P_allind(self):
import mat_emosqp
# Update matrix P
Px = self.P_new.data
mat_emosqp.update_P(Px, None, 0)
x, y, _, _, _ = mat_emosqp.solve()
# Assert close
nptest.assert_array_almost_equal(x, np.array([0., 5.]), decimal=5)
nptest.assert_array_almost_equal(
y, np.array([0., 0., 3., 0., 0.]), decimal=5)
# Update matrix P to the original value
Px_idx = np.arange(self.P.nnz)
mat_emosqp.update_P(Px, Px_idx, len(Px))
def test_update_A(self):
import mat_emosqp
# Update matrix A
Ax = self.A_new.data
Ax_idx = np.arange(self.A_new.nnz)
mat_emosqp.update_A(Ax, Ax_idx, len(Ax))
# Solve problem
x, y, _, _, _ = mat_emosqp.solve()
# Assert close
nptest.assert_array_almost_equal(x,
np.array([0.15765766, 7.34234234]), decimal=5)
nptest.assert_array_almost_equal(
y, np.array([0., 0., 2.36711712, 0., 0.]), decimal=5)
# Update matrix A to the original value
Ax = self.A.data
Ax_idx = np.arange(self.A.nnz)
mat_emosqp.update_A(Ax, Ax_idx, len(Ax))
def test_update_A_allind(self):
import mat_emosqp
# Update matrix A
Ax = self.A_new.data
mat_emosqp.update_A(Ax, None, 0)
x, y, _, _, _ = mat_emosqp.solve()
# Assert close
nptest.assert_array_almost_equal(x,
np.array([0.15765766, 7.34234234]), decimal=5)
nptest.assert_array_almost_equal(
y, np.array([0., 0., 2.36711712, 0., 0.]), decimal=5)
# Update matrix A to the original value
Ax = self.A.data
Ax_idx = np.arange(self.A.nnz)
mat_emosqp.update_A(Ax, Ax_idx, len(Ax))
def test_update_P_A_indP_indA(self):
import mat_emosqp
# Update matrices P and A
Px = self.P_new.data
Px_idx = np.arange(self.P_new.nnz)
Ax = self.A_new.data
Ax_idx = np.arange(self.A_new.nnz)
mat_emosqp.update_P_A(Px, Px_idx, len(Px), Ax, Ax_idx, len(Ax))
# Solve problem
x, y, _, _, _ = mat_emosqp.solve()
# Assert close
nptest.assert_array_almost_equal(x, np.array([4.25, 3.25]), decimal=5)
nptest.assert_array_almost_equal(
y, np.array([0., 0., 3.625, 0., 0.]), decimal=5)
# Update matrices P and A to the original values
Px = self.P.data
Ax = self.A.data
mat_emosqp.update_P_A(Px, None, 0, Ax, None, 0)
def test_update_P_A_indP(self):
import mat_emosqp
# Update matrices P and A
Px = self.P_new.data
Px_idx = np.arange(self.P_new.nnz)
Ax = self.A_new.data
mat_emosqp.update_P_A(Px, Px_idx, len(Px), Ax, None, 0)
x, y, _, _, _ = mat_emosqp.solve()
# Assert close
nptest.assert_array_almost_equal(x, np.array([4.25, 3.25]), decimal=5)
nptest.assert_array_almost_equal(
y, np.array([0., 0., 3.625, 0., 0.]), decimal=5)
# Update matrices P and A to the original values
Px = self.P.data
Ax = self.A.data
mat_emosqp.update_P_A(Px, None, 0, Ax, None, 0)
def test_update_P_A_indA(self):
import mat_emosqp
# Update matrices P and A
Px = self.P_new.data
Ax = self.A_new.data
Ax_idx = np.arange(self.A_new.nnz)
mat_emosqp.update_P_A(Px, None, 0, Ax, Ax_idx, len(Ax))
x, y, _, _, _ = mat_emosqp.solve()
# Assert close
nptest.assert_array_almost_equal(x, np.array([4.25, 3.25]), decimal=5)
nptest.assert_array_almost_equal(
y, np.array([0., 0., 3.625, 0., 0.]), decimal=5)
# Update matrix P to the original value
Px = self.P.data
Px_idx = np.arange(self.P.nnz)
Ax = self.A.data
Ax_idx = np.arange(self.A.nnz)
mat_emosqp.update_P_A(Px, Px_idx, len(Px), Ax, Ax_idx, len(Ax))
def test_update_P_A_allind(self):
import mat_emosqp
# Update matrices P and A
Px = self.P_new.data
Ax = self.A_new.data
mat_emosqp.update_P_A(Px, None, 0, Ax, None, 0)
x, y, _, _, _ = mat_emosqp.solve()
# Assert close
nptest.assert_array_almost_equal(x, np.array([4.25, 3.25]), decimal=5)
nptest.assert_array_almost_equal(
y, np.array([0., 0., 3.625, 0., 0.]), decimal=5)
# Update matrices P and A to the original values
Px = self.P.data
Ax = self.A.data
mat_emosqp.update_P_A(Px, None, 0, Ax, None, 0)
|
oxfordcontrol/osqp-python
|
module/tests/codegen_matrices_test.py
|
Python
|
apache-2.0
| 7,046
|